g.js 876 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["G"] = factory();
  8. else
  9. root["G"] = factory();
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "./node_modules/_@antv_event-emitter@0.1.2@@antv/event-emitter/esm/index.js":
  99. /*!**********************************************************************************!*\
  100. !*** ./node_modules/_@antv_event-emitter@0.1.2@@antv/event-emitter/esm/index.js ***!
  101. \**********************************************************************************/
  102. /*! exports provided: default */
  103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104. "use strict";
  105. __webpack_require__.r(__webpack_exports__);
  106. var WILDCARD = '*';
  107. /* event-emitter */
  108. var EventEmitter =
  109. /** @class */
  110. function () {
  111. function EventEmitter() {
  112. this._events = {};
  113. }
  114. /**
  115. * 监听一个事件
  116. * @param evt
  117. * @param callback
  118. * @param once
  119. */
  120. EventEmitter.prototype.on = function (evt, callback, once) {
  121. if (!this._events[evt]) {
  122. this._events[evt] = [];
  123. }
  124. this._events[evt].push({
  125. callback: callback,
  126. once: !!once
  127. });
  128. return this;
  129. };
  130. /**
  131. * 监听一个事件一次
  132. * @param evt
  133. * @param callback
  134. */
  135. EventEmitter.prototype.once = function (evt, callback) {
  136. this.on(evt, callback, true);
  137. return this;
  138. };
  139. /**
  140. * 触发一个事件
  141. * @param evt
  142. * @param args
  143. */
  144. EventEmitter.prototype.emit = function (evt) {
  145. var _this = this;
  146. var args = [];
  147. for (var _i = 1; _i < arguments.length; _i++) {
  148. args[_i - 1] = arguments[_i];
  149. }
  150. var events = this._events[evt] || [];
  151. var wildcardEvents = this._events[WILDCARD] || []; // 实际的处理 emit 方法
  152. var doEmit = function (es) {
  153. var length = es.length;
  154. for (var i = 0; i < length; i++) {
  155. if (!es[i]) {
  156. continue;
  157. }
  158. var _a = es[i],
  159. callback = _a.callback,
  160. once = _a.once;
  161. if (once) {
  162. es.splice(i, 1);
  163. if (es.length === 0) {
  164. delete _this._events[evt];
  165. }
  166. length--;
  167. i--;
  168. }
  169. callback.apply(_this, args);
  170. }
  171. };
  172. doEmit(events);
  173. doEmit(wildcardEvents);
  174. };
  175. /**
  176. * 取消监听一个事件,或者一个channel
  177. * @param evt
  178. * @param callback
  179. */
  180. EventEmitter.prototype.off = function (evt, callback) {
  181. if (!evt) {
  182. // evt 为空全部清除
  183. this._events = {};
  184. } else {
  185. if (!callback) {
  186. // evt 存在,callback 为空,清除事件所有方法
  187. delete this._events[evt];
  188. } else {
  189. // evt 存在,callback 存在,清除匹配的
  190. var events = this._events[evt] || [];
  191. var length_1 = events.length;
  192. for (var i = 0; i < length_1; i++) {
  193. if (events[i].callback === callback) {
  194. events.splice(i, 1);
  195. length_1--;
  196. i--;
  197. }
  198. }
  199. if (events.length === 0) {
  200. delete this._events[evt];
  201. }
  202. }
  203. }
  204. return this;
  205. };
  206. /* 当前所有的事件 */
  207. EventEmitter.prototype.getEvents = function () {
  208. return this._events;
  209. };
  210. return EventEmitter;
  211. }();
  212. /* harmony default export */ __webpack_exports__["default"] = (EventEmitter);
  213. /***/ }),
  214. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js":
  215. /*!***********************************************************************************!*\
  216. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js ***!
  217. \***********************************************************************************/
  218. /*! exports provided: default */
  219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  220. "use strict";
  221. __webpack_require__.r(__webpack_exports__);
  222. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  223. /* harmony import */ var _antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/event-emitter */ "./node_modules/_@antv_event-emitter@0.1.2@@antv/event-emitter/esm/index.js");
  224. /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
  225. var Base =
  226. /** @class */
  227. function (_super) {
  228. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Base, _super);
  229. function Base(cfg) {
  230. var _this = _super.call(this) || this;
  231. /**
  232. * 是否被销毁
  233. * @type {boolean}
  234. */
  235. _this.destroyed = false;
  236. var defaultCfg = _this.getDefaultCfg();
  237. _this.cfg = Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["mix"])(defaultCfg, cfg);
  238. return _this;
  239. }
  240. /**
  241. * @protected
  242. * 默认的配置项
  243. * @returns {object} 默认的配置项
  244. */
  245. Base.prototype.getDefaultCfg = function () {
  246. return {};
  247. }; // 实现接口的方法
  248. Base.prototype.get = function (name) {
  249. return this.cfg[name];
  250. }; // 实现接口的方法
  251. Base.prototype.set = function (name, value) {
  252. this.cfg[name] = value;
  253. }; // 实现接口的方法
  254. Base.prototype.destroy = function () {
  255. this.cfg = {
  256. destroyed: true
  257. };
  258. this.off();
  259. this.destroyed = true;
  260. };
  261. return Base;
  262. }(_antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__["default"]);
  263. /* harmony default export */ __webpack_exports__["default"] = (Base);
  264. /***/ }),
  265. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/canvas.js":
  266. /*!*************************************************************************************!*\
  267. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/canvas.js ***!
  268. \*************************************************************************************/
  269. /*! exports provided: default */
  270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  271. "use strict";
  272. __webpack_require__.r(__webpack_exports__);
  273. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  274. /* harmony import */ var detect_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! detect-browser */ "./node_modules/_detect-browser@5.1.0@detect-browser/index.js");
  275. /* harmony import */ var detect_browser__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(detect_browser__WEBPACK_IMPORTED_MODULE_1__);
  276. /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js");
  277. /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
  278. /* harmony import */ var _animate_timeline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../animate/timeline */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/animate/timeline.js");
  279. /* harmony import */ var _event_event_contoller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../event/event-contoller */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/event-contoller.js");
  280. var PX_SUFFIX = 'px';
  281. var browser = Object(detect_browser__WEBPACK_IMPORTED_MODULE_1__["detect"])();
  282. var isFirefox = browser && browser.name === 'firefox';
  283. var Canvas =
  284. /** @class */
  285. function (_super) {
  286. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Canvas, _super);
  287. function Canvas(cfg) {
  288. var _this = _super.call(this, cfg) || this;
  289. _this.initContainer();
  290. _this.initDom();
  291. _this.initEvents();
  292. _this.initTimeline();
  293. return _this;
  294. }
  295. Canvas.prototype.getDefaultCfg = function () {
  296. var cfg = _super.prototype.getDefaultCfg.call(this); // set default cursor style for canvas
  297. cfg['cursor'] = 'default'; // CSS transform 目前尚未经过长时间验证,为了避免影响上层业务,默认关闭,上层按需开启
  298. cfg['supportCSSTransform'] = false;
  299. return cfg;
  300. };
  301. /**
  302. * @protected
  303. * 初始化容器
  304. */
  305. Canvas.prototype.initContainer = function () {
  306. var container = this.get('container');
  307. if (Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isString"])(container)) {
  308. container = document.getElementById(container);
  309. this.set('container', container);
  310. }
  311. };
  312. /**
  313. * @protected
  314. * 初始化 DOM
  315. */
  316. Canvas.prototype.initDom = function () {
  317. var el = this.createDom();
  318. this.set('el', el); // 附加到容器
  319. var container = this.get('container');
  320. container.appendChild(el); // 设置初始宽度
  321. this.setDOMSize(this.get('width'), this.get('height'));
  322. };
  323. /**
  324. * @protected
  325. * 初始化绑定的事件
  326. */
  327. Canvas.prototype.initEvents = function () {
  328. var eventController = new _event_event_contoller__WEBPACK_IMPORTED_MODULE_5__["default"]({
  329. canvas: this
  330. });
  331. eventController.init();
  332. this.set('eventController', eventController);
  333. };
  334. /**
  335. * @protected
  336. * 初始化时间轴
  337. */
  338. Canvas.prototype.initTimeline = function () {
  339. var timeline = new _animate_timeline__WEBPACK_IMPORTED_MODULE_4__["default"](this);
  340. this.set('timeline', timeline);
  341. };
  342. /**
  343. * @protected
  344. * 修改画布对应的 DOM 的大小
  345. * @param {number} width 宽度
  346. * @param {number} height 高度
  347. */
  348. Canvas.prototype.setDOMSize = function (width, height) {
  349. var el = this.get('el');
  350. if (_util_util__WEBPACK_IMPORTED_MODULE_3__["isBrowser"]) {
  351. el.style.width = width + PX_SUFFIX;
  352. el.style.height = height + PX_SUFFIX;
  353. }
  354. }; // 实现接口
  355. Canvas.prototype.changeSize = function (width, height) {
  356. this.setDOMSize(width, height);
  357. this.set('width', width);
  358. this.set('height', height);
  359. this.onCanvasChange('changeSize');
  360. };
  361. /**
  362. * 获取当前的渲染引擎
  363. * @return {Renderer} 返回当前的渲染引擎
  364. */
  365. Canvas.prototype.getRenderer = function () {
  366. return this.get('renderer');
  367. };
  368. /**
  369. * 获取画布的 cursor 样式
  370. * @return {Cursor}
  371. */
  372. Canvas.prototype.getCursor = function () {
  373. return this.get('cursor');
  374. };
  375. /**
  376. * 设置画布的 cursor 样式
  377. * @param {Cursor} cursor cursor 样式
  378. */
  379. Canvas.prototype.setCursor = function (cursor) {
  380. this.set('cursor', cursor);
  381. var el = this.get('el');
  382. if (_util_util__WEBPACK_IMPORTED_MODULE_3__["isBrowser"] && el) {
  383. // 直接设置样式,不等待鼠标移动时再设置
  384. el.style.cursor = cursor;
  385. }
  386. }; // 实现接口
  387. Canvas.prototype.getPointByEvent = function (ev) {
  388. var supportCSSTransform = this.get('supportCSSTransform');
  389. if (supportCSSTransform) {
  390. // For Firefox <= 38
  391. if (isFirefox && !Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isNil"])(ev.layerX) && ev.layerX !== ev.offsetX) {
  392. return {
  393. x: ev.layerX,
  394. y: ev.layerY
  395. };
  396. }
  397. if (!Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isNil"])(ev.offsetX)) {
  398. // For IE6+, Firefox >= 39, Chrome, Safari, Opera
  399. return {
  400. x: ev.offsetX,
  401. y: ev.offsetY
  402. };
  403. }
  404. } // should calculate by self for other cases, like Safari in ios
  405. // TODO: support CSS transform
  406. var _a = this.getClientByEvent(ev),
  407. clientX = _a.x,
  408. clientY = _a.y;
  409. return this.getPointByClient(clientX, clientY);
  410. }; // 获取 touch 事件的 clientX 和 clientY 需要单独处理
  411. Canvas.prototype.getClientByEvent = function (ev) {
  412. var clientInfo = ev;
  413. if (ev.touches) {
  414. if (ev.type === 'touchend') {
  415. clientInfo = ev.changedTouches[0];
  416. } else {
  417. clientInfo = ev.touches[0];
  418. }
  419. }
  420. return {
  421. x: clientInfo.clientX,
  422. y: clientInfo.clientY
  423. };
  424. }; // 实现接口
  425. Canvas.prototype.getPointByClient = function (clientX, clientY) {
  426. var el = this.get('el');
  427. var bbox = el.getBoundingClientRect();
  428. return {
  429. x: clientX - bbox.left,
  430. y: clientY - bbox.top
  431. };
  432. }; // 实现接口
  433. Canvas.prototype.getClientByPoint = function (x, y) {
  434. var el = this.get('el');
  435. var bbox = el.getBoundingClientRect();
  436. return {
  437. x: x + bbox.left,
  438. y: y + bbox.top
  439. };
  440. }; // 实现接口
  441. Canvas.prototype.draw = function () {};
  442. /**
  443. * @protected
  444. * 销毁 DOM 容器
  445. */
  446. Canvas.prototype.removeDom = function () {
  447. var el = this.get('el');
  448. el.parentNode.removeChild(el);
  449. };
  450. /**
  451. * @protected
  452. * 清理所有的事件
  453. */
  454. Canvas.prototype.clearEvents = function () {
  455. var eventController = this.get('eventController');
  456. eventController.destroy();
  457. };
  458. Canvas.prototype.isCanvas = function () {
  459. return true;
  460. };
  461. Canvas.prototype.getParent = function () {
  462. return null;
  463. };
  464. Canvas.prototype.destroy = function () {
  465. var timeline = this.get('timeline');
  466. if (this.get('destroyed')) {
  467. return;
  468. }
  469. this.clear(); // 同初始化时相反顺序调用
  470. if (timeline) {
  471. // 画布销毁时自动停止动画
  472. timeline.stop();
  473. }
  474. this.clearEvents();
  475. this.removeDom();
  476. _super.prototype.destroy.call(this);
  477. };
  478. return Canvas;
  479. }(_container__WEBPACK_IMPORTED_MODULE_2__["default"]);
  480. /* harmony default export */ __webpack_exports__["default"] = (Canvas);
  481. /***/ }),
  482. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js":
  483. /*!****************************************************************************************!*\
  484. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js ***!
  485. \****************************************************************************************/
  486. /*! exports provided: default */
  487. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  488. "use strict";
  489. __webpack_require__.r(__webpack_exports__);
  490. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  491. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js");
  492. /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
  493. var SHAPE_MAP = {};
  494. var INDEX = '_INDEX';
  495. /**
  496. * 设置 canvas
  497. * @param {IElement} element 元素
  498. * @param {ICanvas} canvas 画布
  499. */
  500. function setCanvas(element, canvas) {
  501. element.set('canvas', canvas);
  502. if (element.isGroup()) {
  503. var children = element.get('children');
  504. if (children.length) {
  505. children.forEach(function (child) {
  506. setCanvas(child, canvas);
  507. });
  508. }
  509. }
  510. }
  511. /**
  512. * 设置 timeline
  513. * @param {IElement} element 元素
  514. * @param {Timeline} timeline 时间轴
  515. */
  516. function setTimeline(element, timeline) {
  517. element.set('timeline', timeline);
  518. if (element.isGroup()) {
  519. var children = element.get('children');
  520. if (children.length) {
  521. children.forEach(function (child) {
  522. setTimeline(child, timeline);
  523. });
  524. }
  525. }
  526. }
  527. function contains(container, element) {
  528. var children = container.getChildren();
  529. return children.indexOf(element) >= 0;
  530. }
  531. function removeChild(container, element, destroy) {
  532. if (destroy === void 0) {
  533. destroy = true;
  534. } // 不再调用 element.remove() 方法,会出现循环调用
  535. if (destroy) {
  536. element.destroy();
  537. } else {
  538. element.set('parent', null);
  539. element.set('canvas', null);
  540. }
  541. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["removeFromArray"])(container.getChildren(), element);
  542. }
  543. function getComparer(compare) {
  544. return function (left, right) {
  545. var result = compare(left, right);
  546. return result === 0 ? left[INDEX] - right[INDEX] : result;
  547. };
  548. }
  549. var Container =
  550. /** @class */
  551. function (_super) {
  552. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Container, _super);
  553. function Container() {
  554. return _super !== null && _super.apply(this, arguments) || this;
  555. }
  556. Container.prototype.isCanvas = function () {
  557. return false;
  558. }; // 根据子节点确定 BBox
  559. Container.prototype.getBBox = function () {
  560. // 所有的值可能在画布的可视区外
  561. var minX = Infinity;
  562. var maxX = -Infinity;
  563. var minY = Infinity;
  564. var maxY = -Infinity;
  565. var xArr = [];
  566. var yArr = []; // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并
  567. var children = this.getChildren().filter(function (child) {
  568. return child.get('visible') && (!child.isGroup() || child.isGroup() && child.getChildren().length > 0);
  569. });
  570. if (children.length > 0) {
  571. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child) {
  572. var box = child.getBBox();
  573. xArr.push(box.minX, box.maxX);
  574. yArr.push(box.minY, box.maxY);
  575. });
  576. minX = Math.min.apply(null, xArr);
  577. maxX = Math.max.apply(null, xArr);
  578. minY = Math.min.apply(null, yArr);
  579. maxY = Math.max.apply(null, yArr);
  580. } else {
  581. minX = 0;
  582. maxX = 0;
  583. minY = 0;
  584. maxY = 0;
  585. }
  586. var box = {
  587. x: minX,
  588. y: minY,
  589. minX: minX,
  590. minY: minY,
  591. maxX: maxX,
  592. maxY: maxY,
  593. width: maxX - minX,
  594. height: maxY - minY
  595. };
  596. return box;
  597. }; // 获取画布的包围盒
  598. Container.prototype.getCanvasBBox = function () {
  599. var minX = Infinity;
  600. var maxX = -Infinity;
  601. var minY = Infinity;
  602. var maxY = -Infinity;
  603. var xArr = [];
  604. var yArr = []; // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并
  605. var children = this.getChildren().filter(function (child) {
  606. return child.get('visible') && (!child.isGroup() || child.isGroup() && child.getChildren().length > 0);
  607. });
  608. if (children.length > 0) {
  609. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child) {
  610. var box = child.getCanvasBBox();
  611. xArr.push(box.minX, box.maxX);
  612. yArr.push(box.minY, box.maxY);
  613. });
  614. minX = Math.min.apply(null, xArr);
  615. maxX = Math.max.apply(null, xArr);
  616. minY = Math.min.apply(null, yArr);
  617. maxY = Math.max.apply(null, yArr);
  618. } else {
  619. minX = 0;
  620. maxX = 0;
  621. minY = 0;
  622. maxY = 0;
  623. }
  624. var box = {
  625. x: minX,
  626. y: minY,
  627. minX: minX,
  628. minY: minY,
  629. maxX: maxX,
  630. maxY: maxY,
  631. width: maxX - minX,
  632. height: maxY - minY
  633. };
  634. return box;
  635. };
  636. Container.prototype.getDefaultCfg = function () {
  637. var cfg = _super.prototype.getDefaultCfg.call(this);
  638. cfg['children'] = [];
  639. return cfg;
  640. };
  641. Container.prototype.onAttrChange = function (name, value, originValue) {
  642. _super.prototype.onAttrChange.call(this, name, value, originValue);
  643. if (name === 'matrix') {
  644. var totalMatrix = this.getTotalMatrix();
  645. this._applyChildrenMarix(totalMatrix);
  646. }
  647. }; // 不但应用到自己身上还要应用于子元素
  648. Container.prototype.applyMatrix = function (matrix) {
  649. var preTotalMatrix = this.getTotalMatrix();
  650. _super.prototype.applyMatrix.call(this, matrix);
  651. var totalMatrix = this.getTotalMatrix(); // totalMatrix 没有发生变化时,这里仅考虑两者都为 null 时
  652. // 不继续向下传递矩阵
  653. if (totalMatrix === preTotalMatrix) {
  654. return;
  655. }
  656. this._applyChildrenMarix(totalMatrix);
  657. }; // 在子元素上设置矩阵
  658. Container.prototype._applyChildrenMarix = function (totalMatrix) {
  659. var children = this.getChildren();
  660. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child) {
  661. child.applyMatrix(totalMatrix);
  662. });
  663. }; // 兼容老版本的接口
  664. Container.prototype.addShape = function () {
  665. var args = [];
  666. for (var _i = 0; _i < arguments.length; _i++) {
  667. args[_i] = arguments[_i];
  668. }
  669. var type = args[0];
  670. var cfg = args[1];
  671. if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isObject"])(type)) {
  672. cfg = type;
  673. } else {
  674. cfg['type'] = type;
  675. }
  676. var shapeType = SHAPE_MAP[cfg.type];
  677. if (!shapeType) {
  678. shapeType = Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["upperFirst"])(cfg.type);
  679. SHAPE_MAP[cfg.type] = shapeType;
  680. }
  681. var ShapeBase = this.getShapeBase();
  682. var shape = new ShapeBase[shapeType](cfg);
  683. this.add(shape);
  684. return shape;
  685. };
  686. Container.prototype.addGroup = function () {
  687. var args = [];
  688. for (var _i = 0; _i < arguments.length; _i++) {
  689. args[_i] = arguments[_i];
  690. }
  691. var groupClass = args[0],
  692. cfg = args[1];
  693. var group;
  694. if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(groupClass)) {
  695. if (cfg) {
  696. group = new groupClass(cfg);
  697. } else {
  698. group = new groupClass({
  699. // canvas,
  700. parent: this
  701. });
  702. }
  703. } else {
  704. var tmpCfg = groupClass || {};
  705. var TmpGroupClass = this.getGroupBase();
  706. group = new TmpGroupClass(tmpCfg);
  707. }
  708. this.add(group);
  709. return group;
  710. };
  711. Container.prototype.getCanvas = function () {
  712. var canvas;
  713. if (this.isCanvas()) {
  714. canvas = this;
  715. } else {
  716. canvas = this.get('canvas');
  717. }
  718. return canvas;
  719. };
  720. Container.prototype.getShape = function (x, y, ev) {
  721. // 如果不支持拾取,则直接返回
  722. if (!Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isAllowCapture"])(this)) {
  723. return null;
  724. }
  725. var children = this.getChildren();
  726. var shape; // 如果容器是 group
  727. if (!this.isCanvas()) {
  728. var v = [x, y, 1]; // 将 x, y 转换成对应于 group 的局部坐标
  729. v = this.invertFromMatrix(v);
  730. if (!this.isClipped(v[0], v[1])) {
  731. shape = this._findShape(children, v[0], v[1], ev);
  732. }
  733. } else {
  734. shape = this._findShape(children, x, y, ev);
  735. }
  736. return shape;
  737. };
  738. Container.prototype._findShape = function (children, x, y, ev) {
  739. var shape = null;
  740. for (var i = children.length - 1; i >= 0; i--) {
  741. var child = children[i];
  742. if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["isAllowCapture"])(child)) {
  743. if (child.isGroup()) {
  744. shape = child.getShape(x, y, ev);
  745. } else if (child.isHit(x, y)) {
  746. shape = child;
  747. }
  748. }
  749. if (shape) {
  750. break;
  751. }
  752. }
  753. return shape;
  754. };
  755. Container.prototype.add = function (element) {
  756. var canvas = this.getCanvas();
  757. var children = this.getChildren();
  758. var timeline = this.get('timeline');
  759. var preParent = element.getParent();
  760. if (preParent) {
  761. removeChild(preParent, element, false);
  762. }
  763. element.set('parent', this);
  764. if (canvas) {
  765. setCanvas(element, canvas);
  766. }
  767. if (timeline) {
  768. setTimeline(element, timeline);
  769. }
  770. children.push(element);
  771. element.onCanvasChange('add');
  772. this._applyElementMatrix(element);
  773. }; // 将当前容器的矩阵应用到子元素
  774. Container.prototype._applyElementMatrix = function (element) {
  775. var totalMatrix = this.getTotalMatrix(); // 添加图形或者分组时,需要把当前图元的矩阵设置进去
  776. if (totalMatrix) {
  777. element.applyMatrix(totalMatrix);
  778. }
  779. };
  780. Container.prototype.getChildren = function () {
  781. return this.get('children');
  782. };
  783. Container.prototype.sort = function () {
  784. var children = this.getChildren(); // 稳定排序
  785. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (child, index) {
  786. child[INDEX] = index;
  787. return child;
  788. });
  789. children.sort(getComparer(function (obj1, obj2) {
  790. return obj1.get('zIndex') - obj2.get('zIndex');
  791. }));
  792. this.onCanvasChange('sort');
  793. };
  794. Container.prototype.clear = function () {
  795. this.set('clearing', true);
  796. if (this.destroyed) {
  797. return;
  798. }
  799. var children = this.getChildren();
  800. for (var i = children.length - 1; i >= 0; i--) {
  801. children[i].destroy(); // 销毁子元素
  802. }
  803. this.set('children', []);
  804. this.onCanvasChange('clear');
  805. this.set('clearing', false);
  806. };
  807. Container.prototype.destroy = function () {
  808. if (this.get('destroyed')) {
  809. return;
  810. }
  811. this.clear();
  812. _super.prototype.destroy.call(this);
  813. };
  814. /**
  815. * 获取第一个子元素
  816. * @return {IElement} 第一个元素
  817. */
  818. Container.prototype.getFirst = function () {
  819. return this.getChildByIndex(0);
  820. };
  821. /**
  822. * 获取最后一个子元素
  823. * @return {IElement} 元素
  824. */
  825. Container.prototype.getLast = function () {
  826. var children = this.getChildren();
  827. return this.getChildByIndex(children.length - 1);
  828. };
  829. /**
  830. * 根据索引获取子元素
  831. * @return {IElement} 第一个元素
  832. */
  833. Container.prototype.getChildByIndex = function (index) {
  834. var children = this.getChildren();
  835. return children[index];
  836. };
  837. /**
  838. * 子元素的数量
  839. * @return {number} 子元素数量
  840. */
  841. Container.prototype.getCount = function () {
  842. var children = this.getChildren();
  843. return children.length;
  844. };
  845. /**
  846. * 是否包含对应元素
  847. * @param {IElement} element 元素
  848. * @return {boolean}
  849. */
  850. Container.prototype.contain = function (element) {
  851. var children = this.getChildren();
  852. return children.indexOf(element) > -1;
  853. };
  854. /**
  855. * 移除对应子元素
  856. * @param {IElement} element 子元素
  857. * @param {boolean} destroy 是否销毁子元素,默认为 true
  858. */
  859. Container.prototype.removeChild = function (element, destroy) {
  860. if (destroy === void 0) {
  861. destroy = true;
  862. }
  863. if (this.contain(element)) {
  864. element.remove(destroy);
  865. }
  866. };
  867. /**
  868. * 查找所有匹配的元素
  869. * @param {ElementFilterFn} fn 匹配函数
  870. * @return {IElement[]} 元素数组
  871. */
  872. Container.prototype.findAll = function (fn) {
  873. var rst = [];
  874. var children = this.getChildren();
  875. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (element) {
  876. if (fn(element)) {
  877. rst.push(element);
  878. }
  879. if (element.isGroup()) {
  880. rst = rst.concat(element.findAll(fn));
  881. }
  882. });
  883. return rst;
  884. };
  885. /**
  886. * 查找元素,找到第一个返回
  887. * @param {ElementFilterFn} fn 匹配函数
  888. * @return {IElement|null} 元素,可以为空
  889. */
  890. Container.prototype.find = function (fn) {
  891. var rst = null;
  892. var children = this.getChildren();
  893. Object(_util_util__WEBPACK_IMPORTED_MODULE_2__["each"])(children, function (element) {
  894. if (fn(element)) {
  895. rst = element;
  896. } else if (element.isGroup()) {
  897. rst = element.find(fn);
  898. }
  899. if (rst) {
  900. return false;
  901. }
  902. });
  903. return rst;
  904. };
  905. /**
  906. * 根据 ID 查找元素
  907. * @param {string} id 元素 id
  908. * @return {IElement|null} 元素
  909. */
  910. Container.prototype.findById = function (id) {
  911. return this.find(function (element) {
  912. return element.get('id') === id;
  913. });
  914. };
  915. /**
  916. * 该方法即将废弃,不建议使用
  917. * 根据 className 查找元素
  918. * TODO: 该方式定义暂时只给 G6 3.3 以后的版本使用,待 G6 中的 findByClassName 方法移除后,G 也需要同步移除
  919. * @param {string} className 元素 className
  920. * @return {IElement | null} 元素
  921. */
  922. Container.prototype.findByClassName = function (className) {
  923. return this.find(function (element) {
  924. return element.get('className') === className;
  925. });
  926. };
  927. /**
  928. * 根据 name 查找元素列表
  929. * @param {string} name 元素名称
  930. * @return {IElement[]} 元素
  931. */
  932. Container.prototype.findAllByName = function (name) {
  933. return this.findAll(function (element) {
  934. return element.get('name') === name;
  935. });
  936. };
  937. return Container;
  938. }(_element__WEBPACK_IMPORTED_MODULE_1__["default"]);
  939. /* harmony default export */ __webpack_exports__["default"] = (Container);
  940. /***/ }),
  941. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js":
  942. /*!**************************************************************************************!*\
  943. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js ***!
  944. \**************************************************************************************/
  945. /*! exports provided: default */
  946. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  947. "use strict";
  948. __webpack_require__.r(__webpack_exports__);
  949. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  950. /* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  951. /* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/matrix-util */ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/index.js");
  952. /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
  953. /* harmony import */ var _util_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/matrix */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js");
  954. /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js");
  955. var MATRIX = 'matrix';
  956. var CLONE_CFGS = ['zIndex', 'capture', 'visible', 'type']; // 可以在 toAttrs 中设置,但不属于绘图属性的字段
  957. var RESERVED_PORPS = ['repeat'];
  958. var DELEGATION_SPLIT = ':';
  959. var WILDCARD = '*'; // 需要考虑数组嵌套数组的场景
  960. // 数组嵌套对象的场景不考虑
  961. function _cloneArrayAttr(arr) {
  962. var result = [];
  963. for (var i = 0; i < arr.length; i++) {
  964. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isArray"])(arr[i])) {
  965. result.push([].concat(arr[i]));
  966. } else {
  967. result.push(arr[i]);
  968. }
  969. }
  970. return result;
  971. }
  972. function getFormatFromAttrs(toAttrs, shape) {
  973. var fromAttrs = {};
  974. var attrs = shape.attrs;
  975. for (var k in toAttrs) {
  976. fromAttrs[k] = attrs[k];
  977. }
  978. return fromAttrs;
  979. }
  980. function getFormatToAttrs(props, shape) {
  981. var toAttrs = {};
  982. var attrs = shape.attr();
  983. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(props, function (v, k) {
  984. if (RESERVED_PORPS.indexOf(k) === -1 && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isEqual"])(attrs[k], v)) {
  985. toAttrs[k] = v;
  986. }
  987. });
  988. return toAttrs;
  989. }
  990. function checkExistedAttrs(animations, animation) {
  991. if (animation.onFrame) {
  992. return animations;
  993. }
  994. var startTime = animation.startTime,
  995. delay = animation.delay,
  996. duration = animation.duration;
  997. var hasOwnProperty = Object.prototype.hasOwnProperty;
  998. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (item) {
  999. // 后一个动画开始执行的时间 < 前一个动画的结束时间 && 后一个动画的执行时间 > 前一个动画的延迟
  1000. if (startTime + delay < item.startTime + item.delay + item.duration && duration > item.delay) {
  1001. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animation.toAttrs, function (v, k) {
  1002. if (hasOwnProperty.call(item.toAttrs, k)) {
  1003. delete item.toAttrs[k];
  1004. delete item.fromAttrs[k];
  1005. }
  1006. });
  1007. }
  1008. });
  1009. return animations;
  1010. }
  1011. var Element =
  1012. /** @class */
  1013. function (_super) {
  1014. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(Element, _super);
  1015. function Element(cfg) {
  1016. var _this = _super.call(this, cfg) || this;
  1017. /**
  1018. * @protected
  1019. * 图形属性
  1020. * @type {ShapeAttrs}
  1021. */
  1022. _this.attrs = {};
  1023. var attrs = _this.getDefaultAttrs();
  1024. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["mix"])(attrs, cfg.attrs);
  1025. _this.attrs = attrs;
  1026. _this.initAttrs(attrs);
  1027. _this.initAnimate(); // 初始化动画
  1028. return _this;
  1029. } // override
  1030. Element.prototype.getDefaultCfg = function () {
  1031. return {
  1032. visible: true,
  1033. capture: true,
  1034. zIndex: 0
  1035. };
  1036. };
  1037. /**
  1038. * @protected
  1039. * 获取默认的属相
  1040. */
  1041. Element.prototype.getDefaultAttrs = function () {
  1042. return {
  1043. matrix: this.getDefaultMatrix(),
  1044. opacity: 1
  1045. };
  1046. };
  1047. /**
  1048. * @protected
  1049. * 一些方法调用会引起画布变化
  1050. * @param {ChangeType} changeType 改变的类型
  1051. */
  1052. Element.prototype.onCanvasChange = function (changeType) {};
  1053. /**
  1054. * @protected
  1055. * 初始化属性,有些属性需要加工
  1056. * @param {object} attrs 属性值
  1057. */
  1058. Element.prototype.initAttrs = function (attrs) {};
  1059. /**
  1060. * @protected
  1061. * 初始化动画
  1062. */
  1063. Element.prototype.initAnimate = function () {
  1064. this.set('animable', true);
  1065. this.set('animating', false);
  1066. };
  1067. Element.prototype.isGroup = function () {
  1068. return false;
  1069. };
  1070. Element.prototype.getParent = function () {
  1071. return this.get('parent');
  1072. };
  1073. Element.prototype.getCanvas = function () {
  1074. return this.get('canvas');
  1075. };
  1076. Element.prototype.attr = function () {
  1077. var _a;
  1078. var args = [];
  1079. for (var _i = 0; _i < arguments.length; _i++) {
  1080. args[_i] = arguments[_i];
  1081. }
  1082. var name = args[0],
  1083. value = args[1];
  1084. if (!name) return this.attrs;
  1085. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(name)) {
  1086. for (var k in name) {
  1087. this.setAttr(k, name[k]);
  1088. }
  1089. this.afterAttrsChange(name);
  1090. return this;
  1091. }
  1092. if (args.length === 2) {
  1093. this.setAttr(name, value);
  1094. this.afterAttrsChange((_a = {}, _a[name] = value, _a));
  1095. return this;
  1096. }
  1097. return this.attrs[name];
  1098. }; // 是否被裁剪,被裁剪则不显示,不参与拾取
  1099. Element.prototype.isClipped = function (refX, refY) {
  1100. var clip = this.getClip();
  1101. return clip && !clip.isHit(refX, refY);
  1102. };
  1103. /**
  1104. * 内部设置属性值的接口
  1105. * @param {string} name 属性名
  1106. * @param {any} value 属性值
  1107. */
  1108. Element.prototype.setAttr = function (name, value) {
  1109. var originValue = this.attrs[name];
  1110. if (originValue !== value) {
  1111. this.attrs[name] = value;
  1112. this.onAttrChange(name, value, originValue);
  1113. }
  1114. };
  1115. /**
  1116. * @protected
  1117. * 属性值发生改变
  1118. * @param {string} name 属性名
  1119. * @param {any} value 属性值
  1120. * @param {any} originValue 属性值
  1121. */
  1122. Element.prototype.onAttrChange = function (name, value, originValue) {
  1123. if (name === 'matrix') {
  1124. this.set('totalMatrix', null);
  1125. }
  1126. };
  1127. /**
  1128. * 属性更改后需要做的事情
  1129. * @protected
  1130. */
  1131. Element.prototype.afterAttrsChange = function (targetAttrs) {
  1132. if (this.cfg.isClipShape) {
  1133. var applyTo = this.cfg.applyTo;
  1134. if (applyTo) {
  1135. applyTo.onCanvasChange('clip');
  1136. }
  1137. } else {
  1138. this.onCanvasChange('attr');
  1139. }
  1140. };
  1141. Element.prototype.show = function () {
  1142. // 不是高频操作直接使用 set
  1143. this.set('visible', true);
  1144. this.onCanvasChange('show');
  1145. return this;
  1146. };
  1147. Element.prototype.hide = function () {
  1148. // 不是高频操作直接使用 set
  1149. this.set('visible', false);
  1150. this.onCanvasChange('hide');
  1151. return this;
  1152. };
  1153. Element.prototype.setZIndex = function (zIndex) {
  1154. this.set('zIndex', zIndex);
  1155. var parent = this.getParent();
  1156. if (parent) {
  1157. // 改变 zIndex 不应该立即触发渲染 (调用 onCanvasChange('zIndex')),需要经过 sort 再触发
  1158. parent.sort();
  1159. }
  1160. return this;
  1161. };
  1162. Element.prototype.toFront = function () {
  1163. var parent = this.getParent();
  1164. if (!parent) {
  1165. return;
  1166. }
  1167. var children = parent.getChildren();
  1168. var el = this.get('el');
  1169. var index = children.indexOf(this);
  1170. children.splice(index, 1);
  1171. children.push(this);
  1172. this.onCanvasChange('zIndex');
  1173. };
  1174. Element.prototype.toBack = function () {
  1175. var parent = this.getParent();
  1176. if (!parent) {
  1177. return;
  1178. }
  1179. var children = parent.getChildren();
  1180. var el = this.get('el');
  1181. var index = children.indexOf(this);
  1182. children.splice(index, 1);
  1183. children.unshift(this);
  1184. this.onCanvasChange('zIndex');
  1185. };
  1186. Element.prototype.remove = function (destroy) {
  1187. if (destroy === void 0) {
  1188. destroy = true;
  1189. }
  1190. var parent = this.getParent();
  1191. if (parent) {
  1192. Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["removeFromArray"])(parent.getChildren(), this);
  1193. if (!parent.get('clearing')) {
  1194. // 如果父元素正在清理,当前元素不触发 remove
  1195. this.onCanvasChange('remove');
  1196. }
  1197. } else {
  1198. this.onCanvasChange('remove');
  1199. }
  1200. if (destroy) {
  1201. this.destroy();
  1202. }
  1203. };
  1204. Element.prototype.resetMatrix = function () {
  1205. this.attr(MATRIX, this.getDefaultMatrix());
  1206. this.onCanvasChange('matrix');
  1207. };
  1208. Element.prototype.getMatrix = function () {
  1209. return this.attr(MATRIX);
  1210. };
  1211. Element.prototype.setMatrix = function (m) {
  1212. this.attr(MATRIX, m);
  1213. this.onCanvasChange('matrix');
  1214. }; // 获取总的 matrix
  1215. Element.prototype.getTotalMatrix = function () {
  1216. var totalMatrix = this.cfg.totalMatrix;
  1217. if (!totalMatrix) {
  1218. var currentMatrix = this.attr('matrix');
  1219. var parentMatrix = this.cfg.parentMatrix;
  1220. if (parentMatrix && currentMatrix) {
  1221. totalMatrix = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyMatrix"])(parentMatrix, currentMatrix);
  1222. } else {
  1223. totalMatrix = currentMatrix || parentMatrix;
  1224. }
  1225. this.set('totalMatrix', totalMatrix);
  1226. }
  1227. return totalMatrix;
  1228. }; // 上层分组设置 matrix
  1229. Element.prototype.applyMatrix = function (matrix) {
  1230. var currentMatrix = this.attr('matrix');
  1231. var totalMatrix = null;
  1232. if (matrix && currentMatrix) {
  1233. totalMatrix = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyMatrix"])(matrix, currentMatrix);
  1234. } else {
  1235. totalMatrix = currentMatrix || matrix;
  1236. }
  1237. this.set('totalMatrix', totalMatrix);
  1238. this.set('parentMatrix', matrix);
  1239. };
  1240. /**
  1241. * @protected
  1242. * 获取默认的矩阵
  1243. * @returns {number[]|null} 默认的矩阵
  1244. */
  1245. Element.prototype.getDefaultMatrix = function () {
  1246. return null;
  1247. }; // 将向量应用设置的矩阵
  1248. Element.prototype.applyToMatrix = function (v) {
  1249. var matrix = this.attr('matrix');
  1250. if (matrix) {
  1251. return Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyVec2"])(matrix, v);
  1252. }
  1253. return v;
  1254. }; // 根据设置的矩阵,将向量转换相对于图形/分组的位置
  1255. Element.prototype.invertFromMatrix = function (v) {
  1256. var matrix = this.attr('matrix');
  1257. if (matrix) {
  1258. var invertMatrix = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["invert"])(matrix);
  1259. if (invertMatrix) {
  1260. return Object(_util_matrix__WEBPACK_IMPORTED_MODULE_4__["multiplyVec2"])(invertMatrix, v);
  1261. }
  1262. }
  1263. return v;
  1264. }; // 设置 clip
  1265. Element.prototype.setClip = function (clipCfg) {
  1266. var canvas = this.getCanvas(); // 应该只设置当前元素的 clip,不应该去修改 clip 本身,方便 clip 被复用
  1267. // TODO: setClip 的传参既 shape 配置,也支持 shape 对象
  1268. // const preShape = this.get('clipShape');
  1269. // if (preShape) {
  1270. // // 将之前的 clipShape 销毁
  1271. // preShape.destroy();
  1272. // }
  1273. var clipShape = null; // 如果配置项为 null,则不移除 clipShape
  1274. if (clipCfg) {
  1275. var ShapeBase = this.getShapeBase();
  1276. var shapeType = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["upperFirst"])(clipCfg.type);
  1277. var Cons = ShapeBase[shapeType];
  1278. if (Cons) {
  1279. clipShape = new Cons({
  1280. type: clipCfg.type,
  1281. isClipShape: true,
  1282. applyTo: this,
  1283. attrs: clipCfg.attrs,
  1284. canvas: canvas
  1285. });
  1286. }
  1287. }
  1288. this.set('clipShape', clipShape);
  1289. this.onCanvasChange('clip');
  1290. return clipShape;
  1291. };
  1292. Element.prototype.getClip = function () {
  1293. // 高频率调用的地方直接使用 this.cfg.xxx
  1294. var clipShape = this.cfg.clipShape; // 未设置时返回 Null,保证一致性
  1295. if (!clipShape) {
  1296. return null;
  1297. }
  1298. return clipShape;
  1299. };
  1300. Element.prototype.clone = function () {
  1301. var _this = this;
  1302. var originAttrs = this.attrs;
  1303. var attrs = {};
  1304. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(originAttrs, function (i, k) {
  1305. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isArray"])(originAttrs[k])) {
  1306. attrs[k] = _cloneArrayAttr(originAttrs[k]);
  1307. } else {
  1308. attrs[k] = originAttrs[k];
  1309. }
  1310. });
  1311. var cons = this.constructor; // @ts-ignore
  1312. var clone = new cons({
  1313. attrs: attrs
  1314. });
  1315. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(CLONE_CFGS, function (cfgName) {
  1316. clone.set(cfgName, _this.get(cfgName));
  1317. });
  1318. return clone;
  1319. };
  1320. Element.prototype.destroy = function () {
  1321. var destroyed = this.destroyed;
  1322. if (destroyed) {
  1323. return;
  1324. }
  1325. this.attrs = {};
  1326. _super.prototype.destroy.call(this); // this.onCanvasChange('destroy');
  1327. };
  1328. /**
  1329. * 是否处于动画暂停状态
  1330. * @return {boolean} 是否处于动画暂停状态
  1331. */
  1332. Element.prototype.isAnimatePaused = function () {
  1333. return this.get('_pause').isPaused;
  1334. };
  1335. /**
  1336. * 执行动画,支持多种函数签名
  1337. * 1. animate(toAttrs: ElementAttrs, duration: number, easing?: string, callback?: () => void, delay?: number)
  1338. * 2. animate(onFrame: OnFrame, duration: number, easing?: string, callback?: () => void, delay?: number)
  1339. * 3. animate(toAttrs: ElementAttrs, cfg: AnimateCfg)
  1340. * 4. animate(onFrame: OnFrame, cfg: AnimateCfg)
  1341. * 各个参数的含义为:
  1342. * toAttrs 动画最终状态
  1343. * onFrame 自定义帧动画函数
  1344. * duration 动画执行时间
  1345. * easing 动画缓动效果
  1346. * callback 动画执行后的回调
  1347. * delay 动画延迟时间
  1348. */
  1349. Element.prototype.animate = function () {
  1350. var args = [];
  1351. for (var _i = 0; _i < arguments.length; _i++) {
  1352. args[_i] = arguments[_i];
  1353. }
  1354. this.set('animating', true);
  1355. var timeline = this.get('timeline');
  1356. if (!timeline) {
  1357. timeline = this.get('canvas').get('timeline');
  1358. this.set('timeline', timeline);
  1359. }
  1360. var animations = this.get('animations') || []; // 初始化 tick
  1361. if (!timeline.timer) {
  1362. timeline.initTimer();
  1363. }
  1364. var toAttrs = args[0],
  1365. duration = args[1],
  1366. _a = args[2],
  1367. easing = _a === void 0 ? 'easeLinear' : _a,
  1368. _b = args[3],
  1369. callback = _b === void 0 ? _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"] : _b,
  1370. _c = args[4],
  1371. delay = _c === void 0 ? 0 : _c;
  1372. var onFrame;
  1373. var repeat;
  1374. var pauseCallback;
  1375. var resumeCallback;
  1376. var animateCfg; // 第二个参数,既可以是动画最终状态 toAttrs,也可以是自定义帧动画函数 onFrame
  1377. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(toAttrs)) {
  1378. onFrame = toAttrs;
  1379. toAttrs = {};
  1380. } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(toAttrs) && toAttrs.onFrame) {
  1381. // 兼容 3.0 中的写法,onFrame 和 repeat 可在 toAttrs 中设置
  1382. onFrame = toAttrs.onFrame;
  1383. repeat = toAttrs.repeat;
  1384. } // 第二个参数,既可以是执行时间 duration,也可以是动画参数 animateCfg
  1385. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(duration)) {
  1386. animateCfg = duration;
  1387. duration = animateCfg.duration;
  1388. easing = animateCfg.easing || 'easeLinear';
  1389. delay = animateCfg.delay || 0; // animateCfg 中的设置优先级更高
  1390. repeat = animateCfg.repeat || repeat || false;
  1391. callback = animateCfg.callback || _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"];
  1392. pauseCallback = animateCfg.pauseCallback || _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"];
  1393. resumeCallback = animateCfg.resumeCallback || _antv_util__WEBPACK_IMPORTED_MODULE_1__["noop"];
  1394. } else {
  1395. // 第四个参数,既可以是回调函数 callback,也可以是延迟时间 delay
  1396. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(callback)) {
  1397. delay = callback;
  1398. callback = null;
  1399. } // 第三个参数,既可以是缓动参数 easing,也可以是回调函数 callback
  1400. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(easing)) {
  1401. callback = easing;
  1402. easing = 'easeLinear';
  1403. } else {
  1404. easing = easing || 'easeLinear';
  1405. }
  1406. }
  1407. var formatToAttrs = getFormatToAttrs(toAttrs, this);
  1408. var animation = {
  1409. fromAttrs: getFormatFromAttrs(formatToAttrs, this),
  1410. toAttrs: formatToAttrs,
  1411. duration: duration,
  1412. easing: easing,
  1413. repeat: repeat,
  1414. callback: callback,
  1415. pauseCallback: pauseCallback,
  1416. resumeCallback: resumeCallback,
  1417. delay: delay,
  1418. startTime: timeline.getTime(),
  1419. id: Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["uniqueId"])(),
  1420. onFrame: onFrame,
  1421. pathFormatted: false
  1422. }; // 如果动画元素队列中已经有这个图形了
  1423. if (animations.length > 0) {
  1424. // 先检查是否需要合并属性。若有相同的动画,将该属性从前一个动画中删除,直接用后一个动画中
  1425. animations = checkExistedAttrs(animations, animation);
  1426. } else {
  1427. // 否则将图形添加到动画元素队列
  1428. timeline.addAnimator(this);
  1429. }
  1430. animations.push(animation);
  1431. this.set('animations', animations);
  1432. this.set('_pause', {
  1433. isPaused: false
  1434. });
  1435. };
  1436. /**
  1437. * 停止动画
  1438. * @param {boolean} toEnd 是否到动画的最终状态
  1439. */
  1440. Element.prototype.stopAnimate = function (toEnd) {
  1441. var _this = this;
  1442. if (toEnd === void 0) {
  1443. toEnd = true;
  1444. }
  1445. var animations = this.get('animations');
  1446. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (animation) {
  1447. // 将动画执行到最后一帧
  1448. if (toEnd) {
  1449. if (animation.onFrame) {
  1450. _this.attr(animation.onFrame(1));
  1451. } else {
  1452. _this.attr(animation.toAttrs);
  1453. }
  1454. }
  1455. if (animation.callback) {
  1456. // 动画停止时的回调
  1457. animation.callback();
  1458. }
  1459. });
  1460. this.set('animating', false);
  1461. this.set('animations', []);
  1462. };
  1463. /**
  1464. * 暂停动画
  1465. */
  1466. Element.prototype.pauseAnimate = function () {
  1467. var timeline = this.get('timeline');
  1468. var animations = this.get('animations');
  1469. var pauseTime = timeline.getTime();
  1470. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (animation) {
  1471. animation._paused = true;
  1472. animation._pauseTime = pauseTime;
  1473. if (animation.pauseCallback) {
  1474. // 动画暂停时的回调
  1475. animation.pauseCallback();
  1476. }
  1477. }); // 记录下是在什么时候暂停的
  1478. this.set('_pause', {
  1479. isPaused: true,
  1480. pauseTime: pauseTime
  1481. });
  1482. return this;
  1483. };
  1484. /**
  1485. * 恢复动画
  1486. */
  1487. Element.prototype.resumeAnimate = function () {
  1488. var timeline = this.get('timeline');
  1489. var current = timeline.getTime();
  1490. var animations = this.get('animations');
  1491. var pauseTime = this.get('_pause').pauseTime; // 之后更新属性需要计算动画已经执行的时长,如果暂停了,就把初始时间调后
  1492. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(animations, function (animation) {
  1493. animation.startTime = animation.startTime + (current - pauseTime);
  1494. animation._paused = false;
  1495. animation._pauseTime = null;
  1496. if (animation.resumeCallback) {
  1497. animation.resumeCallback();
  1498. }
  1499. });
  1500. this.set('_pause', {
  1501. isPaused: false
  1502. });
  1503. this.set('animations', animations);
  1504. return this;
  1505. };
  1506. /**
  1507. * 触发委托事件
  1508. * @param {string} type 事件类型
  1509. * @param {GraphEvent} eventObj 事件对象
  1510. */
  1511. Element.prototype.emitDelegation = function (type, eventObj) {
  1512. var _this = this;
  1513. var paths = eventObj.propagationPath;
  1514. var events = this.getEvents();
  1515. var relativeShape;
  1516. if (type === 'mouseenter') {
  1517. relativeShape = eventObj.fromShape;
  1518. } else if (type === 'mouseleave') {
  1519. relativeShape = eventObj.toShape;
  1520. }
  1521. var _loop_1 = function (i) {
  1522. var element = paths[i]; // 暂定跟 name 绑定
  1523. var name_1 = element.get('name');
  1524. if (name_1) {
  1525. // 第一个 mouseenter 和 mouseleave 的停止即可,因为后面的都是前面的 Parent
  1526. if ( // 只有 element 是 Group 或者 Canvas 的时候,才需要判断 isParent
  1527. (element.isGroup() || element.isCanvas && element.isCanvas()) && relativeShape && Object(_util_util__WEBPACK_IMPORTED_MODULE_3__["isParent"])(element, relativeShape)) {
  1528. return "break";
  1529. }
  1530. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["isArray"])(name_1)) {
  1531. Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__["each"])(name_1, function (subName) {
  1532. _this.emitDelegateEvent(element, subName, eventObj);
  1533. });
  1534. } else {
  1535. this_1.emitDelegateEvent(element, name_1, eventObj);
  1536. }
  1537. }
  1538. };
  1539. var this_1 = this; // 至少有一个对象,且第一个对象为 shape
  1540. for (var i = 0; i < paths.length; i++) {
  1541. var state_1 = _loop_1(i);
  1542. if (state_1 === "break") break;
  1543. }
  1544. };
  1545. Element.prototype.emitDelegateEvent = function (element, name, eventObj) {
  1546. var events = this.getEvents(); // 事件委托的形式 name:type
  1547. var eventName = name + DELEGATION_SPLIT + eventObj.type;
  1548. if (events[eventName] || events[WILDCARD]) {
  1549. // 对于通配符 *,事件名称 = 委托事件名称
  1550. eventObj.name = eventName;
  1551. eventObj.currentTarget = element;
  1552. eventObj.delegateTarget = this; // 将委托事件的监听对象 delegateObject 挂载到事件对象上
  1553. eventObj.delegateObject = element.get('delegateObject');
  1554. this.emit(eventName, eventObj);
  1555. }
  1556. };
  1557. /**
  1558. * 移动元素
  1559. * @param {number} translateX 水平移动距离
  1560. * @param {number} translateY 垂直移动距离
  1561. * @return {IElement} 元素
  1562. */
  1563. Element.prototype.translate = function (translateX, translateY) {
  1564. if (translateX === void 0) {
  1565. translateX = 0;
  1566. }
  1567. if (translateY === void 0) {
  1568. translateY = 0;
  1569. }
  1570. var matrix = this.getMatrix();
  1571. var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['t', translateX, translateY]]);
  1572. this.setMatrix(newMatrix);
  1573. return this;
  1574. };
  1575. /**
  1576. * 移动元素到目标位置
  1577. * @param {number} targetX 目标位置的水平坐标
  1578. * @param {number} targetX 目标位置的垂直坐标
  1579. * @return {IElement} 元素
  1580. */
  1581. Element.prototype.move = function (targetX, targetY) {
  1582. var x = this.attr('x') || 0;
  1583. var y = this.attr('y') || 0;
  1584. this.translate(targetX - x, targetY - y);
  1585. return this;
  1586. };
  1587. /**
  1588. * 移动元素到目标位置,等价于 move 方法。由于 moveTo 的语义性更强,因此在文档中推荐使用 moveTo 方法
  1589. * @param {number} targetX 目标位置的 x 轴坐标
  1590. * @param {number} targetY 目标位置的 y 轴坐标
  1591. * @return {IElement} 元素
  1592. */
  1593. Element.prototype.moveTo = function (targetX, targetY) {
  1594. return this.move(targetX, targetY);
  1595. };
  1596. /**
  1597. * 缩放元素
  1598. * @param {number} ratioX 水平缩放比例
  1599. * @param {number} ratioY 垂直缩放比例
  1600. * @return {IElement} 元素
  1601. */
  1602. Element.prototype.scale = function (ratioX, ratioY) {
  1603. var matrix = this.getMatrix();
  1604. var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['s', ratioX, ratioY || ratioX]]);
  1605. this.setMatrix(newMatrix);
  1606. return this;
  1607. };
  1608. /**
  1609. * 以画布左上角 (0, 0) 为中心旋转元素
  1610. * @param {number} radian 旋转角度(弧度值)
  1611. * @return {IElement} 元素
  1612. */
  1613. Element.prototype.rotate = function (radian) {
  1614. var matrix = this.getMatrix();
  1615. var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['r', radian]]);
  1616. this.setMatrix(newMatrix);
  1617. return this;
  1618. };
  1619. /**
  1620. * 以起始点为中心旋转元素
  1621. * @param {number} radian 旋转角度(弧度值)
  1622. * @return {IElement} 元素
  1623. */
  1624. Element.prototype.rotateAtStart = function (rotate) {
  1625. var _a = this.attr(),
  1626. x = _a.x,
  1627. y = _a.y;
  1628. var matrix = this.getMatrix();
  1629. var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['t', -x, -y], ['r', rotate], ['t', x, y]]);
  1630. this.setMatrix(newMatrix);
  1631. return this;
  1632. };
  1633. /**
  1634. * 以任意点 (x, y) 为中心旋转元素
  1635. * @param {number} radian 旋转角度(弧度值)
  1636. * @return {IElement} 元素
  1637. */
  1638. Element.prototype.rotateAtPoint = function (x, y, rotate) {
  1639. var matrix = this.getMatrix();
  1640. var newMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__["ext"].transform(matrix, [['t', -x, -y], ['r', rotate], ['t', x, y]]);
  1641. this.setMatrix(newMatrix);
  1642. return this;
  1643. };
  1644. return Element;
  1645. }(_base__WEBPACK_IMPORTED_MODULE_5__["default"]);
  1646. /* harmony default export */ __webpack_exports__["default"] = (Element);
  1647. /***/ }),
  1648. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/group.js":
  1649. /*!************************************************************************************!*\
  1650. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/group.js ***!
  1651. \************************************************************************************/
  1652. /*! exports provided: default */
  1653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1654. "use strict";
  1655. __webpack_require__.r(__webpack_exports__);
  1656. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  1657. /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./container */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/container.js");
  1658. var AbstractGroup =
  1659. /** @class */
  1660. function (_super) {
  1661. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AbstractGroup, _super);
  1662. function AbstractGroup() {
  1663. return _super !== null && _super.apply(this, arguments) || this;
  1664. }
  1665. AbstractGroup.prototype.isGroup = function () {
  1666. return true;
  1667. };
  1668. AbstractGroup.prototype.isEntityGroup = function () {
  1669. return false;
  1670. };
  1671. AbstractGroup.prototype.clone = function () {
  1672. var clone = _super.prototype.clone.call(this); // 获取构造函数
  1673. var children = this.getChildren();
  1674. for (var i = 0; i < children.length; i++) {
  1675. var child = children[i];
  1676. clone.add(child.clone());
  1677. }
  1678. return clone;
  1679. };
  1680. return AbstractGroup;
  1681. }(_container__WEBPACK_IMPORTED_MODULE_1__["default"]);
  1682. /* harmony default export */ __webpack_exports__["default"] = (AbstractGroup);
  1683. /***/ }),
  1684. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/shape.js":
  1685. /*!************************************************************************************!*\
  1686. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/shape.js ***!
  1687. \************************************************************************************/
  1688. /*! exports provided: default */
  1689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1690. "use strict";
  1691. __webpack_require__.r(__webpack_exports__);
  1692. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  1693. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/element.js");
  1694. /* harmony import */ var _util_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/matrix */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js");
  1695. var AbstractShape =
  1696. /** @class */
  1697. function (_super) {
  1698. Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(AbstractShape, _super);
  1699. function AbstractShape(cfg) {
  1700. return _super.call(this, cfg) || this;
  1701. } // 是否在包围盒内
  1702. AbstractShape.prototype._isInBBox = function (refX, refY) {
  1703. var bbox = this.getBBox();
  1704. return bbox.minX <= refX && bbox.maxX >= refX && bbox.minY <= refY && bbox.maxY >= refY;
  1705. };
  1706. /**
  1707. * 属性更改后需要做的事情
  1708. * @protected
  1709. * @param {ShapeAttrs} targetAttrs 渲染的图像属性
  1710. */
  1711. AbstractShape.prototype.afterAttrsChange = function (targetAttrs) {
  1712. _super.prototype.afterAttrsChange.call(this, targetAttrs);
  1713. this.clearCacheBBox();
  1714. }; // 计算包围盒时,需要缓存,这是一个高频的操作
  1715. AbstractShape.prototype.getBBox = function () {
  1716. var bbox = this.cfg.bbox;
  1717. if (!bbox) {
  1718. bbox = this.calculateBBox();
  1719. this.set('bbox', bbox);
  1720. }
  1721. return bbox;
  1722. }; // 计算相对于画布的包围盒
  1723. AbstractShape.prototype.getCanvasBBox = function () {
  1724. var canvasBBox = this.cfg.canvasBBox;
  1725. if (!canvasBBox) {
  1726. canvasBBox = this.calculateCanvasBBox();
  1727. this.set('canvasBBox', canvasBBox);
  1728. }
  1729. return canvasBBox;
  1730. };
  1731. AbstractShape.prototype.applyMatrix = function (matrix) {
  1732. _super.prototype.applyMatrix.call(this, matrix); // 清理掉缓存的包围盒
  1733. this.set('canvasBBox', null);
  1734. };
  1735. /**
  1736. * 计算相对于画布的包围盒,默认等同于 bbox
  1737. * @return {BBox} 包围盒
  1738. */
  1739. AbstractShape.prototype.calculateCanvasBBox = function () {
  1740. var bbox = this.getBBox();
  1741. var totalMatrix = this.getTotalMatrix();
  1742. var minX = bbox.minX,
  1743. minY = bbox.minY,
  1744. maxX = bbox.maxX,
  1745. maxY = bbox.maxY;
  1746. if (totalMatrix) {
  1747. var topLeft = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.minX, bbox.minY]);
  1748. var topRight = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.maxX, bbox.minY]);
  1749. var bottomLeft = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.minX, bbox.maxY]);
  1750. var bottomRight = Object(_util_matrix__WEBPACK_IMPORTED_MODULE_2__["multiplyVec2"])(totalMatrix, [bbox.maxX, bbox.maxY]);
  1751. minX = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);
  1752. maxX = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);
  1753. minY = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);
  1754. maxY = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);
  1755. }
  1756. var attrs = this.attrs; // 如果存在 shadow 则计算 shadow
  1757. if (attrs.shadowColor) {
  1758. var _a = attrs.shadowBlur,
  1759. shadowBlur = _a === void 0 ? 0 : _a,
  1760. _b = attrs.shadowOffsetX,
  1761. shadowOffsetX = _b === void 0 ? 0 : _b,
  1762. _c = attrs.shadowOffsetY,
  1763. shadowOffsetY = _c === void 0 ? 0 : _c;
  1764. var shadowLeft = minX - shadowBlur + shadowOffsetX;
  1765. var shadowRight = maxX + shadowBlur + shadowOffsetX;
  1766. var shadowTop = minY - shadowBlur + shadowOffsetY;
  1767. var shadowBottom = maxY + shadowBlur + shadowOffsetY;
  1768. minX = Math.min(minX, shadowLeft);
  1769. maxX = Math.max(maxX, shadowRight);
  1770. minY = Math.min(minY, shadowTop);
  1771. maxY = Math.max(maxY, shadowBottom);
  1772. }
  1773. return {
  1774. x: minX,
  1775. y: minY,
  1776. minX: minX,
  1777. minY: minY,
  1778. maxX: maxX,
  1779. maxY: maxY,
  1780. width: maxX - minX,
  1781. height: maxY - minY
  1782. };
  1783. };
  1784. /**
  1785. * @protected
  1786. * 清理缓存的 bbox
  1787. */
  1788. AbstractShape.prototype.clearCacheBBox = function () {
  1789. this.set('bbox', null);
  1790. this.set('canvasBBox', null);
  1791. }; // 实现接口
  1792. AbstractShape.prototype.isClipShape = function () {
  1793. return this.get('isClipShape');
  1794. };
  1795. /**
  1796. * @protected
  1797. * 不同的图形自己实现是否在图形内部的逻辑,要判断边和填充区域
  1798. * @param {number} refX 相对于图形的坐标 x
  1799. * @param {number} refY 相对于图形的坐标 Y
  1800. * @return {boolean} 点是否在图形内部
  1801. */
  1802. AbstractShape.prototype.isInShape = function (refX, refY) {
  1803. return false;
  1804. };
  1805. /**
  1806. * 是否仅仅使用 BBox 检测就可以判定拾取到图形
  1807. * 默认是 false,但是有些图形例如 image、marker 等都可直接使用 BBox 的检测而不需要使用图形拾取
  1808. * @return {Boolean} 仅仅使用 BBox 进行拾取
  1809. */
  1810. AbstractShape.prototype.isOnlyHitBox = function () {
  1811. return false;
  1812. }; // 不同的 Shape 各自实现
  1813. AbstractShape.prototype.isHit = function (x, y) {
  1814. var startArrowShape = this.get('startArrowShape');
  1815. var endArrowShape = this.get('endArrowShape');
  1816. var vec = [x, y, 1];
  1817. vec = this.invertFromMatrix(vec);
  1818. var refX = vec[0],
  1819. refY = vec[1];
  1820. var inBBox = this._isInBBox(refX, refY); // 跳过图形的拾取,在某些图形中可以省略一倍的检测成本
  1821. if (this.isOnlyHitBox()) {
  1822. return inBBox;
  1823. } // 被裁减掉的和不在包围盒内的不进行计算
  1824. if (inBBox && !this.isClipped(refX, refY)) {
  1825. // 对图形进行拾取判断
  1826. if (this.isInShape(refX, refY)) {
  1827. return true;
  1828. } // 对起始箭头进行拾取判断
  1829. if (startArrowShape && startArrowShape.isHit(refX, refY)) {
  1830. return true;
  1831. } // 对结束箭头进行拾取判断
  1832. if (endArrowShape && endArrowShape.isHit(refX, refY)) {
  1833. return true;
  1834. }
  1835. }
  1836. return false;
  1837. };
  1838. return AbstractShape;
  1839. }(_element__WEBPACK_IMPORTED_MODULE_1__["default"]);
  1840. /* harmony default export */ __webpack_exports__["default"] = (AbstractShape);
  1841. /***/ }),
  1842. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/animate/timeline.js":
  1843. /*!**************************************************************************************!*\
  1844. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/animate/timeline.js ***!
  1845. \**************************************************************************************/
  1846. /*! exports provided: default */
  1847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1848. "use strict";
  1849. __webpack_require__.r(__webpack_exports__);
  1850. /* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  1851. /* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/index.js");
  1852. /* harmony import */ var d3_ease__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-ease */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/index.js");
  1853. /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-interpolate */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/index.js");
  1854. /* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/path */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js");
  1855. /* harmony import */ var _util_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/color */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/color.js");
  1856. // 目前整体动画只需要数值和数组的差值计算
  1857. var IDENTITY_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];
  1858. /**
  1859. * 使用 ratio 进行插值计算来更新属性
  1860. * @param {IElement} shape 元素
  1861. * @param {Animation} animation 动画
  1862. * @param {number} ratio 比例
  1863. * @return {boolean} 动画是否执行完成
  1864. */
  1865. function _update(shape, animation, ratio) {
  1866. var cProps = {}; // 此刻属性
  1867. var fromAttrs = animation.fromAttrs,
  1868. toAttrs = animation.toAttrs;
  1869. if (shape.destroyed) {
  1870. return;
  1871. }
  1872. var interf; // 差值函数
  1873. for (var k in toAttrs) {
  1874. if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isEqual"])(fromAttrs[k], toAttrs[k])) {
  1875. if (k === 'path') {
  1876. var toPath = toAttrs[k];
  1877. var fromPath = fromAttrs[k];
  1878. if (toPath.length > fromPath.length) {
  1879. toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](toAttrs[k]); // 终点状态
  1880. fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](fromAttrs[k]); // 起始状态
  1881. fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["fillPathByDiff"](fromPath, toPath);
  1882. fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["formatPath"](fromPath, toPath);
  1883. animation.fromAttrs.path = fromPath;
  1884. animation.toAttrs.path = toPath;
  1885. } else if (!animation.pathFormatted) {
  1886. toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](toAttrs[k]);
  1887. fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["parsePathString"](fromAttrs[k]);
  1888. fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__["formatPath"](fromPath, toPath);
  1889. animation.fromAttrs.path = fromPath;
  1890. animation.toAttrs.path = toPath;
  1891. animation.pathFormatted = true;
  1892. }
  1893. cProps[k] = [];
  1894. for (var i = 0; i < toPath.length; i++) {
  1895. var toPathPoint = toPath[i];
  1896. var fromPathPoint = fromPath[i];
  1897. var cPathPoint = [];
  1898. for (var j = 0; j < toPathPoint.length; j++) {
  1899. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(toPathPoint[j]) && fromPathPoint && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(fromPathPoint[j])) {
  1900. interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_3__["interpolate"])(fromPathPoint[j], toPathPoint[j]);
  1901. cPathPoint.push(interf(ratio));
  1902. } else {
  1903. cPathPoint.push(toPathPoint[j]);
  1904. }
  1905. }
  1906. cProps[k].push(cPathPoint);
  1907. }
  1908. } else if (k === 'matrix') {
  1909. /*
  1910. 对矩阵进行插值时,需要保证矩阵不为空,为空则使用单位矩阵
  1911. TODO: 二维和三维场景下单位矩阵不同,之后 WebGL 版需要做进一步处理
  1912. */
  1913. var matrixFn = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_3__["interpolateArray"])(fromAttrs[k] || IDENTITY_MATRIX, toAttrs[k] || IDENTITY_MATRIX);
  1914. var currentMatrix = matrixFn(ratio);
  1915. cProps[k] = currentMatrix;
  1916. } else if (Object(_util_color__WEBPACK_IMPORTED_MODULE_5__["isColorProp"])(k) && Object(_util_color__WEBPACK_IMPORTED_MODULE_5__["isGradientColor"])(toAttrs[k])) {
  1917. cProps[k] = toAttrs[k];
  1918. } else if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(toAttrs[k])) {
  1919. // 非函数类型的值才能做插值
  1920. interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_3__["interpolate"])(fromAttrs[k], toAttrs[k]);
  1921. cProps[k] = interf(ratio);
  1922. }
  1923. }
  1924. }
  1925. shape.attr(cProps);
  1926. }
  1927. /**
  1928. * 根据自定义帧动画函数 onFrame 来更新属性
  1929. * @param {IElement} shape 元素
  1930. * @param {Animation} animation 动画
  1931. * @param {number} elapsed 动画执行时间(毫秒)
  1932. * @return {boolean} 动画是否执行完成
  1933. */
  1934. function update(shape, animation, elapsed) {
  1935. var startTime = animation.startTime,
  1936. delay = animation.delay; // 如果还没有开始执行或暂停,先不更新
  1937. if (elapsed < startTime + delay || animation._paused) {
  1938. return false;
  1939. }
  1940. var ratio;
  1941. var duration = animation.duration;
  1942. var easing = animation.easing; // 已执行时间
  1943. elapsed = elapsed - startTime - animation.delay;
  1944. if (animation.repeat) {
  1945. // 如果动画重复执行,则 elapsed > duration,计算 ratio 时需取模
  1946. ratio = elapsed % duration / duration;
  1947. ratio = d3_ease__WEBPACK_IMPORTED_MODULE_2__[easing](ratio);
  1948. } else {
  1949. ratio = elapsed / duration;
  1950. if (ratio < 1) {
  1951. // 动画未执行完
  1952. ratio = d3_ease__WEBPACK_IMPORTED_MODULE_2__[easing](ratio);
  1953. } else {
  1954. // 动画已执行完
  1955. if (animation.onFrame) {
  1956. shape.attr(animation.onFrame(1));
  1957. } else {
  1958. shape.attr(animation.toAttrs);
  1959. }
  1960. return true;
  1961. }
  1962. }
  1963. if (animation.onFrame) {
  1964. var attrs = animation.onFrame(ratio);
  1965. shape.attr(attrs);
  1966. } else {
  1967. _update(shape, animation, ratio);
  1968. }
  1969. return false;
  1970. }
  1971. var Timeline =
  1972. /** @class */
  1973. function () {
  1974. /**
  1975. * 时间轴构造函数,依赖于画布
  1976. * @param {}
  1977. */
  1978. function Timeline(canvas) {
  1979. /**
  1980. * 执行动画的元素列表
  1981. * @type {IElement[]}
  1982. */
  1983. this.animators = [];
  1984. /**
  1985. * 当前时间
  1986. * @type {number}
  1987. */
  1988. this.current = 0;
  1989. /**
  1990. * 定时器
  1991. * @type {d3Timer.Timer}
  1992. */
  1993. this.timer = null;
  1994. this.canvas = canvas;
  1995. }
  1996. /**
  1997. * 初始化定时器
  1998. */
  1999. Timeline.prototype.initTimer = function () {
  2000. console.log('here... initTimer')
  2001. var _this = this;
  2002. var isFinished = false;
  2003. var shape;
  2004. var animations;
  2005. var animation;
  2006. this.timer = d3_timer__WEBPACK_IMPORTED_MODULE_1__["timer"](function (elapsed) {
  2007. _this.current = elapsed;
  2008. console.log('here... run timer')
  2009. if (_this.animators.length > 0) {
  2010. for (var i = _this.animators.length - 1; i >= 0; i--) {
  2011. shape = _this.animators[i];
  2012. if (shape.destroyed) {
  2013. // 如果已经被销毁,直接移出队列
  2014. _this.removeAnimator(i);
  2015. continue;
  2016. }
  2017. if (!shape.isAnimatePaused()) {
  2018. animations = shape.get('animations');
  2019. for (var j = animations.length - 1; j >= 0; j--) {
  2020. animation = animations[j];
  2021. isFinished = update(shape, animation, elapsed);
  2022. if (isFinished) {
  2023. animations.splice(j, 1);
  2024. isFinished = false;
  2025. if (animation.callback) {
  2026. animation.callback();
  2027. }
  2028. }
  2029. }
  2030. }
  2031. if (animations.length === 0) {
  2032. _this.removeAnimator(i);
  2033. }
  2034. }
  2035. var autoDraw = _this.canvas.get('autoDraw'); // 非自动渲染模式下,手动调用 canvas.draw() 重新渲染
  2036. if (!autoDraw) {
  2037. _this.canvas.draw();
  2038. }
  2039. }
  2040. });
  2041. };
  2042. /**
  2043. * 增加动画元素
  2044. */
  2045. Timeline.prototype.addAnimator = function (shape) {
  2046. this.animators.push(shape);
  2047. };
  2048. /**
  2049. * 移除动画元素
  2050. */
  2051. Timeline.prototype.removeAnimator = function (index) {
  2052. this.animators.splice(index, 1);
  2053. };
  2054. /**
  2055. * 是否有动画在执行
  2056. */
  2057. Timeline.prototype.isAnimating = function () {
  2058. return !!this.animators.length;
  2059. };
  2060. /**
  2061. * 停止定时器
  2062. */
  2063. Timeline.prototype.stop = function () {
  2064. if (this.timer) {
  2065. this.timer.stop();
  2066. }
  2067. };
  2068. /**
  2069. * 停止时间轴上所有元素的动画,并置空动画元素列表
  2070. * @param {boolean} toEnd 是否到动画的最终状态,用来透传给动画元素的 stopAnimate 方法
  2071. */
  2072. Timeline.prototype.stopAllAnimations = function (toEnd) {
  2073. if (toEnd === void 0) {
  2074. toEnd = true;
  2075. }
  2076. this.animators.forEach(function (animator) {
  2077. animator.stopAnimate(toEnd);
  2078. });
  2079. this.animators = [];
  2080. this.canvas.draw();
  2081. };
  2082. /**
  2083. * 获取当前时间
  2084. */
  2085. Timeline.prototype.getTime = function () {
  2086. return this.current;
  2087. };
  2088. return Timeline;
  2089. }();
  2090. /* harmony default export */ __webpack_exports__["default"] = (Timeline);
  2091. /***/ }),
  2092. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/event-contoller.js":
  2093. /*!*******************************************************************************************!*\
  2094. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/event-contoller.js ***!
  2095. \*******************************************************************************************/
  2096. /*! exports provided: default */
  2097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2098. "use strict";
  2099. __webpack_require__.r(__webpack_exports__);
  2100. /* harmony import */ var _graph_event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graph-event */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js");
  2101. /* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js");
  2102. /**
  2103. * @fileoverview 事件处理器
  2104. * @author dxq613@gmail.com
  2105. */
  2106. var CLICK_OFFSET = 40;
  2107. var LEFT_BTN_CODE = 0;
  2108. var DELEGATION_SPLIT = ':';
  2109. var EVENTS = ['mousedown', 'mouseup', 'dblclick', 'mouseout', 'mouseover', 'mousemove', 'mouseleave', 'mouseenter', 'touchstart', 'touchmove', 'touchend', 'dragenter', 'dragover', 'dragleave', 'drop', 'contextmenu', 'mousewheel']; // 是否有委托事件监听
  2110. function hasDelegation(events, type) {
  2111. for (var key in events) {
  2112. if (events.hasOwnProperty(key) && key.indexOf(DELEGATION_SPLIT + type) >= 0) {
  2113. return true;
  2114. }
  2115. }
  2116. return false;
  2117. } // 触发目标事件,目标只能是 shape 或 canvas
  2118. function emitTargetEvent(target, type, eventObj) {
  2119. eventObj.name = type;
  2120. eventObj.target = target;
  2121. eventObj.currentTarget = target;
  2122. eventObj.delegateTarget = target;
  2123. target.emit(type, eventObj);
  2124. } // 事件冒泡, enter 和 leave 需要对 fromShape 和 toShape 进行判同
  2125. function bubbleEvent(container, type, eventObj) {
  2126. if (eventObj.bubbles) {
  2127. var relativeShape = void 0;
  2128. var isOverEvent = false;
  2129. if (type === 'mouseenter') {
  2130. relativeShape = eventObj.fromShape;
  2131. isOverEvent = true;
  2132. } else if (type === 'mouseleave') {
  2133. isOverEvent = true;
  2134. relativeShape = eventObj.toShape;
  2135. } // canvas 上的 mouseenter, mouseleave 事件,仅当进入或者移出 canvas 时触发
  2136. if (container.isCanvas() && isOverEvent) {
  2137. return;
  2138. } // 如果相关图形同当前图形在同一个容器内,不触发事件
  2139. if (relativeShape && Object(_util_util__WEBPACK_IMPORTED_MODULE_1__["isParent"])(container, relativeShape)) {
  2140. // 阻止继续向上冒泡
  2141. eventObj.bubbles = false;
  2142. return;
  2143. } // 事件名称可能在委托过程中被修改,因此事件冒泡时需要重新设置事件名称
  2144. eventObj.name = type;
  2145. eventObj.currentTarget = container;
  2146. eventObj.delegateTarget = container;
  2147. container.emit(type, eventObj);
  2148. }
  2149. }
  2150. var EventController =
  2151. /** @class */
  2152. function () {
  2153. function EventController(cfg) {
  2154. var _this = this; // 正在被拖拽的图形
  2155. this.draggingShape = null;
  2156. this.dragging = false; // 当前鼠标/touch所在位置的图形
  2157. this.currentShape = null;
  2158. this.mousedownShape = null;
  2159. this.mousedownPoint = null; // 统一处理所有的回调
  2160. this._eventCallback = function (ev) {
  2161. var type = ev.type;
  2162. _this._triggerEvent(type, ev);
  2163. }; // 在 document 处理拖拽到画布外的事件,处理从图形上移除画布未被捕捉的问题
  2164. this._onDocumentMove = function (ev) {
  2165. var canvas = _this.canvas;
  2166. var el = canvas.get('el');
  2167. if (el !== ev.target) {
  2168. // 不在 canvas 上移动
  2169. if (_this.dragging || _this.currentShape) {
  2170. var pointInfo = _this._getPointInfo(ev); // 还在拖拽过程中
  2171. if (_this.dragging) {
  2172. _this._emitEvent('drag', ev, pointInfo, _this.draggingShape);
  2173. } // 说明从某个图形直接移动到了画布外面,
  2174. // 修复了 mouseleave 的 bug 后不再出现这种情况
  2175. // if (this.currentShape) {
  2176. // this._emitEvent('mouseleave', ev, pointInfo, this.currentShape, this.currentShape, null);
  2177. // this.currentShape = null;
  2178. // }
  2179. }
  2180. }
  2181. }; // 在 document 上处理拖拽到外面,释放鼠标时触发 dragend
  2182. this._onDocumentMouseUp = function (ev) {
  2183. var canvas = _this.canvas;
  2184. var el = canvas.get('el');
  2185. if (el !== ev.target) {
  2186. // 不在 canvas 上移动
  2187. if (_this.dragging) {
  2188. var pointInfo = _this._getPointInfo(ev);
  2189. if (_this.draggingShape) {
  2190. // 如果存在拖拽的图形,则也触发 drop 事件
  2191. _this._emitEvent('drop', ev, pointInfo, null);
  2192. }
  2193. _this._emitEvent('dragend', ev, pointInfo, _this.draggingShape);
  2194. _this._afterDrag(_this.draggingShape, pointInfo, ev);
  2195. }
  2196. }
  2197. };
  2198. this.canvas = cfg.canvas;
  2199. }
  2200. EventController.prototype.init = function () {
  2201. this._bindEvents();
  2202. }; // 注册事件
  2203. EventController.prototype._bindEvents = function () {
  2204. var _this = this;
  2205. var el = this.canvas.get('el');
  2206. Object(_util_util__WEBPACK_IMPORTED_MODULE_1__["each"])(EVENTS, function (eventName) {
  2207. el.addEventListener(eventName, _this._eventCallback);
  2208. });
  2209. if (document) {
  2210. // 处理移动到外面没有触发 shape mouse leave 的事件
  2211. // 处理拖拽到外部的问题
  2212. document.addEventListener('mousemove', this._onDocumentMove); // 处理拖拽过程中在外部释放鼠标的问题
  2213. document.addEventListener('mouseup', this._onDocumentMouseUp);
  2214. }
  2215. }; // 清理事件
  2216. EventController.prototype._clearEvents = function () {
  2217. var _this = this;
  2218. var el = this.canvas.get('el');
  2219. Object(_util_util__WEBPACK_IMPORTED_MODULE_1__["each"])(EVENTS, function (eventName) {
  2220. el.removeEventListener(eventName, _this._eventCallback);
  2221. });
  2222. if (document) {
  2223. document.removeEventListener('mousemove', this._onDocumentMove);
  2224. document.removeEventListener('mouseup', this._onDocumentMouseUp);
  2225. }
  2226. };
  2227. EventController.prototype._getEventObj = function (type, event, point, target, fromShape, toShape) {
  2228. var eventObj = new _graph_event__WEBPACK_IMPORTED_MODULE_0__["default"](type, event);
  2229. eventObj.fromShape = fromShape;
  2230. eventObj.toShape = toShape;
  2231. eventObj.x = point.x;
  2232. eventObj.y = point.y;
  2233. eventObj.clientX = point.clientX;
  2234. eventObj.clientY = point.clientY;
  2235. eventObj.propagationPath.push(target); // 事件的x,y应该是基于画布左上角的,与canvas的matrix无关
  2236. return eventObj;
  2237. }; // 根据点获取图形,提取成独立方法,便于后续优化
  2238. EventController.prototype._getShape = function (point, ev) {
  2239. return this.canvas.getShape(point.x, point.y, ev);
  2240. }; // 获取事件的当前点的信息
  2241. EventController.prototype._getPointInfo = function (ev) {
  2242. var canvas = this.canvas;
  2243. var clientPoint = canvas.getClientByEvent(ev);
  2244. var point = canvas.getPointByEvent(ev);
  2245. return {
  2246. x: point.x,
  2247. y: point.y,
  2248. clientX: clientPoint.x,
  2249. clientY: clientPoint.y
  2250. };
  2251. }; // 触发事件
  2252. EventController.prototype._triggerEvent = function (type, ev) {
  2253. var pointInfo = this._getPointInfo(ev); // 每次都获取图形有一定成本,后期可以考虑进行缓存策略
  2254. var shape = this._getShape(pointInfo, ev);
  2255. var method = this["_on" + type];
  2256. var leaveCanvas = false;
  2257. if (method) {
  2258. method.call(this, pointInfo, shape, ev);
  2259. } else {
  2260. var preShape = this.currentShape; // 如果进入、移出画布时存在图形,则要分别触发事件
  2261. if (type === 'mouseenter' || type === 'dragenter' || type === 'mouseover') {
  2262. this._emitEvent(type, ev, pointInfo, null, null, shape); // 先进入画布
  2263. if (shape) {
  2264. this._emitEvent(type, ev, pointInfo, shape, null, shape); // 再触发图形的事件
  2265. }
  2266. if (type === 'mouseenter' && this.draggingShape) {
  2267. // 如果正在拖拽图形, 则触发 dragleave
  2268. this._emitEvent('dragenter', ev, pointInfo, null);
  2269. }
  2270. } else if (type === 'mouseleave' || type === 'dragleave' || type === 'mouseout') {
  2271. leaveCanvas = true;
  2272. if (preShape) {
  2273. this._emitEvent(type, ev, pointInfo, preShape, preShape, null); // 先触发图形的事件
  2274. }
  2275. this._emitEvent(type, ev, pointInfo, null, preShape, null); // 再触发离开画布事件
  2276. if (type === 'mouseleave' && this.draggingShape) {
  2277. this._emitEvent('dragleave', ev, pointInfo, null);
  2278. }
  2279. } else {
  2280. this._emitEvent(type, ev, pointInfo, shape, null, null); // 一般事件中不需要考虑 from, to
  2281. }
  2282. }
  2283. if (!leaveCanvas) {
  2284. this.currentShape = shape;
  2285. } // 当鼠标从画布移动到 shape 或者从 preShape 移动到 shape 时,应用 shape 上的鼠标样式
  2286. if (shape && !shape.get('destroyed')) {
  2287. var canvas = this.canvas;
  2288. var el = canvas.get('el');
  2289. el.style.cursor = shape.attr('cursor') || canvas.get('cursor');
  2290. }
  2291. }; // 记录下点击的位置、图形,便于拖拽事件、click 事件的判定
  2292. EventController.prototype._onmousedown = function (pointInfo, shape, event) {
  2293. // 只有鼠标左键的 mousedown 事件才会设置 mousedownShape 等属性,避免鼠标右键的 mousedown 事件引起其他事件发生
  2294. if (event.button === LEFT_BTN_CODE) {
  2295. this.mousedownShape = shape;
  2296. this.mousedownPoint = pointInfo;
  2297. this.mousedownTimeStamp = event.timeStamp;
  2298. }
  2299. this._emitEvent('mousedown', event, pointInfo, shape, null, null); // mousedown 不考虑fromShape, toShape
  2300. }; // mouseleave 和 mouseenter 都是成对存在的
  2301. // mouseenter 和 mouseover 同时触发
  2302. EventController.prototype._emitMouseoverEvents = function (event, pointInfo, fromShape, toShape) {
  2303. var el = this.canvas.get('el');
  2304. if (fromShape !== toShape) {
  2305. if (fromShape) {
  2306. this._emitEvent('mouseout', event, pointInfo, fromShape, fromShape, toShape);
  2307. this._emitEvent('mouseleave', event, pointInfo, fromShape, fromShape, toShape); // 当鼠标从 fromShape 移动到画布上时,重置鼠标样式
  2308. if (!toShape || toShape.get('destroyed')) {
  2309. el.style.cursor = this.canvas.get('cursor');
  2310. }
  2311. }
  2312. if (toShape) {
  2313. this._emitEvent('mouseover', event, pointInfo, toShape, fromShape, toShape);
  2314. this._emitEvent('mouseenter', event, pointInfo, toShape, fromShape, toShape);
  2315. }
  2316. }
  2317. }; // dragover 不等同于 mouseover,而等同于 mousemove
  2318. EventController.prototype._emitDragoverEvents = function (event, pointInfo, fromShape, toShape, isCanvasEmit) {
  2319. if (toShape) {
  2320. if (toShape !== fromShape) {
  2321. if (fromShape) {
  2322. this._emitEvent('dragleave', event, pointInfo, fromShape, fromShape, toShape);
  2323. }
  2324. this._emitEvent('dragenter', event, pointInfo, toShape, fromShape, toShape);
  2325. }
  2326. if (!isCanvasEmit) {
  2327. this._emitEvent('dragover', event, pointInfo, toShape);
  2328. }
  2329. } else if (fromShape) {
  2330. // TODO: 此处判断有问题,当 drag 图形时,也会触发一次 dragleave 事件,因为此时 toShape 为 null,这不是所期望的
  2331. // 经过空白区域
  2332. this._emitEvent('dragleave', event, pointInfo, fromShape, fromShape, toShape);
  2333. }
  2334. if (isCanvasEmit) {
  2335. this._emitEvent('dragover', event, pointInfo, toShape);
  2336. }
  2337. }; // drag 完成后,需要做一些清理工作
  2338. EventController.prototype._afterDrag = function (draggingShape, pointInfo, event) {
  2339. if (draggingShape) {
  2340. draggingShape.set('capture', true); // 恢复可以拾取
  2341. this.draggingShape = null;
  2342. }
  2343. this.dragging = false; // drag 完成后,有可能 draggingShape 已经移动到了当前位置,所以不能直接取当前图形
  2344. var shape = this._getShape(pointInfo, event); // 拖拽完成后,进行 enter,leave 的判定
  2345. if (shape !== draggingShape) {
  2346. this._emitMouseoverEvents(event, pointInfo, draggingShape, shape);
  2347. }
  2348. this.currentShape = shape; // 更新当前 shape,如果不处理当前图形的 mouseleave 事件可能会出问题
  2349. }; // 按键抬起时,会终止拖拽、触发点击
  2350. EventController.prototype._onmouseup = function (pointInfo, shape, event) {
  2351. // eevent.button === 0 表示鼠标左键事件,此处加上判断主要是为了避免右键鼠标会触发 mouseup 和 click 事件
  2352. // ref: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
  2353. if (event.button === LEFT_BTN_CODE) {
  2354. var draggingShape = this.draggingShape;
  2355. if (this.dragging) {
  2356. // 存在可以拖拽的图形,同时拖拽到其他图形上时触发 drag 事件
  2357. if (draggingShape) {
  2358. this._emitEvent('drop', event, pointInfo, shape);
  2359. }
  2360. this._emitEvent('dragend', event, pointInfo, draggingShape);
  2361. this._afterDrag(draggingShape, pointInfo, event);
  2362. } else {
  2363. this._emitEvent('mouseup', event, pointInfo, shape); // 先触发 mouseup 再触发 click
  2364. if (shape === this.mousedownShape) {
  2365. this._emitEvent('click', event, pointInfo, shape);
  2366. }
  2367. this.mousedownShape = null;
  2368. this.mousedownPoint = null;
  2369. }
  2370. }
  2371. }; // 当触发浏览器的 dragover 事件时,不会再触发 mousemove ,所以这时候的 dragenter, dragleave 事件需要重新处理
  2372. EventController.prototype._ondragover = function (pointInfo, shape, event) {
  2373. event.preventDefault(); // 如果不对 dragover 进行 preventDefault,则不会在 canvas 上触发 drop 事件
  2374. var preShape = this.currentShape;
  2375. this._emitDragoverEvents(event, pointInfo, preShape, shape, true);
  2376. }; // 大量的图形事件,都通过 mousemove 模拟
  2377. EventController.prototype._onmousemove = function (pointInfo, shape, event) {
  2378. var canvas = this.canvas;
  2379. var preShape = this.currentShape;
  2380. var draggingShape = this.draggingShape; // 正在拖拽时
  2381. if (this.dragging) {
  2382. // 正在拖拽中
  2383. if (draggingShape) {
  2384. // 如果拖拽了 shape 会触发 dragenter, dragleave, dragover 和 drag 事件
  2385. this._emitDragoverEvents(event, pointInfo, preShape, shape, false);
  2386. } // 如果存在 draggingShape 则会在 draggingShape 上触发 drag 事件,冒泡到 canvas 上
  2387. // 否则在 canvas 上触发 drag 事件
  2388. this._emitEvent('drag', event, pointInfo, draggingShape);
  2389. } else {
  2390. var mousedownPoint = this.mousedownPoint;
  2391. if (mousedownPoint) {
  2392. // 当鼠标点击下去,同时移动时,进行 drag 判定
  2393. var mousedownShape = this.mousedownShape;
  2394. var now = event.timeStamp;
  2395. var timeWindow = now - this.mousedownTimeStamp;
  2396. var dx = mousedownPoint.clientX - pointInfo.clientX;
  2397. var dy = mousedownPoint.clientY - pointInfo.clientY;
  2398. var dist = dx * dx + dy * dy;
  2399. if (timeWindow > 120 || dist > CLICK_OFFSET) {
  2400. if (mousedownShape && mousedownShape.get('draggable')) {
  2401. // 设置了 draggable 的 shape 才能触发 drag 相关的事件
  2402. draggingShape = this.mousedownShape; // 拖动鼠标点下时的 shape
  2403. draggingShape.set('capture', false); // 禁止继续拾取,否则无法进行 dragover,dragenter,dragleave,drop的判定
  2404. this.draggingShape = draggingShape;
  2405. this.dragging = true;
  2406. this._emitEvent('dragstart', event, pointInfo, draggingShape); // 清理按下鼠标时缓存的值
  2407. this.mousedownShape = null;
  2408. this.mousedownPoint = null;
  2409. } else if (!mousedownShape && canvas.get('draggable')) {
  2410. // 设置了 draggable 的 canvas 才能触发 drag 相关的事件
  2411. this.dragging = true;
  2412. this._emitEvent('dragstart', event, pointInfo, null); // 清理按下鼠标时缓存的值
  2413. this.mousedownShape = null;
  2414. this.mousedownPoint = null;
  2415. } else {
  2416. this._emitMouseoverEvents(event, pointInfo, preShape, shape);
  2417. this._emitEvent('mousemove', event, pointInfo, shape);
  2418. }
  2419. } else {
  2420. this._emitMouseoverEvents(event, pointInfo, preShape, shape);
  2421. this._emitEvent('mousemove', event, pointInfo, shape);
  2422. }
  2423. } else {
  2424. // 没有按键按下时,则直接触发 mouse over 相关的各种事件
  2425. this._emitMouseoverEvents(event, pointInfo, preShape, shape); // 始终触发移动
  2426. this._emitEvent('mousemove', event, pointInfo, shape);
  2427. }
  2428. }
  2429. }; // 触发事件
  2430. EventController.prototype._emitEvent = function (type, event, pointInfo, shape, fromShape, toShape) {
  2431. var eventObj = this._getEventObj(type, event, pointInfo, shape, fromShape, toShape); // 存在 shape 触发,则进行冒泡处理
  2432. if (shape) {
  2433. eventObj.shape = shape; // 触发 shape 上的事件
  2434. emitTargetEvent(shape, type, eventObj);
  2435. var parent_1 = shape.getParent(); // 执行冒泡
  2436. while (parent_1) {
  2437. // 委托事件要先触发
  2438. parent_1.emitDelegation(type, eventObj); // 事件冒泡停止,不能妨碍委托事件
  2439. if (!eventObj.propagationStopped) {
  2440. bubbleEvent(parent_1, type, eventObj);
  2441. }
  2442. eventObj.propagationPath.push(parent_1);
  2443. parent_1 = parent_1.getParent();
  2444. }
  2445. } else {
  2446. // 如果没有 shape 直接在 canvas 上触发
  2447. var canvas = this.canvas; // 直接触发 canvas 上的事件
  2448. emitTargetEvent(canvas, type, eventObj);
  2449. }
  2450. };
  2451. EventController.prototype.destroy = function () {
  2452. // 清理事件
  2453. this._clearEvents(); // 清理缓存的对象
  2454. this.canvas = null;
  2455. this.currentShape = null;
  2456. this.draggingShape = null;
  2457. this.mousedownPoint = null;
  2458. this.mousedownShape = null;
  2459. this.mousedownTimeStamp = null;
  2460. };
  2461. return EventController;
  2462. }();
  2463. /* harmony default export */ __webpack_exports__["default"] = (EventController);
  2464. /***/ }),
  2465. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js":
  2466. /*!***************************************************************************************!*\
  2467. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js ***!
  2468. \***************************************************************************************/
  2469. /*! exports provided: default */
  2470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2471. "use strict";
  2472. __webpack_require__.r(__webpack_exports__);
  2473. var GraphEvent =
  2474. /** @class */
  2475. function () {
  2476. function GraphEvent(type, event) {
  2477. /**
  2478. * 是否允许冒泡
  2479. * @type {boolean}
  2480. */
  2481. this.bubbles = true;
  2482. /**
  2483. * 触发对象
  2484. * @type {object}
  2485. */
  2486. this.target = null;
  2487. /**
  2488. * 监听对象
  2489. * @type {object}
  2490. */
  2491. this.currentTarget = null;
  2492. /**
  2493. * 委托对象
  2494. * @type {object}
  2495. */
  2496. this.delegateTarget = null;
  2497. /**
  2498. * 委托事件监听对象的代理对象,即 ev.delegateObject = ev.currentTarget.get('delegateObject')
  2499. * @type {object}
  2500. */
  2501. this.delegateObject = null;
  2502. /**
  2503. * 是否阻止了原生事件
  2504. * @type {boolean}
  2505. */
  2506. this.defaultPrevented = false;
  2507. /**
  2508. * 是否阻止传播(向上冒泡)
  2509. * @type {boolean}
  2510. */
  2511. this.propagationStopped = false;
  2512. /**
  2513. * 触发事件的图形
  2514. * @type {IShape}
  2515. */
  2516. this.shape = null;
  2517. /**
  2518. * 开始触发事件的图形
  2519. * @type {IShape}
  2520. */
  2521. this.fromShape = null;
  2522. /**
  2523. * 事件结束时的触发图形
  2524. * @type {IShape}
  2525. */
  2526. this.toShape = null; // 触发事件的路径
  2527. this.propagationPath = [];
  2528. this.type = type;
  2529. this.name = type;
  2530. this.originalEvent = event;
  2531. this.timeStamp = event.timeStamp;
  2532. }
  2533. /**
  2534. * 阻止浏览器默认的行为
  2535. */
  2536. GraphEvent.prototype.preventDefault = function () {
  2537. this.defaultPrevented = true;
  2538. if (this.originalEvent.preventDefault) {
  2539. this.originalEvent.preventDefault();
  2540. }
  2541. };
  2542. /**
  2543. * 阻止冒泡
  2544. */
  2545. GraphEvent.prototype.stopPropagation = function () {
  2546. this.propagationStopped = true;
  2547. };
  2548. GraphEvent.prototype.toString = function () {
  2549. var type = this.type;
  2550. return "[Event (type=" + type + ")]";
  2551. };
  2552. GraphEvent.prototype.save = function () {};
  2553. GraphEvent.prototype.restore = function () {};
  2554. return GraphEvent;
  2555. }();
  2556. /* harmony default export */ __webpack_exports__["default"] = (GraphEvent);
  2557. /***/ }),
  2558. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js":
  2559. /*!***************************************************************************!*\
  2560. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js ***!
  2561. \***************************************************************************/
  2562. /*! exports provided: version, Event, Base, AbstractCanvas, AbstractGroup, AbstractShape, PathUtil */
  2563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2564. "use strict";
  2565. __webpack_require__.r(__webpack_exports__);
  2566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
  2567. /* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/path */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js");
  2568. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "PathUtil", function() { return _util_path__WEBPACK_IMPORTED_MODULE_0__; });
  2569. /* harmony import */ var _event_graph_event__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event/graph-event */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/event/graph-event.js");
  2570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return _event_graph_event__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  2571. /* harmony import */ var _abstract_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./abstract/base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/base.js");
  2572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base", function() { return _abstract_base__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  2573. /* harmony import */ var _abstract_canvas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./abstract/canvas */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/canvas.js");
  2574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbstractCanvas", function() { return _abstract_canvas__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  2575. /* harmony import */ var _abstract_group__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./abstract/group */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/group.js");
  2576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbstractGroup", function() { return _abstract_group__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  2577. /* harmony import */ var _abstract_shape__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./abstract/shape */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/abstract/shape.js");
  2578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbstractShape", function() { return _abstract_shape__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  2579. /**
  2580. * @fileoverview G 的基础接口定义和所有的抽象类
  2581. * @author dxq613@gmail.com
  2582. */
  2583. var pkg = __webpack_require__(/*! ../package.json */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/package.json");
  2584. var version = pkg.version;
  2585. /***/ }),
  2586. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/color.js":
  2587. /*!********************************************************************************!*\
  2588. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/color.js ***!
  2589. \********************************************************************************/
  2590. /*! exports provided: isColorProp, isGradientColor */
  2591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2592. "use strict";
  2593. __webpack_require__.r(__webpack_exports__);
  2594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColorProp", function() { return isColorProp; });
  2595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isGradientColor", function() { return isGradientColor; });
  2596. var isColorProp = function (prop) {
  2597. return ['fill', 'stroke', 'fillStyle', 'strokeStyle'].includes(prop);
  2598. };
  2599. var isGradientColor = function (val) {
  2600. return /^[r,R,L,l]{1}[\s]*\(/.test(val);
  2601. };
  2602. /***/ }),
  2603. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js":
  2604. /*!*********************************************************************************!*\
  2605. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/matrix.js ***!
  2606. \*********************************************************************************/
  2607. /*! exports provided: multiplyMatrix, multiplyVec2, invert */
  2608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2609. "use strict";
  2610. __webpack_require__.r(__webpack_exports__);
  2611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyMatrix", function() { return multiplyMatrix; });
  2612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyVec2", function() { return multiplyVec2; });
  2613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  2614. /**
  2615. * @fileoverview 矩阵运算,本来是要引入 gl-matrix, 但是考虑到 g-mobile 对大小有限制,同时 g-webgl 使用的 matrix 不一致
  2616. * 所以,这里仅实现 2D 几个运算,上层自己引入 gl-matrix
  2617. * @author dxq613@gmail.com
  2618. */
  2619. /**
  2620. * 3阶矩阵相乘
  2621. * @param {number[]} a 矩阵1
  2622. * @param {number[]} b 矩阵2
  2623. */
  2624. function multiplyMatrix(a, b) {
  2625. var out = [];
  2626. var a00 = a[0];
  2627. var a01 = a[1];
  2628. var a02 = a[2];
  2629. var a10 = a[3];
  2630. var a11 = a[4];
  2631. var a12 = a[5];
  2632. var a20 = a[6];
  2633. var a21 = a[7];
  2634. var a22 = a[8];
  2635. var b00 = b[0];
  2636. var b01 = b[1];
  2637. var b02 = b[2];
  2638. var b10 = b[3];
  2639. var b11 = b[4];
  2640. var b12 = b[5];
  2641. var b20 = b[6];
  2642. var b21 = b[7];
  2643. var b22 = b[8];
  2644. out[0] = b00 * a00 + b01 * a10 + b02 * a20;
  2645. out[1] = b00 * a01 + b01 * a11 + b02 * a21;
  2646. out[2] = b00 * a02 + b01 * a12 + b02 * a22;
  2647. out[3] = b10 * a00 + b11 * a10 + b12 * a20;
  2648. out[4] = b10 * a01 + b11 * a11 + b12 * a21;
  2649. out[5] = b10 * a02 + b11 * a12 + b12 * a22;
  2650. out[6] = b20 * a00 + b21 * a10 + b22 * a20;
  2651. out[7] = b20 * a01 + b21 * a11 + b22 * a21;
  2652. out[8] = b20 * a02 + b21 * a12 + b22 * a22;
  2653. return out;
  2654. }
  2655. /**
  2656. * 3阶矩阵同2阶向量相乘
  2657. * @param {number[]} m 矩阵
  2658. * @param {number[]} v 二阶向量
  2659. */
  2660. function multiplyVec2(m, v) {
  2661. var out = [];
  2662. var x = v[0];
  2663. var y = v[1];
  2664. out[0] = m[0] * x + m[3] * y + m[6];
  2665. out[1] = m[1] * x + m[4] * y + m[7];
  2666. return out;
  2667. }
  2668. /**
  2669. * 矩阵的逆
  2670. * @param {number[]} a 矩阵
  2671. */
  2672. function invert(a) {
  2673. var out = [];
  2674. var a00 = a[0];
  2675. var a01 = a[1];
  2676. var a02 = a[2];
  2677. var a10 = a[3];
  2678. var a11 = a[4];
  2679. var a12 = a[5];
  2680. var a20 = a[6];
  2681. var a21 = a[7];
  2682. var a22 = a[8];
  2683. var b01 = a22 * a11 - a12 * a21;
  2684. var b11 = -a22 * a10 + a12 * a20;
  2685. var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
  2686. var det = a00 * b01 + a01 * b11 + a02 * b21;
  2687. if (!det) {
  2688. return null;
  2689. }
  2690. det = 1.0 / det;
  2691. out[0] = b01 * det;
  2692. out[1] = (-a22 * a01 + a02 * a21) * det;
  2693. out[2] = (a12 * a01 - a02 * a11) * det;
  2694. out[3] = b11 * det;
  2695. out[4] = (a22 * a00 - a02 * a20) * det;
  2696. out[5] = (-a12 * a00 + a02 * a10) * det;
  2697. out[6] = b21 * det;
  2698. out[7] = (-a21 * a00 + a01 * a20) * det;
  2699. out[8] = (a11 * a00 - a01 * a10) * det;
  2700. return out;
  2701. }
  2702. /***/ }),
  2703. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js":
  2704. /*!*******************************************************************************!*\
  2705. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/path.js ***!
  2706. \*******************************************************************************/
  2707. /*! exports provided: catmullRomToBezier, fillPath, fillPathByDiff, formatPath, intersection, parsePathArray, parsePathString, pathToAbsolute, pathToCurve, rectPath */
  2708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2709. "use strict";
  2710. __webpack_require__.r(__webpack_exports__);
  2711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catmullRomToBezier", function() { return catmullRomToBezier; });
  2712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fillPath", function() { return fillPath; });
  2713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fillPathByDiff", function() { return fillPathByDiff; });
  2714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatPath", function() { return formatPath; });
  2715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return intersection; });
  2716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parsePathArray", function() { return parsePathArray; });
  2717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parsePathString", function() { return parsePathString; });
  2718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pathToAbsolute", function() { return pathToAbsolute; });
  2719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pathToCurve", function() { return pathToCurve; });
  2720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rectPath", function() { return rectPath; });
  2721. /* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  2722. var SPACES = '\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029';
  2723. var PATH_COMMAND = new RegExp("([a-z])[" + SPACES + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + SPACES + "]*,?[" + SPACES + "]*)+)", 'ig');
  2724. var PATH_VALUES = new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + SPACES + "]*,?[" + SPACES + "]*", 'ig'); // Parse given path string into an array of arrays of path segments
  2725. var parsePathString = function (pathString) {
  2726. if (!pathString) {
  2727. return null;
  2728. }
  2729. if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isArray"])(pathString)) {
  2730. return pathString;
  2731. }
  2732. var paramCounts = {
  2733. a: 7,
  2734. c: 6,
  2735. o: 2,
  2736. h: 1,
  2737. l: 2,
  2738. m: 2,
  2739. r: 4,
  2740. q: 4,
  2741. s: 4,
  2742. t: 2,
  2743. v: 1,
  2744. u: 3,
  2745. z: 0
  2746. };
  2747. var data = [];
  2748. String(pathString).replace(PATH_COMMAND, function (a, b, c) {
  2749. var params = [];
  2750. var name = b.toLowerCase();
  2751. c.replace(PATH_VALUES, function (a, b) {
  2752. b && params.push(+b);
  2753. });
  2754. if (name === 'm' && params.length > 2) {
  2755. data.push([b].concat(params.splice(0, 2)));
  2756. name = 'l';
  2757. b = b === 'm' ? 'l' : 'L';
  2758. }
  2759. if (name === 'o' && params.length === 1) {
  2760. data.push([b, params[0]]);
  2761. }
  2762. if (name === 'r') {
  2763. data.push([b].concat(params));
  2764. } else {
  2765. while (params.length >= paramCounts[name]) {
  2766. data.push([b].concat(params.splice(0, paramCounts[name])));
  2767. if (!paramCounts[name]) {
  2768. break;
  2769. }
  2770. }
  2771. }
  2772. return pathString;
  2773. });
  2774. return data;
  2775. }; // http://schepers.cc/getting-to-the-point
  2776. var catmullRomToBezier = function (crp, z) {
  2777. var d = []; // @ts-ignore
  2778. for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
  2779. var p = [{
  2780. x: +crp[i - 2],
  2781. y: +crp[i - 1]
  2782. }, {
  2783. x: +crp[i],
  2784. y: +crp[i + 1]
  2785. }, {
  2786. x: +crp[i + 2],
  2787. y: +crp[i + 3]
  2788. }, {
  2789. x: +crp[i + 4],
  2790. y: +crp[i + 5]
  2791. }];
  2792. if (z) {
  2793. if (!i) {
  2794. p[0] = {
  2795. x: +crp[iLen - 2],
  2796. y: +crp[iLen - 1]
  2797. };
  2798. } else if (iLen - 4 === i) {
  2799. p[3] = {
  2800. x: +crp[0],
  2801. y: +crp[1]
  2802. };
  2803. } else if (iLen - 2 === i) {
  2804. p[2] = {
  2805. x: +crp[0],
  2806. y: +crp[1]
  2807. };
  2808. p[3] = {
  2809. x: +crp[2],
  2810. y: +crp[3]
  2811. };
  2812. }
  2813. } else {
  2814. if (iLen - 4 === i) {
  2815. p[3] = p[2];
  2816. } else if (!i) {
  2817. p[0] = {
  2818. x: +crp[i],
  2819. y: +crp[i + 1]
  2820. };
  2821. }
  2822. }
  2823. d.push(['C', (-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6 * p[2].y - p[3].y) / 6, p[2].x, p[2].y]);
  2824. }
  2825. return d;
  2826. };
  2827. var ellipsePath = function (x, y, rx, ry, a) {
  2828. var res = [];
  2829. if (a === null && ry === null) {
  2830. ry = rx;
  2831. }
  2832. x = +x;
  2833. y = +y;
  2834. rx = +rx;
  2835. ry = +ry;
  2836. if (a !== null) {
  2837. var rad = Math.PI / 180;
  2838. var x1 = x + rx * Math.cos(-ry * rad);
  2839. var x2 = x + rx * Math.cos(-a * rad);
  2840. var y1 = y + rx * Math.sin(-ry * rad);
  2841. var y2 = y + rx * Math.sin(-a * rad);
  2842. res = [['M', x1, y1], ['A', rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
  2843. } else {
  2844. res = [['M', x, y], ['m', 0, -ry], ['a', rx, ry, 0, 1, 1, 0, 2 * ry], ['a', rx, ry, 0, 1, 1, 0, -2 * ry], ['z']];
  2845. }
  2846. return res;
  2847. };
  2848. var pathToAbsolute = function (pathArray) {
  2849. pathArray = parsePathString(pathArray);
  2850. if (!pathArray || !pathArray.length) {
  2851. return [['M', 0, 0]];
  2852. }
  2853. var res = [];
  2854. var x = 0;
  2855. var y = 0;
  2856. var mx = 0;
  2857. var my = 0;
  2858. var start = 0;
  2859. var pa0;
  2860. var dots;
  2861. if (pathArray[0][0] === 'M') {
  2862. x = +pathArray[0][1];
  2863. y = +pathArray[0][2];
  2864. mx = x;
  2865. my = y;
  2866. start++;
  2867. res[0] = ['M', x, y];
  2868. }
  2869. var crz = pathArray.length === 3 && pathArray[0][0] === 'M' && pathArray[1][0].toUpperCase() === 'R' && pathArray[2][0].toUpperCase() === 'Z';
  2870. for (var r = void 0, pa = void 0, i = start, ii = pathArray.length; i < ii; i++) {
  2871. res.push(r = []);
  2872. pa = pathArray[i];
  2873. pa0 = pa[0];
  2874. if (pa0 !== pa0.toUpperCase()) {
  2875. r[0] = pa0.toUpperCase();
  2876. switch (r[0]) {
  2877. case 'A':
  2878. r[1] = pa[1];
  2879. r[2] = pa[2];
  2880. r[3] = pa[3];
  2881. r[4] = pa[4];
  2882. r[5] = pa[5];
  2883. r[6] = +pa[6] + x;
  2884. r[7] = +pa[7] + y;
  2885. break;
  2886. case 'V':
  2887. r[1] = +pa[1] + y;
  2888. break;
  2889. case 'H':
  2890. r[1] = +pa[1] + x;
  2891. break;
  2892. case 'R':
  2893. dots = [x, y].concat(pa.slice(1));
  2894. for (var j = 2, jj = dots.length; j < jj; j++) {
  2895. dots[j] = +dots[j] + x;
  2896. dots[++j] = +dots[j] + y;
  2897. }
  2898. res.pop();
  2899. res = res.concat(catmullRomToBezier(dots, crz));
  2900. break;
  2901. case 'O':
  2902. res.pop();
  2903. dots = ellipsePath(x, y, pa[1], pa[2]);
  2904. dots.push(dots[0]);
  2905. res = res.concat(dots);
  2906. break;
  2907. case 'U':
  2908. res.pop();
  2909. res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
  2910. r = ['U'].concat(res[res.length - 1].slice(-2));
  2911. break;
  2912. case 'M':
  2913. mx = +pa[1] + x;
  2914. my = +pa[2] + y;
  2915. break;
  2916. // for lint
  2917. default:
  2918. for (var j = 1, jj = pa.length; j < jj; j++) {
  2919. r[j] = +pa[j] + (j % 2 ? x : y);
  2920. }
  2921. }
  2922. } else if (pa0 === 'R') {
  2923. dots = [x, y].concat(pa.slice(1));
  2924. res.pop();
  2925. res = res.concat(catmullRomToBezier(dots, crz));
  2926. r = ['R'].concat(pa.slice(-2));
  2927. } else if (pa0 === 'O') {
  2928. res.pop();
  2929. dots = ellipsePath(x, y, pa[1], pa[2]);
  2930. dots.push(dots[0]);
  2931. res = res.concat(dots);
  2932. } else if (pa0 === 'U') {
  2933. res.pop();
  2934. res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
  2935. r = ['U'].concat(res[res.length - 1].slice(-2));
  2936. } else {
  2937. for (var k = 0, kk = pa.length; k < kk; k++) {
  2938. r[k] = pa[k];
  2939. }
  2940. }
  2941. pa0 = pa0.toUpperCase();
  2942. if (pa0 !== 'O') {
  2943. switch (r[0]) {
  2944. case 'Z':
  2945. x = +mx;
  2946. y = +my;
  2947. break;
  2948. case 'H':
  2949. x = r[1];
  2950. break;
  2951. case 'V':
  2952. y = r[1];
  2953. break;
  2954. case 'M':
  2955. mx = r[r.length - 2];
  2956. my = r[r.length - 1];
  2957. break;
  2958. // for lint
  2959. default:
  2960. x = r[r.length - 2];
  2961. y = r[r.length - 1];
  2962. }
  2963. }
  2964. }
  2965. return res;
  2966. };
  2967. var l2c = function (x1, y1, x2, y2) {
  2968. return [x1, y1, x2, y2, x2, y2];
  2969. };
  2970. var q2c = function (x1, y1, ax, ay, x2, y2) {
  2971. var _13 = 1 / 3;
  2972. var _23 = 2 / 3;
  2973. return [_13 * x1 + _23 * ax, _13 * y1 + _23 * ay, _13 * x2 + _23 * ax, _13 * y2 + _23 * ay, x2, y2];
  2974. };
  2975. var a2c = function (x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
  2976. // for more information of where this math came from visit:
  2977. // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
  2978. if (rx === ry) {
  2979. rx += 1;
  2980. }
  2981. var _120 = Math.PI * 120 / 180;
  2982. var rad = Math.PI / 180 * (+angle || 0);
  2983. var res = [];
  2984. var xy;
  2985. var f1;
  2986. var f2;
  2987. var cx;
  2988. var cy;
  2989. var rotate = function (x, y, rad) {
  2990. var X = x * Math.cos(rad) - y * Math.sin(rad);
  2991. var Y = x * Math.sin(rad) + y * Math.cos(rad);
  2992. return {
  2993. x: X,
  2994. y: Y
  2995. };
  2996. };
  2997. if (!recursive) {
  2998. xy = rotate(x1, y1, -rad);
  2999. x1 = xy.x;
  3000. y1 = xy.y;
  3001. xy = rotate(x2, y2, -rad);
  3002. x2 = xy.x;
  3003. y2 = xy.y;
  3004. if (x1 === x2 && y1 === y2) {
  3005. // 若弧的起始点和终点重叠则错开一点
  3006. x2 += 1;
  3007. y2 += 1;
  3008. } // const cos = Math.cos(Math.PI / 180 * angle);
  3009. // const sin = Math.sin(Math.PI / 180 * angle);
  3010. var x = (x1 - x2) / 2;
  3011. var y = (y1 - y2) / 2;
  3012. var h = x * x / (rx * rx) + y * y / (ry * ry);
  3013. if (h > 1) {
  3014. h = Math.sqrt(h);
  3015. rx = h * rx;
  3016. ry = h * ry;
  3017. }
  3018. var rx2 = rx * rx;
  3019. var ry2 = ry * ry;
  3020. var k = (large_arc_flag === sweep_flag ? -1 : 1) * Math.sqrt(Math.abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x)));
  3021. cx = k * rx * y / ry + (x1 + x2) / 2;
  3022. cy = k * -ry * x / rx + (y1 + y2) / 2; // @ts-ignore
  3023. f1 = Math.asin(((y1 - cy) / ry).toFixed(9)); // @ts-ignore
  3024. f2 = Math.asin(((y2 - cy) / ry).toFixed(9));
  3025. f1 = x1 < cx ? Math.PI - f1 : f1;
  3026. f2 = x2 < cx ? Math.PI - f2 : f2;
  3027. f1 < 0 && (f1 = Math.PI * 2 + f1);
  3028. f2 < 0 && (f2 = Math.PI * 2 + f2);
  3029. if (sweep_flag && f1 > f2) {
  3030. f1 = f1 - Math.PI * 2;
  3031. }
  3032. if (!sweep_flag && f2 > f1) {
  3033. f2 = f2 - Math.PI * 2;
  3034. }
  3035. } else {
  3036. f1 = recursive[0];
  3037. f2 = recursive[1];
  3038. cx = recursive[2];
  3039. cy = recursive[3];
  3040. }
  3041. var df = f2 - f1;
  3042. if (Math.abs(df) > _120) {
  3043. var f2old = f2;
  3044. var x2old = x2;
  3045. var y2old = y2;
  3046. f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
  3047. x2 = cx + rx * Math.cos(f2);
  3048. y2 = cy + ry * Math.sin(f2);
  3049. res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
  3050. }
  3051. df = f2 - f1;
  3052. var c1 = Math.cos(f1);
  3053. var s1 = Math.sin(f1);
  3054. var c2 = Math.cos(f2);
  3055. var s2 = Math.sin(f2);
  3056. var t = Math.tan(df / 4);
  3057. var hx = 4 / 3 * rx * t;
  3058. var hy = 4 / 3 * ry * t;
  3059. var m1 = [x1, y1];
  3060. var m2 = [x1 + hx * s1, y1 - hy * c1];
  3061. var m3 = [x2 + hx * s2, y2 - hy * c2];
  3062. var m4 = [x2, y2];
  3063. m2[0] = 2 * m1[0] - m2[0];
  3064. m2[1] = 2 * m1[1] - m2[1];
  3065. if (recursive) {
  3066. return [m2, m3, m4].concat(res);
  3067. }
  3068. res = [m2, m3, m4].concat(res).join().split(',');
  3069. var newres = [];
  3070. for (var i = 0, ii = res.length; i < ii; i++) {
  3071. newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
  3072. }
  3073. return newres;
  3074. };
  3075. var pathToCurve = function (path, path2) {
  3076. var p = pathToAbsolute(path);
  3077. var p2 = path2 && pathToAbsolute(path2);
  3078. var attrs = {
  3079. x: 0,
  3080. y: 0,
  3081. bx: 0,
  3082. by: 0,
  3083. X: 0,
  3084. Y: 0,
  3085. qx: null,
  3086. qy: null
  3087. };
  3088. var attrs2 = {
  3089. x: 0,
  3090. y: 0,
  3091. bx: 0,
  3092. by: 0,
  3093. X: 0,
  3094. Y: 0,
  3095. qx: null,
  3096. qy: null
  3097. };
  3098. var pcoms1 = []; // path commands of original path p
  3099. var pcoms2 = []; // path commands of original path p2
  3100. var pfirst = ''; // temporary holder for original path command
  3101. var pcom = ''; // holder for previous path command of original path
  3102. var ii;
  3103. var processPath = function (path, d, pcom) {
  3104. var nx;
  3105. var ny;
  3106. if (!path) {
  3107. return ['C', d.x, d.y, d.x, d.y, d.x, d.y];
  3108. }
  3109. !(path[0] in {
  3110. T: 1,
  3111. Q: 1
  3112. }) && (d.qx = d.qy = null);
  3113. switch (path[0]) {
  3114. case 'M':
  3115. d.X = path[1];
  3116. d.Y = path[2];
  3117. break;
  3118. case 'A':
  3119. path = ['C'].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
  3120. break;
  3121. case 'S':
  3122. if (pcom === 'C' || pcom === 'S') {
  3123. // In "S" case we have to take into account, if the previous command is C/S.
  3124. nx = d.x * 2 - d.bx; // And reflect the previous
  3125. ny = d.y * 2 - d.by; // command's control point relative to the current point.
  3126. } else {
  3127. // or some else or nothing
  3128. nx = d.x;
  3129. ny = d.y;
  3130. }
  3131. path = ['C', nx, ny].concat(path.slice(1));
  3132. break;
  3133. case 'T':
  3134. if (pcom === 'Q' || pcom === 'T') {
  3135. // In "T" case we have to take into account, if the previous command is Q/T.
  3136. d.qx = d.x * 2 - d.qx; // And make a reflection similar
  3137. d.qy = d.y * 2 - d.qy; // to case "S".
  3138. } else {
  3139. // or something else or nothing
  3140. d.qx = d.x;
  3141. d.qy = d.y;
  3142. }
  3143. path = ['C'].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
  3144. break;
  3145. case 'Q':
  3146. d.qx = path[1];
  3147. d.qy = path[2];
  3148. path = ['C'].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
  3149. break;
  3150. case 'L':
  3151. path = ['C'].concat(l2c(d.x, d.y, path[1], path[2]));
  3152. break;
  3153. case 'H':
  3154. path = ['C'].concat(l2c(d.x, d.y, path[1], d.y));
  3155. break;
  3156. case 'V':
  3157. path = ['C'].concat(l2c(d.x, d.y, d.x, path[1]));
  3158. break;
  3159. case 'Z':
  3160. path = ['C'].concat(l2c(d.x, d.y, d.X, d.Y));
  3161. break;
  3162. default:
  3163. break;
  3164. }
  3165. return path;
  3166. };
  3167. var fixArc = function (pp, i) {
  3168. if (pp[i].length > 7) {
  3169. pp[i].shift();
  3170. var pi = pp[i];
  3171. while (pi.length) {
  3172. pcoms1[i] = 'A'; // if created multiple C:s, their original seg is saved
  3173. p2 && (pcoms2[i] = 'A'); // the same as above
  3174. pp.splice(i++, 0, ['C'].concat(pi.splice(0, 6)));
  3175. }
  3176. pp.splice(i, 1);
  3177. ii = Math.max(p.length, p2 && p2.length || 0);
  3178. }
  3179. };
  3180. var fixM = function (path1, path2, a1, a2, i) {
  3181. if (path1 && path2 && path1[i][0] === 'M' && path2[i][0] !== 'M') {
  3182. path2.splice(i, 0, ['M', a2.x, a2.y]);
  3183. a1.bx = 0;
  3184. a1.by = 0;
  3185. a1.x = path1[i][1];
  3186. a1.y = path1[i][2];
  3187. ii = Math.max(p.length, p2 && p2.length || 0);
  3188. }
  3189. };
  3190. ii = Math.max(p.length, p2 && p2.length || 0);
  3191. for (var i = 0; i < ii; i++) {
  3192. p[i] && (pfirst = p[i][0]); // save current path command
  3193. if (pfirst !== 'C') {
  3194. // C is not saved yet, because it may be result of conversion
  3195. pcoms1[i] = pfirst; // Save current path command
  3196. i && (pcom = pcoms1[i - 1]); // Get previous path command pcom
  3197. }
  3198. p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
  3199. if (pcoms1[i] !== 'A' && pfirst === 'C') pcoms1[i] = 'C'; // A is the only command
  3200. // which may produce multiple C:s
  3201. // so we have to make sure that C is also C in original path
  3202. fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
  3203. if (p2) {
  3204. // the same procedures is done to p2
  3205. p2[i] && (pfirst = p2[i][0]);
  3206. if (pfirst !== 'C') {
  3207. pcoms2[i] = pfirst;
  3208. i && (pcom = pcoms2[i - 1]);
  3209. }
  3210. p2[i] = processPath(p2[i], attrs2, pcom);
  3211. if (pcoms2[i] !== 'A' && pfirst === 'C') {
  3212. pcoms2[i] = 'C';
  3213. }
  3214. fixArc(p2, i);
  3215. }
  3216. fixM(p, p2, attrs, attrs2, i);
  3217. fixM(p2, p, attrs2, attrs, i);
  3218. var seg = p[i];
  3219. var seg2 = p2 && p2[i];
  3220. var seglen = seg.length;
  3221. var seg2len = p2 && seg2.length;
  3222. attrs.x = seg[seglen - 2];
  3223. attrs.y = seg[seglen - 1];
  3224. attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x;
  3225. attrs.by = parseFloat(seg[seglen - 3]) || attrs.y;
  3226. attrs2.bx = p2 && (parseFloat(seg2[seg2len - 4]) || attrs2.x);
  3227. attrs2.by = p2 && (parseFloat(seg2[seg2len - 3]) || attrs2.y);
  3228. attrs2.x = p2 && seg2[seg2len - 2];
  3229. attrs2.y = p2 && seg2[seg2len - 1];
  3230. }
  3231. return p2 ? [p, p2] : p;
  3232. };
  3233. var p2s = /,?([a-z]),?/gi;
  3234. var parsePathArray = function (path) {
  3235. return path.join(',').replace(p2s, '$1');
  3236. };
  3237. var base3 = function (t, p1, p2, p3, p4) {
  3238. var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4;
  3239. var t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
  3240. return t * t2 - 3 * p1 + 3 * p2;
  3241. };
  3242. var bezlen = function (x1, y1, x2, y2, x3, y3, x4, y4, z) {
  3243. if (z === null) {
  3244. z = 1;
  3245. }
  3246. z = z > 1 ? 1 : z < 0 ? 0 : z;
  3247. var z2 = z / 2;
  3248. var n = 12;
  3249. var Tvalues = [-0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816];
  3250. var Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472];
  3251. var sum = 0;
  3252. for (var i = 0; i < n; i++) {
  3253. var ct = z2 * Tvalues[i] + z2;
  3254. var xbase = base3(ct, x1, x2, x3, x4);
  3255. var ybase = base3(ct, y1, y2, y3, y4);
  3256. var comb = xbase * xbase + ybase * ybase;
  3257. sum += Cvalues[i] * Math.sqrt(comb);
  3258. }
  3259. return z2 * sum;
  3260. };
  3261. var curveDim = function (x0, y0, x1, y1, x2, y2, x3, y3) {
  3262. var tvalues = [];
  3263. var bounds = [[], []];
  3264. var a;
  3265. var b;
  3266. var c;
  3267. var t;
  3268. for (var i = 0; i < 2; ++i) {
  3269. if (i === 0) {
  3270. b = 6 * x0 - 12 * x1 + 6 * x2;
  3271. a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
  3272. c = 3 * x1 - 3 * x0;
  3273. } else {
  3274. b = 6 * y0 - 12 * y1 + 6 * y2;
  3275. a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
  3276. c = 3 * y1 - 3 * y0;
  3277. }
  3278. if (Math.abs(a) < 1e-12) {
  3279. if (Math.abs(b) < 1e-12) {
  3280. continue;
  3281. }
  3282. t = -c / b;
  3283. if (t > 0 && t < 1) {
  3284. tvalues.push(t);
  3285. }
  3286. continue;
  3287. }
  3288. var b2ac = b * b - 4 * c * a;
  3289. var sqrtb2ac = Math.sqrt(b2ac);
  3290. if (b2ac < 0) {
  3291. continue;
  3292. }
  3293. var t1 = (-b + sqrtb2ac) / (2 * a);
  3294. if (t1 > 0 && t1 < 1) {
  3295. tvalues.push(t1);
  3296. }
  3297. var t2 = (-b - sqrtb2ac) / (2 * a);
  3298. if (t2 > 0 && t2 < 1) {
  3299. tvalues.push(t2);
  3300. }
  3301. }
  3302. var j = tvalues.length;
  3303. var jlen = j;
  3304. var mt;
  3305. while (j--) {
  3306. t = tvalues[j];
  3307. mt = 1 - t;
  3308. bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
  3309. bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
  3310. }
  3311. bounds[0][jlen] = x0;
  3312. bounds[1][jlen] = y0;
  3313. bounds[0][jlen + 1] = x3;
  3314. bounds[1][jlen + 1] = y3;
  3315. bounds[0].length = bounds[1].length = jlen + 2;
  3316. return {
  3317. min: {
  3318. x: Math.min.apply(0, bounds[0]),
  3319. y: Math.min.apply(0, bounds[1])
  3320. },
  3321. max: {
  3322. x: Math.max.apply(0, bounds[0]),
  3323. y: Math.max.apply(0, bounds[1])
  3324. }
  3325. };
  3326. };
  3327. var intersect = function (x1, y1, x2, y2, x3, y3, x4, y4) {
  3328. if (Math.max(x1, x2) < Math.min(x3, x4) || Math.min(x1, x2) > Math.max(x3, x4) || Math.max(y1, y2) < Math.min(y3, y4) || Math.min(y1, y2) > Math.max(y3, y4)) {
  3329. return;
  3330. }
  3331. var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4);
  3332. var ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4);
  3333. var denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
  3334. if (!denominator) {
  3335. return;
  3336. }
  3337. var px = nx / denominator;
  3338. var py = ny / denominator;
  3339. var px2 = +px.toFixed(2);
  3340. var py2 = +py.toFixed(2);
  3341. if (px2 < +Math.min(x1, x2).toFixed(2) || px2 > +Math.max(x1, x2).toFixed(2) || px2 < +Math.min(x3, x4).toFixed(2) || px2 > +Math.max(x3, x4).toFixed(2) || py2 < +Math.min(y1, y2).toFixed(2) || py2 > +Math.max(y1, y2).toFixed(2) || py2 < +Math.min(y3, y4).toFixed(2) || py2 > +Math.max(y3, y4).toFixed(2)) {
  3342. return;
  3343. }
  3344. return {
  3345. x: px,
  3346. y: py
  3347. };
  3348. };
  3349. var isPointInsideBBox = function (bbox, x, y) {
  3350. return x >= bbox.x && x <= bbox.x + bbox.width && y >= bbox.y && y <= bbox.y + bbox.height;
  3351. };
  3352. var rectPath = function (x, y, w, h, r) {
  3353. if (r) {
  3354. return [['M', +x + +r, y], ['l', w - r * 2, 0], ['a', r, r, 0, 0, 1, r, r], ['l', 0, h - r * 2], ['a', r, r, 0, 0, 1, -r, r], ['l', r * 2 - w, 0], ['a', r, r, 0, 0, 1, -r, -r], ['l', 0, r * 2 - h], ['a', r, r, 0, 0, 1, r, -r], ['z']];
  3355. }
  3356. var res = [['M', x, y], ['l', w, 0], ['l', 0, h], ['l', -w, 0], ['z']]; // @ts-ignore
  3357. res.parsePathArray = parsePathArray;
  3358. return res;
  3359. };
  3360. var box = function (x, y, width, height) {
  3361. if (x === null) {
  3362. x = y = width = height = 0;
  3363. }
  3364. if (y === null) {
  3365. y = x.y;
  3366. width = x.width;
  3367. height = x.height;
  3368. x = x.x;
  3369. }
  3370. return {
  3371. x: x,
  3372. y: y,
  3373. width: width,
  3374. w: width,
  3375. height: height,
  3376. h: height,
  3377. x2: x + width,
  3378. y2: y + height,
  3379. cx: x + width / 2,
  3380. cy: y + height / 2,
  3381. r1: Math.min(width, height) / 2,
  3382. r2: Math.max(width, height) / 2,
  3383. r0: Math.sqrt(width * width + height * height) / 2,
  3384. path: rectPath(x, y, width, height),
  3385. vb: [x, y, width, height].join(' ')
  3386. };
  3387. };
  3388. var isBBoxIntersect = function (bbox1, bbox2) {
  3389. bbox1 = box(bbox1);
  3390. bbox2 = box(bbox2);
  3391. return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
  3392. };
  3393. var bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
  3394. if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["isArray"])(p1x)) {
  3395. p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
  3396. }
  3397. var bbox = curveDim.apply(null, p1x);
  3398. return box(bbox.min.x, bbox.min.y, bbox.max.x - bbox.min.x, bbox.max.y - bbox.min.y);
  3399. };
  3400. var findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
  3401. var t1 = 1 - t;
  3402. var t13 = Math.pow(t1, 3);
  3403. var t12 = Math.pow(t1, 2);
  3404. var t2 = t * t;
  3405. var t3 = t2 * t;
  3406. var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x;
  3407. var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;
  3408. var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x);
  3409. var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y);
  3410. var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x);
  3411. var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y);
  3412. var ax = t1 * p1x + t * c1x;
  3413. var ay = t1 * p1y + t * c1y;
  3414. var cx = t1 * c2x + t * p2x;
  3415. var cy = t1 * c2y + t * p2y;
  3416. var alpha = 90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI; // (mx > nx || my < ny) && (alpha += 180);
  3417. return {
  3418. x: x,
  3419. y: y,
  3420. m: {
  3421. x: mx,
  3422. y: my
  3423. },
  3424. n: {
  3425. x: nx,
  3426. y: ny
  3427. },
  3428. start: {
  3429. x: ax,
  3430. y: ay
  3431. },
  3432. end: {
  3433. x: cx,
  3434. y: cy
  3435. },
  3436. alpha: alpha
  3437. };
  3438. };
  3439. var interHelper = function (bez1, bez2, justCount) {
  3440. var bbox1 = bezierBBox(bez1);
  3441. var bbox2 = bezierBBox(bez2);
  3442. if (!isBBoxIntersect(bbox1, bbox2)) {
  3443. return justCount ? 0 : [];
  3444. }
  3445. var l1 = bezlen.apply(0, bez1);
  3446. var l2 = bezlen.apply(0, bez2);
  3447. var n1 = ~~(l1 / 8);
  3448. var n2 = ~~(l2 / 8);
  3449. var dots1 = [];
  3450. var dots2 = [];
  3451. var xy = {};
  3452. var res = justCount ? 0 : [];
  3453. for (var i = 0; i < n1 + 1; i++) {
  3454. var d = findDotsAtSegment.apply(0, bez1.concat(i / n1));
  3455. dots1.push({
  3456. x: d.x,
  3457. y: d.y,
  3458. t: i / n1
  3459. });
  3460. }
  3461. for (var i = 0; i < n2 + 1; i++) {
  3462. var d = findDotsAtSegment.apply(0, bez2.concat(i / n2));
  3463. dots2.push({
  3464. x: d.x,
  3465. y: d.y,
  3466. t: i / n2
  3467. });
  3468. }
  3469. for (var i = 0; i < n1; i++) {
  3470. for (var j = 0; j < n2; j++) {
  3471. var di = dots1[i];
  3472. var di1 = dots1[i + 1];
  3473. var dj = dots2[j];
  3474. var dj1 = dots2[j + 1];
  3475. var ci = Math.abs(di1.x - di.x) < 0.001 ? 'y' : 'x';
  3476. var cj = Math.abs(dj1.x - dj.x) < 0.001 ? 'y' : 'x';
  3477. var is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
  3478. if (is) {
  3479. if (xy[is.x.toFixed(4)] === is.y.toFixed(4)) {
  3480. continue;
  3481. }
  3482. xy[is.x.toFixed(4)] = is.y.toFixed(4);
  3483. var t1 = di.t + Math.abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t);
  3484. var t2 = dj.t + Math.abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
  3485. if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
  3486. if (justCount) {
  3487. // @ts-ignore
  3488. res += 1;
  3489. } else {
  3490. // @ts-ignore
  3491. res.push({
  3492. x: is.x,
  3493. y: is.y,
  3494. t1: t1,
  3495. t2: t2
  3496. });
  3497. }
  3498. }
  3499. }
  3500. }
  3501. }
  3502. return res;
  3503. };
  3504. var interPathHelper = function (path1, path2, justCount) {
  3505. path1 = pathToCurve(path1);
  3506. path2 = pathToCurve(path2);
  3507. var x1;
  3508. var y1;
  3509. var x2;
  3510. var y2;
  3511. var x1m;
  3512. var y1m;
  3513. var x2m;
  3514. var y2m;
  3515. var bez1;
  3516. var bez2;
  3517. var res = justCount ? 0 : [];
  3518. for (var i = 0, ii = path1.length; i < ii; i++) {
  3519. var pi = path1[i];
  3520. if (pi[0] === 'M') {
  3521. x1 = x1m = pi[1];
  3522. y1 = y1m = pi[2];
  3523. } else {
  3524. if (pi[0] === 'C') {
  3525. bez1 = [x1, y1].concat(pi.slice(1));
  3526. x1 = bez1[6];
  3527. y1 = bez1[7];
  3528. } else {
  3529. bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
  3530. x1 = x1m;
  3531. y1 = y1m;
  3532. }
  3533. for (var j = 0, jj = path2.length; j < jj; j++) {
  3534. var pj = path2[j];
  3535. if (pj[0] === 'M') {
  3536. x2 = x2m = pj[1];
  3537. y2 = y2m = pj[2];
  3538. } else {
  3539. if (pj[0] === 'C') {
  3540. bez2 = [x2, y2].concat(pj.slice(1));
  3541. x2 = bez2[6];
  3542. y2 = bez2[7];
  3543. } else {
  3544. bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
  3545. x2 = x2m;
  3546. y2 = y2m;
  3547. }
  3548. var intr = interHelper(bez1, bez2, justCount);
  3549. if (justCount) {
  3550. // @ts-ignore
  3551. res += intr;
  3552. } else {
  3553. // @ts-ignore
  3554. for (var k = 0, kk = intr.length; k < kk; k++) {
  3555. intr[k].segment1 = i;
  3556. intr[k].segment2 = j;
  3557. intr[k].bez1 = bez1;
  3558. intr[k].bez2 = bez2;
  3559. } // @ts-ignore
  3560. res = res.concat(intr);
  3561. }
  3562. }
  3563. }
  3564. }
  3565. }
  3566. return res;
  3567. };
  3568. var intersection = function (path1, path2) {
  3569. return interPathHelper(path1, path2);
  3570. };
  3571. function decasteljau(points, t) {
  3572. var left = [];
  3573. var right = [];
  3574. function recurse(points, t) {
  3575. if (points.length === 1) {
  3576. left.push(points[0]);
  3577. right.push(points[0]);
  3578. } else {
  3579. var middlePoints = [];
  3580. for (var i = 0; i < points.length - 1; i++) {
  3581. if (i === 0) {
  3582. left.push(points[0]);
  3583. }
  3584. if (i === points.length - 2) {
  3585. right.push(points[i + 1]);
  3586. }
  3587. middlePoints[i] = [(1 - t) * points[i][0] + t * points[i + 1][0], (1 - t) * points[i][1] + t * points[i + 1][1]];
  3588. }
  3589. recurse(middlePoints, t);
  3590. }
  3591. }
  3592. if (points.length) {
  3593. recurse(points, t);
  3594. }
  3595. return {
  3596. left: left,
  3597. right: right.reverse()
  3598. };
  3599. }
  3600. function splitCurve(start, end, count) {
  3601. var points = [[start[1], start[2]]];
  3602. count = count || 2;
  3603. var segments = [];
  3604. if (end[0] === 'A') {
  3605. points.push(end[6]);
  3606. points.push(end[7]);
  3607. } else if (end[0] === 'C') {
  3608. points.push([end[1], end[2]]);
  3609. points.push([end[3], end[4]]);
  3610. points.push([end[5], end[6]]);
  3611. } else if (end[0] === 'S' || end[0] === 'Q') {
  3612. points.push([end[1], end[2]]);
  3613. points.push([end[3], end[4]]);
  3614. } else {
  3615. points.push([end[1], end[2]]);
  3616. }
  3617. var leftSegments = points;
  3618. var t = 1 / count;
  3619. for (var i = 0; i < count - 1; i++) {
  3620. var rt = t / (1 - t * i);
  3621. var split = decasteljau(leftSegments, rt);
  3622. segments.push(split.left);
  3623. leftSegments = split.right;
  3624. }
  3625. segments.push(leftSegments);
  3626. var result = segments.map(function (segment) {
  3627. var cmd = [];
  3628. if (segment.length === 4) {
  3629. cmd.push('C');
  3630. cmd = cmd.concat(segment[2]);
  3631. }
  3632. if (segment.length >= 3) {
  3633. if (segment.length === 3) {
  3634. cmd.push('Q');
  3635. }
  3636. cmd = cmd.concat(segment[1]);
  3637. }
  3638. if (segment.length === 2) {
  3639. cmd.push('L');
  3640. }
  3641. cmd = cmd.concat(segment[segment.length - 1]);
  3642. return cmd;
  3643. });
  3644. return result;
  3645. }
  3646. var splitSegment = function (start, end, count) {
  3647. if (count === 1) {
  3648. return [[].concat(start)];
  3649. }
  3650. var segments = [];
  3651. if (end[0] === 'L' || end[0] === 'C' || end[0] === 'Q') {
  3652. segments = segments.concat(splitCurve(start, end, count));
  3653. } else {
  3654. var temp = [].concat(start);
  3655. if (temp[0] === 'M') {
  3656. temp[0] = 'L';
  3657. }
  3658. for (var i = 0; i <= count - 1; i++) {
  3659. segments.push(temp);
  3660. }
  3661. }
  3662. return segments;
  3663. };
  3664. var fillPath = function (source, target) {
  3665. if (source.length === 1) {
  3666. return source;
  3667. }
  3668. var sourceLen = source.length - 1;
  3669. var targetLen = target.length - 1;
  3670. var ratio = sourceLen / targetLen;
  3671. var segmentsToFill = [];
  3672. if (source.length === 1 && source[0][0] === 'M') {
  3673. for (var i = 0; i < targetLen - sourceLen; i++) {
  3674. source.push(source[0]);
  3675. }
  3676. return source;
  3677. }
  3678. for (var i = 0; i < targetLen; i++) {
  3679. var index = Math.floor(ratio * i);
  3680. segmentsToFill[index] = (segmentsToFill[index] || 0) + 1;
  3681. }
  3682. var filled = segmentsToFill.reduce(function (filled, count, i) {
  3683. if (i === sourceLen) {
  3684. return filled.concat(source[sourceLen]);
  3685. }
  3686. return filled.concat(splitSegment(source[i], source[i + 1], count));
  3687. }, []);
  3688. filled.unshift(source[0]);
  3689. if (target[targetLen] === 'Z' || target[targetLen] === 'z') {
  3690. filled.push('Z');
  3691. }
  3692. return filled;
  3693. };
  3694. var isEqual = function (obj1, obj2) {
  3695. if (obj1.length !== obj2.length) {
  3696. return false;
  3697. }
  3698. var result = true;
  3699. Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__["each"])(obj1, function (item, i) {
  3700. if (item !== obj2[i]) {
  3701. result = false;
  3702. return false;
  3703. }
  3704. });
  3705. return result;
  3706. };
  3707. function getMinDiff(del, add, modify) {
  3708. var type = null;
  3709. var min = modify;
  3710. if (add < min) {
  3711. min = add;
  3712. type = 'add';
  3713. }
  3714. if (del < min) {
  3715. min = del;
  3716. type = 'del';
  3717. }
  3718. return {
  3719. type: type,
  3720. min: min
  3721. };
  3722. }
  3723. /*
  3724. * https://en.wikipedia.org/wiki/Levenshtein_distance
  3725. * 计算两条path的编辑距离
  3726. */
  3727. var levenshteinDistance = function (source, target) {
  3728. var sourceLen = source.length;
  3729. var targetLen = target.length;
  3730. var sourceSegment;
  3731. var targetSegment;
  3732. var temp = 0;
  3733. if (sourceLen === 0 || targetLen === 0) {
  3734. return null;
  3735. }
  3736. var dist = [];
  3737. for (var i = 0; i <= sourceLen; i++) {
  3738. dist[i] = [];
  3739. dist[i][0] = {
  3740. min: i
  3741. };
  3742. }
  3743. for (var j = 0; j <= targetLen; j++) {
  3744. dist[0][j] = {
  3745. min: j
  3746. };
  3747. }
  3748. for (var i = 1; i <= sourceLen; i++) {
  3749. sourceSegment = source[i - 1];
  3750. for (var j = 1; j <= targetLen; j++) {
  3751. targetSegment = target[j - 1];
  3752. if (isEqual(sourceSegment, targetSegment)) {
  3753. temp = 0;
  3754. } else {
  3755. temp = 1;
  3756. }
  3757. var del = dist[i - 1][j].min + 1;
  3758. var add = dist[i][j - 1].min + 1;
  3759. var modify = dist[i - 1][j - 1].min + temp;
  3760. dist[i][j] = getMinDiff(del, add, modify);
  3761. }
  3762. }
  3763. return dist;
  3764. };
  3765. var fillPathByDiff = function (source, target) {
  3766. var diffMatrix = levenshteinDistance(source, target);
  3767. var sourceLen = source.length;
  3768. var targetLen = target.length;
  3769. var changes = [];
  3770. var index = 1;
  3771. var minPos = 1; // 如果source和target不是完全不相等
  3772. if (diffMatrix[sourceLen][targetLen].min !== sourceLen) {
  3773. // 获取从source到target所需改动
  3774. for (var i = 1; i <= sourceLen; i++) {
  3775. var min = diffMatrix[i][i].min;
  3776. minPos = i;
  3777. for (var j = index; j <= targetLen; j++) {
  3778. if (diffMatrix[i][j].min < min) {
  3779. min = diffMatrix[i][j].min;
  3780. minPos = j;
  3781. }
  3782. }
  3783. index = minPos;
  3784. if (diffMatrix[i][index].type) {
  3785. changes.push({
  3786. index: i - 1,
  3787. type: diffMatrix[i][index].type
  3788. });
  3789. }
  3790. } // 对source进行增删path
  3791. for (var i = changes.length - 1; i >= 0; i--) {
  3792. index = changes[i].index;
  3793. if (changes[i].type === 'add') {
  3794. source.splice(index, 0, [].concat(source[index]));
  3795. } else {
  3796. source.splice(index, 1);
  3797. }
  3798. }
  3799. } // source尾部补齐
  3800. sourceLen = source.length;
  3801. var diff = targetLen - sourceLen;
  3802. if (sourceLen < targetLen) {
  3803. for (var i = 0; i < diff; i++) {
  3804. if (source[sourceLen - 1][0] === 'z' || source[sourceLen - 1][0] === 'Z') {
  3805. source.splice(sourceLen - 2, 0, source[sourceLen - 2]);
  3806. } else {
  3807. source.push(source[sourceLen - 1]);
  3808. }
  3809. sourceLen += 1;
  3810. }
  3811. }
  3812. return source;
  3813. }; // 将两个点均分成count个点
  3814. function _splitPoints(points, former, count) {
  3815. var result = [].concat(points);
  3816. var index;
  3817. var t = 1 / (count + 1);
  3818. var formerEnd = _getSegmentPoints(former)[0];
  3819. for (var i = 1; i <= count; i++) {
  3820. t *= i;
  3821. index = Math.floor(points.length * t);
  3822. if (index === 0) {
  3823. result.unshift([formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);
  3824. } else {
  3825. result.splice(index, 0, [formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);
  3826. }
  3827. }
  3828. return result;
  3829. }
  3830. /*
  3831. * 抽取pathSegment中的关键点
  3832. * M,L,A,Q,H,V一个端点
  3833. * Q, S抽取一个端点,一个控制点
  3834. * C抽取一个端点,两个控制点
  3835. */
  3836. function _getSegmentPoints(segment) {
  3837. var points = [];
  3838. switch (segment[0]) {
  3839. case 'M':
  3840. points.push([segment[1], segment[2]]);
  3841. break;
  3842. case 'L':
  3843. points.push([segment[1], segment[2]]);
  3844. break;
  3845. case 'A':
  3846. points.push([segment[6], segment[7]]);
  3847. break;
  3848. case 'Q':
  3849. points.push([segment[3], segment[4]]);
  3850. points.push([segment[1], segment[2]]);
  3851. break;
  3852. case 'T':
  3853. points.push([segment[1], segment[2]]);
  3854. break;
  3855. case 'C':
  3856. points.push([segment[5], segment[6]]);
  3857. points.push([segment[1], segment[2]]);
  3858. points.push([segment[3], segment[4]]);
  3859. break;
  3860. case 'S':
  3861. points.push([segment[3], segment[4]]);
  3862. points.push([segment[1], segment[2]]);
  3863. break;
  3864. case 'H':
  3865. points.push([segment[1], segment[1]]);
  3866. break;
  3867. case 'V':
  3868. points.push([segment[1], segment[1]]);
  3869. break;
  3870. default:
  3871. }
  3872. return points;
  3873. }
  3874. var formatPath = function (fromPath, toPath) {
  3875. if (fromPath.length <= 1) {
  3876. return fromPath;
  3877. }
  3878. var points;
  3879. for (var i = 0; i < toPath.length; i++) {
  3880. if (fromPath[i][0] !== toPath[i][0]) {
  3881. // 获取fromPath的pathSegment的端点,根据toPath的指令对其改造
  3882. points = _getSegmentPoints(fromPath[i]);
  3883. switch (toPath[i][0]) {
  3884. case 'M':
  3885. fromPath[i] = ['M'].concat(points[0]);
  3886. break;
  3887. case 'L':
  3888. fromPath[i] = ['L'].concat(points[0]);
  3889. break;
  3890. case 'A':
  3891. fromPath[i] = [].concat(toPath[i]);
  3892. fromPath[i][6] = points[0][0];
  3893. fromPath[i][7] = points[0][1];
  3894. break;
  3895. case 'Q':
  3896. if (points.length < 2) {
  3897. if (i > 0) {
  3898. points = _splitPoints(points, fromPath[i - 1], 1);
  3899. } else {
  3900. fromPath[i] = toPath[i];
  3901. break;
  3902. }
  3903. }
  3904. fromPath[i] = ['Q'].concat(points.reduce(function (arr, i) {
  3905. return arr.concat(i);
  3906. }, []));
  3907. break;
  3908. case 'T':
  3909. fromPath[i] = ['T'].concat(points[0]);
  3910. break;
  3911. case 'C':
  3912. if (points.length < 3) {
  3913. if (i > 0) {
  3914. points = _splitPoints(points, fromPath[i - 1], 2);
  3915. } else {
  3916. fromPath[i] = toPath[i];
  3917. break;
  3918. }
  3919. }
  3920. fromPath[i] = ['C'].concat(points.reduce(function (arr, i) {
  3921. return arr.concat(i);
  3922. }, []));
  3923. break;
  3924. case 'S':
  3925. if (points.length < 2) {
  3926. if (i > 0) {
  3927. points = _splitPoints(points, fromPath[i - 1], 1);
  3928. } else {
  3929. fromPath[i] = toPath[i];
  3930. break;
  3931. }
  3932. }
  3933. fromPath[i] = ['S'].concat(points.reduce(function (arr, i) {
  3934. return arr.concat(i);
  3935. }, []));
  3936. break;
  3937. default:
  3938. fromPath[i] = toPath[i];
  3939. }
  3940. }
  3941. }
  3942. return fromPath;
  3943. };
  3944. /***/ }),
  3945. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js":
  3946. /*!*******************************************************************************!*\
  3947. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/util/util.js ***!
  3948. \*******************************************************************************/
  3949. /*! exports provided: removeFromArray, isBrowser, isNil, isFunction, isString, isObject, isArray, mix, each, upperFirst, isParent, isAllowCapture */
  3950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3951. "use strict";
  3952. __webpack_require__.r(__webpack_exports__);
  3953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromArray", function() { return removeFromArray; });
  3954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowser", function() { return isBrowser; });
  3955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParent", function() { return isParent; });
  3956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAllowCapture", function() { return isAllowCapture; });
  3957. /* harmony import */ var _antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util/lib/is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
  3958. /* harmony import */ var _antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0__);
  3959. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _antv_util_lib_is_nil__WEBPACK_IMPORTED_MODULE_0___default.a; });
  3960. /* harmony import */ var _antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util/lib/is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
  3961. /* harmony import */ var _antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1__);
  3962. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _antv_util_lib_is_function__WEBPACK_IMPORTED_MODULE_1___default.a; });
  3963. /* harmony import */ var _antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
  3964. /* harmony import */ var _antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2__);
  3965. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _antv_util_lib_is_string__WEBPACK_IMPORTED_MODULE_2___default.a; });
  3966. /* harmony import */ var _antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util/lib/is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
  3967. /* harmony import */ var _antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3__);
  3968. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _antv_util_lib_is_object__WEBPACK_IMPORTED_MODULE_3___default.a; });
  3969. /* harmony import */ var _antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
  3970. /* harmony import */ var _antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4__);
  3971. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _antv_util_lib_is_array__WEBPACK_IMPORTED_MODULE_4___default.a; });
  3972. /* harmony import */ var _antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/util/lib/mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
  3973. /* harmony import */ var _antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5__);
  3974. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _antv_util_lib_mix__WEBPACK_IMPORTED_MODULE_5___default.a; });
  3975. /* harmony import */ var _antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
  3976. /* harmony import */ var _antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6__);
  3977. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _antv_util_lib_each__WEBPACK_IMPORTED_MODULE_6___default.a; });
  3978. /* harmony import */ var _antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/util/lib/upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js");
  3979. /* harmony import */ var _antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7__);
  3980. /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _antv_util_lib_upper_first__WEBPACK_IMPORTED_MODULE_7___default.a; });
  3981. function removeFromArray(arr, obj) {
  3982. var index = arr.indexOf(obj);
  3983. if (index !== -1) {
  3984. arr.splice(index, 1);
  3985. }
  3986. }
  3987. var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
  3988. // 是否元素的父容器
  3989. function isParent(container, shape) {
  3990. // 所有 shape 都是 canvas 的子元素
  3991. if (container.isCanvas()) {
  3992. return true;
  3993. }
  3994. var parent = shape.getParent();
  3995. var isParent = false;
  3996. while (parent) {
  3997. if (parent === container) {
  3998. isParent = true;
  3999. break;
  4000. }
  4001. parent = parent.getParent();
  4002. }
  4003. return isParent;
  4004. }
  4005. function isAllowCapture(element) {
  4006. // @ts-ignore
  4007. return element.cfg.visible && element.cfg.capture;
  4008. }
  4009. /***/ }),
  4010. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/circle.js":
  4011. /*!*********************************************************************************!*\
  4012. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/circle.js ***!
  4013. \*********************************************************************************/
  4014. /*! no static exports found */
  4015. /***/ (function(module, exports, __webpack_require__) {
  4016. "use strict";
  4017. Object.defineProperty(exports, "__esModule", {
  4018. value: true
  4019. });
  4020. function default_1(shape) {
  4021. var _a = shape.attr(),
  4022. x = _a.x,
  4023. y = _a.y,
  4024. r = _a.r;
  4025. return {
  4026. x: x - r,
  4027. y: y - r,
  4028. width: r * 2,
  4029. height: r * 2
  4030. };
  4031. }
  4032. exports.default = default_1;
  4033. /***/ }),
  4034. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/ellipse.js":
  4035. /*!**********************************************************************************!*\
  4036. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/ellipse.js ***!
  4037. \**********************************************************************************/
  4038. /*! no static exports found */
  4039. /***/ (function(module, exports, __webpack_require__) {
  4040. "use strict";
  4041. Object.defineProperty(exports, "__esModule", {
  4042. value: true
  4043. });
  4044. function default_1(shape) {
  4045. var attrs = shape.attr();
  4046. var x = attrs.x,
  4047. y = attrs.y,
  4048. rx = attrs.rx,
  4049. ry = attrs.ry;
  4050. return {
  4051. x: x - rx,
  4052. y: y - ry,
  4053. width: rx * 2,
  4054. height: ry * 2
  4055. };
  4056. }
  4057. exports.default = default_1;
  4058. /***/ }),
  4059. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/index.js":
  4060. /*!********************************************************************************!*\
  4061. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/index.js ***!
  4062. \********************************************************************************/
  4063. /*! no static exports found */
  4064. /***/ (function(module, exports, __webpack_require__) {
  4065. "use strict";
  4066. Object.defineProperty(exports, "__esModule", {
  4067. value: true
  4068. });
  4069. var register_1 = __webpack_require__(/*! ./register */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/register.js");
  4070. exports.getBBoxMethod = register_1.getMethod;
  4071. var rect_1 = __webpack_require__(/*! ./rect */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/rect.js");
  4072. var circle_1 = __webpack_require__(/*! ./circle */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/circle.js");
  4073. var polyline_1 = __webpack_require__(/*! ./polyline */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polyline.js");
  4074. var polygon_1 = __webpack_require__(/*! ./polygon */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polygon.js");
  4075. var text_1 = __webpack_require__(/*! ./text */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/text.js");
  4076. var path_1 = __webpack_require__(/*! ./path */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/path.js");
  4077. var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/line.js");
  4078. var ellipse_1 = __webpack_require__(/*! ./ellipse */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/ellipse.js");
  4079. register_1.register('rect', rect_1.default);
  4080. register_1.register('image', rect_1.default); // image 使用 rect 的包围盒计算
  4081. register_1.register('circle', circle_1.default);
  4082. register_1.register('marker', circle_1.default); // marker 使用 circle 的计算方案
  4083. register_1.register('polyline', polyline_1.default);
  4084. register_1.register('polygon', polygon_1.default);
  4085. register_1.register('text', text_1.default);
  4086. register_1.register('path', path_1.default);
  4087. register_1.register('line', line_1.default);
  4088. register_1.register('ellipse', ellipse_1.default);
  4089. /***/ }),
  4090. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/line.js":
  4091. /*!*******************************************************************************!*\
  4092. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/line.js ***!
  4093. \*******************************************************************************/
  4094. /*! no static exports found */
  4095. /***/ (function(module, exports, __webpack_require__) {
  4096. "use strict";
  4097. Object.defineProperty(exports, "__esModule", {
  4098. value: true
  4099. });
  4100. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js");
  4101. function default_1(shape) {
  4102. var attrs = shape.attr();
  4103. var x1 = attrs.x1,
  4104. y1 = attrs.y1,
  4105. x2 = attrs.x2,
  4106. y2 = attrs.y2;
  4107. var minX = Math.min(x1, x2);
  4108. var maxX = Math.max(x1, x2);
  4109. var minY = Math.min(y1, y2);
  4110. var maxY = Math.max(y1, y2);
  4111. var bbox = {
  4112. minX: minX,
  4113. maxX: maxX,
  4114. minY: minY,
  4115. maxY: maxY
  4116. };
  4117. bbox = util_1.mergeArrowBBox(shape, bbox);
  4118. return {
  4119. x: bbox.minX,
  4120. y: bbox.minY,
  4121. width: bbox.maxX - bbox.minX,
  4122. height: bbox.maxY - bbox.minY
  4123. };
  4124. }
  4125. exports.default = default_1;
  4126. /***/ }),
  4127. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/path.js":
  4128. /*!*******************************************************************************!*\
  4129. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/path.js ***!
  4130. \*******************************************************************************/
  4131. /*! no static exports found */
  4132. /***/ (function(module, exports, __webpack_require__) {
  4133. "use strict";
  4134. Object.defineProperty(exports, "__esModule", {
  4135. value: true
  4136. });
  4137. var quadratic_1 = __webpack_require__(/*! @antv/g-math/lib/quadratic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js");
  4138. var cubic_1 = __webpack_require__(/*! @antv/g-math/lib/cubic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js");
  4139. var arc_1 = __webpack_require__(/*! @antv/g-math/lib/arc */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/arc.js");
  4140. var path_2_segments_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-segments */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js");
  4141. var is_number_equal_1 = __webpack_require__(/*! @antv/util/lib/is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js");
  4142. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js");
  4143. function getPathBox(segments, lineWidth) {
  4144. var xArr = [];
  4145. var yArr = [];
  4146. var segmentsWithAngle = [];
  4147. for (var i = 0; i < segments.length; i++) {
  4148. var segment = segments[i];
  4149. var currentPoint = segment.currentPoint,
  4150. params = segment.params,
  4151. prePoint = segment.prePoint;
  4152. var box = void 0;
  4153. switch (segment.command) {
  4154. case 'Q':
  4155. box = quadratic_1.default.box(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4]);
  4156. break;
  4157. case 'C':
  4158. box = cubic_1.default.box(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], params[5], params[6]);
  4159. break;
  4160. case 'A':
  4161. var arcParams = segment.arcParams;
  4162. box = arc_1.default.box(arcParams.cx, arcParams.cy, arcParams.rx, arcParams.ry, arcParams.xRotation, arcParams.startAngle, arcParams.endAngle);
  4163. break;
  4164. default:
  4165. xArr.push(currentPoint[0]);
  4166. yArr.push(currentPoint[1]);
  4167. break;
  4168. }
  4169. if (box) {
  4170. segment.box = box;
  4171. xArr.push(box.x, box.x + box.width);
  4172. yArr.push(box.y, box.y + box.height);
  4173. }
  4174. if (lineWidth && (segment.command === 'L' || segment.command === 'M') && segment.prePoint && segment.nextPoint) {
  4175. segmentsWithAngle.push(segment);
  4176. }
  4177. } // bbox calculation should ignore NaN for path attribute
  4178. // ref: https://github.com/antvis/g/issues/210
  4179. xArr = xArr.filter(function (item) {
  4180. return !Number.isNaN(item);
  4181. });
  4182. yArr = yArr.filter(function (item) {
  4183. return !Number.isNaN(item);
  4184. });
  4185. var minX = Math.min.apply(null, xArr);
  4186. var minY = Math.min.apply(null, yArr);
  4187. var maxX = Math.max.apply(null, xArr);
  4188. var maxY = Math.max.apply(null, yArr);
  4189. if (segmentsWithAngle.length === 0) {
  4190. return {
  4191. x: minX,
  4192. y: minY,
  4193. width: maxX - minX,
  4194. height: maxY - minY
  4195. };
  4196. }
  4197. for (var i = 0; i < segmentsWithAngle.length; i++) {
  4198. var segment = segmentsWithAngle[i];
  4199. var currentPoint = segment.currentPoint;
  4200. var extra = void 0;
  4201. if (currentPoint[0] === minX) {
  4202. extra = getExtraFromSegmentWithAngle(segment, lineWidth);
  4203. minX = minX - extra.xExtra;
  4204. } else if (currentPoint[0] === maxX) {
  4205. extra = getExtraFromSegmentWithAngle(segment, lineWidth);
  4206. maxX = maxX + extra.xExtra;
  4207. }
  4208. if (currentPoint[1] === minY) {
  4209. extra = getExtraFromSegmentWithAngle(segment, lineWidth);
  4210. minY = minY - extra.yExtra;
  4211. } else if (currentPoint[1] === maxY) {
  4212. extra = getExtraFromSegmentWithAngle(segment, lineWidth);
  4213. maxY = maxY + extra.yExtra;
  4214. }
  4215. }
  4216. return {
  4217. x: minX,
  4218. y: minY,
  4219. width: maxX - minX,
  4220. height: maxY - minY
  4221. };
  4222. }
  4223. function getExtraFromSegmentWithAngle(segment, lineWidth) {
  4224. var prePoint = segment.prePoint,
  4225. currentPoint = segment.currentPoint,
  4226. nextPoint = segment.nextPoint;
  4227. var currentAndPre = Math.pow(currentPoint[0] - prePoint[0], 2) + Math.pow(currentPoint[1] - prePoint[1], 2);
  4228. var currentAndNext = Math.pow(currentPoint[0] - nextPoint[0], 2) + Math.pow(currentPoint[1] - nextPoint[1], 2);
  4229. var preAndNext = Math.pow(prePoint[0] - nextPoint[0], 2) + Math.pow(prePoint[1] - nextPoint[1], 2); // 以 currentPoint 为顶点的夹角
  4230. var currentAngle = Math.acos((currentAndPre + currentAndNext - preAndNext) / (2 * Math.sqrt(currentAndPre) * Math.sqrt(currentAndNext))); // 夹角为空、 0 或 PI 时,不需要计算夹角处的额外宽度
  4231. // 注意: 由于计算精度问题,夹角为 0 的情况计算出来的角度可能是一个很小的值,还需要判断其与 0 是否近似相等
  4232. if (!currentAngle || Math.sin(currentAngle) === 0 || is_number_equal_1.default(currentAngle, 0)) {
  4233. return {
  4234. xExtra: 0,
  4235. yExtra: 0
  4236. };
  4237. }
  4238. var xAngle = Math.abs(Math.atan2(nextPoint[1] - currentPoint[1], nextPoint[0] - currentPoint[0]));
  4239. var yAngle = Math.abs(Math.atan2(nextPoint[0] - currentPoint[0], nextPoint[1] - currentPoint[1])); // 将夹角转为锐角
  4240. xAngle = xAngle > Math.PI / 2 ? Math.PI - xAngle : xAngle;
  4241. yAngle = yAngle > Math.PI / 2 ? Math.PI - yAngle : yAngle; // 这里不考虑在水平和垂直方向的投影,直接使用最大差值
  4242. // 由于上层统一加减了二分之一线宽,这里需要进行弥补
  4243. var extra = {
  4244. // 水平方向投影
  4245. xExtra: Math.cos(currentAngle / 2 - xAngle) * (lineWidth / 2 * (1 / Math.sin(currentAngle / 2))) - lineWidth / 2 || 0,
  4246. // 垂直方向投影
  4247. yExtra: Math.cos(yAngle - currentAngle / 2) * (lineWidth / 2 * (1 / Math.sin(currentAngle / 2))) - lineWidth / 2 || 0
  4248. };
  4249. return extra;
  4250. }
  4251. function default_1(shape) {
  4252. var attrs = shape.attr();
  4253. var path = attrs.path,
  4254. stroke = attrs.stroke;
  4255. var lineWidth = stroke ? attrs.lineWidth : 0; // 只有有 stroke 时,lineWidth 才生效
  4256. var segments = shape.get('segments') || path_2_segments_1.default(path);
  4257. var _a = getPathBox(segments, lineWidth),
  4258. x = _a.x,
  4259. y = _a.y,
  4260. width = _a.width,
  4261. height = _a.height;
  4262. var bbox = {
  4263. minX: x,
  4264. minY: y,
  4265. maxX: x + width,
  4266. maxY: y + height
  4267. };
  4268. bbox = util_1.mergeArrowBBox(shape, bbox);
  4269. return {
  4270. x: bbox.minX,
  4271. y: bbox.minY,
  4272. width: bbox.maxX - bbox.minX,
  4273. height: bbox.maxY - bbox.minY
  4274. };
  4275. }
  4276. exports.default = default_1;
  4277. /***/ }),
  4278. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polygon.js":
  4279. /*!**********************************************************************************!*\
  4280. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polygon.js ***!
  4281. \**********************************************************************************/
  4282. /*! no static exports found */
  4283. /***/ (function(module, exports, __webpack_require__) {
  4284. "use strict";
  4285. Object.defineProperty(exports, "__esModule", {
  4286. value: true
  4287. });
  4288. var util_1 = __webpack_require__(/*! @antv/g-math/lib/util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  4289. function default_1(shape) {
  4290. var attrs = shape.attr();
  4291. var points = attrs.points;
  4292. var xArr = [];
  4293. var yArr = [];
  4294. for (var i = 0; i < points.length; i++) {
  4295. var point = points[i];
  4296. xArr.push(point[0]);
  4297. yArr.push(point[1]);
  4298. }
  4299. return util_1.getBBoxByArray(xArr, yArr);
  4300. }
  4301. exports.default = default_1;
  4302. /***/ }),
  4303. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polyline.js":
  4304. /*!***********************************************************************************!*\
  4305. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/polyline.js ***!
  4306. \***********************************************************************************/
  4307. /*! no static exports found */
  4308. /***/ (function(module, exports, __webpack_require__) {
  4309. "use strict";
  4310. Object.defineProperty(exports, "__esModule", {
  4311. value: true
  4312. });
  4313. var util_1 = __webpack_require__(/*! @antv/g-math/lib/util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  4314. var util_2 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js");
  4315. function default_1(shape) {
  4316. var attrs = shape.attr();
  4317. var points = attrs.points;
  4318. var xArr = [];
  4319. var yArr = [];
  4320. for (var i = 0; i < points.length; i++) {
  4321. var point = points[i];
  4322. xArr.push(point[0]);
  4323. yArr.push(point[1]);
  4324. }
  4325. var _a = util_1.getBBoxByArray(xArr, yArr),
  4326. x = _a.x,
  4327. y = _a.y,
  4328. width = _a.width,
  4329. height = _a.height;
  4330. var bbox = {
  4331. minX: x,
  4332. minY: y,
  4333. maxX: x + width,
  4334. maxY: y + height
  4335. };
  4336. bbox = util_2.mergeArrowBBox(shape, bbox);
  4337. return {
  4338. x: bbox.minX,
  4339. y: bbox.minY,
  4340. width: bbox.maxX - bbox.minX,
  4341. height: bbox.maxY - bbox.minY
  4342. };
  4343. }
  4344. exports.default = default_1;
  4345. /***/ }),
  4346. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/rect.js":
  4347. /*!*******************************************************************************!*\
  4348. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/rect.js ***!
  4349. \*******************************************************************************/
  4350. /*! no static exports found */
  4351. /***/ (function(module, exports, __webpack_require__) {
  4352. "use strict";
  4353. Object.defineProperty(exports, "__esModule", {
  4354. value: true
  4355. });
  4356. function default_1(shape) {
  4357. var attrs = shape.attr();
  4358. var x = attrs.x,
  4359. y = attrs.y,
  4360. width = attrs.width,
  4361. height = attrs.height;
  4362. return {
  4363. x: x,
  4364. y: y,
  4365. width: width,
  4366. height: height
  4367. };
  4368. }
  4369. exports.default = default_1;
  4370. /***/ }),
  4371. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/register.js":
  4372. /*!***********************************************************************************!*\
  4373. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/register.js ***!
  4374. \***********************************************************************************/
  4375. /*! no static exports found */
  4376. /***/ (function(module, exports, __webpack_require__) {
  4377. "use strict";
  4378. Object.defineProperty(exports, "__esModule", {
  4379. value: true
  4380. });
  4381. var cache = new Map();
  4382. /**
  4383. * 注册计算包围盒的算法
  4384. * @param type 方法名
  4385. * @param method 方法
  4386. */
  4387. function register(type, method) {
  4388. cache.set(type, method);
  4389. }
  4390. exports.register = register;
  4391. /**
  4392. * 获取计算包围盒的算法
  4393. * @param type 方法名
  4394. */
  4395. function getMethod(type) {
  4396. return cache.get(type);
  4397. }
  4398. exports.getMethod = getMethod;
  4399. /***/ }),
  4400. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/text.js":
  4401. /*!*******************************************************************************!*\
  4402. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/text.js ***!
  4403. \*******************************************************************************/
  4404. /*! no static exports found */
  4405. /***/ (function(module, exports, __webpack_require__) {
  4406. "use strict";
  4407. Object.defineProperty(exports, "__esModule", {
  4408. value: true
  4409. });
  4410. var text_1 = __webpack_require__(/*! ../util/text */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js");
  4411. function default_1(shape) {
  4412. var attrs = shape.attr();
  4413. var x = attrs.x,
  4414. y = attrs.y,
  4415. text = attrs.text,
  4416. fontSize = attrs.fontSize,
  4417. lineHeight = attrs.lineHeight;
  4418. var font = attrs.font;
  4419. if (!font) {
  4420. // 如果未组装 font
  4421. font = text_1.assembleFont(attrs);
  4422. }
  4423. var width = text_1.getTextWidth(text, font);
  4424. var bbox;
  4425. if (!width) {
  4426. // 如果width不存在,四点共其实点
  4427. bbox = {
  4428. x: x,
  4429. y: y,
  4430. width: 0,
  4431. height: 0
  4432. };
  4433. } else {
  4434. var textAlign = attrs.textAlign,
  4435. textBaseline = attrs.textBaseline;
  4436. var height = text_1.getTextHeight(text, fontSize, lineHeight); // attrs.height
  4437. // 默认左右对齐:left, 默认上下对齐 bottom
  4438. var point = {
  4439. x: x,
  4440. y: y - height
  4441. };
  4442. if (textAlign) {
  4443. if (textAlign === 'end' || textAlign === 'right') {
  4444. point.x -= width;
  4445. } else if (textAlign === 'center') {
  4446. point.x -= width / 2;
  4447. }
  4448. }
  4449. if (textBaseline) {
  4450. if (textBaseline === 'top') {
  4451. point.y += height;
  4452. } else if (textBaseline === 'middle') {
  4453. point.y += height / 2;
  4454. }
  4455. }
  4456. bbox = {
  4457. x: point.x,
  4458. y: point.y,
  4459. width: width,
  4460. height: height
  4461. };
  4462. }
  4463. return bbox;
  4464. }
  4465. exports.default = default_1;
  4466. /***/ }),
  4467. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js":
  4468. /*!*******************************************************************************!*\
  4469. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/util.js ***!
  4470. \*******************************************************************************/
  4471. /*! no static exports found */
  4472. /***/ (function(module, exports, __webpack_require__) {
  4473. "use strict";
  4474. Object.defineProperty(exports, "__esModule", {
  4475. value: true
  4476. }); // 合并包围盒
  4477. function mergeBBox(bbox1, bbox2) {
  4478. if (!bbox1 || !bbox2) {
  4479. return bbox1 || bbox2;
  4480. }
  4481. return {
  4482. minX: Math.min(bbox1.minX, bbox2.minX),
  4483. minY: Math.min(bbox1.minY, bbox2.minY),
  4484. maxX: Math.max(bbox1.maxX, bbox2.maxX),
  4485. maxY: Math.max(bbox1.maxY, bbox2.maxY)
  4486. };
  4487. }
  4488. exports.mergeBBox = mergeBBox; // 合并箭头的包围盒
  4489. function mergeArrowBBox(shape, bbox) {
  4490. var startArrowShape = shape.get('startArrowShape');
  4491. var endArrowShape = shape.get('endArrowShape');
  4492. var startArrowBBox = null;
  4493. var endArrowBBox = null;
  4494. if (startArrowShape) {
  4495. startArrowBBox = startArrowShape.getCanvasBBox();
  4496. bbox = mergeBBox(bbox, startArrowBBox);
  4497. }
  4498. if (endArrowShape) {
  4499. endArrowBBox = endArrowShape.getCanvasBBox();
  4500. bbox = mergeBBox(bbox, endArrowBBox);
  4501. }
  4502. return bbox;
  4503. }
  4504. exports.mergeArrowBBox = mergeArrowBBox;
  4505. /***/ }),
  4506. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/interfaces.js":
  4507. /*!********************************************************************************!*\
  4508. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/interfaces.js ***!
  4509. \********************************************************************************/
  4510. /*! no static exports found */
  4511. /***/ (function(module, exports, __webpack_require__) {
  4512. "use strict";
  4513. Object.defineProperty(exports, "__esModule", {
  4514. value: true
  4515. });
  4516. /***/ }),
  4517. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/types.js":
  4518. /*!***************************************************************************!*\
  4519. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/types.js ***!
  4520. \***************************************************************************/
  4521. /*! no static exports found */
  4522. /***/ (function(module, exports, __webpack_require__) {
  4523. "use strict";
  4524. Object.defineProperty(exports, "__esModule", {
  4525. value: true
  4526. });
  4527. /***/ }),
  4528. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/matrix.js":
  4529. /*!*********************************************************************************!*\
  4530. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/matrix.js ***!
  4531. \*********************************************************************************/
  4532. /*! no static exports found */
  4533. /***/ (function(module, exports, __webpack_require__) {
  4534. "use strict";
  4535. /**
  4536. * @fileoverview 矩阵运算,本来是要引入 gl-matrix, 但是考虑到 g-mobile 对大小有限制,同时 g-webgl 使用的 matrix 不一致
  4537. * 所以,这里仅实现 2D 几个运算,上层自己引入 gl-matrix
  4538. * @author dxq613@gmail.com
  4539. */
  4540. Object.defineProperty(exports, "__esModule", {
  4541. value: true
  4542. });
  4543. /**
  4544. * 3阶矩阵相乘
  4545. * @param {number[]} a 矩阵1
  4546. * @param {number[]} b 矩阵2
  4547. */
  4548. function multiplyMatrix(a, b) {
  4549. var out = [];
  4550. var a00 = a[0];
  4551. var a01 = a[1];
  4552. var a02 = a[2];
  4553. var a10 = a[3];
  4554. var a11 = a[4];
  4555. var a12 = a[5];
  4556. var a20 = a[6];
  4557. var a21 = a[7];
  4558. var a22 = a[8];
  4559. var b00 = b[0];
  4560. var b01 = b[1];
  4561. var b02 = b[2];
  4562. var b10 = b[3];
  4563. var b11 = b[4];
  4564. var b12 = b[5];
  4565. var b20 = b[6];
  4566. var b21 = b[7];
  4567. var b22 = b[8];
  4568. out[0] = b00 * a00 + b01 * a10 + b02 * a20;
  4569. out[1] = b00 * a01 + b01 * a11 + b02 * a21;
  4570. out[2] = b00 * a02 + b01 * a12 + b02 * a22;
  4571. out[3] = b10 * a00 + b11 * a10 + b12 * a20;
  4572. out[4] = b10 * a01 + b11 * a11 + b12 * a21;
  4573. out[5] = b10 * a02 + b11 * a12 + b12 * a22;
  4574. out[6] = b20 * a00 + b21 * a10 + b22 * a20;
  4575. out[7] = b20 * a01 + b21 * a11 + b22 * a21;
  4576. out[8] = b20 * a02 + b21 * a12 + b22 * a22;
  4577. return out;
  4578. }
  4579. exports.multiplyMatrix = multiplyMatrix;
  4580. /**
  4581. * 3阶矩阵同2阶向量相乘
  4582. * @param {number[]} m 矩阵
  4583. * @param {number[]} v 二阶向量
  4584. */
  4585. function multiplyVec2(m, v) {
  4586. var out = [];
  4587. var x = v[0];
  4588. var y = v[1];
  4589. out[0] = m[0] * x + m[3] * y + m[6];
  4590. out[1] = m[1] * x + m[4] * y + m[7];
  4591. return out;
  4592. }
  4593. exports.multiplyVec2 = multiplyVec2;
  4594. /**
  4595. * 矩阵的逆
  4596. * @param {number[]} a 矩阵
  4597. */
  4598. function invert(a) {
  4599. var out = [];
  4600. var a00 = a[0];
  4601. var a01 = a[1];
  4602. var a02 = a[2];
  4603. var a10 = a[3];
  4604. var a11 = a[4];
  4605. var a12 = a[5];
  4606. var a20 = a[6];
  4607. var a21 = a[7];
  4608. var a22 = a[8];
  4609. var b01 = a22 * a11 - a12 * a21;
  4610. var b11 = -a22 * a10 + a12 * a20;
  4611. var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
  4612. var det = a00 * b01 + a01 * b11 + a02 * b21;
  4613. if (!det) {
  4614. return null;
  4615. }
  4616. det = 1.0 / det;
  4617. out[0] = b01 * det;
  4618. out[1] = (-a22 * a01 + a02 * a21) * det;
  4619. out[2] = (a12 * a01 - a02 * a11) * det;
  4620. out[3] = b11 * det;
  4621. out[4] = (a22 * a00 - a02 * a20) * det;
  4622. out[5] = (-a12 * a00 + a02 * a10) * det;
  4623. out[6] = b21 * det;
  4624. out[7] = (-a21 * a00 + a01 * a20) * det;
  4625. out[8] = (a11 * a00 - a01 * a10) * det;
  4626. return out;
  4627. }
  4628. exports.invert = invert;
  4629. /***/ }),
  4630. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js":
  4631. /*!************************************************************************************!*\
  4632. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js ***!
  4633. \************************************************************************************/
  4634. /*! no static exports found */
  4635. /***/ (function(module, exports, __webpack_require__) {
  4636. "use strict";
  4637. Object.defineProperty(exports, "__esModule", {
  4638. value: true
  4639. }); // 全局设置一个唯一离屏的 ctx,用于计算 isPointInPath
  4640. var offScreenCtx = null;
  4641. function getOffScreenContext() {
  4642. if (!offScreenCtx) {
  4643. var canvas = document.createElement('canvas');
  4644. canvas.width = 1;
  4645. canvas.height = 1;
  4646. offScreenCtx = canvas.getContext('2d');
  4647. }
  4648. return offScreenCtx;
  4649. }
  4650. exports.getOffScreenContext = getOffScreenContext;
  4651. /***/ }),
  4652. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js":
  4653. /*!*******************************************************************************!*\
  4654. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js ***!
  4655. \*******************************************************************************/
  4656. /*! no static exports found */
  4657. /***/ (function(module, exports, __webpack_require__) {
  4658. "use strict";
  4659. Object.defineProperty(exports, "__esModule", {
  4660. value: true
  4661. });
  4662. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js");
  4663. var offscreen_1 = __webpack_require__(/*! ./offscreen */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js");
  4664. /**
  4665. * 获取文本的高度
  4666. * @param text 文本
  4667. * @param fontSize 字体大小
  4668. * @param lineHeight 行高,可以为空
  4669. */
  4670. function getTextHeight(text, fontSize, lineHeight) {
  4671. var lineCount = 1;
  4672. if (util_1.isString(text)) {
  4673. lineCount = text.split('\n').length;
  4674. }
  4675. if (lineCount > 1) {
  4676. var spaceingY = getLineSpaceing(fontSize, lineHeight);
  4677. return fontSize * lineCount + spaceingY * (lineCount - 1);
  4678. }
  4679. return fontSize;
  4680. }
  4681. exports.getTextHeight = getTextHeight;
  4682. /**
  4683. * 获取行间距如果文本多行,需要获取文本间距
  4684. * @param fontSize 字体大小
  4685. * @param lineHeight 行高
  4686. */
  4687. function getLineSpaceing(fontSize, lineHeight) {
  4688. return lineHeight ? lineHeight - fontSize : fontSize * 0.14;
  4689. }
  4690. exports.getLineSpaceing = getLineSpaceing;
  4691. /**
  4692. * 字体宽度
  4693. * @param text 文本
  4694. * @param font 字体
  4695. */
  4696. function getTextWidth(text, font) {
  4697. var context = offscreen_1.getOffScreenContext(); // 获取离屏的 ctx 进行计算
  4698. var width = 0; // null 或者 undefined 时,宽度为 0
  4699. if (util_1.isNil(text) || text === '') {
  4700. return width;
  4701. }
  4702. context.save();
  4703. context.font = font;
  4704. if (util_1.isString(text) && text.includes('\n')) {
  4705. var textArr = text.split('\n');
  4706. util_1.each(textArr, function (subText) {
  4707. var measureWidth = context.measureText(subText).width;
  4708. if (width < measureWidth) {
  4709. width = measureWidth;
  4710. }
  4711. });
  4712. } else {
  4713. width = context.measureText(text).width;
  4714. }
  4715. context.restore();
  4716. return width;
  4717. }
  4718. exports.getTextWidth = getTextWidth;
  4719. function assembleFont(attrs) {
  4720. var fontSize = attrs.fontSize,
  4721. fontFamily = attrs.fontFamily,
  4722. fontWeight = attrs.fontWeight,
  4723. fontStyle = attrs.fontStyle,
  4724. fontVariant = attrs.fontVariant;
  4725. return [fontStyle, fontVariant, fontWeight, fontSize + "px", fontFamily].join(' ').trim();
  4726. }
  4727. exports.assembleFont = assembleFont;
  4728. /***/ }),
  4729. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js":
  4730. /*!*******************************************************************************!*\
  4731. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js ***!
  4732. \*******************************************************************************/
  4733. /*! no static exports found */
  4734. /***/ (function(module, exports, __webpack_require__) {
  4735. "use strict";
  4736. Object.defineProperty(exports, "__esModule", {
  4737. value: true
  4738. });
  4739. function removeFromArray(arr, obj) {
  4740. var index = arr.indexOf(obj);
  4741. if (index !== -1) {
  4742. arr.splice(index, 1);
  4743. }
  4744. }
  4745. exports.removeFromArray = removeFromArray;
  4746. exports.isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
  4747. var is_nil_1 = __webpack_require__(/*! @antv/util/lib/is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
  4748. exports.isNil = is_nil_1.default;
  4749. var is_function_1 = __webpack_require__(/*! @antv/util/lib/is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
  4750. exports.isFunction = is_function_1.default;
  4751. var is_string_1 = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
  4752. exports.isString = is_string_1.default;
  4753. var is_object_1 = __webpack_require__(/*! @antv/util/lib/is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
  4754. exports.isObject = is_object_1.default;
  4755. var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
  4756. exports.isArray = is_array_1.default;
  4757. var mix_1 = __webpack_require__(/*! @antv/util/lib/mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js");
  4758. exports.mix = mix_1.default;
  4759. var each_1 = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
  4760. exports.each = each_1.default;
  4761. var upper_first_1 = __webpack_require__(/*! @antv/util/lib/upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js");
  4762. exports.upperFirst = upper_first_1.default; // 是否元素的父容器
  4763. function isParent(container, shape) {
  4764. // 所有 shape 都是 canvas 的子元素
  4765. if (container.isCanvas()) {
  4766. return true;
  4767. }
  4768. var parent = shape.getParent();
  4769. var isParent = false;
  4770. while (parent) {
  4771. if (parent === container) {
  4772. isParent = true;
  4773. break;
  4774. }
  4775. parent = parent.getParent();
  4776. }
  4777. return isParent;
  4778. }
  4779. exports.isParent = isParent;
  4780. function isAllowCapture(element) {
  4781. // @ts-ignore
  4782. return element.cfg.visible && element.cfg.capture;
  4783. }
  4784. exports.isAllowCapture = isAllowCapture;
  4785. /***/ }),
  4786. /***/ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/package.json":
  4787. /*!***************************************************************************!*\
  4788. !*** ./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/package.json ***!
  4789. \***************************************************************************/
  4790. /*! exports provided: name, version, description, main, module, types, files, scripts, repository, keywords, publishConfig, author, license, bugs, devDependencies, homepage, dependencies, __npminstall_done, gitHead, _from, _resolved, default */
  4791. /***/ (function(module) {
  4792. module.exports = JSON.parse("{\"name\":\"@antv/g-base\",\"version\":\"0.5.0-beta.1\",\"description\":\"A common util collection for antv projects\",\"main\":\"lib/index.js\",\"module\":\"esm/index.js\",\"types\":\"lib/index.d.ts\",\"files\":[\"package.json\",\"esm\",\"lib\",\"LICENSE\",\"README.md\"],\"scripts\":{\"build\":\"npm run clean && run-p build:*\",\"build:esm\":\"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm\",\"build:cjs\":\"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib\",\"clean\":\"rm -rf esm lib\",\"watch:cjs\":\"tsc-watch -p tsconfig.json --target ES5 --module commonjs --outDir lib --compiler typescript/bin/tsc\",\"coverage\":\"npm run coverage-generator && npm run coverage-viewer\",\"coverage-generator\":\"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts\",\"coverage-viewer\":\"torch-coverage\",\"test\":\"torch --renderer --compile --opts tests/mocha.opts\",\"test-live\":\"torch --compile --interactive tests/unit\",\"tsc\":\"tsc --noEmit\",\"typecheck\":\"tsc --noEmit\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/antvis/util.git\"},\"keywords\":[\"util\",\"antv\",\"g\"],\"publishConfig\":{\"access\":\"public\"},\"author\":\"https://github.com/orgs/antvis/people\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/antvis/util/issues\"},\"devDependencies\":{\"@antv/torch\":\"^1.0.0\",\"gl-matrix\":\"^3.0.0\",\"less\":\"^3.9.0\",\"npm-run-all\":\"^4.1.5\",\"tsc-watch\":\"^4.0.0\"},\"homepage\":\"https://github.com/antvis/util#readme\",\"dependencies\":{\"@antv/event-emitter\":\"^0.1.1\",\"@antv/g-math\":\"^0.1.3\",\"@antv/matrix-util\":\"^3.1.0-beta.1\",\"@antv/path-util\":\"~2.0.5\",\"@antv/util\":\"~2.0.0\",\"@types/d3-timer\":\"^1.0.9\",\"d3-ease\":\"^1.0.5\",\"d3-interpolate\":\"^1.3.2\",\"d3-timer\":\"^1.0.9\",\"detect-browser\":\"^5.1.0\"},\"__npminstall_done\":\"Fri May 29 2020 19:03:41 GMT+0800 (GMT+08:00)\",\"gitHead\":\"f1dd2cc436ea123939f400a9a9d88f1ebce46be9\",\"_from\":\"@antv/g-base@0.5.0-beta.1\",\"_resolved\":\"https://registry.npm.taobao.org/@antv/g-base/download/@antv/g-base-0.5.0-beta.1.tgz\"}");
  4793. /***/ }),
  4794. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/arc.js":
  4795. /*!******************************************************************!*\
  4796. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/arc.js ***!
  4797. \******************************************************************/
  4798. /*! no static exports found */
  4799. /***/ (function(module, exports, __webpack_require__) {
  4800. "use strict";
  4801. Object.defineProperty(exports, "__esModule", {
  4802. value: true
  4803. });
  4804. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  4805. var ellipse_1 = __webpack_require__(/*! ./ellipse */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/ellipse.js"); // 偏导数 x
  4806. function derivativeXAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle) {
  4807. return -1 * rx * Math.cos(xRotation) * Math.sin(angle) - ry * Math.sin(xRotation) * Math.cos(angle);
  4808. } // 偏导数 y
  4809. function derivativeYAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle) {
  4810. return -1 * rx * Math.sin(xRotation) * Math.sin(angle) + ry * Math.cos(xRotation) * Math.cos(angle);
  4811. } // x 的极值
  4812. function xExtrema(rx, ry, xRotation) {
  4813. return Math.atan(-ry / rx * Math.tan(xRotation));
  4814. } // y 的极值
  4815. function yExtrema(rx, ry, xRotation) {
  4816. return Math.atan(ry / (rx * Math.tan(xRotation)));
  4817. } // 根据角度求 x 坐标
  4818. function xAt(cx, cy, rx, ry, xRotation, angle) {
  4819. return rx * Math.cos(xRotation) * Math.cos(angle) - ry * Math.sin(xRotation) * Math.sin(angle) + cx;
  4820. } // 根据角度求 y 坐标
  4821. function yAt(cx, cy, rx, ry, xRotation, angle) {
  4822. return rx * Math.sin(xRotation) * Math.cos(angle) + ry * Math.cos(xRotation) * Math.sin(angle) + cy;
  4823. } // 获取点在椭圆上的角度
  4824. function getAngle(rx, ry, x0, y0) {
  4825. var angle = Math.atan2(y0 * rx, x0 * ry); // 转换到 0 - 2PI 内
  4826. return (angle + Math.PI * 2) % (Math.PI * 2);
  4827. } // 根据角度获取,x,y
  4828. function getPoint(rx, ry, angle) {
  4829. return {
  4830. x: rx * Math.cos(angle),
  4831. y: ry * Math.sin(angle)
  4832. };
  4833. } // 旋转
  4834. function rotate(x, y, angle) {
  4835. var cos = Math.cos(angle);
  4836. var sin = Math.sin(angle);
  4837. return [x * cos - y * sin, x * sin + y * cos];
  4838. }
  4839. exports.default = {
  4840. /**
  4841. * 计算包围盒
  4842. * @param {number} cx 圆心 x
  4843. * @param {number} cy 圆心 y
  4844. * @param {number} rx x 轴方向的半径
  4845. * @param {number} ry y 轴方向的半径
  4846. * @param {number} xRotation 旋转角度
  4847. * @param {number} startAngle 起始角度
  4848. * @param {number} endAngle 结束角度
  4849. * @return {object} 包围盒对象
  4850. */
  4851. box: function (cx, cy, rx, ry, xRotation, startAngle, endAngle) {
  4852. var xDim = xExtrema(rx, ry, xRotation);
  4853. var minX = Infinity;
  4854. var maxX = -Infinity;
  4855. var xs = [startAngle, endAngle];
  4856. for (var i = -Math.PI * 2; i <= Math.PI * 2; i += Math.PI) {
  4857. var xAngle = xDim + i;
  4858. if (startAngle < endAngle) {
  4859. if (startAngle < xAngle && xAngle < endAngle) {
  4860. xs.push(xAngle);
  4861. }
  4862. } else {
  4863. if (endAngle < xAngle && xAngle < startAngle) {
  4864. xs.push(xAngle);
  4865. }
  4866. }
  4867. }
  4868. for (var i = 0; i < xs.length; i++) {
  4869. var x = xAt(cx, cy, rx, ry, xRotation, xs[i]);
  4870. if (x < minX) {
  4871. minX = x;
  4872. }
  4873. if (x > maxX) {
  4874. maxX = x;
  4875. }
  4876. }
  4877. var yDim = yExtrema(rx, ry, xRotation);
  4878. var minY = Infinity;
  4879. var maxY = -Infinity;
  4880. var ys = [startAngle, endAngle];
  4881. for (var i = -Math.PI * 2; i <= Math.PI * 2; i += Math.PI) {
  4882. var yAngle = yDim + i;
  4883. if (startAngle < endAngle) {
  4884. if (startAngle < yAngle && yAngle < endAngle) {
  4885. ys.push(yAngle);
  4886. }
  4887. } else {
  4888. if (endAngle < yAngle && yAngle < startAngle) {
  4889. ys.push(yAngle);
  4890. }
  4891. }
  4892. }
  4893. for (var i = 0; i < ys.length; i++) {
  4894. var y = yAt(cx, cy, rx, ry, xRotation, ys[i]);
  4895. if (y < minY) {
  4896. minY = y;
  4897. }
  4898. if (y > maxY) {
  4899. maxY = y;
  4900. }
  4901. }
  4902. return {
  4903. x: minX,
  4904. y: minY,
  4905. width: maxX - minX,
  4906. height: maxY - minY
  4907. };
  4908. },
  4909. /**
  4910. * 获取圆弧的长度,计算圆弧长度时不考虑旋转角度,
  4911. * 仅跟 rx, ry, startAngle, endAngle 相关
  4912. * @param {number} cx 圆心 x
  4913. * @param {number} cy 圆心 y
  4914. * @param {number} rx x 轴方向的半径
  4915. * @param {number} ry y 轴方向的半径
  4916. * @param {number} xRotation 旋转角度
  4917. * @param {number} startAngle 起始角度
  4918. * @param {number} endAngle 结束角度
  4919. */
  4920. length: function (cx, cy, rx, ry, xRotation, startAngle, endAngle) {},
  4921. /**
  4922. * 获取指定点到圆弧的最近距离的点
  4923. * @param {number} cx 圆心 x
  4924. * @param {number} cy 圆心 y
  4925. * @param {number} rx x 轴方向的半径
  4926. * @param {number} ry y 轴方向的半径
  4927. * @param {number} xRotation 旋转角度
  4928. * @param {number} startAngle 起始角度
  4929. * @param {number} endAngle 结束角度
  4930. * @param {number} x0 指定点的 x
  4931. * @param {number} y0 指定点的 y
  4932. * @return {object} 到指定点最近距离的点
  4933. */
  4934. nearestPoint: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, x0, y0) {
  4935. // 将最近距离问题转换成到椭圆中心 0,0 没有旋转的椭圆问题
  4936. var relativeVector = rotate(x0 - cx, y0 - cy, -xRotation);
  4937. var x1 = relativeVector[0],
  4938. y1 = relativeVector[1]; // 计算点到椭圆的最近的点
  4939. var relativePoint = ellipse_1.default.nearestPoint(0, 0, rx, ry, x1, y1); // 获取点在椭圆上的角度
  4940. var angle = getAngle(rx, ry, relativePoint.x, relativePoint.y); // 点没有在圆弧上
  4941. if (angle < startAngle) {
  4942. // 小于起始圆弧
  4943. relativePoint = getPoint(rx, ry, startAngle);
  4944. } else if (angle > endAngle) {
  4945. // 大于结束圆弧
  4946. relativePoint = getPoint(rx, ry, endAngle);
  4947. } // 旋转到 xRotation 的角度
  4948. var vector = rotate(relativePoint.x, relativePoint.y, xRotation);
  4949. return {
  4950. x: vector[0] + cx,
  4951. y: vector[1] + cy
  4952. };
  4953. },
  4954. pointDistance: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, x0, y0) {
  4955. var nearestPoint = this.nearestPoint(cx, cy, rx, ry, x0, y0);
  4956. return util_1.distance(nearestPoint.x, nearestPoint.y, x0, y0);
  4957. },
  4958. pointAt: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, t) {
  4959. var angle = (endAngle - startAngle) * t + startAngle;
  4960. return {
  4961. x: xAt(cx, cy, rx, ry, xRotation, angle),
  4962. y: yAt(cx, cy, rx, ry, xRotation, angle)
  4963. };
  4964. },
  4965. tangentAngle: function (cx, cy, rx, ry, xRotation, startAngle, endAngle, t) {
  4966. var angle = (endAngle - startAngle) * t + startAngle;
  4967. var dx = derivativeXAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle);
  4968. var dy = derivativeYAt(cx, cy, rx, ry, xRotation, startAngle, endAngle, angle);
  4969. return util_1.piMod(Math.atan2(dy, dx));
  4970. }
  4971. };
  4972. /***/ }),
  4973. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js":
  4974. /*!*********************************************************************!*\
  4975. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js ***!
  4976. \*********************************************************************/
  4977. /*! no static exports found */
  4978. /***/ (function(module, exports, __webpack_require__) {
  4979. "use strict";
  4980. Object.defineProperty(exports, "__esModule", {
  4981. value: true
  4982. });
  4983. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  4984. var EPSILON = 0.0001;
  4985. /**
  4986. * 使用牛顿切割法求最近的点
  4987. * @param {number[]} xArr 点的 x 数组
  4988. * @param {number[]} yArr 点的 y 数组
  4989. * @param {number} x 指定的点 x
  4990. * @param {number} y 指定的点 y
  4991. * @param {Function} tCallback 差值函数
  4992. */
  4993. function nearestPoint(xArr, yArr, x, y, tCallback) {
  4994. var t;
  4995. var interval = 0.005;
  4996. var d = Infinity;
  4997. var v0 = [x, y];
  4998. for (var i = 0; i <= 20; i++) {
  4999. var _t = i * 0.05;
  5000. var v1 = [tCallback.apply(null, xArr.concat([_t])), tCallback.apply(null, yArr.concat([_t]))];
  5001. var d1 = util_1.distance(v0[0], v0[1], v1[0], v1[1]);
  5002. if (d1 < d) {
  5003. t = _t;
  5004. d = d1;
  5005. }
  5006. } // 提前终止
  5007. if (t === 0) {
  5008. return {
  5009. x: xArr[0],
  5010. y: yArr[0]
  5011. };
  5012. }
  5013. if (t === 1) {
  5014. var count = xArr.length;
  5015. return {
  5016. x: xArr[count - 1],
  5017. y: yArr[count - 1]
  5018. };
  5019. }
  5020. d = Infinity;
  5021. for (var i = 0; i < 32; i++) {
  5022. if (interval < EPSILON) {
  5023. break;
  5024. }
  5025. var prev = t - interval;
  5026. var next = t + interval;
  5027. var v1 = [tCallback.apply(null, xArr.concat([prev])), tCallback.apply(null, yArr.concat([prev]))];
  5028. var d1 = util_1.distance(v0[0], v0[1], v1[0], v1[1]);
  5029. if (prev >= 0 && d1 < d) {
  5030. t = prev;
  5031. d = d1;
  5032. } else {
  5033. var v2 = [tCallback.apply(null, xArr.concat([next])), tCallback.apply(null, yArr.concat([next]))];
  5034. var d2 = util_1.distance(v0[0], v0[1], v2[0], v2[1]);
  5035. if (next <= 1 && d2 < d) {
  5036. t = next;
  5037. d = d2;
  5038. } else {
  5039. interval *= 0.5;
  5040. }
  5041. }
  5042. }
  5043. return {
  5044. x: tCallback.apply(null, xArr.concat([t])),
  5045. y: tCallback.apply(null, yArr.concat([t]))
  5046. };
  5047. }
  5048. exports.nearestPoint = nearestPoint; // 近似求解 https://community.khronos.org/t/3d-cubic-bezier-segment-length/62363/2
  5049. function snapLength(xArr, yArr) {
  5050. var totalLength = 0;
  5051. var count = xArr.length;
  5052. for (var i = 0; i < count; i++) {
  5053. var x = xArr[i];
  5054. var y = yArr[i];
  5055. var nextX = xArr[(i + 1) % count];
  5056. var nextY = yArr[(i + 1) % count];
  5057. totalLength += util_1.distance(x, y, nextX, nextY);
  5058. }
  5059. return totalLength / 2;
  5060. }
  5061. exports.snapLength = snapLength;
  5062. /***/ }),
  5063. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js":
  5064. /*!********************************************************************!*\
  5065. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js ***!
  5066. \********************************************************************/
  5067. /*! no static exports found */
  5068. /***/ (function(module, exports, __webpack_require__) {
  5069. "use strict";
  5070. Object.defineProperty(exports, "__esModule", {
  5071. value: true
  5072. });
  5073. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  5074. var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
  5075. var bezier_1 = __webpack_require__(/*! ./bezier */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js");
  5076. function cubicAt(p0, p1, p2, p3, t) {
  5077. var onet = 1 - t; // t * t * t 的性能大概是 Math.pow(t, 3) 的三倍
  5078. return onet * onet * onet * p0 + 3 * p1 * t * onet * onet + 3 * p2 * t * t * onet + p3 * t * t * t;
  5079. }
  5080. function derivativeAt(p0, p1, p2, p3, t) {
  5081. var onet = 1 - t;
  5082. return 3 * (onet * onet * (p1 - p0) + 2 * onet * t * (p2 - p1) + t * t * (p3 - p2));
  5083. }
  5084. function extrema(p0, p1, p2, p3) {
  5085. var a = -3 * p0 + 9 * p1 - 9 * p2 + 3 * p3;
  5086. var b = 6 * p0 - 12 * p1 + 6 * p2;
  5087. var c = 3 * p1 - 3 * p0;
  5088. var extremas = [];
  5089. var t1;
  5090. var t2;
  5091. var discSqrt;
  5092. if (util_1.isNumberEqual(a, 0)) {
  5093. if (!util_1.isNumberEqual(b, 0)) {
  5094. t1 = -c / b;
  5095. if (t1 >= 0 && t1 <= 1) {
  5096. extremas.push(t1);
  5097. }
  5098. }
  5099. } else {
  5100. var disc = b * b - 4 * a * c;
  5101. if (util_1.isNumberEqual(disc, 0)) {
  5102. extremas.push(-b / (2 * a));
  5103. } else if (disc > 0) {
  5104. discSqrt = Math.sqrt(disc);
  5105. t1 = (-b + discSqrt) / (2 * a);
  5106. t2 = (-b - discSqrt) / (2 * a);
  5107. if (t1 >= 0 && t1 <= 1) {
  5108. extremas.push(t1);
  5109. }
  5110. if (t2 >= 0 && t2 <= 1) {
  5111. extremas.push(t2);
  5112. }
  5113. }
  5114. }
  5115. return extremas;
  5116. } // 分割贝塞尔曲线
  5117. function divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, t) {
  5118. // 划分点
  5119. var xt = cubicAt(x1, x2, x3, x4, t);
  5120. var yt = cubicAt(y1, y2, y3, y4, t); // 计算两点之间的差值点
  5121. var c1 = line_1.default.pointAt(x1, y1, x2, y2, t);
  5122. var c2 = line_1.default.pointAt(x2, y2, x3, y3, t);
  5123. var c3 = line_1.default.pointAt(x3, y3, x4, y4, t);
  5124. var c12 = line_1.default.pointAt(c1.x, c1.y, c2.x, c2.y, t);
  5125. var c23 = line_1.default.pointAt(c2.x, c2.y, c3.x, c3.y, t);
  5126. return [[x1, y1, c1.x, c1.y, c12.x, c12.y, xt, yt], [xt, yt, c23.x, c23.y, c3.x, c3.y, x4, y4]];
  5127. } // 使用迭代法取贝塞尔曲线的长度,二阶和三阶分开写,更清晰和便于调试
  5128. function cubicLength(x1, y1, x2, y2, x3, y3, x4, y4, iterationCount) {
  5129. if (iterationCount === 0) {
  5130. return bezier_1.snapLength([x1, x2, x3, x4], [y1, y2, y3, y4]);
  5131. }
  5132. var cubics = divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, 0.5);
  5133. var left = cubics[0];
  5134. var right = cubics[1];
  5135. left.push(iterationCount - 1);
  5136. right.push(iterationCount - 1);
  5137. return cubicLength.apply(null, left) + cubicLength.apply(null, right);
  5138. }
  5139. exports.default = {
  5140. extrema: extrema,
  5141. box: function (x1, y1, x2, y2, x3, y3, x4, y4) {
  5142. var xArr = [x1, x4];
  5143. var yArr = [y1, y4];
  5144. var xExtrema = extrema(x1, x2, x3, x4);
  5145. var yExtrema = extrema(y1, y2, y3, y4);
  5146. for (var i = 0; i < xExtrema.length; i++) {
  5147. xArr.push(cubicAt(x1, x2, x3, x4, xExtrema[i]));
  5148. }
  5149. for (var i = 0; i < yExtrema.length; i++) {
  5150. yArr.push(cubicAt(y1, y2, y3, y4, yExtrema[i]));
  5151. }
  5152. return util_1.getBBoxByArray(xArr, yArr);
  5153. },
  5154. length: function (x1, y1, x2, y2, x3, y3, x4, y4) {
  5155. // 迭代三次,划分成 8 段求长度
  5156. return cubicLength(x1, y1, x2, y2, x3, y3, x4, y4, 3);
  5157. },
  5158. nearestPoint: function (x1, y1, x2, y2, x3, y3, x4, y4, x0, y0) {
  5159. return bezier_1.nearestPoint([x1, x2, x3, x4], [y1, y2, y3, y4], x0, y0, cubicAt);
  5160. },
  5161. pointDistance: function (x1, y1, x2, y2, x3, y3, x4, y4, x0, y0) {
  5162. var point = this.nearestPoint(x1, y1, x2, y2, x3, y3, x4, y4, x0, y0);
  5163. return util_1.distance(point.x, point.y, x0, y0);
  5164. },
  5165. interpolationAt: cubicAt,
  5166. pointAt: function (x1, y1, x2, y2, x3, y3, x4, y4, t) {
  5167. return {
  5168. x: cubicAt(x1, x2, x3, x4, t),
  5169. y: cubicAt(y1, y2, y3, y4, t)
  5170. };
  5171. },
  5172. divide: function (x1, y1, x2, y2, x3, y3, x4, y4, t) {
  5173. return divideCubic(x1, y1, x2, y2, x3, y3, x4, y4, t);
  5174. },
  5175. tangentAngle: function (x1, y1, x2, y2, x3, y3, x4, y4, t) {
  5176. var dx = derivativeAt(x1, x2, x3, x4, t);
  5177. var dy = derivativeAt(y1, y2, y3, y4, t);
  5178. return util_1.piMod(Math.atan2(dy, dx));
  5179. }
  5180. };
  5181. /***/ }),
  5182. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/ellipse.js":
  5183. /*!**********************************************************************!*\
  5184. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/ellipse.js ***!
  5185. \**********************************************************************/
  5186. /*! no static exports found */
  5187. /***/ (function(module, exports, __webpack_require__) {
  5188. "use strict";
  5189. /**
  5190. * @fileoverview 椭圆的一些计算,
  5191. * - 周长计算参考:https://www.mathsisfun.com/geometry/ellipse-perimeter.html
  5192. * - 距离计算参考:https://wet-robots.ghost.io/simple-method-for-distance-to-ellipse/
  5193. * @author dxq613@gmail.com
  5194. */
  5195. Object.defineProperty(exports, "__esModule", {
  5196. value: true
  5197. });
  5198. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  5199. function copysign(v1, v2) {
  5200. var absv = Math.abs(v1);
  5201. return v2 > 0 ? absv : absv * -1;
  5202. }
  5203. exports.default = {
  5204. /**
  5205. * 包围盒计算
  5206. * @param {number} x 椭圆中心 x
  5207. * @param {number} y 椭圆中心 y
  5208. * @param {number} rx 椭圆 x 方向半径
  5209. * @param {number} ry 椭圆 y 方向半径
  5210. * @return {object} 包围盒
  5211. */
  5212. box: function (x, y, rx, ry) {
  5213. return {
  5214. x: x - rx,
  5215. y: y - ry,
  5216. width: rx * 2,
  5217. height: ry * 2
  5218. };
  5219. },
  5220. /**
  5221. * 计算周长,使用近似法
  5222. * @param {number} x 椭圆中心 x
  5223. * @param {number} y 椭圆中心 y
  5224. * @param {number} rx 椭圆 x 方向半径
  5225. * @param {number} ry 椭圆 y 方向半径
  5226. * @return {number} 椭圆周长
  5227. */
  5228. length: function (x, y, rx, ry) {
  5229. return Math.PI * (3 * (rx + ry) - Math.sqrt((3 * rx + ry) * (rx + 3 * ry)));
  5230. },
  5231. /**
  5232. * 距离椭圆最近的点
  5233. * @param {number} x 椭圆中心 x
  5234. * @param {number} y 椭圆中心 y
  5235. * @param {number} rx 椭圆 x 方向半径
  5236. * @param {number} ry 椭圆 y 方向半径
  5237. * @param {number} x0 指定的点 x
  5238. * @param {number} y0 指定的点 y
  5239. * @return {object} 椭圆上距离指定点最近的点
  5240. */
  5241. nearestPoint: function (x, y, rx, ry, x0, y0) {
  5242. var a = rx;
  5243. var b = ry; // 假如椭圆半径为0则返回圆心
  5244. if (a === 0 || b === 0) {
  5245. return {
  5246. x: x,
  5247. y: y
  5248. };
  5249. } // 转换成 0, 0 为中心的椭圆计算
  5250. var relativeX = x0 - x;
  5251. var relativeY = y0 - y;
  5252. var px = Math.abs(relativeX);
  5253. var py = Math.abs(relativeY);
  5254. var squareA = a * a;
  5255. var squareB = b * b; // const angle0 = Math.atan2(relativeY, relativeX);
  5256. var t = Math.PI / 4;
  5257. var nearestX; // 椭圆上的任一点
  5258. var nearestY; // 迭代 4 次
  5259. for (var i = 0; i < 4; i++) {
  5260. nearestX = a * Math.cos(t);
  5261. nearestY = b * Math.sin(t);
  5262. var ex = (squareA - squareB) * Math.pow(Math.cos(t), 3) / a;
  5263. var ey = (squareB - squareA) * Math.pow(Math.sin(t), 3) / b;
  5264. var rx1 = nearestX - ex;
  5265. var ry1 = nearestY - ey;
  5266. var qx = px - ex;
  5267. var qy = py - ey;
  5268. var r = Math.hypot(ry1, rx1);
  5269. var q = Math.hypot(qy, qx);
  5270. var delta_c = r * Math.asin((rx1 * qy - ry1 * qx) / (r * q));
  5271. var delta_t = delta_c / Math.sqrt(squareA + squareB - nearestX * nearestX - nearestY * nearestY);
  5272. t += delta_t;
  5273. t = Math.min(Math.PI / 2, Math.max(0, t));
  5274. }
  5275. return {
  5276. x: x + copysign(nearestX, relativeX),
  5277. y: y + copysign(nearestY, relativeY)
  5278. };
  5279. },
  5280. /**
  5281. * 点到椭圆最近的距离
  5282. * @param {number} x 椭圆中心 x
  5283. * @param {number} y 椭圆中心 y
  5284. * @param {number} rx 椭圆 x 方向半径
  5285. * @param {number} ry 椭圆 y 方向半径
  5286. * @param {number} x0 指定的点 x
  5287. * @param {number} y0 指定的点 y
  5288. * @return {number} 点到椭圆的距离
  5289. */
  5290. pointDistance: function (x, y, rx, ry, x0, y0) {
  5291. var nearestPoint = this.nearestPoint(x, y, rx, ry, x0, y0);
  5292. return util_1.distance(nearestPoint.x, nearestPoint.y, x0, y0);
  5293. },
  5294. /**
  5295. * 根据比例获取点
  5296. * @param {number} x 椭圆中心 x
  5297. * @param {number} y 椭圆中心 y
  5298. * @param {number} rx 椭圆 x 方向半径
  5299. * @param {number} ry 椭圆 y 方向半径
  5300. * @param {number} t 指定比例,x轴方向为 0
  5301. * @return {object} 点
  5302. */
  5303. pointAt: function (x, y, rx, ry, t) {
  5304. var angle = 2 * Math.PI * t; // 按照角度进行计算,而不按照周长计算
  5305. return {
  5306. x: x + rx * Math.cos(angle),
  5307. y: y + ry * Math.sin(angle)
  5308. };
  5309. },
  5310. /**
  5311. * 根据比例计算切线角度
  5312. * @param {number} x 椭圆中心 x
  5313. * @param {number} y 椭圆中心 y
  5314. * @param {number} rx 椭圆 x 方向半径
  5315. * @param {number} ry 椭圆 y 方向半径
  5316. * @param {number} t 指定比例 0 - 1 之间,x轴方向为 0。在 0-1 范围之外是循环还是返回 null,还需要调整
  5317. * @return {number} 角度,在 0 - 2PI 之间
  5318. */
  5319. tangentAngle: function (x, y, rx, ry, t) {
  5320. var angle = 2 * Math.PI * t; // 按照角度进行计算,而不按照周长计算
  5321. // 直接使用 x,y 的导数计算, x' = -rx * sin(t); y' = ry * cos(t);
  5322. var tangentAngle = Math.atan2(ry * Math.cos(angle), -rx * Math.sin(angle)); // 也可以使用指定点的切线方程计算,成本有些高
  5323. // const point = this.pointAt(0, 0, rx, ry, t); // 椭圆的切线同椭圆的中心不相关
  5324. // let tangentAngle = -1 * Math.atan((ry * ry * point.x) / (rx * rx * point.y));
  5325. // if (angle >= 0 && angle <= Math.PI) {
  5326. // tangentAngle += Math.PI;
  5327. // }
  5328. return util_1.piMod(tangentAngle);
  5329. }
  5330. };
  5331. /***/ }),
  5332. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js":
  5333. /*!*******************************************************************!*\
  5334. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js ***!
  5335. \*******************************************************************/
  5336. /*! no static exports found */
  5337. /***/ (function(module, exports, __webpack_require__) {
  5338. "use strict";
  5339. Object.defineProperty(exports, "__esModule", {
  5340. value: true
  5341. });
  5342. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  5343. var vec2 = __webpack_require__(/*! gl-matrix/vec2 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js");
  5344. exports.default = {
  5345. /**
  5346. * 计算线段的包围盒
  5347. * @param {number} x1 起始点 x
  5348. * @param {number} y1 起始点 y
  5349. * @param {number} x2 结束点 x
  5350. * @param {number} y2 结束点 y
  5351. * @return {object} 包围盒对象
  5352. */
  5353. box: function (x1, y1, x2, y2) {
  5354. return util_1.getBBoxByArray([x1, x2], [y1, y2]);
  5355. },
  5356. /**
  5357. * 线段的长度
  5358. * @param {number} x1 起始点 x
  5359. * @param {number} y1 起始点 y
  5360. * @param {number} x2 结束点 x
  5361. * @param {number} y2 结束点 y
  5362. * @return {number} 距离
  5363. */
  5364. length: function (x1, y1, x2, y2) {
  5365. return util_1.distance(x1, y1, x2, y2);
  5366. },
  5367. /**
  5368. * 根据比例获取点
  5369. * @param {number} x1 起始点 x
  5370. * @param {number} y1 起始点 y
  5371. * @param {number} x2 结束点 x
  5372. * @param {number} y2 结束点 y
  5373. * @param {number} t 指定比例
  5374. * @return {object} 包含 x, y 的点
  5375. */
  5376. pointAt: function (x1, y1, x2, y2, t) {
  5377. return {
  5378. x: (1 - t) * x1 + t * x2,
  5379. y: (1 - t) * y1 + t * y2
  5380. };
  5381. },
  5382. /**
  5383. * 点到线段的距离
  5384. * @param {number} x1 起始点 x
  5385. * @param {number} y1 起始点 y
  5386. * @param {number} x2 结束点 x
  5387. * @param {number} y2 结束点 y
  5388. * @param {number} x 测试点 x
  5389. * @param {number} y 测试点 y
  5390. * @return {number} 距离
  5391. */
  5392. pointDistance: function (x1, y1, x2, y2, x, y) {
  5393. // 投影距离 x1, y1 的向量,假设 p, p1, p2 三个点,投影点为 a
  5394. // p1a = p1p.p1p2/|p1p2| * (p1p 的单位向量)
  5395. var cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);
  5396. if (cross < 0) {
  5397. return util_1.distance(x1, y1, x, y);
  5398. }
  5399. var lengthSquare = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
  5400. if (cross > lengthSquare) {
  5401. return util_1.distance(x2, y2, x, y);
  5402. }
  5403. return this.pointToLine(x1, y1, x2, y2, x, y);
  5404. },
  5405. /**
  5406. * 点到直线的距离,而不是点到线段的距离
  5407. * @param {number} x1 起始点 x
  5408. * @param {number} y1 起始点 y
  5409. * @param {number} x2 结束点 x
  5410. * @param {number} y2 结束点 y
  5411. * @param {number} x 测试点 x
  5412. * @param {number} y 测试点 y
  5413. * @return {number} 距离
  5414. */
  5415. pointToLine: function (x1, y1, x2, y2, x, y) {
  5416. var d = [x2 - x1, y2 - y1]; // 如果端点相等,则判定点到点的距离
  5417. if (vec2.exactEquals(d, [0, 0])) {
  5418. return Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
  5419. }
  5420. var u = [-d[1], d[0]];
  5421. vec2.normalize(u, u);
  5422. var a = [x - x1, y - y1];
  5423. return Math.abs(vec2.dot(a, u));
  5424. },
  5425. /**
  5426. * 线段的角度
  5427. * @param {number} x1 起始点 x
  5428. * @param {number} y1 起始点 y
  5429. * @param {number} x2 结束点 x
  5430. * @param {number} y2 结束点 y
  5431. * @return {number} 导数
  5432. */
  5433. tangentAngle: function (x1, y1, x2, y2) {
  5434. return Math.atan2(y2 - y1, x2 - x1);
  5435. }
  5436. };
  5437. /***/ }),
  5438. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/polyline.js":
  5439. /*!***********************************************************************!*\
  5440. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/polyline.js ***!
  5441. \***********************************************************************/
  5442. /*! no static exports found */
  5443. /***/ (function(module, exports, __webpack_require__) {
  5444. "use strict";
  5445. Object.defineProperty(exports, "__esModule", {
  5446. value: true
  5447. });
  5448. var segments_1 = __webpack_require__(/*! ./segments */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/segments.js");
  5449. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  5450. exports.default = {
  5451. /**
  5452. * 计算多折线的包围盒
  5453. * @param {array} points 点的集合 [x,y] 的形式
  5454. * @return {object} 包围盒
  5455. */
  5456. box: function (points) {
  5457. var xArr = [];
  5458. var yArr = [];
  5459. for (var i = 0; i < points.length; i++) {
  5460. var point = points[i];
  5461. xArr.push(point[0]);
  5462. yArr.push(point[1]);
  5463. }
  5464. return util_1.getBBoxByArray(xArr, yArr);
  5465. },
  5466. /**
  5467. * 计算多折线的长度
  5468. * @param {array} points 点的集合 [x,y] 的形式
  5469. * @return {object} 多条边的长度
  5470. */
  5471. length: function (points) {
  5472. return segments_1.lengthOfSegment(points);
  5473. },
  5474. /**
  5475. * 根据比例获取多折线的点
  5476. * @param {array} points 点的集合 [x,y] 的形式
  5477. * @param {number} t 在多折线的长度上的比例
  5478. * @return {object} 根据比例值计算出来的点
  5479. */
  5480. pointAt: function (points, t) {
  5481. return segments_1.pointAtSegments(points, t);
  5482. },
  5483. /**
  5484. * 指定点到多折线的距离
  5485. * @param {array} points 点的集合 [x,y] 的形式
  5486. * @param {number} x 指定点的 x
  5487. * @param {number} y 指定点的 y
  5488. * @return {number} 点到多折线的距离
  5489. */
  5490. pointDistance: function (points, x, y) {
  5491. return segments_1.distanceAtSegment(points, x, y);
  5492. },
  5493. /**
  5494. * 根据比例获取多折线的切线角度
  5495. * @param {array} points 点的集合 [x,y] 的形式
  5496. * @param {number} t 在多折线的长度上的比例
  5497. * @return {object} 根据比例值计算出来的角度
  5498. */
  5499. tangentAngle: function (points, t) {
  5500. return segments_1.angleAtSegments(points, t);
  5501. }
  5502. };
  5503. /***/ }),
  5504. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js":
  5505. /*!************************************************************************!*\
  5506. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js ***!
  5507. \************************************************************************/
  5508. /*! no static exports found */
  5509. /***/ (function(module, exports, __webpack_require__) {
  5510. "use strict";
  5511. Object.defineProperty(exports, "__esModule", {
  5512. value: true
  5513. });
  5514. var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
  5515. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  5516. var bezier_1 = __webpack_require__(/*! ./bezier */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/bezier.js"); // 差值公式
  5517. function quadraticAt(p0, p1, p2, t) {
  5518. var onet = 1 - t;
  5519. return onet * onet * p0 + 2 * t * onet * p1 + t * t * p2;
  5520. } // 求极值
  5521. function extrema(p0, p1, p2) {
  5522. var a = p0 + p2 - 2 * p1;
  5523. if (util_1.isNumberEqual(a, 0)) {
  5524. return [0.5];
  5525. }
  5526. var rst = (p0 - p1) / a;
  5527. if (rst <= 1 && rst >= 0) {
  5528. return [rst];
  5529. }
  5530. return [];
  5531. }
  5532. function derivativeAt(p0, p1, p2, t) {
  5533. return 2 * (1 - t) * (p1 - p0) + 2 * t * (p2 - p1);
  5534. } // 分割贝塞尔曲线
  5535. function divideQuadratic(x1, y1, x2, y2, x3, y3, t) {
  5536. // 划分点
  5537. var xt = quadraticAt(x1, x2, x3, t);
  5538. var yt = quadraticAt(y1, y2, y3, t); // 分割的第一条曲线的控制点
  5539. var controlPoint1 = line_1.default.pointAt(x1, y1, x2, y2, t); // 分割的第二条曲线的控制点
  5540. var controlPoint2 = line_1.default.pointAt(x2, y2, x3, y3, t);
  5541. return [[x1, y1, controlPoint1.x, controlPoint1.y, xt, yt], [xt, yt, controlPoint2.x, controlPoint2.y, x3, y3]];
  5542. } // 使用迭代法取贝塞尔曲线的长度
  5543. function quadraticLength(x1, y1, x2, y2, x3, y3, iterationCount) {
  5544. if (iterationCount === 0) {
  5545. return (util_1.distance(x1, y1, x2, y2) + util_1.distance(x2, y2, x3, y3) + util_1.distance(x1, y1, x3, y3)) / 2;
  5546. }
  5547. var quadratics = divideQuadratic(x1, y1, x2, y2, x3, y3, 0.5);
  5548. var left = quadratics[0];
  5549. var right = quadratics[1];
  5550. left.push(iterationCount - 1);
  5551. right.push(iterationCount - 1);
  5552. return quadraticLength.apply(null, left) + quadraticLength.apply(null, right);
  5553. }
  5554. exports.default = {
  5555. box: function (x1, y1, x2, y2, x3, y3) {
  5556. var xExtrema = extrema(x1, x2, x3)[0];
  5557. var yExtrema = extrema(y1, y2, y3)[0]; // 控制点不加入 box 的计算
  5558. var xArr = [x1, x3];
  5559. var yArr = [y1, y3];
  5560. if (xExtrema !== undefined) {
  5561. xArr.push(quadraticAt(x1, x2, x3, xExtrema));
  5562. }
  5563. if (yExtrema !== undefined) {
  5564. yArr.push(quadraticAt(y1, y2, y3, yExtrema));
  5565. }
  5566. return util_1.getBBoxByArray(xArr, yArr);
  5567. },
  5568. length: function (x1, y1, x2, y2, x3, y3) {
  5569. return quadraticLength(x1, y1, x2, y2, x3, y3, 3);
  5570. },
  5571. nearestPoint: function (x1, y1, x2, y2, x3, y3, x0, y0) {
  5572. return bezier_1.nearestPoint([x1, x2, x3], [y1, y2, y3], x0, y0, quadraticAt);
  5573. },
  5574. pointDistance: function (x1, y1, x2, y2, x3, y3, x0, y0) {
  5575. var point = this.nearestPoint(x1, y1, x2, y2, x3, y3, x0, y0);
  5576. return util_1.distance(point.x, point.y, x0, y0);
  5577. },
  5578. interpolationAt: quadraticAt,
  5579. pointAt: function (x1, y1, x2, y2, x3, y3, t) {
  5580. return {
  5581. x: quadraticAt(x1, x2, x3, t),
  5582. y: quadraticAt(y1, y2, y3, t)
  5583. };
  5584. },
  5585. divide: function (x1, y1, x2, y2, x3, y3, t) {
  5586. return divideQuadratic(x1, y1, x2, y2, x3, y3, t);
  5587. },
  5588. tangentAngle: function (x1, y1, x2, y2, x3, y3, t) {
  5589. var dx = derivativeAt(x1, x2, x3, t);
  5590. var dy = derivativeAt(y1, y2, y3, t);
  5591. var angle = Math.atan2(dy, dx);
  5592. return util_1.piMod(angle);
  5593. }
  5594. };
  5595. /***/ }),
  5596. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/segments.js":
  5597. /*!***********************************************************************!*\
  5598. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/segments.js ***!
  5599. \***********************************************************************/
  5600. /*! no static exports found */
  5601. /***/ (function(module, exports, __webpack_require__) {
  5602. "use strict";
  5603. Object.defineProperty(exports, "__esModule", {
  5604. value: true
  5605. });
  5606. var line_1 = __webpack_require__(/*! ./line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
  5607. var util_1 = __webpack_require__(/*! ./util */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js");
  5608. function analyzePoints(points) {
  5609. // 计算每段的长度和总的长度
  5610. var totalLength = 0;
  5611. var segments = [];
  5612. for (var i = 0; i < points.length - 1; i++) {
  5613. var from = points[i];
  5614. var to = points[i + 1];
  5615. var length_1 = util_1.distance(from[0], from[1], to[0], to[1]);
  5616. var seg = {
  5617. from: from,
  5618. to: to,
  5619. length: length_1
  5620. };
  5621. segments.push(seg);
  5622. totalLength += length_1;
  5623. }
  5624. return {
  5625. segments: segments,
  5626. totalLength: totalLength
  5627. };
  5628. }
  5629. function lengthOfSegment(points) {
  5630. if (points.length < 2) {
  5631. return 0;
  5632. }
  5633. var totalLength = 0;
  5634. for (var i = 0; i < points.length - 1; i++) {
  5635. var from = points[i];
  5636. var to = points[i + 1];
  5637. totalLength += util_1.distance(from[0], from[1], to[0], to[1]);
  5638. }
  5639. return totalLength;
  5640. }
  5641. exports.lengthOfSegment = lengthOfSegment;
  5642. /**
  5643. * 按照比例在数据片段中获取点
  5644. * @param {array} points 点的集合
  5645. * @param {number} t 百分比 0-1
  5646. * @return {object} 点的坐标
  5647. */
  5648. function pointAtSegments(points, t) {
  5649. // 边界判断
  5650. if (t > 1 || t < 0 || points.length < 2) {
  5651. return null;
  5652. }
  5653. var _a = analyzePoints(points),
  5654. segments = _a.segments,
  5655. totalLength = _a.totalLength; // 多个点有可能重合
  5656. if (totalLength === 0) {
  5657. return {
  5658. x: points[0][0],
  5659. y: points[0][1]
  5660. };
  5661. } // 计算比例
  5662. var startRatio = 0;
  5663. var point = null;
  5664. for (var i = 0; i < segments.length; i++) {
  5665. var seg = segments[i];
  5666. var from = seg.from,
  5667. to = seg.to;
  5668. var currentRatio = seg.length / totalLength;
  5669. if (t >= startRatio && t <= startRatio + currentRatio) {
  5670. var localRatio = (t - startRatio) / currentRatio;
  5671. point = line_1.default.pointAt(from[0], from[1], to[0], to[1], localRatio);
  5672. break;
  5673. }
  5674. startRatio += currentRatio;
  5675. }
  5676. return point;
  5677. }
  5678. exports.pointAtSegments = pointAtSegments;
  5679. /**
  5680. * 按照比例在数据片段中获取切线的角度
  5681. * @param {array} points 点的集合
  5682. * @param {number} t 百分比 0-1
  5683. */
  5684. function angleAtSegments(points, t) {
  5685. // 边界判断
  5686. if (t > 1 || t < 0 || points.length < 2) {
  5687. return 0;
  5688. }
  5689. var _a = analyzePoints(points),
  5690. segments = _a.segments,
  5691. totalLength = _a.totalLength; // 计算比例
  5692. var startRatio = 0;
  5693. var angle = 0;
  5694. for (var i = 0; i < segments.length; i++) {
  5695. var seg = segments[i];
  5696. var from = seg.from,
  5697. to = seg.to;
  5698. var currentRatio = seg.length / totalLength;
  5699. if (t >= startRatio && t <= startRatio + currentRatio) {
  5700. angle = Math.atan2(to[1] - from[1], to[0] - from[0]);
  5701. break;
  5702. }
  5703. startRatio += currentRatio;
  5704. }
  5705. return angle;
  5706. }
  5707. exports.angleAtSegments = angleAtSegments;
  5708. function distanceAtSegment(points, x, y) {
  5709. var minDistance = Infinity;
  5710. for (var i = 0; i < points.length - 1; i++) {
  5711. var point = points[i];
  5712. var nextPoint = points[i + 1];
  5713. var distance_1 = line_1.default.pointDistance(point[0], point[1], nextPoint[0], nextPoint[1], x, y);
  5714. if (distance_1 < minDistance) {
  5715. minDistance = distance_1;
  5716. }
  5717. }
  5718. return minDistance;
  5719. }
  5720. exports.distanceAtSegment = distanceAtSegment;
  5721. /***/ }),
  5722. /***/ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js":
  5723. /*!*******************************************************************!*\
  5724. !*** ./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/util.js ***!
  5725. \*******************************************************************/
  5726. /*! no static exports found */
  5727. /***/ (function(module, exports, __webpack_require__) {
  5728. "use strict";
  5729. Object.defineProperty(exports, "__esModule", {
  5730. value: true
  5731. });
  5732. function minNum(array) {
  5733. return Math.min.apply(null, array);
  5734. }
  5735. function maxNum(array) {
  5736. return Math.max.apply(null, array);
  5737. }
  5738. /**
  5739. * 两点之间的距离
  5740. * @param {number} x1 起始点 x
  5741. * @param {number} y1 起始点 y
  5742. * @param {number} x2 结束点 x
  5743. * @param {number} y2 结束点 y
  5744. * @return {number} 距离
  5745. */
  5746. function distance(x1, y1, x2, y2) {
  5747. var dx = x1 - x2;
  5748. var dy = y1 - y2;
  5749. return Math.sqrt(dx * dx + dy * dy);
  5750. }
  5751. exports.distance = distance;
  5752. function isNumberEqual(v1, v2) {
  5753. return Math.abs(v1 - v2) < 0.001;
  5754. }
  5755. exports.isNumberEqual = isNumberEqual;
  5756. function getBBoxByArray(xArr, yArr) {
  5757. var minX = minNum(xArr);
  5758. var minY = minNum(yArr);
  5759. var maxX = maxNum(xArr);
  5760. var maxY = maxNum(yArr);
  5761. return {
  5762. x: minX,
  5763. y: minY,
  5764. width: maxX - minX,
  5765. height: maxY - minY
  5766. };
  5767. }
  5768. exports.getBBoxByArray = getBBoxByArray;
  5769. function getBBoxRange(x1, y1, x2, y2) {
  5770. return {
  5771. minX: minNum([x1, x2]),
  5772. maxX: maxNum([x1, x2]),
  5773. minY: minNum([y1, y2]),
  5774. maxY: maxNum([y1, y2])
  5775. };
  5776. }
  5777. exports.getBBoxRange = getBBoxRange;
  5778. function piMod(angle) {
  5779. return (angle + Math.PI * 2) % (Math.PI * 2);
  5780. }
  5781. exports.piMod = piMod;
  5782. /***/ }),
  5783. /***/ "./node_modules/_@antv_matrix-util@3.0.3@@antv/matrix-util/lib/mat3.js":
  5784. /*!*****************************************************************************!*\
  5785. !*** ./node_modules/_@antv_matrix-util@3.0.3@@antv/matrix-util/lib/mat3.js ***!
  5786. \*****************************************************************************/
  5787. /*! no static exports found */
  5788. /***/ (function(module, exports, __webpack_require__) {
  5789. "use strict";
  5790. Object.defineProperty(exports, "__esModule", {
  5791. value: true
  5792. });
  5793. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  5794. tslib_1.__exportStar(__webpack_require__(/*! gl-matrix/mat3 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js"), exports);
  5795. var mat3_1 = __webpack_require__(/*! gl-matrix/mat3 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js");
  5796. function leftTranslate(out, a, v) {
  5797. var transMat = new Array(9);
  5798. mat3_1.fromTranslation(transMat, v);
  5799. return mat3_1.multiply(out, transMat, a);
  5800. }
  5801. function leftRotate(out, a, rad) {
  5802. var rotateMat = new Array(9);
  5803. mat3_1.fromRotation(rotateMat, rad);
  5804. return mat3_1.multiply(out, rotateMat, a);
  5805. }
  5806. function leftScale(out, a, v) {
  5807. var scaleMat = new Array(9);
  5808. mat3_1.fromScaling(scaleMat, v);
  5809. return mat3_1.multiply(out, scaleMat, a);
  5810. }
  5811. function leftMultiply(out, a, a1) {
  5812. return mat3_1.multiply(out, a1, a);
  5813. }
  5814. /**
  5815. * 根据 actions 来做 transform
  5816. * @param m
  5817. * @param actions
  5818. */
  5819. function transform(m, actions) {
  5820. var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];
  5821. for (var i = 0, len = actions.length; i < len; i++) {
  5822. var action = actions[i];
  5823. switch (action[0]) {
  5824. case 't':
  5825. leftTranslate(matrix, matrix, [action[1], action[2]]);
  5826. break;
  5827. case 's':
  5828. leftScale(matrix, matrix, [action[1], action[2]]);
  5829. break;
  5830. case 'r':
  5831. leftRotate(matrix, matrix, action[1]);
  5832. break;
  5833. case 'm':
  5834. leftMultiply(matrix, matrix, action[1]);
  5835. break;
  5836. default:
  5837. break;
  5838. }
  5839. }
  5840. return matrix;
  5841. }
  5842. exports.transform = transform;
  5843. /***/ }),
  5844. /***/ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/ext.js":
  5845. /*!***********************************************************************************!*\
  5846. !*** ./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/ext.js ***!
  5847. \***********************************************************************************/
  5848. /*! exports provided: leftTranslate, leftRotate, leftScale, transform, direction, angleTo, vertical */
  5849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5850. "use strict";
  5851. __webpack_require__.r(__webpack_exports__);
  5852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftTranslate", function() { return leftTranslate; });
  5853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftRotate", function() { return leftRotate; });
  5854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftScale", function() { return leftScale; });
  5855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
  5856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "direction", function() { return direction; });
  5857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angleTo", function() { return angleTo; });
  5858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vertical", function() { return vertical; });
  5859. /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js");
  5860. /**
  5861. * @description 扩展方法,提供 gl-matrix 为提供的方法
  5862. * */
  5863. function leftTranslate(out, a, v) {
  5864. var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];
  5865. gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].fromTranslation(transMat, v);
  5866. return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, transMat, a);
  5867. }
  5868. function leftRotate(out, a, rad) {
  5869. var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];
  5870. gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].fromRotation(rotateMat, rad);
  5871. return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, rotateMat, a);
  5872. }
  5873. function leftScale(out, a, v) {
  5874. var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];
  5875. gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].fromScaling(scaleMat, v);
  5876. return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, scaleMat, a);
  5877. }
  5878. function leftMultiply(out, a, a1) {
  5879. return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"].multiply(out, a1, a);
  5880. }
  5881. /**
  5882. * 根据 actions 来做 transform
  5883. * @param m
  5884. * @param actions
  5885. */
  5886. function transform(m, actions) {
  5887. var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];
  5888. for (var i = 0, len = actions.length; i < len; i++) {
  5889. var action = actions[i];
  5890. switch (action[0]) {
  5891. case 't':
  5892. leftTranslate(matrix, matrix, [action[1], action[2]]);
  5893. break;
  5894. case 's':
  5895. leftScale(matrix, matrix, [action[1], action[2]]);
  5896. break;
  5897. case 'r':
  5898. leftRotate(matrix, matrix, action[1]);
  5899. break;
  5900. case 'm':
  5901. leftMultiply(matrix, matrix, action[1]);
  5902. break;
  5903. default:
  5904. break;
  5905. }
  5906. }
  5907. return matrix;
  5908. }
  5909. /**
  5910. * 向量 v1 到 向量 v2 夹角的方向
  5911. * @param {Array} v1 向量
  5912. * @param {Array} v2 向量
  5913. * @return {Boolean} >= 0 顺时针 < 0 逆时针
  5914. */
  5915. function direction(v1, v2) {
  5916. return v1[0] * v2[1] - v2[0] * v1[1];
  5917. }
  5918. /**
  5919. * 二维向量 v1 到 v2 的夹角
  5920. * @param v1
  5921. * @param v2
  5922. * @param direct
  5923. */
  5924. function angleTo(v1, v2, direct) {
  5925. var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__["vec2"].angle(v1, v2);
  5926. var angleLargeThanPI = direction(v1, v2) >= 0;
  5927. if (direct) {
  5928. if (angleLargeThanPI) {
  5929. return Math.PI * 2 - ang;
  5930. }
  5931. return ang;
  5932. }
  5933. if (angleLargeThanPI) {
  5934. return ang;
  5935. }
  5936. return Math.PI * 2 - ang;
  5937. }
  5938. /**
  5939. * 计算二维向量的垂直向量
  5940. * @param out
  5941. * @param v
  5942. * @param flag
  5943. */
  5944. function vertical(out, v, flag) {
  5945. if (flag) {
  5946. out[0] = v[1];
  5947. out[1] = -1 * v[0];
  5948. } else {
  5949. out[0] = -1 * v[1];
  5950. out[1] = v[0];
  5951. }
  5952. return out;
  5953. }
  5954. /***/ }),
  5955. /***/ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/index.js":
  5956. /*!*************************************************************************************!*\
  5957. !*** ./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/index.js ***!
  5958. \*************************************************************************************/
  5959. /*! exports provided: mat3, vec2, vec3, ext */
  5960. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5961. "use strict";
  5962. __webpack_require__.r(__webpack_exports__);
  5963. /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js");
  5964. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mat3", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["mat3"]; });
  5965. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "vec2", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["vec2"]; });
  5966. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "vec3", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__["vec3"]; });
  5967. /* harmony import */ var _ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ext */ "./node_modules/_@antv_matrix-util@3.1.0-beta.2@@antv/matrix-util/esm/ext.js");
  5968. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ext", function() { return _ext__WEBPACK_IMPORTED_MODULE_1__; });
  5969. /***/ }),
  5970. /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js":
  5971. /*!***********************************************************************************!*\
  5972. !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js ***!
  5973. \***********************************************************************************/
  5974. /*! no static exports found */
  5975. /***/ (function(module, exports, __webpack_require__) {
  5976. "use strict";
  5977. Object.defineProperty(exports, "__esModule", {
  5978. value: true
  5979. });
  5980. var mod_1 = __webpack_require__(/*! @antv/util/lib/mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js");
  5981. var to_radian_1 = __webpack_require__(/*! @antv/util/lib/to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js"); // 向量长度
  5982. function vMag(v) {
  5983. return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
  5984. } // u.v/|u||v|,计算夹角的余弦值
  5985. function vRatio(u, v) {
  5986. // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1
  5987. return vMag(u) * vMag(v) ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)) : 1;
  5988. } // 向量角度
  5989. function vAngle(u, v) {
  5990. return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));
  5991. }
  5992. /**
  5993. * 判断两个点是否重合,点坐标的格式为 [x, y]
  5994. * @param {Array} point1 第一个点
  5995. * @param {Array} point2 第二个点
  5996. */
  5997. function isSamePoint(point1, point2) {
  5998. return point1[0] === point2[0] && point1[1] === point2[1];
  5999. }
  6000. exports.isSamePoint = isSamePoint; // A 0:rx 1:ry 2:x-axis-rotation 3:large-arc-flag 4:sweep-flag 5: x 6: y
  6001. function getArcParams(startPoint, params) {
  6002. var rx = params[1];
  6003. var ry = params[2];
  6004. var xRotation = mod_1.default(to_radian_1.default(params[3]), Math.PI * 2);
  6005. var arcFlag = params[4];
  6006. var sweepFlag = params[5]; // 弧形起点坐标
  6007. var x1 = startPoint[0];
  6008. var y1 = startPoint[1]; // 弧形终点坐标
  6009. var x2 = params[6];
  6010. var y2 = params[7];
  6011. var xp = Math.cos(xRotation) * (x1 - x2) / 2.0 + Math.sin(xRotation) * (y1 - y2) / 2.0;
  6012. var yp = -1 * Math.sin(xRotation) * (x1 - x2) / 2.0 + Math.cos(xRotation) * (y1 - y2) / 2.0;
  6013. var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
  6014. if (lambda > 1) {
  6015. rx *= Math.sqrt(lambda);
  6016. ry *= Math.sqrt(lambda);
  6017. }
  6018. var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);
  6019. var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;
  6020. if (arcFlag === sweepFlag) {
  6021. f *= -1;
  6022. }
  6023. if (isNaN(f)) {
  6024. f = 0;
  6025. } // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理
  6026. var cxp = ry ? f * rx * yp / ry : 0;
  6027. var cyp = rx ? f * -ry * xp / rx : 0; // 椭圆圆心坐标
  6028. var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;
  6029. var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp; // 起始点的单位向量
  6030. var u = [(xp - cxp) / rx, (yp - cyp) / ry]; // 终止点的单位向量
  6031. var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; // 计算起始点和圆心的连线,与 x 轴正方向的夹角
  6032. var theta = vAngle([1, 0], u); // 计算圆弧起始点和终止点与椭圆圆心连线的夹角
  6033. var dTheta = vAngle(u, v);
  6034. if (vRatio(u, v) <= -1) {
  6035. dTheta = Math.PI;
  6036. }
  6037. if (vRatio(u, v) >= 1) {
  6038. dTheta = 0;
  6039. }
  6040. if (sweepFlag === 0 && dTheta > 0) {
  6041. dTheta = dTheta - 2 * Math.PI;
  6042. }
  6043. if (sweepFlag === 1 && dTheta < 0) {
  6044. dTheta = dTheta + 2 * Math.PI;
  6045. }
  6046. return {
  6047. cx: cx,
  6048. cy: cy,
  6049. // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理
  6050. rx: isSamePoint(startPoint, [x2, y2]) ? 0 : rx,
  6051. ry: isSamePoint(startPoint, [x2, y2]) ? 0 : ry,
  6052. startAngle: theta,
  6053. endAngle: theta + dTheta,
  6054. xRotation: xRotation,
  6055. arcFlag: arcFlag,
  6056. sweepFlag: sweepFlag
  6057. };
  6058. }
  6059. exports.default = getArcParams;
  6060. /***/ }),
  6061. /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path-string.js":
  6062. /*!**************************************************************************************!*\
  6063. !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path-string.js ***!
  6064. \**************************************************************************************/
  6065. /*! no static exports found */
  6066. /***/ (function(module, exports, __webpack_require__) {
  6067. "use strict";
  6068. Object.defineProperty(exports, "__esModule", {
  6069. value: true
  6070. });
  6071. var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
  6072. var SPACES = '\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029';
  6073. var PATH_COMMAND = new RegExp('([a-z])[' + SPACES + ',]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', 'ig');
  6074. var PATH_VALUES = new RegExp('(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[' + SPACES + ']*,?[' + SPACES + ']*', 'ig'); // Parses given path string into an array of arrays of path segments
  6075. function parsePathString(pathString) {
  6076. if (!pathString) {
  6077. return null;
  6078. }
  6079. if (is_array_1.default(pathString)) {
  6080. return pathString;
  6081. }
  6082. var paramCounts = {
  6083. a: 7,
  6084. c: 6,
  6085. o: 2,
  6086. h: 1,
  6087. l: 2,
  6088. m: 2,
  6089. r: 4,
  6090. q: 4,
  6091. s: 4,
  6092. t: 2,
  6093. v: 1,
  6094. u: 3,
  6095. z: 0
  6096. };
  6097. var data = [];
  6098. String(pathString).replace(PATH_COMMAND, function (a, b, c) {
  6099. var params = [];
  6100. var name = b.toLowerCase();
  6101. c.replace(PATH_VALUES, function (a, b) {
  6102. b && params.push(+b);
  6103. });
  6104. if (name === 'm' && params.length > 2) {
  6105. data.push([b].concat(params.splice(0, 2)));
  6106. name = 'l';
  6107. b = b === 'm' ? 'l' : 'L';
  6108. }
  6109. if (name === 'o' && params.length === 1) {
  6110. data.push([b, params[0]]);
  6111. }
  6112. if (name === 'r') {
  6113. data.push([b].concat(params));
  6114. } else {
  6115. while (params.length >= paramCounts[name]) {
  6116. data.push([b].concat(params.splice(0, paramCounts[name])));
  6117. if (!paramCounts[name]) {
  6118. break;
  6119. }
  6120. }
  6121. }
  6122. return '';
  6123. });
  6124. return data;
  6125. }
  6126. exports.default = parsePathString;
  6127. /***/ }),
  6128. /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path.js":
  6129. /*!*******************************************************************************!*\
  6130. !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path.js ***!
  6131. \*******************************************************************************/
  6132. /*! no static exports found */
  6133. /***/ (function(module, exports, __webpack_require__) {
  6134. "use strict";
  6135. Object.defineProperty(exports, "__esModule", {
  6136. value: true
  6137. });
  6138. var each_1 = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
  6139. var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
  6140. var is_string_1 = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
  6141. var regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig;
  6142. var regexDot = /[^\s\,]+/ig;
  6143. function parsePath(p) {
  6144. var path = p || [];
  6145. if (is_array_1.default(path)) {
  6146. return path;
  6147. }
  6148. if (is_string_1.default(path)) {
  6149. path = path.match(regexTags);
  6150. each_1.default(path, function (item, index) {
  6151. // @ts-ignore
  6152. item = item.match(regexDot);
  6153. if (item[0].length > 1) {
  6154. var tag = item[0].charAt(0); // @ts-ignore
  6155. item.splice(1, 0, item[0].substr(1)); // @ts-ignore
  6156. item[0] = tag;
  6157. } // @ts-ignore
  6158. each_1.default(item, function (sub, i) {
  6159. if (!isNaN(sub)) {
  6160. // @ts-ignore
  6161. item[i] = +sub;
  6162. }
  6163. }); // @ts-ignore
  6164. path[index] = item;
  6165. });
  6166. return path;
  6167. }
  6168. }
  6169. exports.default = parsePath;
  6170. /***/ }),
  6171. /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js":
  6172. /*!************************************************************************************!*\
  6173. !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js ***!
  6174. \************************************************************************************/
  6175. /*! no static exports found */
  6176. /***/ (function(module, exports, __webpack_require__) {
  6177. "use strict";
  6178. Object.defineProperty(exports, "__esModule", {
  6179. value: true
  6180. });
  6181. var parse_path_string_1 = __webpack_require__(/*! ./parse-path-string */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path-string.js");
  6182. var REGEX_MD = /[a-z]/;
  6183. function toSymmetry(p, c) {
  6184. return [c[0] + (c[0] - p[0]), c[1] + (c[1] - p[1])];
  6185. }
  6186. function pathToAbsolute(pathString) {
  6187. var pathArray = parse_path_string_1.default(pathString);
  6188. if (!pathArray || !pathArray.length) {
  6189. return [['M', 0, 0]];
  6190. }
  6191. var needProcess = false; // 如果存在小写的命令或者 V,H,T,S 则需要处理
  6192. for (var i = 0; i < pathArray.length; i++) {
  6193. var cmd = pathArray[i][0]; // 如果存在相对位置的命令,则中断返回
  6194. if (REGEX_MD.test(cmd) || ['V', 'H', 'T', 'S'].indexOf(cmd) >= 0) {
  6195. needProcess = true;
  6196. break;
  6197. }
  6198. } // 如果不存在相对命令,则直接返回
  6199. // 如果在业务上都写绝对路径,这种方式最快,仅做了一次检测
  6200. if (!needProcess) {
  6201. return pathArray;
  6202. }
  6203. var res = [];
  6204. var x = 0;
  6205. var y = 0;
  6206. var mx = 0;
  6207. var my = 0;
  6208. var start = 0;
  6209. var pa0;
  6210. var dots;
  6211. var first = pathArray[0];
  6212. if (first[0] === 'M' || first[0] === 'm') {
  6213. x = +first[1];
  6214. y = +first[2];
  6215. mx = x;
  6216. my = y;
  6217. start++;
  6218. res[0] = ['M', x, y];
  6219. }
  6220. for (var i = start, ii = pathArray.length; i < ii; i++) {
  6221. var pa = pathArray[i];
  6222. var preParams = res[i - 1]; // 取前一个已经处理后的节点,否则会出现问题
  6223. var r = [];
  6224. var cmd = pa[0];
  6225. var upCmd = cmd.toUpperCase();
  6226. if (cmd !== upCmd) {
  6227. r[0] = upCmd;
  6228. switch (upCmd) {
  6229. case 'A':
  6230. r[1] = pa[1];
  6231. r[2] = pa[2];
  6232. r[3] = pa[3];
  6233. r[4] = pa[4];
  6234. r[5] = pa[5];
  6235. r[6] = +pa[6] + x;
  6236. r[7] = +pa[7] + y;
  6237. break;
  6238. case 'V':
  6239. r[1] = +pa[1] + y;
  6240. break;
  6241. case 'H':
  6242. r[1] = +pa[1] + x;
  6243. break;
  6244. case 'M':
  6245. mx = +pa[1] + x;
  6246. my = +pa[2] + y;
  6247. break;
  6248. // for lint
  6249. default:
  6250. for (var j = 1, jj = pa.length; j < jj; j++) {
  6251. r[j] = +pa[j] + (j % 2 ? x : y);
  6252. }
  6253. }
  6254. } else {
  6255. // 如果本来已经大写,则不处理
  6256. r = pathArray[i];
  6257. } // 需要在外面统一做,同时处理 V,H,S,T 等特殊指令
  6258. switch (upCmd) {
  6259. case 'Z':
  6260. x = +mx;
  6261. y = +my;
  6262. break;
  6263. case 'H':
  6264. x = r[1];
  6265. r = ['L', x, y];
  6266. break;
  6267. case 'V':
  6268. y = r[1];
  6269. r = ['L', x, y];
  6270. break;
  6271. case 'T':
  6272. x = r[1];
  6273. y = r[2]; // 以 x, y 为中心的,上一个控制点的对称点
  6274. // 需要假设上一个节点的命令为 Q
  6275. var symetricT = toSymmetry([preParams[1], preParams[2]], [preParams[3], preParams[4]]);
  6276. r = ['Q', symetricT[0], symetricT[1], x, y];
  6277. break;
  6278. case 'S':
  6279. x = r[r.length - 2];
  6280. y = r[r.length - 1]; // 以 x,y 为中心,取上一个控制点,
  6281. // 需要假设上一个线段为 C 或者 S
  6282. var length_1 = preParams.length;
  6283. var symetricS = toSymmetry([preParams[length_1 - 4], preParams[length_1 - 3]], [preParams[length_1 - 2], preParams[length_1 - 1]]);
  6284. r = ['C', symetricS[0], symetricS[1], r[1], r[2], x, y];
  6285. break;
  6286. case 'M':
  6287. mx = r[r.length - 2];
  6288. my = r[r.length - 1];
  6289. break;
  6290. // for lint
  6291. default:
  6292. x = r[r.length - 2];
  6293. y = r[r.length - 1];
  6294. }
  6295. res.push(r);
  6296. }
  6297. return res;
  6298. }
  6299. exports.default = pathToAbsolute;
  6300. /***/ }),
  6301. /***/ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js":
  6302. /*!************************************************************************************!*\
  6303. !*** ./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js ***!
  6304. \************************************************************************************/
  6305. /*! no static exports found */
  6306. /***/ (function(module, exports, __webpack_require__) {
  6307. "use strict";
  6308. Object.defineProperty(exports, "__esModule", {
  6309. value: true
  6310. });
  6311. var get_arc_params_1 = __webpack_require__(/*! ./get-arc-params */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js");
  6312. var get_arc_params_2 = __webpack_require__(/*! ./get-arc-params */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/get-arc-params.js");
  6313. var parse_path_1 = __webpack_require__(/*! ./parse-path */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/parse-path.js"); // 点对称
  6314. function toSymmetry(point, center) {
  6315. return [center[0] + (center[0] - point[0]), center[1] + (center[1] - point[1])];
  6316. }
  6317. function getSegments(path) {
  6318. path = parse_path_1.default(path);
  6319. var segments = [];
  6320. var currentPoint = null; // 当前图形
  6321. var nextParams = null; // 下一节点的 path 参数
  6322. var startMovePoint = null; // 开始 M 的点,可能会有多个
  6323. var lastStartMovePointIndex = 0; // 最近一个开始点 M 的索引
  6324. var count = path.length;
  6325. for (var i = 0; i < count; i++) {
  6326. var params = path[i];
  6327. nextParams = path[i + 1];
  6328. var command = params[0]; // 数学定义上的参数,便于后面的计算
  6329. var segment = {
  6330. command: command,
  6331. prePoint: currentPoint,
  6332. params: params,
  6333. startTangent: null,
  6334. endTangent: null
  6335. };
  6336. switch (command) {
  6337. case 'M':
  6338. startMovePoint = [params[1], params[2]];
  6339. lastStartMovePointIndex = i;
  6340. break;
  6341. case 'A':
  6342. var arcParams = get_arc_params_1.default(currentPoint, params);
  6343. segment['arcParams'] = arcParams;
  6344. break;
  6345. default:
  6346. break;
  6347. }
  6348. if (command === 'Z') {
  6349. // 有了 Z 后,当前节点从开始 M 的点开始
  6350. currentPoint = startMovePoint; // 如果当前点的命令为 Z,相当于当前点为最近一个 M 点,则下一个点直接指向最近一个 M 点的下一个点
  6351. nextParams = path[lastStartMovePointIndex + 1];
  6352. } else {
  6353. var len = params.length;
  6354. currentPoint = [params[len - 2], params[len - 1]];
  6355. }
  6356. if (nextParams && nextParams[0] === 'Z') {
  6357. // 如果下一个点的命令为 Z,则下一个点直接指向最近一个 M 点
  6358. nextParams = path[lastStartMovePointIndex];
  6359. if (segments[lastStartMovePointIndex]) {
  6360. // 如果下一个点的命令为 Z,则最近一个 M 点的前一个点为当前点
  6361. segments[lastStartMovePointIndex].prePoint = currentPoint;
  6362. }
  6363. }
  6364. segment['currentPoint'] = currentPoint; // 如果当前点与最近一个 M 点相同,则最近一个 M 点的前一个点为当前点的前一个点
  6365. if (segments[lastStartMovePointIndex] && get_arc_params_2.isSamePoint(currentPoint, segments[lastStartMovePointIndex].currentPoint)) {
  6366. segments[lastStartMovePointIndex].prePoint = segment.prePoint;
  6367. }
  6368. var nextPoint = nextParams ? [nextParams[nextParams.length - 2], nextParams[nextParams.length - 1]] : null;
  6369. segment['nextPoint'] = nextPoint; // Add startTangent and endTangent
  6370. var prePoint = segment.prePoint;
  6371. if (['L', 'H', 'V'].includes(command)) {
  6372. segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];
  6373. segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];
  6374. } else if (command === 'Q') {
  6375. // 二次贝塞尔曲线只有一个控制点
  6376. var cp = [params[1], params[2]]; // 二次贝塞尔曲线的终点为 currentPoint
  6377. segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];
  6378. segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];
  6379. } else if (command === 'T') {
  6380. var preSegment = segments[i - 1];
  6381. var cp = toSymmetry(preSegment.currentPoint, prePoint);
  6382. if (preSegment.command === 'Q') {
  6383. segment.command = 'Q';
  6384. segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];
  6385. segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];
  6386. } else {
  6387. segment.command = 'TL';
  6388. segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];
  6389. segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];
  6390. }
  6391. } else if (command === 'C') {
  6392. // 三次贝塞尔曲线有两个控制点
  6393. var cp1 = [params[1], params[2]];
  6394. var cp2 = [params[3], params[4]];
  6395. segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];
  6396. segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];
  6397. } else if (command === 'S') {
  6398. var preSegment = segments[i - 1];
  6399. var cp1 = toSymmetry(preSegment.currentPoint, prePoint);
  6400. var cp2 = [params[1], params[2]];
  6401. if (preSegment.command === 'C') {
  6402. segment.command = 'C'; // 将 S 命令变换为 C 命令
  6403. segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];
  6404. segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];
  6405. } else {
  6406. segment.command = 'SQ'; // 将 S 命令变换为 SQ 命令
  6407. segment.startTangent = [prePoint[0] - cp2[0], prePoint[1] - cp2[1]];
  6408. segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];
  6409. }
  6410. } else if (command === 'A') {
  6411. var d = 0.001;
  6412. var _a = segment['arcParams'] || {},
  6413. _b = _a.cx,
  6414. cx = _b === void 0 ? 0 : _b,
  6415. _c = _a.cy,
  6416. cy = _c === void 0 ? 0 : _c,
  6417. _d = _a.rx,
  6418. rx = _d === void 0 ? 0 : _d,
  6419. _e = _a.ry,
  6420. ry = _e === void 0 ? 0 : _e,
  6421. _f = _a.sweepFlag,
  6422. sweepFlag = _f === void 0 ? 0 : _f,
  6423. _g = _a.startAngle,
  6424. startAngle = _g === void 0 ? 0 : _g,
  6425. _h = _a.endAngle,
  6426. endAngle = _h === void 0 ? 0 : _h;
  6427. if (sweepFlag === 0) {
  6428. d *= -1;
  6429. }
  6430. var dx1 = rx * Math.cos(startAngle - d) + cx;
  6431. var dy1 = ry * Math.sin(startAngle - d) + cy;
  6432. segment.startTangent = [dx1 - startMovePoint[0], dy1 - startMovePoint[1]];
  6433. var dx2 = rx * Math.cos(startAngle + endAngle + d) + cx;
  6434. var dy2 = ry * Math.sin(startAngle + endAngle - d) + cy;
  6435. segment.endTangent = [prePoint[0] - dx2, prePoint[1] - dy2];
  6436. }
  6437. segments.push(segment);
  6438. }
  6439. return segments;
  6440. }
  6441. exports.default = getSegments;
  6442. /***/ }),
  6443. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/augment.js":
  6444. /*!******************************************************************!*\
  6445. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/augment.js ***!
  6446. \******************************************************************/
  6447. /*! exports provided: default */
  6448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6449. "use strict";
  6450. __webpack_require__.r(__webpack_exports__);
  6451. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js");
  6452. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  6453. var augment = function () {
  6454. var args = [];
  6455. for (var _i = 0; _i < arguments.length; _i++) {
  6456. args[_i] = arguments[_i];
  6457. }
  6458. var c = args[0];
  6459. for (var i = 1; i < args.length; i++) {
  6460. var obj = args[i];
  6461. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(obj)) {
  6462. obj = obj.prototype;
  6463. }
  6464. Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(c.prototype, obj);
  6465. }
  6466. };
  6467. /* harmony default export */ __webpack_exports__["default"] = (augment);
  6468. /***/ }),
  6469. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/cache.js":
  6470. /*!****************************************************************!*\
  6471. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/cache.js ***!
  6472. \****************************************************************/
  6473. /*! exports provided: default */
  6474. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6475. "use strict";
  6476. __webpack_require__.r(__webpack_exports__);
  6477. /**
  6478. * k-v 存储
  6479. */
  6480. var default_1 =
  6481. /** @class */
  6482. function () {
  6483. function default_1() {
  6484. this.map = {};
  6485. }
  6486. default_1.prototype.has = function (key) {
  6487. return this.map[key] !== undefined;
  6488. };
  6489. default_1.prototype.get = function (key, def) {
  6490. var v = this.map[key];
  6491. return v === undefined ? def : v;
  6492. };
  6493. default_1.prototype.set = function (key, value) {
  6494. this.map[key] = value;
  6495. };
  6496. default_1.prototype.clear = function () {
  6497. this.map = {};
  6498. };
  6499. default_1.prototype.delete = function (key) {
  6500. delete this.map[key];
  6501. };
  6502. default_1.prototype.size = function () {
  6503. return Object.keys(this.map).length;
  6504. };
  6505. return default_1;
  6506. }();
  6507. /* harmony default export */ __webpack_exports__["default"] = (default_1);
  6508. /***/ }),
  6509. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clamp.js":
  6510. /*!****************************************************************!*\
  6511. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/clamp.js ***!
  6512. \****************************************************************/
  6513. /*! exports provided: default */
  6514. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6515. "use strict";
  6516. __webpack_require__.r(__webpack_exports__);
  6517. var clamp = function (a, min, max) {
  6518. if (a < min) {
  6519. return min;
  6520. } else if (a > max) {
  6521. return max;
  6522. }
  6523. return a;
  6524. };
  6525. /* harmony default export */ __webpack_exports__["default"] = (clamp);
  6526. /***/ }),
  6527. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clear-animation-frame.js":
  6528. /*!********************************************************************************!*\
  6529. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/clear-animation-frame.js ***!
  6530. \********************************************************************************/
  6531. /*! exports provided: default */
  6532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6533. "use strict";
  6534. __webpack_require__.r(__webpack_exports__);
  6535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return cancelAnimationFrame; });
  6536. function cancelAnimationFrame(handler) {
  6537. var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || // @ts-ignore
  6538. window.mozCancelAnimationFrame || // @ts-ignore
  6539. window.msCancelAnimationFrame || clearTimeout;
  6540. method(handler);
  6541. }
  6542. ;
  6543. /***/ }),
  6544. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clone.js":
  6545. /*!****************************************************************!*\
  6546. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/clone.js ***!
  6547. \****************************************************************/
  6548. /*! exports provided: default */
  6549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6550. "use strict";
  6551. __webpack_require__.r(__webpack_exports__);
  6552. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6553. var clone = function (obj) {
  6554. if (typeof obj !== 'object' || obj === null) {
  6555. return obj;
  6556. }
  6557. var rst;
  6558. if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) {
  6559. rst = [];
  6560. for (var i = 0, l = obj.length; i < l; i++) {
  6561. if (typeof obj[i] === 'object' && obj[i] != null) {
  6562. rst[i] = clone(obj[i]);
  6563. } else {
  6564. rst[i] = obj[i];
  6565. }
  6566. }
  6567. } else {
  6568. rst = {};
  6569. for (var k in obj) {
  6570. if (typeof obj[k] === 'object' && obj[k] != null) {
  6571. rst[k] = clone(obj[k]);
  6572. } else {
  6573. rst[k] = obj[k];
  6574. }
  6575. }
  6576. }
  6577. return rst;
  6578. };
  6579. /* harmony default export */ __webpack_exports__["default"] = (clone);
  6580. /***/ }),
  6581. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js":
  6582. /*!*******************************************************************!*\
  6583. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js ***!
  6584. \*******************************************************************/
  6585. /*! exports provided: default */
  6586. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6587. "use strict";
  6588. __webpack_require__.r(__webpack_exports__);
  6589. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  6590. var contains = function (arr, value) {
  6591. if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  6592. return false;
  6593. }
  6594. return arr.indexOf(value) > -1;
  6595. };
  6596. /* harmony default export */ __webpack_exports__["default"] = (contains);
  6597. /***/ }),
  6598. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/debounce.js":
  6599. /*!*******************************************************************!*\
  6600. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/debounce.js ***!
  6601. \*******************************************************************/
  6602. /*! exports provided: default */
  6603. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6604. "use strict";
  6605. __webpack_require__.r(__webpack_exports__);
  6606. function debounce(func, wait, immediate) {
  6607. var timeout;
  6608. return function () {
  6609. var context = this,
  6610. args = arguments;
  6611. var later = function () {
  6612. timeout = null;
  6613. if (!immediate) {
  6614. func.apply(context, args);
  6615. }
  6616. };
  6617. var callNow = immediate && !timeout;
  6618. clearTimeout(timeout);
  6619. timeout = setTimeout(later, wait);
  6620. if (callNow) {
  6621. func.apply(context, args);
  6622. }
  6623. };
  6624. }
  6625. /* harmony default export */ __webpack_exports__["default"] = (debounce);
  6626. /***/ }),
  6627. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/deep-mix.js":
  6628. /*!*******************************************************************!*\
  6629. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/deep-mix.js ***!
  6630. \*******************************************************************/
  6631. /*! exports provided: default */
  6632. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6633. "use strict";
  6634. __webpack_require__.r(__webpack_exports__);
  6635. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6636. /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
  6637. var MAX_MIX_LEVEL = 5;
  6638. function _deepMix(dist, src, level, maxLevel) {
  6639. level = level || 0;
  6640. maxLevel = maxLevel || MAX_MIX_LEVEL;
  6641. for (var key in src) {
  6642. if (src.hasOwnProperty(key)) {
  6643. var value = src[key];
  6644. if (value !== null && Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  6645. if (!Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__["default"])(dist[key])) {
  6646. dist[key] = {};
  6647. }
  6648. if (level < maxLevel) {
  6649. _deepMix(dist[key], value, level + 1, maxLevel);
  6650. } else {
  6651. dist[key] = src[key];
  6652. }
  6653. } else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  6654. dist[key] = [];
  6655. dist[key] = dist[key].concat(value);
  6656. } else if (value !== undefined) {
  6657. dist[key] = value;
  6658. }
  6659. }
  6660. }
  6661. } // todo 重写
  6662. var deepMix = function (rst) {
  6663. var args = [];
  6664. for (var _i = 1; _i < arguments.length; _i++) {
  6665. args[_i - 1] = arguments[_i];
  6666. }
  6667. for (var i = 0; i < args.length; i += 1) {
  6668. _deepMix(rst, args[i]);
  6669. }
  6670. return rst;
  6671. };
  6672. /* harmony default export */ __webpack_exports__["default"] = (deepMix);
  6673. /***/ }),
  6674. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/difference.js":
  6675. /*!*********************************************************************!*\
  6676. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/difference.js ***!
  6677. \*********************************************************************/
  6678. /*! exports provided: default */
  6679. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6680. "use strict";
  6681. __webpack_require__.r(__webpack_exports__);
  6682. /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js");
  6683. /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
  6684. /**
  6685. * Flattens `array` a single level deep.
  6686. *
  6687. * @param {Array} arr The array to inspect.
  6688. * @param {Array} values The values to exclude.
  6689. * @return {Array} Returns the new array of filtered values.
  6690. * @example
  6691. * difference([2, 1], [2, 3]); // => [1]
  6692. */
  6693. var difference = function (arr, values) {
  6694. if (values === void 0) {
  6695. values = [];
  6696. }
  6697. return Object(_filter__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (value) {
  6698. return !Object(_contains__WEBPACK_IMPORTED_MODULE_1__["default"])(values, value);
  6699. });
  6700. };
  6701. /* harmony default export */ __webpack_exports__["default"] = (difference);
  6702. /***/ }),
  6703. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js":
  6704. /*!***************************************************************!*\
  6705. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js ***!
  6706. \***************************************************************/
  6707. /*! exports provided: default */
  6708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6709. "use strict";
  6710. __webpack_require__.r(__webpack_exports__);
  6711. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6712. /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
  6713. function each(elements, func) {
  6714. if (!elements) {
  6715. return;
  6716. }
  6717. var rst;
  6718. if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(elements)) {
  6719. for (var i = 0, len = elements.length; i < len; i++) {
  6720. rst = func(elements[i], i);
  6721. if (rst === false) {
  6722. break;
  6723. }
  6724. }
  6725. } else if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__["default"])(elements)) {
  6726. for (var k in elements) {
  6727. if (elements.hasOwnProperty(k)) {
  6728. rst = func(elements[k], k);
  6729. if (rst === false) {
  6730. break;
  6731. }
  6732. }
  6733. }
  6734. }
  6735. }
  6736. /* harmony default export */ __webpack_exports__["default"] = (each);
  6737. /***/ }),
  6738. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/ends-with.js":
  6739. /*!********************************************************************!*\
  6740. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/ends-with.js ***!
  6741. \********************************************************************/
  6742. /*! exports provided: default */
  6743. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6744. "use strict";
  6745. __webpack_require__.r(__webpack_exports__);
  6746. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6747. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  6748. function endsWith(arr, e) {
  6749. return Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) ? arr[arr.length - 1] === e : false;
  6750. }
  6751. /* harmony default export */ __webpack_exports__["default"] = (endsWith);
  6752. /***/ }),
  6753. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/every.js":
  6754. /*!****************************************************************!*\
  6755. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/every.js ***!
  6756. \****************************************************************/
  6757. /*! exports provided: default */
  6758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6759. "use strict";
  6760. __webpack_require__.r(__webpack_exports__);
  6761. /**
  6762. * 只要有一个不满足条件就返回 false
  6763. * @param arr
  6764. * @param func
  6765. */
  6766. var every = function (arr, func) {
  6767. for (var i = 0; i < arr.length; i++) {
  6768. if (!func(arr[i], i)) return false;
  6769. }
  6770. return true;
  6771. };
  6772. /* harmony default export */ __webpack_exports__["default"] = (every);
  6773. /***/ }),
  6774. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/extend.js":
  6775. /*!*****************************************************************!*\
  6776. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/extend.js ***!
  6777. \*****************************************************************/
  6778. /*! exports provided: default */
  6779. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6780. "use strict";
  6781. __webpack_require__.r(__webpack_exports__);
  6782. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js");
  6783. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  6784. var extend = function (subclass, superclass, overrides, staticOverrides) {
  6785. // 如果只提供父类构造函数,则自动生成子类构造函数
  6786. if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(superclass)) {
  6787. overrides = superclass;
  6788. superclass = subclass;
  6789. subclass = function () {};
  6790. }
  6791. var create = Object.create ? function (proto, c) {
  6792. return Object.create(proto, {
  6793. constructor: {
  6794. value: c
  6795. }
  6796. });
  6797. } : function (proto, c) {
  6798. function Tmp() {}
  6799. Tmp.prototype = proto;
  6800. var o = new Tmp();
  6801. o.constructor = c;
  6802. return o;
  6803. };
  6804. var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype
  6805. subclass.prototype = Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(superObj, subclass.prototype); // 指定子类的prototype
  6806. subclass.superclass = create(superclass.prototype, superclass);
  6807. Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(superObj, overrides);
  6808. Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])(subclass, staticOverrides);
  6809. return subclass;
  6810. };
  6811. /* harmony default export */ __webpack_exports__["default"] = (extend);
  6812. /***/ }),
  6813. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js":
  6814. /*!*****************************************************************!*\
  6815. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js ***!
  6816. \*****************************************************************/
  6817. /*! exports provided: default */
  6818. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6819. "use strict";
  6820. __webpack_require__.r(__webpack_exports__);
  6821. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  6822. var filter = function (arr, func) {
  6823. if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  6824. return arr;
  6825. }
  6826. var result = [];
  6827. for (var index = 0; index < arr.length; index++) {
  6828. var value = arr[index];
  6829. if (func(value, index)) {
  6830. result.push(value);
  6831. }
  6832. }
  6833. return result;
  6834. };
  6835. /* harmony default export */ __webpack_exports__["default"] = (filter);
  6836. /***/ }),
  6837. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find-index.js":
  6838. /*!*********************************************************************!*\
  6839. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/find-index.js ***!
  6840. \*********************************************************************/
  6841. /*! exports provided: default */
  6842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6843. "use strict";
  6844. __webpack_require__.r(__webpack_exports__);
  6845. function findIndex(arr, predicate, fromIndex) {
  6846. if (fromIndex === void 0) {
  6847. fromIndex = 0;
  6848. }
  6849. for (var i = fromIndex; i < arr.length; i++) {
  6850. if (predicate(arr[i], i)) {
  6851. // 找到终止循环
  6852. return i;
  6853. }
  6854. }
  6855. return -1;
  6856. }
  6857. /* harmony default export */ __webpack_exports__["default"] = (findIndex);
  6858. /***/ }),
  6859. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find.js":
  6860. /*!***************************************************************!*\
  6861. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/find.js ***!
  6862. \***************************************************************/
  6863. /*! exports provided: default */
  6864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6865. "use strict";
  6866. __webpack_require__.r(__webpack_exports__);
  6867. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  6868. /* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-match */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js");
  6869. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6870. /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
  6871. function find(arr, predicate) {
  6872. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_2__["default"])(arr)) return null;
  6873. var _predicate;
  6874. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate)) {
  6875. _predicate = predicate;
  6876. }
  6877. if (Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_3__["default"])(predicate)) {
  6878. _predicate = function (a) {
  6879. return Object(_is_match__WEBPACK_IMPORTED_MODULE_1__["default"])(a, predicate);
  6880. };
  6881. }
  6882. if (_predicate) {
  6883. for (var i = 0; i < arr.length; i += 1) {
  6884. if (_predicate(arr[i])) {
  6885. return arr[i];
  6886. }
  6887. }
  6888. }
  6889. return null;
  6890. }
  6891. /* harmony default export */ __webpack_exports__["default"] = (find);
  6892. /***/ }),
  6893. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/first-value.js":
  6894. /*!**********************************************************************!*\
  6895. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/first-value.js ***!
  6896. \**********************************************************************/
  6897. /*! exports provided: default */
  6898. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6899. "use strict";
  6900. __webpack_require__.r(__webpack_exports__);
  6901. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  6902. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6903. var firstValue = function (data, name) {
  6904. var rst = null;
  6905. for (var i = 0; i < data.length; i++) {
  6906. var obj = data[i];
  6907. var value = obj[name];
  6908. if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  6909. if (Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  6910. rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云
  6911. } else {
  6912. rst = value;
  6913. }
  6914. break;
  6915. }
  6916. }
  6917. return rst;
  6918. };
  6919. /* harmony default export */ __webpack_exports__["default"] = (firstValue);
  6920. /***/ }),
  6921. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/fixed-base.js":
  6922. /*!*********************************************************************!*\
  6923. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/fixed-base.js ***!
  6924. \*********************************************************************/
  6925. /*! exports provided: default */
  6926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6927. "use strict";
  6928. __webpack_require__.r(__webpack_exports__);
  6929. var fixedBase = function (v, base) {
  6930. var str = base.toString();
  6931. var index = str.indexOf('.');
  6932. if (index === -1) {
  6933. return Math.round(v);
  6934. }
  6935. var length = str.substr(index + 1).length;
  6936. if (length > 20) {
  6937. length = 20;
  6938. }
  6939. return parseFloat(v.toFixed(length));
  6940. };
  6941. /* harmony default export */ __webpack_exports__["default"] = (fixedBase);
  6942. /***/ }),
  6943. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten-deep.js":
  6944. /*!***********************************************************************!*\
  6945. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten-deep.js ***!
  6946. \***********************************************************************/
  6947. /*! exports provided: default */
  6948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6949. "use strict";
  6950. __webpack_require__.r(__webpack_exports__);
  6951. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6952. /**
  6953. * Flattens `array` a single level deep.
  6954. *
  6955. * @param {Array} arr The array to flatten.
  6956. * @param {Array} result The array to return.
  6957. * @return {Array} Returns the new flattened array.
  6958. * @example
  6959. *
  6960. * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]
  6961. */
  6962. var flattenDeep = function (arr, result) {
  6963. if (result === void 0) {
  6964. result = [];
  6965. }
  6966. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  6967. result.push(arr);
  6968. } else {
  6969. for (var i = 0; i < arr.length; i += 1) {
  6970. flattenDeep(arr[i], result);
  6971. }
  6972. }
  6973. return result;
  6974. };
  6975. /* harmony default export */ __webpack_exports__["default"] = (flattenDeep);
  6976. /***/ }),
  6977. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten.js":
  6978. /*!******************************************************************!*\
  6979. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten.js ***!
  6980. \******************************************************************/
  6981. /*! exports provided: default */
  6982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6983. "use strict";
  6984. __webpack_require__.r(__webpack_exports__);
  6985. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  6986. /**
  6987. * Flattens `array` a single level deep.
  6988. *
  6989. * @param {Array} arr The array to flatten.
  6990. * @return {Array} Returns the new flattened array.
  6991. * @example
  6992. *
  6993. * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]
  6994. */
  6995. var flatten = function (arr) {
  6996. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  6997. return [];
  6998. }
  6999. var rst = [];
  7000. for (var i = 0; i < arr.length; i++) {
  7001. rst = rst.concat(arr[i]);
  7002. }
  7003. return rst;
  7004. };
  7005. /* harmony default export */ __webpack_exports__["default"] = (flatten);
  7006. /***/ }),
  7007. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/for-in.js":
  7008. /*!*****************************************************************!*\
  7009. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/for-in.js ***!
  7010. \*****************************************************************/
  7011. /*! exports provided: default */
  7012. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7013. "use strict";
  7014. __webpack_require__.r(__webpack_exports__);
  7015. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  7016. /* harmony default export */ __webpack_exports__["default"] = (_each__WEBPACK_IMPORTED_MODULE_0__["default"]);
  7017. /***/ }),
  7018. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-range.js":
  7019. /*!********************************************************************!*\
  7020. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-range.js ***!
  7021. \********************************************************************/
  7022. /*! exports provided: default */
  7023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7024. "use strict";
  7025. __webpack_require__.r(__webpack_exports__);
  7026. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  7027. var getRange = function (values) {
  7028. // 存在 NaN 时,min,max 判定会出问题
  7029. var filterValues = values.filter(function (v) {
  7030. return !isNaN(v);
  7031. });
  7032. if (!filterValues.length) {
  7033. // 如果没有数值则直接返回0
  7034. return {
  7035. min: 0,
  7036. max: 0
  7037. };
  7038. }
  7039. if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(values[0])) {
  7040. var tmp = [];
  7041. for (var i = 0; i < values.length; i++) {
  7042. tmp = tmp.concat(values[i]);
  7043. }
  7044. filterValues = tmp;
  7045. }
  7046. var max = Math.max.apply(null, filterValues);
  7047. var min = Math.min.apply(null, filterValues);
  7048. return {
  7049. min: min,
  7050. max: max
  7051. };
  7052. };
  7053. /* harmony default export */ __webpack_exports__["default"] = (getRange);
  7054. /***/ }),
  7055. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js":
  7056. /*!*******************************************************************!*\
  7057. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js ***!
  7058. \*******************************************************************/
  7059. /*! exports provided: default */
  7060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7061. "use strict";
  7062. __webpack_require__.r(__webpack_exports__);
  7063. var toString = {}.toString;
  7064. var getType = function (value) {
  7065. return toString.call(value).replace(/^\[object /, '').replace(/]$/, '');
  7066. };
  7067. /* harmony default export */ __webpack_exports__["default"] = (getType);
  7068. /***/ }),
  7069. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-wrap-behavior.js":
  7070. /*!****************************************************************************!*\
  7071. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-wrap-behavior.js ***!
  7072. \****************************************************************************/
  7073. /*! exports provided: default */
  7074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7075. "use strict";
  7076. __webpack_require__.r(__webpack_exports__);
  7077. /**
  7078. * 获取封装的事件
  7079. * @protected
  7080. * @param {Object} obj 对象
  7081. * @param {String} action 事件名称
  7082. * @return {Function} 返回事件处理函数
  7083. */
  7084. function getWrapBehavior(obj, action) {
  7085. return obj['_wrap_' + action];
  7086. }
  7087. /* harmony default export */ __webpack_exports__["default"] = (getWrapBehavior);
  7088. /***/ }),
  7089. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get.js":
  7090. /*!**************************************************************!*\
  7091. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/get.js ***!
  7092. \**************************************************************/
  7093. /*! exports provided: default */
  7094. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7095. "use strict";
  7096. __webpack_require__.r(__webpack_exports__);
  7097. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  7098. /**
  7099. * https://github.com/developit/dlv/blob/master/index.js
  7100. * @param obj
  7101. * @param key
  7102. * @param defaultValue
  7103. */
  7104. /* harmony default export */ __webpack_exports__["default"] = (function (obj, key, defaultValue) {
  7105. var p = 0;
  7106. var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_0__["default"])(key) ? key.split('.') : key;
  7107. while (obj && p < keyArr.length) {
  7108. obj = obj[keyArr[p++]];
  7109. }
  7110. return obj === undefined || p < keyArr.length ? defaultValue : obj;
  7111. });
  7112. /***/ }),
  7113. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js":
  7114. /*!*******************************************************************!*\
  7115. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js ***!
  7116. \*******************************************************************/
  7117. /*! exports provided: default */
  7118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7119. "use strict";
  7120. __webpack_require__.r(__webpack_exports__);
  7121. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  7122. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  7123. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7124. function groupBy(data, condition) {
  7125. if (!condition || !Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(data)) {
  7126. return {};
  7127. }
  7128. var result = {}; // 兼容方法和 字符串的写法
  7129. var predicate = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(condition) ? condition : function (item) {
  7130. return item[condition];
  7131. };
  7132. var key;
  7133. for (var i = 0; i < data.length; i++) {
  7134. var item = data[i];
  7135. key = predicate(item);
  7136. if (hasOwnProperty.call(result, key)) {
  7137. result[key].push(item);
  7138. } else {
  7139. result[key] = [item];
  7140. }
  7141. }
  7142. return result;
  7143. }
  7144. /* harmony default export */ __webpack_exports__["default"] = (groupBy);
  7145. /***/ }),
  7146. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js":
  7147. /*!***********************************************************************!*\
  7148. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js ***!
  7149. \***********************************************************************/
  7150. /*! exports provided: default */
  7151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7152. "use strict";
  7153. __webpack_require__.r(__webpack_exports__);
  7154. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  7155. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  7156. /* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./group-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js");
  7157. var groupToMap = function (data, condition) {
  7158. if (!condition) {
  7159. return {
  7160. 0: data
  7161. };
  7162. }
  7163. if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(condition)) {
  7164. var paramsCondition_1 = Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(condition) ? condition : condition.replace(/\s+/g, '').split('*');
  7165. condition = function (row) {
  7166. var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序
  7167. for (var i = 0, l = paramsCondition_1.length; i < l; i++) {
  7168. unique += row[paramsCondition_1[i]] && row[paramsCondition_1[i]].toString();
  7169. }
  7170. return unique;
  7171. };
  7172. }
  7173. var groups = Object(_group_by__WEBPACK_IMPORTED_MODULE_2__["default"])(data, condition);
  7174. return groups;
  7175. };
  7176. /* harmony default export */ __webpack_exports__["default"] = (groupToMap);
  7177. /***/ }),
  7178. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group.js":
  7179. /*!****************************************************************!*\
  7180. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/group.js ***!
  7181. \****************************************************************/
  7182. /*! exports provided: default */
  7183. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7184. "use strict";
  7185. __webpack_require__.r(__webpack_exports__);
  7186. /* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./group-to-map */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js");
  7187. /* harmony default export */ __webpack_exports__["default"] = (function (data, condition) {
  7188. if (!condition) {
  7189. // 没有条件,则自身改成数组
  7190. return [data];
  7191. }
  7192. var groups = Object(_group_to_map__WEBPACK_IMPORTED_MODULE_0__["default"])(data, condition);
  7193. var array = [];
  7194. for (var i in groups) {
  7195. array.push(groups[i]);
  7196. }
  7197. return array;
  7198. });
  7199. /***/ }),
  7200. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-key.js":
  7201. /*!******************************************************************!*\
  7202. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-key.js ***!
  7203. \******************************************************************/
  7204. /*! exports provided: default */
  7205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7206. "use strict";
  7207. __webpack_require__.r(__webpack_exports__);
  7208. /* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./has */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js");
  7209. /* harmony default export */ __webpack_exports__["default"] = (_has__WEBPACK_IMPORTED_MODULE_0__["default"]);
  7210. /***/ }),
  7211. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-value.js":
  7212. /*!********************************************************************!*\
  7213. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-value.js ***!
  7214. \********************************************************************/
  7215. /*! exports provided: default */
  7216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7217. "use strict";
  7218. __webpack_require__.r(__webpack_exports__);
  7219. /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
  7220. /* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js");
  7221. /* harmony default export */ __webpack_exports__["default"] = (function (obj, value) {
  7222. return Object(_contains__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values__WEBPACK_IMPORTED_MODULE_1__["default"])(obj), value);
  7223. });
  7224. /***/ }),
  7225. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js":
  7226. /*!**************************************************************!*\
  7227. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js ***!
  7228. \**************************************************************/
  7229. /*! exports provided: default */
  7230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7231. "use strict";
  7232. __webpack_require__.r(__webpack_exports__);
  7233. /* harmony default export */ __webpack_exports__["default"] = (function (obj, key) {
  7234. return obj.hasOwnProperty(key);
  7235. });
  7236. /***/ }),
  7237. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/head.js":
  7238. /*!***************************************************************!*\
  7239. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/head.js ***!
  7240. \***************************************************************/
  7241. /*! exports provided: default */
  7242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7243. "use strict";
  7244. __webpack_require__.r(__webpack_exports__);
  7245. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return head; });
  7246. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  7247. function head(o) {
  7248. if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(o)) {
  7249. return o[0];
  7250. }
  7251. return undefined;
  7252. }
  7253. /***/ }),
  7254. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/identity.js":
  7255. /*!*******************************************************************!*\
  7256. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/identity.js ***!
  7257. \*******************************************************************/
  7258. /*! exports provided: default */
  7259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7260. "use strict";
  7261. __webpack_require__.r(__webpack_exports__);
  7262. /* harmony default export */ __webpack_exports__["default"] = (function (v) {
  7263. return v;
  7264. });
  7265. /***/ }),
  7266. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index-of.js":
  7267. /*!*******************************************************************!*\
  7268. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/index-of.js ***!
  7269. \*******************************************************************/
  7270. /*! exports provided: default */
  7271. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7272. "use strict";
  7273. __webpack_require__.r(__webpack_exports__);
  7274. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  7275. var indexOf = function (arr, obj) {
  7276. if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  7277. return -1;
  7278. }
  7279. var m = Array.prototype.indexOf;
  7280. if (m) {
  7281. return m.call(arr, obj);
  7282. }
  7283. var index = -1;
  7284. for (var i = 0; i < arr.length; i++) {
  7285. if (arr[i] === obj) {
  7286. index = i;
  7287. break;
  7288. }
  7289. }
  7290. return index;
  7291. };
  7292. /* harmony default export */ __webpack_exports__["default"] = (indexOf);
  7293. /***/ }),
  7294. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js":
  7295. /*!****************************************************************!*\
  7296. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js ***!
  7297. \****************************************************************/
  7298. /*! exports provided: contains, includes, difference, find, findIndex, firstValue, flatten, flattenDeep, getRange, pull, pullAt, reduce, remove, sortBy, union, uniq, valuesOfKey, head, last, startsWith, endsWith, filter, every, some, group, groupBy, groupToMap, getWrapBehavior, wrapBehavior, number2color, parseRadius, clamp, fixedBase, isDecimal, isEven, isInteger, isNegative, isNumberEqual, isOdd, isPositive, maxBy, minBy, mod, toDegree, toInteger, toRadian, forIn, has, hasKey, hasValue, keys, isMatch, values, lowerCase, lowerFirst, substitute, upperCase, upperFirst, getType, isArguments, isArray, isArrayLike, isBoolean, isDate, isError, isFunction, isFinite, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isString, isType, isUndefined, isElement, requestAnimationFrame, clearAnimationFrame, augment, clone, debounce, memoize, deepMix, each, extend, indexOf, isEmpty, isEqual, isEqualWith, map, mapValues, mix, assign, get, set, pick, throttle, toArray, toString, uniqueId, noop, identity, size, Cache */
  7299. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7300. "use strict";
  7301. __webpack_require__.r(__webpack_exports__);
  7302. /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
  7303. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  7304. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  7305. /* harmony import */ var _difference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./difference */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/difference.js");
  7306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  7307. /* harmony import */ var _find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./find */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find.js");
  7308. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  7309. /* harmony import */ var _find_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./find-index */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/find-index.js");
  7310. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _find_index__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  7311. /* harmony import */ var _first_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./first-value */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/first-value.js");
  7312. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "firstValue", function() { return _first_value__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  7313. /* harmony import */ var _flatten__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flatten */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten.js");
  7314. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  7315. /* harmony import */ var _flatten_deep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flatten-deep */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/flatten-deep.js");
  7316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flatten_deep__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  7317. /* harmony import */ var _get_range__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-range */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-range.js");
  7318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRange", function() { return _get_range__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  7319. /* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pull */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull.js");
  7320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  7321. /* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pull-at */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js");
  7322. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pull_at__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  7323. /* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reduce */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/reduce.js");
  7324. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  7325. /* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./remove */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/remove.js");
  7326. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  7327. /* harmony import */ var _sort_by__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./sort-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/sort-by.js");
  7328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sort_by__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  7329. /* harmony import */ var _union__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./union */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/union.js");
  7330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  7331. /* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./uniq */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js");
  7332. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  7333. /* harmony import */ var _values_of_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./values-of-key */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values-of-key.js");
  7334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesOfKey", function() { return _values_of_key__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  7335. /* harmony import */ var _head__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./head */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/head.js");
  7336. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  7337. /* harmony import */ var _last__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./last */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/last.js");
  7338. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  7339. /* harmony import */ var _starts_with__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./starts-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/starts-with.js");
  7340. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _starts_with__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  7341. /* harmony import */ var _ends_with__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ends-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/ends-with.js");
  7342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _ends_with__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  7343. /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./filter */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/filter.js");
  7344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  7345. /* harmony import */ var _every__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./every */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/every.js");
  7346. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  7347. /* harmony import */ var _some__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./some */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/some.js");
  7348. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  7349. /* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./group */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group.js");
  7350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "group", function() { return _group__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  7351. /* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./group-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-by.js");
  7352. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _group_by__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  7353. /* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./group-to-map */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/group-to-map.js");
  7354. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupToMap", function() { return _group_to_map__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  7355. /* harmony import */ var _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./get-wrap-behavior */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-wrap-behavior.js");
  7356. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWrapBehavior", function() { return _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  7357. /* harmony import */ var _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./wrap-behavior */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/wrap-behavior.js");
  7358. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapBehavior", function() { return _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  7359. /* harmony import */ var _number2color__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./number2color */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/number2color.js");
  7360. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "number2color", function() { return _number2color__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  7361. /* harmony import */ var _parse_radius__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parse-radius */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/parse-radius.js");
  7362. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseRadius", function() { return _parse_radius__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  7363. /* harmony import */ var _clamp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./clamp */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clamp.js");
  7364. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  7365. /* harmony import */ var _fixed_base__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./fixed-base */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/fixed-base.js");
  7366. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fixedBase", function() { return _fixed_base__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  7367. /* harmony import */ var _is_decimal__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./is-decimal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-decimal.js");
  7368. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDecimal", function() { return _is_decimal__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  7369. /* harmony import */ var _is_even__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./is-even */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-even.js");
  7370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEven", function() { return _is_even__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  7371. /* harmony import */ var _is_integer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./is-integer */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-integer.js");
  7372. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _is_integer__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  7373. /* harmony import */ var _is_negative__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./is-negative */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-negative.js");
  7374. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNegative", function() { return _is_negative__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  7375. /* harmony import */ var _is_number_equal__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number-equal.js");
  7376. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumberEqual", function() { return _is_number_equal__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  7377. /* harmony import */ var _is_odd__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./is-odd */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-odd.js");
  7378. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isOdd", function() { return _is_odd__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  7379. /* harmony import */ var _is_positive__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./is-positive */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-positive.js");
  7380. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPositive", function() { return _is_positive__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  7381. /* harmony import */ var _max_by__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./max-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/max-by.js");
  7382. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _max_by__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  7383. /* harmony import */ var _min_by__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./min-by */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/min-by.js");
  7384. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _min_by__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  7385. /* harmony import */ var _mod__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mod.js");
  7386. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mod", function() { return _mod__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  7387. /* harmony import */ var _to_degree__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./to-degree */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-degree.js");
  7388. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return _to_degree__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  7389. /* harmony import */ var _to_integer__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./to-integer */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-integer.js");
  7390. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _to_integer__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  7391. /* harmony import */ var _to_radian__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-radian.js");
  7392. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toRadian", function() { return _to_radian__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  7393. /* harmony import */ var _for_in__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./for-in */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/for-in.js");
  7394. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _for_in__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  7395. /* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./has */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has.js");
  7396. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  7397. /* harmony import */ var _has_key__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./has-key */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-key.js");
  7398. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasKey", function() { return _has_key__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  7399. /* harmony import */ var _has_value__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./has-value */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/has-value.js");
  7400. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasValue", function() { return _has_value__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  7401. /* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./keys */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js");
  7402. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  7403. /* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./is-match */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js");
  7404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _is_match__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  7405. /* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./values */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js");
  7406. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  7407. /* harmony import */ var _lower_case__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./lower-case */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-case.js");
  7408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lower_case__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  7409. /* harmony import */ var _lower_first__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./lower-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-first.js");
  7410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lower_first__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  7411. /* harmony import */ var _substitute__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./substitute */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/substitute.js");
  7412. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "substitute", function() { return _substitute__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  7413. /* harmony import */ var _upper_case__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./upper-case */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-case.js");
  7414. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upper_case__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  7415. /* harmony import */ var _upper_first__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./upper-first */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-first.js");
  7416. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upper_first__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  7417. /* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./get-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js");
  7418. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getType", function() { return _get_type__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  7419. /* harmony import */ var _is_arguments__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./is-arguments */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-arguments.js");
  7420. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _is_arguments__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  7421. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  7422. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _is_array__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  7423. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  7424. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _is_array_like__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  7425. /* harmony import */ var _is_boolean__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./is-boolean */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-boolean.js");
  7426. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _is_boolean__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  7427. /* harmony import */ var _is_date__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./is-date */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-date.js");
  7428. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _is_date__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  7429. /* harmony import */ var _is_error__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./is-error */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-error.js");
  7430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _is_error__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  7431. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  7432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _is_function__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  7433. /* harmony import */ var _is_finite__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./is-finite */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-finite.js");
  7434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _is_finite__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  7435. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  7436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _is_nil__WEBPACK_IMPORTED_MODULE_66__["default"]; });
  7437. /* harmony import */ var _is_null__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./is-null */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-null.js");
  7438. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _is_null__WEBPACK_IMPORTED_MODULE_67__["default"]; });
  7439. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  7440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _is_number__WEBPACK_IMPORTED_MODULE_68__["default"]; });
  7441. /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
  7442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _is_object__WEBPACK_IMPORTED_MODULE_69__["default"]; });
  7443. /* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js");
  7444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _is_object_like__WEBPACK_IMPORTED_MODULE_70__["default"]; });
  7445. /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
  7446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _is_plain_object__WEBPACK_IMPORTED_MODULE_71__["default"]; });
  7447. /* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./is-prototype */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js");
  7448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPrototype", function() { return _is_prototype__WEBPACK_IMPORTED_MODULE_72__["default"]; });
  7449. /* harmony import */ var _is_reg_exp__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./is-reg-exp */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-reg-exp.js");
  7450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _is_reg_exp__WEBPACK_IMPORTED_MODULE_73__["default"]; });
  7451. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  7452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _is_string__WEBPACK_IMPORTED_MODULE_74__["default"]; });
  7453. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7454. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isType", function() { return _is_type__WEBPACK_IMPORTED_MODULE_75__["default"]; });
  7455. /* harmony import */ var _is_undefined__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./is-undefined */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-undefined.js");
  7456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _is_undefined__WEBPACK_IMPORTED_MODULE_76__["default"]; });
  7457. /* harmony import */ var _is_element__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./is-element */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-element.js");
  7458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _is_element__WEBPACK_IMPORTED_MODULE_77__["default"]; });
  7459. /* harmony import */ var _request_animation_frame__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./request-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/request-animation-frame.js");
  7460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "requestAnimationFrame", function() { return _request_animation_frame__WEBPACK_IMPORTED_MODULE_78__["default"]; });
  7461. /* harmony import */ var _clear_animation_frame__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./clear-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clear-animation-frame.js");
  7462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clearAnimationFrame", function() { return _clear_animation_frame__WEBPACK_IMPORTED_MODULE_79__["default"]; });
  7463. /* harmony import */ var _augment__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./augment */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/augment.js");
  7464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "augment", function() { return _augment__WEBPACK_IMPORTED_MODULE_80__["default"]; });
  7465. /* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./clone */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/clone.js");
  7466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone__WEBPACK_IMPORTED_MODULE_81__["default"]; });
  7467. /* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./debounce */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/debounce.js");
  7468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce__WEBPACK_IMPORTED_MODULE_82__["default"]; });
  7469. /* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./memoize */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/memoize.js");
  7470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize__WEBPACK_IMPORTED_MODULE_83__["default"]; });
  7471. /* harmony import */ var _deep_mix__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./deep-mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/deep-mix.js");
  7472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deepMix", function() { return _deep_mix__WEBPACK_IMPORTED_MODULE_84__["default"]; });
  7473. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  7474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each__WEBPACK_IMPORTED_MODULE_85__["default"]; });
  7475. /* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./extend */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/extend.js");
  7476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend__WEBPACK_IMPORTED_MODULE_86__["default"]; });
  7477. /* harmony import */ var _index_of__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./index-of */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index-of.js");
  7478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _index_of__WEBPACK_IMPORTED_MODULE_87__["default"]; });
  7479. /* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./is-empty */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-empty.js");
  7480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_88__["default"]; });
  7481. /* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./is-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js");
  7482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _is_equal__WEBPACK_IMPORTED_MODULE_89__["default"]; });
  7483. /* harmony import */ var _is_equal_with__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./is-equal-with */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal-with.js");
  7484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _is_equal_with__WEBPACK_IMPORTED_MODULE_90__["default"]; });
  7485. /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./map */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map.js");
  7486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map__WEBPACK_IMPORTED_MODULE_91__["default"]; });
  7487. /* harmony import */ var _map_values__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./map-values */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map-values.js");
  7488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _map_values__WEBPACK_IMPORTED_MODULE_92__["default"]; });
  7489. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./mix */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js");
  7490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _mix__WEBPACK_IMPORTED_MODULE_93__["default"]; });
  7491. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _mix__WEBPACK_IMPORTED_MODULE_93__["default"]; });
  7492. /* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./get */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get.js");
  7493. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get__WEBPACK_IMPORTED_MODULE_94__["default"]; });
  7494. /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./set */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/set.js");
  7495. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set__WEBPACK_IMPORTED_MODULE_95__["default"]; });
  7496. /* harmony import */ var _pick__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./pick */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pick.js");
  7497. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick__WEBPACK_IMPORTED_MODULE_96__["default"]; });
  7498. /* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./throttle */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/throttle.js");
  7499. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle__WEBPACK_IMPORTED_MODULE_97__["default"]; });
  7500. /* harmony import */ var _to_array__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./to-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-array.js");
  7501. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _to_array__WEBPACK_IMPORTED_MODULE_98__["default"]; });
  7502. /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
  7503. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _to_string__WEBPACK_IMPORTED_MODULE_99__["default"]; });
  7504. /* harmony import */ var _unique_id__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./unique-id */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/unique-id.js");
  7505. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _unique_id__WEBPACK_IMPORTED_MODULE_100__["default"]; });
  7506. /* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./noop */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/noop.js");
  7507. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop__WEBPACK_IMPORTED_MODULE_101__["default"]; });
  7508. /* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./identity */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/identity.js");
  7509. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity__WEBPACK_IMPORTED_MODULE_102__["default"]; });
  7510. /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./size */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/size.js");
  7511. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size__WEBPACK_IMPORTED_MODULE_103__["default"]; });
  7512. /* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./cache */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/cache.js");
  7513. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Cache", function() { return _cache__WEBPACK_IMPORTED_MODULE_104__["default"]; });
  7514. // array
  7515. // event
  7516. // format
  7517. // math
  7518. // object
  7519. // string
  7520. // type
  7521. // other
  7522. // 不知道为什么,需要把这个 export,不然 ts 会报类型错误
  7523. /***/ }),
  7524. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-arguments.js":
  7525. /*!***********************************************************************!*\
  7526. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-arguments.js ***!
  7527. \***********************************************************************/
  7528. /*! exports provided: default */
  7529. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7530. "use strict";
  7531. __webpack_require__.r(__webpack_exports__);
  7532. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7533. /**
  7534. * 是否是参数类型
  7535. *
  7536. * @param {Object} value 测试的值
  7537. * @return {Boolean}
  7538. */
  7539. var isArguments = function (value) {
  7540. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Arguments');
  7541. };
  7542. /* harmony default export */ __webpack_exports__["default"] = (isArguments);
  7543. /***/ }),
  7544. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js":
  7545. /*!************************************************************************!*\
  7546. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js ***!
  7547. \************************************************************************/
  7548. /*! exports provided: default */
  7549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7550. "use strict";
  7551. __webpack_require__.r(__webpack_exports__);
  7552. var isArrayLike = function (value) {
  7553. /**
  7554. * isArrayLike([1, 2, 3]) => true
  7555. * isArrayLike(document.body.children) => true
  7556. * isArrayLike('abc') => true
  7557. * isArrayLike(Function) => false
  7558. */
  7559. return value !== null && typeof value !== 'function' && isFinite(value.length);
  7560. };
  7561. /* harmony default export */ __webpack_exports__["default"] = (isArrayLike);
  7562. /***/ }),
  7563. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js":
  7564. /*!*******************************************************************!*\
  7565. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js ***!
  7566. \*******************************************************************/
  7567. /*! exports provided: default */
  7568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7569. "use strict";
  7570. __webpack_require__.r(__webpack_exports__);
  7571. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7572. /* harmony default export */ __webpack_exports__["default"] = (function (value) {
  7573. return Array.isArray ? Array.isArray(value) : Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Array');
  7574. });
  7575. /***/ }),
  7576. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-boolean.js":
  7577. /*!*********************************************************************!*\
  7578. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-boolean.js ***!
  7579. \*********************************************************************/
  7580. /*! exports provided: default */
  7581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7582. "use strict";
  7583. __webpack_require__.r(__webpack_exports__);
  7584. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7585. /**
  7586. * 是否是布尔类型
  7587. *
  7588. * @param {Object} value 测试的值
  7589. * @return {Boolean}
  7590. */
  7591. var isBoolean = function (value) {
  7592. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Boolean');
  7593. };
  7594. /* harmony default export */ __webpack_exports__["default"] = (isBoolean);
  7595. /***/ }),
  7596. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-date.js":
  7597. /*!******************************************************************!*\
  7598. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-date.js ***!
  7599. \******************************************************************/
  7600. /*! exports provided: default */
  7601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7602. "use strict";
  7603. __webpack_require__.r(__webpack_exports__);
  7604. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7605. var isDate = function (value) {
  7606. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Date');
  7607. };
  7608. /* harmony default export */ __webpack_exports__["default"] = (isDate);
  7609. /***/ }),
  7610. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-decimal.js":
  7611. /*!*********************************************************************!*\
  7612. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-decimal.js ***!
  7613. \*********************************************************************/
  7614. /*! exports provided: default */
  7615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7616. "use strict";
  7617. __webpack_require__.r(__webpack_exports__);
  7618. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  7619. var isDecimal = function (num) {
  7620. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 1 !== 0;
  7621. };
  7622. /* harmony default export */ __webpack_exports__["default"] = (isDecimal);
  7623. /***/ }),
  7624. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-element.js":
  7625. /*!*********************************************************************!*\
  7626. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-element.js ***!
  7627. \*********************************************************************/
  7628. /*! exports provided: default */
  7629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7630. "use strict";
  7631. __webpack_require__.r(__webpack_exports__);
  7632. /**
  7633. * 判断是否HTML元素
  7634. * @return {Boolean} 是否HTML元素
  7635. */
  7636. var isElement = function (o) {
  7637. return o instanceof Element || o instanceof HTMLDocument;
  7638. };
  7639. /* harmony default export */ __webpack_exports__["default"] = (isElement);
  7640. /***/ }),
  7641. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-empty.js":
  7642. /*!*******************************************************************!*\
  7643. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-empty.js ***!
  7644. \*******************************************************************/
  7645. /*! exports provided: default */
  7646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7647. "use strict";
  7648. __webpack_require__.r(__webpack_exports__);
  7649. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  7650. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  7651. /* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/get-type.js");
  7652. /* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-prototype */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js");
  7653. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7654. function isEmpty(value) {
  7655. /**
  7656. * isEmpty(null) => true
  7657. * isEmpty() => true
  7658. * isEmpty(true) => true
  7659. * isEmpty(1) => true
  7660. * isEmpty([1, 2, 3]) => false
  7661. * isEmpty('abc') => false
  7662. * isEmpty({ a: 1 }) => false
  7663. */
  7664. if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  7665. return true;
  7666. }
  7667. if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  7668. return !value.length;
  7669. }
  7670. var type = Object(_get_type__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  7671. if (type === 'Map' || type === 'Set') {
  7672. return !value.size;
  7673. }
  7674. if (Object(_is_prototype__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  7675. return !Object.keys(value).length;
  7676. }
  7677. for (var key in value) {
  7678. if (hasOwnProperty.call(value, key)) {
  7679. return false;
  7680. }
  7681. }
  7682. return true;
  7683. }
  7684. /* harmony default export */ __webpack_exports__["default"] = (isEmpty);
  7685. /***/ }),
  7686. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal-with.js":
  7687. /*!************************************************************************!*\
  7688. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal-with.js ***!
  7689. \************************************************************************/
  7690. /*! exports provided: default */
  7691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7692. "use strict";
  7693. __webpack_require__.r(__webpack_exports__);
  7694. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  7695. /* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js");
  7696. /**
  7697. * @param {*} value The value to compare.
  7698. * @param {*} other The other value to compare.
  7699. * @param {Function} [fn] The function to customize comparisons.
  7700. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  7701. * @example
  7702. *
  7703. * function isGreeting(value) {
  7704. * return /^h(?:i|ello)$/.test(value);
  7705. * }
  7706. *
  7707. * function customizer(objValue, othValue) {
  7708. * if (isGreeting(objValue) && isGreeting(othValue)) {
  7709. * return true;
  7710. * }
  7711. * }
  7712. *
  7713. * var array = ['hello', 'goodbye'];
  7714. * var other = ['hi', 'goodbye'];
  7715. *
  7716. * isEqualWith(array, other, customizer); // => true
  7717. */
  7718. /* harmony default export */ __webpack_exports__["default"] = (function (value, other, fn) {
  7719. if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__["default"])(fn)) {
  7720. return Object(_is_equal__WEBPACK_IMPORTED_MODULE_1__["default"])(value, other);
  7721. }
  7722. return !!fn(value, other);
  7723. });
  7724. /***/ }),
  7725. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js":
  7726. /*!*******************************************************************!*\
  7727. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-equal.js ***!
  7728. \*******************************************************************/
  7729. /*! exports provided: default */
  7730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7731. "use strict";
  7732. __webpack_require__.r(__webpack_exports__);
  7733. /* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js");
  7734. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  7735. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  7736. var isEqual = function (value, other) {
  7737. if (value === other) {
  7738. return true;
  7739. }
  7740. if (!value || !other) {
  7741. return false;
  7742. }
  7743. if (Object(_is_string__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_is_string__WEBPACK_IMPORTED_MODULE_2__["default"])(other)) {
  7744. return false;
  7745. }
  7746. if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(value) || Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(other)) {
  7747. if (value.length !== other.length) {
  7748. return false;
  7749. }
  7750. var rst = true;
  7751. for (var i = 0; i < value.length; i++) {
  7752. rst = isEqual(value[i], other[i]);
  7753. if (!rst) {
  7754. break;
  7755. }
  7756. }
  7757. return rst;
  7758. }
  7759. if (Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__["default"])(value) || Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__["default"])(other)) {
  7760. var valueKeys = Object.keys(value);
  7761. var otherKeys = Object.keys(other);
  7762. if (valueKeys.length !== otherKeys.length) {
  7763. return false;
  7764. }
  7765. var rst = true;
  7766. for (var i = 0; i < valueKeys.length; i++) {
  7767. rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);
  7768. if (!rst) {
  7769. break;
  7770. }
  7771. }
  7772. return rst;
  7773. }
  7774. return false;
  7775. };
  7776. /* harmony default export */ __webpack_exports__["default"] = (isEqual);
  7777. /***/ }),
  7778. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-error.js":
  7779. /*!*******************************************************************!*\
  7780. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-error.js ***!
  7781. \*******************************************************************/
  7782. /*! exports provided: default */
  7783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7784. "use strict";
  7785. __webpack_require__.r(__webpack_exports__);
  7786. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7787. /**
  7788. * 是否是参数类型
  7789. *
  7790. * @param {Object} value 测试的值
  7791. * @return {Boolean}
  7792. */
  7793. var isError = function (value) {
  7794. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Error');
  7795. };
  7796. /* harmony default export */ __webpack_exports__["default"] = (isError);
  7797. /***/ }),
  7798. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-even.js":
  7799. /*!******************************************************************!*\
  7800. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-even.js ***!
  7801. \******************************************************************/
  7802. /*! exports provided: default */
  7803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7804. "use strict";
  7805. __webpack_require__.r(__webpack_exports__);
  7806. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  7807. var isEven = function (num) {
  7808. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 2 === 0;
  7809. };
  7810. /* harmony default export */ __webpack_exports__["default"] = (isEven);
  7811. /***/ }),
  7812. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-finite.js":
  7813. /*!********************************************************************!*\
  7814. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-finite.js ***!
  7815. \********************************************************************/
  7816. /*! exports provided: default */
  7817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7818. "use strict";
  7819. __webpack_require__.r(__webpack_exports__);
  7820. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  7821. /**
  7822. * 判断是否为有限数
  7823. * @return {Boolean}
  7824. */
  7825. /* harmony default export */ __webpack_exports__["default"] = (function (value) {
  7826. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && isFinite(value);
  7827. });
  7828. /***/ }),
  7829. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js":
  7830. /*!**********************************************************************!*\
  7831. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js ***!
  7832. \**********************************************************************/
  7833. /*! exports provided: default */
  7834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7835. "use strict";
  7836. __webpack_require__.r(__webpack_exports__);
  7837. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7838. /**
  7839. * 是否为函数
  7840. * @param {*} fn 对象
  7841. * @return {Boolean} 是否函数
  7842. */
  7843. /* harmony default export */ __webpack_exports__["default"] = (function (value) {
  7844. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Function');
  7845. });
  7846. /***/ }),
  7847. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-integer.js":
  7848. /*!*********************************************************************!*\
  7849. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-integer.js ***!
  7850. \*********************************************************************/
  7851. /*! exports provided: default */
  7852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7853. "use strict";
  7854. __webpack_require__.r(__webpack_exports__);
  7855. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  7856. var isInteger = Number.isInteger ? Number.isInteger : function (num) {
  7857. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 1 === 0;
  7858. };
  7859. /* harmony default export */ __webpack_exports__["default"] = (isInteger);
  7860. /***/ }),
  7861. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js":
  7862. /*!*******************************************************************!*\
  7863. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-match.js ***!
  7864. \*******************************************************************/
  7865. /*! exports provided: default */
  7866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7867. "use strict";
  7868. __webpack_require__.r(__webpack_exports__);
  7869. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  7870. /* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js");
  7871. function isMatch(obj, attrs) {
  7872. var _keys = Object(_keys__WEBPACK_IMPORTED_MODULE_1__["default"])(attrs);
  7873. var length = _keys.length;
  7874. if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(obj)) return !length;
  7875. for (var i = 0; i < length; i += 1) {
  7876. var key = _keys[i];
  7877. if (attrs[key] !== obj[key] || !(key in obj)) {
  7878. return false;
  7879. }
  7880. }
  7881. return true;
  7882. }
  7883. /* harmony default export */ __webpack_exports__["default"] = (isMatch);
  7884. /***/ }),
  7885. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-negative.js":
  7886. /*!**********************************************************************!*\
  7887. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-negative.js ***!
  7888. \**********************************************************************/
  7889. /*! exports provided: default */
  7890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7891. "use strict";
  7892. __webpack_require__.r(__webpack_exports__);
  7893. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  7894. var isNegative = function (num) {
  7895. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num < 0;
  7896. };
  7897. /* harmony default export */ __webpack_exports__["default"] = (isNegative);
  7898. /***/ }),
  7899. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js":
  7900. /*!*****************************************************************!*\
  7901. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js ***!
  7902. \*****************************************************************/
  7903. /*! exports provided: default */
  7904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7905. "use strict";
  7906. __webpack_require__.r(__webpack_exports__);
  7907. // isFinite,
  7908. var isNil = function (value) {
  7909. /**
  7910. * isNil(null) => true
  7911. * isNil() => true
  7912. */
  7913. return value === null || value === undefined;
  7914. };
  7915. /* harmony default export */ __webpack_exports__["default"] = (isNil);
  7916. /***/ }),
  7917. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-null.js":
  7918. /*!******************************************************************!*\
  7919. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-null.js ***!
  7920. \******************************************************************/
  7921. /*! exports provided: default */
  7922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7923. "use strict";
  7924. __webpack_require__.r(__webpack_exports__);
  7925. var isNull = function (value) {
  7926. return value === null;
  7927. };
  7928. /* harmony default export */ __webpack_exports__["default"] = (isNull);
  7929. /***/ }),
  7930. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number-equal.js":
  7931. /*!**************************************************************************!*\
  7932. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number-equal.js ***!
  7933. \**************************************************************************/
  7934. /*! exports provided: default */
  7935. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7936. "use strict";
  7937. __webpack_require__.r(__webpack_exports__);
  7938. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isNumberEqual; });
  7939. var PRECISION = 0.00001; // numbers less than this is considered as 0
  7940. function isNumberEqual(a, b, precision) {
  7941. if (precision === void 0) {
  7942. precision = PRECISION;
  7943. }
  7944. return Math.abs(a - b) < precision;
  7945. }
  7946. ;
  7947. /***/ }),
  7948. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js":
  7949. /*!********************************************************************!*\
  7950. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js ***!
  7951. \********************************************************************/
  7952. /*! exports provided: default */
  7953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7954. "use strict";
  7955. __webpack_require__.r(__webpack_exports__);
  7956. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  7957. /**
  7958. * 判断是否数字
  7959. * @return {Boolean} 是否数字
  7960. */
  7961. var isNumber = function (value) {
  7962. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(value, 'Number');
  7963. };
  7964. /* harmony default export */ __webpack_exports__["default"] = (isNumber);
  7965. /***/ }),
  7966. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js":
  7967. /*!*************************************************************************!*\
  7968. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js ***!
  7969. \*************************************************************************/
  7970. /*! exports provided: default */
  7971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7972. "use strict";
  7973. __webpack_require__.r(__webpack_exports__);
  7974. var isObjectLike = function (value) {
  7975. /**
  7976. * isObjectLike({}) => true
  7977. * isObjectLike([1, 2, 3]) => true
  7978. * isObjectLike(Function) => false
  7979. * isObjectLike(null) => false
  7980. */
  7981. return typeof value === 'object' && value !== null;
  7982. };
  7983. /* harmony default export */ __webpack_exports__["default"] = (isObjectLike);
  7984. /***/ }),
  7985. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js":
  7986. /*!********************************************************************!*\
  7987. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js ***!
  7988. \********************************************************************/
  7989. /*! exports provided: default */
  7990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7991. "use strict";
  7992. __webpack_require__.r(__webpack_exports__);
  7993. /* harmony default export */ __webpack_exports__["default"] = (function (value) {
  7994. /**
  7995. * isObject({}) => true
  7996. * isObject([1, 2, 3]) => true
  7997. * isObject(Function) => true
  7998. * isObject(null) => false
  7999. */
  8000. var type = typeof value;
  8001. return value !== null && type === 'object' || type === 'function';
  8002. });
  8003. /***/ }),
  8004. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-odd.js":
  8005. /*!*****************************************************************!*\
  8006. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-odd.js ***!
  8007. \*****************************************************************/
  8008. /*! exports provided: default */
  8009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8010. "use strict";
  8011. __webpack_require__.r(__webpack_exports__);
  8012. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  8013. var isOdd = function (num) {
  8014. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num % 2 !== 0;
  8015. };
  8016. /* harmony default export */ __webpack_exports__["default"] = (isOdd);
  8017. /***/ }),
  8018. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js":
  8019. /*!**************************************************************************!*\
  8020. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js ***!
  8021. \**************************************************************************/
  8022. /*! exports provided: default */
  8023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8024. "use strict";
  8025. __webpack_require__.r(__webpack_exports__);
  8026. /* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object-like.js");
  8027. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  8028. var isPlainObject = function (value) {
  8029. /**
  8030. * isObjectLike(new Foo) => false
  8031. * isObjectLike([1, 2, 3]) => false
  8032. * isObjectLike({ x: 0, y: 0 }) => true
  8033. * isObjectLike(Object.create(null)) => true
  8034. */
  8035. if (!Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__["default"])(value) || !Object(_is_type__WEBPACK_IMPORTED_MODULE_1__["default"])(value, 'Object')) {
  8036. return false;
  8037. }
  8038. if (Object.getPrototypeOf(value) === null) {
  8039. return true;
  8040. }
  8041. var proto = value;
  8042. while (Object.getPrototypeOf(proto) !== null) {
  8043. proto = Object.getPrototypeOf(proto);
  8044. }
  8045. return Object.getPrototypeOf(value) === proto;
  8046. };
  8047. /* harmony default export */ __webpack_exports__["default"] = (isPlainObject);
  8048. /***/ }),
  8049. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-positive.js":
  8050. /*!**********************************************************************!*\
  8051. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-positive.js ***!
  8052. \**********************************************************************/
  8053. /*! exports provided: default */
  8054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8055. "use strict";
  8056. __webpack_require__.r(__webpack_exports__);
  8057. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  8058. var isPositive = function (num) {
  8059. return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__["default"])(num) && num > 0;
  8060. };
  8061. /* harmony default export */ __webpack_exports__["default"] = (isPositive);
  8062. /***/ }),
  8063. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js":
  8064. /*!***********************************************************************!*\
  8065. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-prototype.js ***!
  8066. \***********************************************************************/
  8067. /*! exports provided: default */
  8068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8069. "use strict";
  8070. __webpack_require__.r(__webpack_exports__);
  8071. var objectProto = Object.prototype;
  8072. var isPrototype = function (value) {
  8073. var Ctor = value && value.constructor;
  8074. var proto = typeof Ctor === 'function' && Ctor.prototype || objectProto;
  8075. return value === proto;
  8076. };
  8077. /* harmony default export */ __webpack_exports__["default"] = (isPrototype);
  8078. /***/ }),
  8079. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-reg-exp.js":
  8080. /*!*********************************************************************!*\
  8081. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-reg-exp.js ***!
  8082. \*********************************************************************/
  8083. /*! exports provided: default */
  8084. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8085. "use strict";
  8086. __webpack_require__.r(__webpack_exports__);
  8087. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  8088. var isRegExp = function (str) {
  8089. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(str, 'RegExp');
  8090. };
  8091. /* harmony default export */ __webpack_exports__["default"] = (isRegExp);
  8092. /***/ }),
  8093. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js":
  8094. /*!********************************************************************!*\
  8095. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js ***!
  8096. \********************************************************************/
  8097. /*! exports provided: default */
  8098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8099. "use strict";
  8100. __webpack_require__.r(__webpack_exports__);
  8101. /* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js");
  8102. /* harmony default export */ __webpack_exports__["default"] = (function (str) {
  8103. return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__["default"])(str, 'String');
  8104. });
  8105. /***/ }),
  8106. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js":
  8107. /*!******************************************************************!*\
  8108. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-type.js ***!
  8109. \******************************************************************/
  8110. /*! exports provided: default */
  8111. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8112. "use strict";
  8113. __webpack_require__.r(__webpack_exports__);
  8114. var toString = {}.toString;
  8115. var isType = function (value, type) {
  8116. return toString.call(value) === '[object ' + type + ']';
  8117. };
  8118. /* harmony default export */ __webpack_exports__["default"] = (isType);
  8119. /***/ }),
  8120. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-undefined.js":
  8121. /*!***********************************************************************!*\
  8122. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-undefined.js ***!
  8123. \***********************************************************************/
  8124. /*! exports provided: default */
  8125. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8126. "use strict";
  8127. __webpack_require__.r(__webpack_exports__);
  8128. var isUndefined = function (value) {
  8129. return value === undefined;
  8130. };
  8131. /* harmony default export */ __webpack_exports__["default"] = (isUndefined);
  8132. /***/ }),
  8133. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js":
  8134. /*!***************************************************************!*\
  8135. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/keys.js ***!
  8136. \***************************************************************/
  8137. /*! exports provided: default */
  8138. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8139. "use strict";
  8140. __webpack_require__.r(__webpack_exports__);
  8141. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  8142. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  8143. var keys = Object.keys ? function (obj) {
  8144. return Object.keys(obj);
  8145. } : function (obj) {
  8146. var result = [];
  8147. Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, function (value, key) {
  8148. if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && key === 'prototype')) {
  8149. result.push(key);
  8150. }
  8151. });
  8152. return result;
  8153. };
  8154. /* harmony default export */ __webpack_exports__["default"] = (keys);
  8155. /***/ }),
  8156. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/last.js":
  8157. /*!***************************************************************!*\
  8158. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/last.js ***!
  8159. \***************************************************************/
  8160. /*! exports provided: default */
  8161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8162. "use strict";
  8163. __webpack_require__.r(__webpack_exports__);
  8164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return last; });
  8165. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  8166. function last(o) {
  8167. if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(o)) {
  8168. var arr = o;
  8169. return arr[arr.length - 1];
  8170. }
  8171. return undefined;
  8172. }
  8173. /***/ }),
  8174. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-case.js":
  8175. /*!*********************************************************************!*\
  8176. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-case.js ***!
  8177. \*********************************************************************/
  8178. /*! exports provided: default */
  8179. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8180. "use strict";
  8181. __webpack_require__.r(__webpack_exports__);
  8182. /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
  8183. var lowerCase = function (str) {
  8184. return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(str).toLowerCase();
  8185. };
  8186. /* harmony default export */ __webpack_exports__["default"] = (lowerCase);
  8187. /***/ }),
  8188. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-first.js":
  8189. /*!**********************************************************************!*\
  8190. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/lower-first.js ***!
  8191. \**********************************************************************/
  8192. /*! exports provided: default */
  8193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8194. "use strict";
  8195. __webpack_require__.r(__webpack_exports__);
  8196. /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
  8197. var lowerFirst = function (value) {
  8198. var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  8199. return str.charAt(0).toLowerCase() + str.substring(1);
  8200. };
  8201. /* harmony default export */ __webpack_exports__["default"] = (lowerFirst);
  8202. /***/ }),
  8203. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map-values.js":
  8204. /*!*********************************************************************!*\
  8205. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/map-values.js ***!
  8206. \*********************************************************************/
  8207. /*! exports provided: default */
  8208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8209. "use strict";
  8210. __webpack_require__.r(__webpack_exports__);
  8211. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  8212. /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
  8213. var identity = function (v) {
  8214. return v;
  8215. };
  8216. /* harmony default export */ __webpack_exports__["default"] = (function (object, func) {
  8217. if (func === void 0) {
  8218. func = identity;
  8219. }
  8220. var r = {};
  8221. if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && !Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  8222. Object.keys(object).forEach(function (key) {
  8223. // @ts-ignore
  8224. r[key] = func(object[key], key);
  8225. });
  8226. }
  8227. return r;
  8228. });
  8229. /***/ }),
  8230. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/map.js":
  8231. /*!**************************************************************!*\
  8232. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/map.js ***!
  8233. \**************************************************************/
  8234. /*! exports provided: default */
  8235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8236. "use strict";
  8237. __webpack_require__.r(__webpack_exports__);
  8238. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  8239. var map = function (arr, func) {
  8240. if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  8241. // @ts-ignore
  8242. return arr;
  8243. }
  8244. var result = [];
  8245. for (var index = 0; index < arr.length; index++) {
  8246. var value = arr[index];
  8247. result.push(func(value, index));
  8248. }
  8249. return result;
  8250. };
  8251. /* harmony default export */ __webpack_exports__["default"] = (map);
  8252. /***/ }),
  8253. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/max-by.js":
  8254. /*!*****************************************************************!*\
  8255. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/max-by.js ***!
  8256. \*****************************************************************/
  8257. /*! exports provided: default */
  8258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8259. "use strict";
  8260. __webpack_require__.r(__webpack_exports__);
  8261. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  8262. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  8263. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  8264. /**
  8265. * @param {Array} arr The array to iterate over.
  8266. * @param {Function} [fn] The iteratee invoked per element.
  8267. * @return {*} Returns the maximum value.
  8268. * @example
  8269. *
  8270. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  8271. *
  8272. * maxBy(objects, function(o) { return o.n; });
  8273. * // => { 'n': 2 }
  8274. *
  8275. * maxBy(objects, 'n');
  8276. * // => { 'n': 2 }
  8277. */
  8278. /* harmony default export */ __webpack_exports__["default"] = (function (arr, fn) {
  8279. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) {
  8280. return undefined;
  8281. }
  8282. var max = arr[0];
  8283. var maxData;
  8284. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
  8285. maxData = fn(arr[0]);
  8286. } else {
  8287. maxData = arr[0][fn];
  8288. }
  8289. var data;
  8290. Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (val) {
  8291. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
  8292. data = fn(val);
  8293. } else {
  8294. data = val[fn];
  8295. }
  8296. if (data > maxData) {
  8297. max = val;
  8298. maxData = data;
  8299. }
  8300. });
  8301. return max;
  8302. });
  8303. /***/ }),
  8304. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/memoize.js":
  8305. /*!******************************************************************!*\
  8306. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/memoize.js ***!
  8307. \******************************************************************/
  8308. /*! exports provided: default */
  8309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8310. "use strict";
  8311. __webpack_require__.r(__webpack_exports__);
  8312. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  8313. /**
  8314. * _.memoize(calColor);
  8315. * _.memoize(calColor, (...args) => args[0]);
  8316. * @param f
  8317. * @param resolver
  8318. */
  8319. /* harmony default export */ __webpack_exports__["default"] = (function (f, resolver) {
  8320. if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__["default"])(f)) {
  8321. throw new TypeError('Expected a function');
  8322. }
  8323. var memoized = function () {
  8324. var args = [];
  8325. for (var _i = 0; _i < arguments.length; _i++) {
  8326. args[_i] = arguments[_i];
  8327. } // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key
  8328. var key = resolver ? resolver.apply(this, args) : args[0];
  8329. var cache = memoized.cache;
  8330. if (cache.has(key)) {
  8331. return cache.get(key);
  8332. }
  8333. var result = f.apply(this, args); // 缓存起来
  8334. cache.set(key, result);
  8335. return result;
  8336. };
  8337. memoized.cache = new Map();
  8338. return memoized;
  8339. });
  8340. /***/ }),
  8341. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/min-by.js":
  8342. /*!*****************************************************************!*\
  8343. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/min-by.js ***!
  8344. \*****************************************************************/
  8345. /*! exports provided: default */
  8346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8347. "use strict";
  8348. __webpack_require__.r(__webpack_exports__);
  8349. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  8350. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  8351. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  8352. /**
  8353. * @param {Array} arr The array to iterate over.
  8354. * @param {Function} [fn] The iteratee invoked per element.
  8355. * @return {*} Returns the minimum value.
  8356. * @example
  8357. *
  8358. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  8359. *
  8360. * minBy(objects, function(o) { return o.n; });
  8361. * // => { 'n': 1 }
  8362. *
  8363. * minBy(objects, 'n');
  8364. * // => { 'n': 1 }
  8365. */
  8366. /* harmony default export */ __webpack_exports__["default"] = (function (arr, fn) {
  8367. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) {
  8368. return undefined;
  8369. }
  8370. var min = arr[0];
  8371. var minData;
  8372. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
  8373. minData = fn(arr[0]);
  8374. } else {
  8375. minData = arr[0][fn];
  8376. }
  8377. var data;
  8378. Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (val) {
  8379. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(fn)) {
  8380. data = fn(val);
  8381. } else {
  8382. data = val[fn];
  8383. }
  8384. if (data < minData) {
  8385. min = val;
  8386. minData = data;
  8387. }
  8388. });
  8389. return min;
  8390. });
  8391. /***/ }),
  8392. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js":
  8393. /*!**************************************************************!*\
  8394. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/mix.js ***!
  8395. \**************************************************************/
  8396. /*! exports provided: default */
  8397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8398. "use strict";
  8399. __webpack_require__.r(__webpack_exports__);
  8400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mix; });
  8401. // FIXME: Mutable param should be forbidden in static lang.
  8402. function _mix(dist, obj) {
  8403. for (var key in obj) {
  8404. if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
  8405. dist[key] = obj[key];
  8406. }
  8407. }
  8408. }
  8409. function mix(dist, src1, src2, src3) {
  8410. if (src1) _mix(dist, src1);
  8411. if (src2) _mix(dist, src2);
  8412. if (src3) _mix(dist, src3);
  8413. return dist;
  8414. }
  8415. /***/ }),
  8416. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/mod.js":
  8417. /*!**************************************************************!*\
  8418. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/mod.js ***!
  8419. \**************************************************************/
  8420. /*! exports provided: default */
  8421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8422. "use strict";
  8423. __webpack_require__.r(__webpack_exports__);
  8424. var mod = function (n, m) {
  8425. return (n % m + m) % m;
  8426. };
  8427. /* harmony default export */ __webpack_exports__["default"] = (mod);
  8428. /***/ }),
  8429. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/noop.js":
  8430. /*!***************************************************************!*\
  8431. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/noop.js ***!
  8432. \***************************************************************/
  8433. /*! exports provided: default */
  8434. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8435. "use strict";
  8436. __webpack_require__.r(__webpack_exports__);
  8437. /* harmony default export */ __webpack_exports__["default"] = (function () {});
  8438. /***/ }),
  8439. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/number2color.js":
  8440. /*!***********************************************************************!*\
  8441. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/number2color.js ***!
  8442. \***********************************************************************/
  8443. /*! exports provided: default */
  8444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8445. "use strict";
  8446. __webpack_require__.r(__webpack_exports__);
  8447. var numColorCache = {};
  8448. function numberToColor(num) {
  8449. // 增加缓存
  8450. var color = numColorCache[num];
  8451. if (!color) {
  8452. var str = num.toString(16);
  8453. for (var i = str.length; i < 6; i++) {
  8454. str = '0' + str;
  8455. }
  8456. color = '#' + str;
  8457. numColorCache[num] = color;
  8458. }
  8459. return color;
  8460. }
  8461. /* harmony default export */ __webpack_exports__["default"] = (numberToColor);
  8462. /***/ }),
  8463. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/parse-radius.js":
  8464. /*!***********************************************************************!*\
  8465. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/parse-radius.js ***!
  8466. \***********************************************************************/
  8467. /*! exports provided: default */
  8468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8469. "use strict";
  8470. __webpack_require__.r(__webpack_exports__);
  8471. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  8472. function parseRadius(radius) {
  8473. var r1 = 0,
  8474. r2 = 0,
  8475. r3 = 0,
  8476. r4 = 0;
  8477. if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(radius)) {
  8478. if (radius.length === 1) {
  8479. r1 = r2 = r3 = r4 = radius[0];
  8480. } else if (radius.length === 2) {
  8481. r1 = r3 = radius[0];
  8482. r2 = r4 = radius[1];
  8483. } else if (radius.length === 3) {
  8484. r1 = radius[0];
  8485. r2 = r4 = radius[1];
  8486. r3 = radius[2];
  8487. } else {
  8488. r1 = radius[0];
  8489. r2 = radius[1];
  8490. r3 = radius[2];
  8491. r4 = radius[3];
  8492. }
  8493. } else {
  8494. r1 = r2 = r3 = r4 = radius;
  8495. }
  8496. return {
  8497. r1: r1,
  8498. r2: r2,
  8499. r3: r3,
  8500. r4: r4
  8501. };
  8502. }
  8503. /* harmony default export */ __webpack_exports__["default"] = (parseRadius);
  8504. /***/ }),
  8505. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pick.js":
  8506. /*!***************************************************************!*\
  8507. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/pick.js ***!
  8508. \***************************************************************/
  8509. /*! exports provided: default */
  8510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8511. "use strict";
  8512. __webpack_require__.r(__webpack_exports__);
  8513. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  8514. /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
  8515. var hasOwnProperty = Object.prototype.hasOwnProperty;
  8516. /* harmony default export */ __webpack_exports__["default"] = (function (object, keys) {
  8517. if (object === null || !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__["default"])(object)) {
  8518. return {};
  8519. }
  8520. var result = {};
  8521. Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(keys, function (key) {
  8522. if (hasOwnProperty.call(object, key)) {
  8523. result[key] = object[key];
  8524. }
  8525. });
  8526. return result;
  8527. });
  8528. /***/ }),
  8529. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js":
  8530. /*!******************************************************************!*\
  8531. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js ***!
  8532. \******************************************************************/
  8533. /*! exports provided: default */
  8534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8535. "use strict";
  8536. __webpack_require__.r(__webpack_exports__);
  8537. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  8538. var splice = Array.prototype.splice;
  8539. var pullAt = function pullAt(arr, indexes) {
  8540. if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  8541. return [];
  8542. }
  8543. var length = arr ? indexes.length : 0;
  8544. var last = length - 1;
  8545. while (length--) {
  8546. var previous = void 0;
  8547. var index = indexes[length];
  8548. if (length === last || index !== previous) {
  8549. previous = index;
  8550. splice.call(arr, index, 1);
  8551. }
  8552. }
  8553. return arr;
  8554. };
  8555. /* harmony default export */ __webpack_exports__["default"] = (pullAt);
  8556. /***/ }),
  8557. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull.js":
  8558. /*!***************************************************************!*\
  8559. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull.js ***!
  8560. \***************************************************************/
  8561. /*! exports provided: default */
  8562. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8563. "use strict";
  8564. __webpack_require__.r(__webpack_exports__);
  8565. var arrPrototype = Array.prototype;
  8566. var splice = arrPrototype.splice;
  8567. var indexOf = arrPrototype.indexOf;
  8568. var pull = function (arr) {
  8569. var values = [];
  8570. for (var _i = 1; _i < arguments.length; _i++) {
  8571. values[_i - 1] = arguments[_i];
  8572. }
  8573. for (var i = 0; i < values.length; i++) {
  8574. var value = values[i];
  8575. var fromIndex = -1;
  8576. while ((fromIndex = indexOf.call(arr, value)) > -1) {
  8577. splice.call(arr, fromIndex, 1);
  8578. }
  8579. }
  8580. return arr;
  8581. };
  8582. /* harmony default export */ __webpack_exports__["default"] = (pull);
  8583. /***/ }),
  8584. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/reduce.js":
  8585. /*!*****************************************************************!*\
  8586. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/reduce.js ***!
  8587. \*****************************************************************/
  8588. /*! exports provided: default */
  8589. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8590. "use strict";
  8591. __webpack_require__.r(__webpack_exports__);
  8592. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  8593. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  8594. /* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-plain-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-plain-object.js");
  8595. var reduce = function (arr, fn, init) {
  8596. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) && !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_2__["default"])(arr)) {
  8597. return arr;
  8598. }
  8599. var result = init;
  8600. Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, function (data, i) {
  8601. result = fn(result, data, i);
  8602. });
  8603. return result;
  8604. };
  8605. /* harmony default export */ __webpack_exports__["default"] = (reduce);
  8606. /***/ }),
  8607. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/remove.js":
  8608. /*!*****************************************************************!*\
  8609. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/remove.js ***!
  8610. \*****************************************************************/
  8611. /*! exports provided: default */
  8612. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8613. "use strict";
  8614. __webpack_require__.r(__webpack_exports__);
  8615. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  8616. /* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pull-at */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/pull-at.js");
  8617. var remove = function (arr, predicate) {
  8618. /**
  8619. * const arr = [1, 2, 3, 4]
  8620. * const evens = remove(arr, n => n % 2 == 0)
  8621. * console.log(arr) // => [1, 3]
  8622. * console.log(evens) // => [2, 4]
  8623. */
  8624. var result = [];
  8625. if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(arr)) {
  8626. return result;
  8627. }
  8628. var i = -1;
  8629. var indexes = [];
  8630. var length = arr.length;
  8631. while (++i < length) {
  8632. var value = arr[i];
  8633. if (predicate(value, i, arr)) {
  8634. result.push(value);
  8635. indexes.push(i);
  8636. }
  8637. }
  8638. Object(_pull_at__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, indexes);
  8639. return result;
  8640. };
  8641. /* harmony default export */ __webpack_exports__["default"] = (remove);
  8642. /***/ }),
  8643. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/request-animation-frame.js":
  8644. /*!**********************************************************************************!*\
  8645. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/request-animation-frame.js ***!
  8646. \**********************************************************************************/
  8647. /*! exports provided: default */
  8648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8649. "use strict";
  8650. __webpack_require__.r(__webpack_exports__);
  8651. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return requestAnimationFrame; });
  8652. function requestAnimationFrame(fn) {
  8653. var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame || // @ts-ignore
  8654. window.mozRequestAnimationFrame || // @ts-ignore
  8655. window.msRequestAnimationFrame || function (f) {
  8656. return setTimeout(f, 16);
  8657. };
  8658. return method(fn);
  8659. }
  8660. ;
  8661. /***/ }),
  8662. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/set.js":
  8663. /*!**************************************************************!*\
  8664. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/set.js ***!
  8665. \**************************************************************/
  8666. /*! exports provided: default */
  8667. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8668. "use strict";
  8669. __webpack_require__.r(__webpack_exports__);
  8670. /* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-object.js");
  8671. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  8672. /* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-number */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-number.js");
  8673. /**
  8674. * https://github.com/developit/dlv/blob/master/index.js
  8675. * @param obj
  8676. * @param path
  8677. * @param value
  8678. */
  8679. /* harmony default export */ __webpack_exports__["default"] = (function (obj, path, value) {
  8680. var o = obj;
  8681. var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(path) ? path.split('.') : path;
  8682. keyArr.forEach(function (key, idx) {
  8683. // 不是最后一个
  8684. if (idx < keyArr.length - 1) {
  8685. if (!Object(_is_object__WEBPACK_IMPORTED_MODULE_0__["default"])(o[key])) {
  8686. o[key] = Object(_is_number__WEBPACK_IMPORTED_MODULE_2__["default"])(keyArr[idx + 1]) ? [] : {};
  8687. }
  8688. o = o[key];
  8689. } else {
  8690. o[key] = value;
  8691. }
  8692. });
  8693. return obj;
  8694. });
  8695. /***/ }),
  8696. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/size.js":
  8697. /*!***************************************************************!*\
  8698. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/size.js ***!
  8699. \***************************************************************/
  8700. /*! exports provided: default */
  8701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8702. "use strict";
  8703. __webpack_require__.r(__webpack_exports__);
  8704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return size; });
  8705. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  8706. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  8707. function size(o) {
  8708. if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(o)) {
  8709. return 0;
  8710. }
  8711. if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__["default"])(o)) {
  8712. return o.length;
  8713. }
  8714. return Object.keys(o).length;
  8715. }
  8716. /***/ }),
  8717. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/some.js":
  8718. /*!***************************************************************!*\
  8719. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/some.js ***!
  8720. \***************************************************************/
  8721. /*! exports provided: default */
  8722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8723. "use strict";
  8724. __webpack_require__.r(__webpack_exports__);
  8725. /**
  8726. * 只要有一个满足条件就返回 true
  8727. * @param arr
  8728. * @param func
  8729. */
  8730. var some = function (arr, func) {
  8731. for (var i = 0; i < arr.length; i++) {
  8732. if (func(arr[i], i)) return true;
  8733. }
  8734. return false;
  8735. };
  8736. /* harmony default export */ __webpack_exports__["default"] = (some);
  8737. /***/ }),
  8738. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/sort-by.js":
  8739. /*!******************************************************************!*\
  8740. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/sort-by.js ***!
  8741. \******************************************************************/
  8742. /*! exports provided: default */
  8743. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8744. "use strict";
  8745. __webpack_require__.r(__webpack_exports__);
  8746. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  8747. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  8748. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  8749. function sortBy(arr, key) {
  8750. var comparer;
  8751. if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__["default"])(key)) {
  8752. comparer = function (a, b) {
  8753. return key(a) - key(b);
  8754. };
  8755. } else {
  8756. var keys_1 = [];
  8757. if (Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(key)) {
  8758. keys_1.push(key);
  8759. } else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(key)) {
  8760. keys_1 = key;
  8761. }
  8762. comparer = function (a, b) {
  8763. for (var i = 0; i < keys_1.length; i += 1) {
  8764. var prop = keys_1[i];
  8765. if (a[prop] > b[prop]) {
  8766. return 1;
  8767. }
  8768. if (a[prop] < b[prop]) {
  8769. return -1;
  8770. }
  8771. }
  8772. return 0;
  8773. };
  8774. }
  8775. arr.sort(comparer);
  8776. return arr;
  8777. }
  8778. /* harmony default export */ __webpack_exports__["default"] = (sortBy);
  8779. /***/ }),
  8780. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/starts-with.js":
  8781. /*!**********************************************************************!*\
  8782. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/starts-with.js ***!
  8783. \**********************************************************************/
  8784. /*! exports provided: default */
  8785. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8786. "use strict";
  8787. __webpack_require__.r(__webpack_exports__);
  8788. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  8789. /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-string.js");
  8790. function startsWith(arr, e) {
  8791. return Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) ? arr[0] === e : false;
  8792. }
  8793. /* harmony default export */ __webpack_exports__["default"] = (startsWith);
  8794. /***/ }),
  8795. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/substitute.js":
  8796. /*!*********************************************************************!*\
  8797. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/substitute.js ***!
  8798. \*********************************************************************/
  8799. /*! exports provided: default */
  8800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8801. "use strict";
  8802. __webpack_require__.r(__webpack_exports__);
  8803. function substitute(str, o) {
  8804. if (!str || !o) {
  8805. return str;
  8806. }
  8807. return str.replace(/\\?\{([^{}]+)\}/g, function (match, name) {
  8808. if (match.charAt(0) === '\\') {
  8809. return match.slice(1);
  8810. }
  8811. return o[name] === undefined ? '' : o[name];
  8812. });
  8813. }
  8814. /* harmony default export */ __webpack_exports__["default"] = (substitute);
  8815. /***/ }),
  8816. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/throttle.js":
  8817. /*!*******************************************************************!*\
  8818. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/throttle.js ***!
  8819. \*******************************************************************/
  8820. /*! exports provided: default */
  8821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8822. "use strict";
  8823. __webpack_require__.r(__webpack_exports__);
  8824. /* harmony default export */ __webpack_exports__["default"] = (function (func, wait, options) {
  8825. var timeout, context, args, result;
  8826. var previous = 0;
  8827. if (!options) options = {};
  8828. var later = function () {
  8829. previous = options.leading === false ? 0 : Date.now();
  8830. timeout = null;
  8831. result = func.apply(context, args);
  8832. if (!timeout) context = args = null;
  8833. };
  8834. var throttled = function () {
  8835. var now = Date.now();
  8836. if (!previous && options.leading === false) previous = now;
  8837. var remaining = wait - (now - previous);
  8838. context = this;
  8839. args = arguments;
  8840. if (remaining <= 0 || remaining > wait) {
  8841. if (timeout) {
  8842. clearTimeout(timeout);
  8843. timeout = null;
  8844. }
  8845. previous = now;
  8846. result = func.apply(context, args);
  8847. if (!timeout) context = args = null;
  8848. } else if (!timeout && options.trailing !== false) {
  8849. timeout = setTimeout(later, remaining);
  8850. }
  8851. return result;
  8852. };
  8853. throttled.cancel = function () {
  8854. clearTimeout(timeout);
  8855. previous = 0;
  8856. timeout = context = args = null;
  8857. };
  8858. return throttled;
  8859. });
  8860. /***/ }),
  8861. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-array.js":
  8862. /*!*******************************************************************!*\
  8863. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-array.js ***!
  8864. \*******************************************************************/
  8865. /*! exports provided: default */
  8866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8867. "use strict";
  8868. __webpack_require__.r(__webpack_exports__);
  8869. /* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array-like.js");
  8870. /* harmony default export */ __webpack_exports__["default"] = (function (value) {
  8871. return Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? Array.prototype.slice.call(value) : [];
  8872. });
  8873. /***/ }),
  8874. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-degree.js":
  8875. /*!********************************************************************!*\
  8876. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-degree.js ***!
  8877. \********************************************************************/
  8878. /*! exports provided: default */
  8879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8880. "use strict";
  8881. __webpack_require__.r(__webpack_exports__);
  8882. var DEGREE = 180 / Math.PI;
  8883. var toDegree = function (radian) {
  8884. return DEGREE * radian;
  8885. };
  8886. /* harmony default export */ __webpack_exports__["default"] = (toDegree);
  8887. /***/ }),
  8888. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-integer.js":
  8889. /*!*********************************************************************!*\
  8890. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-integer.js ***!
  8891. \*********************************************************************/
  8892. /*! exports provided: default */
  8893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8894. "use strict";
  8895. __webpack_require__.r(__webpack_exports__);
  8896. /* harmony default export */ __webpack_exports__["default"] = (parseInt);
  8897. /***/ }),
  8898. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-radian.js":
  8899. /*!********************************************************************!*\
  8900. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-radian.js ***!
  8901. \********************************************************************/
  8902. /*! exports provided: default */
  8903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8904. "use strict";
  8905. __webpack_require__.r(__webpack_exports__);
  8906. var RADIAN = Math.PI / 180;
  8907. var toRadian = function (degree) {
  8908. return RADIAN * degree;
  8909. };
  8910. /* harmony default export */ __webpack_exports__["default"] = (toRadian);
  8911. /***/ }),
  8912. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js":
  8913. /*!********************************************************************!*\
  8914. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js ***!
  8915. \********************************************************************/
  8916. /*! exports provided: default */
  8917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8918. "use strict";
  8919. __webpack_require__.r(__webpack_exports__);
  8920. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  8921. /* harmony default export */ __webpack_exports__["default"] = (function (value) {
  8922. if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) return '';
  8923. return value.toString();
  8924. });
  8925. /***/ }),
  8926. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/union.js":
  8927. /*!****************************************************************!*\
  8928. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/union.js ***!
  8929. \****************************************************************/
  8930. /*! exports provided: default */
  8931. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8932. "use strict";
  8933. __webpack_require__.r(__webpack_exports__);
  8934. /* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uniq */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js");
  8935. var union = function () {
  8936. var sources = [];
  8937. for (var _i = 0; _i < arguments.length; _i++) {
  8938. sources[_i] = arguments[_i];
  8939. }
  8940. return Object(_uniq__WEBPACK_IMPORTED_MODULE_0__["default"])([].concat.apply([], sources));
  8941. };
  8942. /* harmony default export */ __webpack_exports__["default"] = (union);
  8943. /***/ }),
  8944. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js":
  8945. /*!***************************************************************!*\
  8946. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/uniq.js ***!
  8947. \***************************************************************/
  8948. /*! exports provided: default */
  8949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8950. "use strict";
  8951. __webpack_require__.r(__webpack_exports__);
  8952. /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/contains.js");
  8953. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  8954. var uniq = function (arr) {
  8955. var resultArr = [];
  8956. Object(_each__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, function (item) {
  8957. if (!Object(_contains__WEBPACK_IMPORTED_MODULE_0__["default"])(resultArr, item)) {
  8958. resultArr.push(item);
  8959. }
  8960. });
  8961. return resultArr;
  8962. };
  8963. /* harmony default export */ __webpack_exports__["default"] = (uniq);
  8964. /***/ }),
  8965. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/unique-id.js":
  8966. /*!********************************************************************!*\
  8967. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/unique-id.js ***!
  8968. \********************************************************************/
  8969. /*! exports provided: default */
  8970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8971. "use strict";
  8972. __webpack_require__.r(__webpack_exports__);
  8973. var map = {};
  8974. /* harmony default export */ __webpack_exports__["default"] = (function (prefix) {
  8975. prefix = prefix || 'g';
  8976. if (!map[prefix]) {
  8977. map[prefix] = 1;
  8978. } else {
  8979. map[prefix] += 1;
  8980. }
  8981. return prefix + map[prefix];
  8982. });
  8983. /***/ }),
  8984. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-case.js":
  8985. /*!*********************************************************************!*\
  8986. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-case.js ***!
  8987. \*********************************************************************/
  8988. /*! exports provided: default */
  8989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8990. "use strict";
  8991. __webpack_require__.r(__webpack_exports__);
  8992. /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
  8993. var upperCase = function (str) {
  8994. return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(str).toUpperCase();
  8995. };
  8996. /* harmony default export */ __webpack_exports__["default"] = (upperCase);
  8997. /***/ }),
  8998. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-first.js":
  8999. /*!**********************************************************************!*\
  9000. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/upper-first.js ***!
  9001. \**********************************************************************/
  9002. /*! exports provided: default */
  9003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9004. "use strict";
  9005. __webpack_require__.r(__webpack_exports__);
  9006. /* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/to-string.js");
  9007. var upperFirst = function (value) {
  9008. var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  9009. return str.charAt(0).toUpperCase() + str.substring(1);
  9010. };
  9011. /* harmony default export */ __webpack_exports__["default"] = (upperFirst);
  9012. /***/ }),
  9013. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values-of-key.js":
  9014. /*!************************************************************************!*\
  9015. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/values-of-key.js ***!
  9016. \************************************************************************/
  9017. /*! exports provided: default */
  9018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9019. "use strict";
  9020. __webpack_require__.r(__webpack_exports__);
  9021. /* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-array.js");
  9022. /* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-nil.js");
  9023. /* harmony default export */ __webpack_exports__["default"] = (function (data, name) {
  9024. var rst = [];
  9025. var tmpMap = {};
  9026. for (var i = 0; i < data.length; i++) {
  9027. var obj = data[i];
  9028. var value = obj[name];
  9029. if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  9030. // flatten
  9031. if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  9032. value = [value];
  9033. }
  9034. for (var j = 0; j < value.length; j++) {
  9035. var val = value[j]; // unique
  9036. if (!tmpMap[val]) {
  9037. rst.push(val);
  9038. tmpMap[val] = true;
  9039. }
  9040. }
  9041. }
  9042. }
  9043. return rst;
  9044. });
  9045. /***/ }),
  9046. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js":
  9047. /*!*****************************************************************!*\
  9048. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/values.js ***!
  9049. \*****************************************************************/
  9050. /*! exports provided: default */
  9051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9052. "use strict";
  9053. __webpack_require__.r(__webpack_exports__);
  9054. /* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/each.js");
  9055. /* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/is-function.js");
  9056. // @ts-ignore
  9057. var values = Object.values ? function (obj) {
  9058. return Object.values(obj);
  9059. } : function (obj) {
  9060. var result = [];
  9061. Object(_each__WEBPACK_IMPORTED_MODULE_0__["default"])(obj, function (value, key) {
  9062. if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__["default"])(obj) && key === 'prototype')) {
  9063. result.push(value);
  9064. }
  9065. });
  9066. return result;
  9067. };
  9068. /* harmony default export */ __webpack_exports__["default"] = (values);
  9069. /***/ }),
  9070. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/wrap-behavior.js":
  9071. /*!************************************************************************!*\
  9072. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/esm/wrap-behavior.js ***!
  9073. \************************************************************************/
  9074. /*! exports provided: default */
  9075. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9076. "use strict";
  9077. __webpack_require__.r(__webpack_exports__);
  9078. /**
  9079. * 封装事件,便于使用上下文this,和便于解除事件时使用
  9080. * @protected
  9081. * @param {Object} obj 对象
  9082. * @param {String} action 事件名称
  9083. * @return {Function} 返回事件处理函数
  9084. */
  9085. function wrapBehavior(obj, action) {
  9086. if (obj['_wrap_' + action]) {
  9087. return obj['_wrap_' + action];
  9088. }
  9089. var method = function (e) {
  9090. obj[action](e);
  9091. };
  9092. obj['_wrap_' + action] = method;
  9093. return method;
  9094. }
  9095. /* harmony default export */ __webpack_exports__["default"] = (wrapBehavior);
  9096. /***/ }),
  9097. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js":
  9098. /*!********************************************************************************!*\
  9099. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js ***!
  9100. \********************************************************************************/
  9101. /*! no static exports found */
  9102. /***/ (function(module, exports, __webpack_require__) {
  9103. "use strict";
  9104. Object.defineProperty(exports, "__esModule", {
  9105. value: true
  9106. });
  9107. function cancelAnimationFrame(handler) {
  9108. var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || // @ts-ignore
  9109. window.mozCancelAnimationFrame || // @ts-ignore
  9110. window.msCancelAnimationFrame || clearTimeout;
  9111. method(handler);
  9112. }
  9113. exports.default = cancelAnimationFrame;
  9114. ;
  9115. /***/ }),
  9116. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js":
  9117. /*!***************************************************************!*\
  9118. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js ***!
  9119. \***************************************************************/
  9120. /*! no static exports found */
  9121. /***/ (function(module, exports, __webpack_require__) {
  9122. "use strict";
  9123. Object.defineProperty(exports, "__esModule", {
  9124. value: true
  9125. });
  9126. var is_array_1 = __webpack_require__(/*! ./is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
  9127. var is_object_1 = __webpack_require__(/*! ./is-object */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js");
  9128. function each(elements, func) {
  9129. if (!elements) {
  9130. return;
  9131. }
  9132. var rst;
  9133. if (is_array_1.default(elements)) {
  9134. for (var i = 0, len = elements.length; i < len; i++) {
  9135. rst = func(elements[i], i);
  9136. if (rst === false) {
  9137. break;
  9138. }
  9139. }
  9140. } else if (is_object_1.default(elements)) {
  9141. for (var k in elements) {
  9142. if (elements.hasOwnProperty(k)) {
  9143. rst = func(elements[k], k);
  9144. if (rst === false) {
  9145. break;
  9146. }
  9147. }
  9148. }
  9149. }
  9150. }
  9151. exports.default = each;
  9152. /***/ }),
  9153. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js":
  9154. /*!*******************************************************************!*\
  9155. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js ***!
  9156. \*******************************************************************/
  9157. /*! no static exports found */
  9158. /***/ (function(module, exports, __webpack_require__) {
  9159. "use strict";
  9160. Object.defineProperty(exports, "__esModule", {
  9161. value: true
  9162. });
  9163. var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
  9164. exports.default = function (value) {
  9165. return Array.isArray ? Array.isArray(value) : is_type_1.default(value, 'Array');
  9166. };
  9167. /***/ }),
  9168. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js":
  9169. /*!**********************************************************************!*\
  9170. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js ***!
  9171. \**********************************************************************/
  9172. /*! no static exports found */
  9173. /***/ (function(module, exports, __webpack_require__) {
  9174. "use strict";
  9175. Object.defineProperty(exports, "__esModule", {
  9176. value: true
  9177. });
  9178. /**
  9179. * 是否为函数
  9180. * @param {*} fn 对象
  9181. * @return {Boolean} 是否函数
  9182. */
  9183. var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
  9184. exports.default = function (value) {
  9185. return is_type_1.default(value, 'Function');
  9186. };
  9187. /***/ }),
  9188. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js":
  9189. /*!*****************************************************************!*\
  9190. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js ***!
  9191. \*****************************************************************/
  9192. /*! no static exports found */
  9193. /***/ (function(module, exports, __webpack_require__) {
  9194. "use strict";
  9195. Object.defineProperty(exports, "__esModule", {
  9196. value: true
  9197. }); // isFinite,
  9198. var isNil = function (value) {
  9199. /**
  9200. * isNil(null) => true
  9201. * isNil() => true
  9202. */
  9203. return value === null || value === undefined;
  9204. };
  9205. exports.default = isNil;
  9206. /***/ }),
  9207. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js":
  9208. /*!**************************************************************************!*\
  9209. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js ***!
  9210. \**************************************************************************/
  9211. /*! no static exports found */
  9212. /***/ (function(module, exports, __webpack_require__) {
  9213. "use strict";
  9214. Object.defineProperty(exports, "__esModule", {
  9215. value: true
  9216. });
  9217. var PRECISION = 0.00001; // numbers less than this is considered as 0
  9218. function isNumberEqual(a, b, precision) {
  9219. if (precision === void 0) {
  9220. precision = PRECISION;
  9221. }
  9222. return Math.abs(a - b) < precision;
  9223. }
  9224. exports.default = isNumberEqual;
  9225. ;
  9226. /***/ }),
  9227. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js":
  9228. /*!********************************************************************!*\
  9229. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-object.js ***!
  9230. \********************************************************************/
  9231. /*! no static exports found */
  9232. /***/ (function(module, exports, __webpack_require__) {
  9233. "use strict";
  9234. Object.defineProperty(exports, "__esModule", {
  9235. value: true
  9236. });
  9237. exports.default = function (value) {
  9238. /**
  9239. * isObject({}) => true
  9240. * isObject([1, 2, 3]) => true
  9241. * isObject(Function) => true
  9242. * isObject(null) => false
  9243. */
  9244. var type = typeof value;
  9245. return value !== null && type === 'object' || type === 'function';
  9246. };
  9247. /***/ }),
  9248. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js":
  9249. /*!********************************************************************!*\
  9250. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js ***!
  9251. \********************************************************************/
  9252. /*! no static exports found */
  9253. /***/ (function(module, exports, __webpack_require__) {
  9254. "use strict";
  9255. Object.defineProperty(exports, "__esModule", {
  9256. value: true
  9257. });
  9258. var is_type_1 = __webpack_require__(/*! ./is-type */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js");
  9259. exports.default = function (str) {
  9260. return is_type_1.default(str, 'String');
  9261. };
  9262. /***/ }),
  9263. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js":
  9264. /*!******************************************************************!*\
  9265. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-type.js ***!
  9266. \******************************************************************/
  9267. /*! no static exports found */
  9268. /***/ (function(module, exports, __webpack_require__) {
  9269. "use strict";
  9270. Object.defineProperty(exports, "__esModule", {
  9271. value: true
  9272. });
  9273. var toString = {}.toString;
  9274. var isType = function (value, type) {
  9275. return toString.call(value) === '[object ' + type + ']';
  9276. };
  9277. exports.default = isType;
  9278. /***/ }),
  9279. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js":
  9280. /*!**************************************************************!*\
  9281. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/mix.js ***!
  9282. \**************************************************************/
  9283. /*! no static exports found */
  9284. /***/ (function(module, exports, __webpack_require__) {
  9285. "use strict";
  9286. Object.defineProperty(exports, "__esModule", {
  9287. value: true
  9288. }); // FIXME: Mutable param should be forbidden in static lang.
  9289. function _mix(dist, obj) {
  9290. for (var key in obj) {
  9291. if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
  9292. dist[key] = obj[key];
  9293. }
  9294. }
  9295. }
  9296. function mix(dist, src1, src2, src3) {
  9297. if (src1) _mix(dist, src1);
  9298. if (src2) _mix(dist, src2);
  9299. if (src3) _mix(dist, src3);
  9300. return dist;
  9301. }
  9302. exports.default = mix;
  9303. /***/ }),
  9304. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js":
  9305. /*!**************************************************************!*\
  9306. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js ***!
  9307. \**************************************************************/
  9308. /*! no static exports found */
  9309. /***/ (function(module, exports, __webpack_require__) {
  9310. "use strict";
  9311. Object.defineProperty(exports, "__esModule", {
  9312. value: true
  9313. });
  9314. var mod = function (n, m) {
  9315. return (n % m + m) % m;
  9316. };
  9317. exports.default = mod;
  9318. /***/ }),
  9319. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js":
  9320. /*!**********************************************************************************!*\
  9321. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js ***!
  9322. \**********************************************************************************/
  9323. /*! no static exports found */
  9324. /***/ (function(module, exports, __webpack_require__) {
  9325. "use strict";
  9326. Object.defineProperty(exports, "__esModule", {
  9327. value: true
  9328. });
  9329. function requestAnimationFrame(fn) {
  9330. var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame || // @ts-ignore
  9331. window.mozRequestAnimationFrame || // @ts-ignore
  9332. window.msRequestAnimationFrame || function (f) {
  9333. return setTimeout(f, 16);
  9334. };
  9335. return method(fn);
  9336. }
  9337. exports.default = requestAnimationFrame;
  9338. ;
  9339. /***/ }),
  9340. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js":
  9341. /*!********************************************************************!*\
  9342. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js ***!
  9343. \********************************************************************/
  9344. /*! no static exports found */
  9345. /***/ (function(module, exports, __webpack_require__) {
  9346. "use strict";
  9347. Object.defineProperty(exports, "__esModule", {
  9348. value: true
  9349. });
  9350. var RADIAN = Math.PI / 180;
  9351. var toRadian = function (degree) {
  9352. return RADIAN * degree;
  9353. };
  9354. exports.default = toRadian;
  9355. /***/ }),
  9356. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js":
  9357. /*!********************************************************************!*\
  9358. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js ***!
  9359. \********************************************************************/
  9360. /*! no static exports found */
  9361. /***/ (function(module, exports, __webpack_require__) {
  9362. "use strict";
  9363. Object.defineProperty(exports, "__esModule", {
  9364. value: true
  9365. });
  9366. var is_nil_1 = __webpack_require__(/*! ./is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
  9367. exports.default = function (value) {
  9368. if (is_nil_1.default(value)) return '';
  9369. return value.toString();
  9370. };
  9371. /***/ }),
  9372. /***/ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js":
  9373. /*!**********************************************************************!*\
  9374. !*** ./node_modules/_@antv_util@2.0.9@@antv/util/lib/upper-first.js ***!
  9375. \**********************************************************************/
  9376. /*! no static exports found */
  9377. /***/ (function(module, exports, __webpack_require__) {
  9378. "use strict";
  9379. Object.defineProperty(exports, "__esModule", {
  9380. value: true
  9381. });
  9382. var to_string_1 = __webpack_require__(/*! ./to-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-string.js");
  9383. var upperFirst = function (value) {
  9384. var str = to_string_1.default(value);
  9385. return str.charAt(0).toUpperCase() + str.substring(1);
  9386. };
  9387. exports.default = upperFirst;
  9388. /***/ }),
  9389. /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js":
  9390. /*!************************************************************!*\
  9391. !*** ./node_modules/_d3-color@1.4.1@d3-color/src/color.js ***!
  9392. \************************************************************/
  9393. /*! exports provided: Color, darker, brighter, default, rgbConvert, rgb, Rgb, hslConvert, hsl */
  9394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9395. "use strict";
  9396. __webpack_require__.r(__webpack_exports__);
  9397. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
  9398. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darker", function() { return darker; });
  9399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brighter", function() { return brighter; });
  9400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return color; });
  9401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbConvert", function() { return rgbConvert; });
  9402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return rgb; });
  9403. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rgb", function() { return Rgb; });
  9404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslConvert", function() { return hslConvert; });
  9405. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return hsl; });
  9406. /* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js");
  9407. function Color() {}
  9408. var darker = 0.7;
  9409. var brighter = 1 / darker;
  9410. var reI = "\\s*([+-]?\\d+)\\s*",
  9411. reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
  9412. reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
  9413. reHex = /^#([0-9a-f]{3,8})$/,
  9414. reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
  9415. reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
  9416. reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
  9417. reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
  9418. reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
  9419. reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
  9420. var named = {
  9421. aliceblue: 0xf0f8ff,
  9422. antiquewhite: 0xfaebd7,
  9423. aqua: 0x00ffff,
  9424. aquamarine: 0x7fffd4,
  9425. azure: 0xf0ffff,
  9426. beige: 0xf5f5dc,
  9427. bisque: 0xffe4c4,
  9428. black: 0x000000,
  9429. blanchedalmond: 0xffebcd,
  9430. blue: 0x0000ff,
  9431. blueviolet: 0x8a2be2,
  9432. brown: 0xa52a2a,
  9433. burlywood: 0xdeb887,
  9434. cadetblue: 0x5f9ea0,
  9435. chartreuse: 0x7fff00,
  9436. chocolate: 0xd2691e,
  9437. coral: 0xff7f50,
  9438. cornflowerblue: 0x6495ed,
  9439. cornsilk: 0xfff8dc,
  9440. crimson: 0xdc143c,
  9441. cyan: 0x00ffff,
  9442. darkblue: 0x00008b,
  9443. darkcyan: 0x008b8b,
  9444. darkgoldenrod: 0xb8860b,
  9445. darkgray: 0xa9a9a9,
  9446. darkgreen: 0x006400,
  9447. darkgrey: 0xa9a9a9,
  9448. darkkhaki: 0xbdb76b,
  9449. darkmagenta: 0x8b008b,
  9450. darkolivegreen: 0x556b2f,
  9451. darkorange: 0xff8c00,
  9452. darkorchid: 0x9932cc,
  9453. darkred: 0x8b0000,
  9454. darksalmon: 0xe9967a,
  9455. darkseagreen: 0x8fbc8f,
  9456. darkslateblue: 0x483d8b,
  9457. darkslategray: 0x2f4f4f,
  9458. darkslategrey: 0x2f4f4f,
  9459. darkturquoise: 0x00ced1,
  9460. darkviolet: 0x9400d3,
  9461. deeppink: 0xff1493,
  9462. deepskyblue: 0x00bfff,
  9463. dimgray: 0x696969,
  9464. dimgrey: 0x696969,
  9465. dodgerblue: 0x1e90ff,
  9466. firebrick: 0xb22222,
  9467. floralwhite: 0xfffaf0,
  9468. forestgreen: 0x228b22,
  9469. fuchsia: 0xff00ff,
  9470. gainsboro: 0xdcdcdc,
  9471. ghostwhite: 0xf8f8ff,
  9472. gold: 0xffd700,
  9473. goldenrod: 0xdaa520,
  9474. gray: 0x808080,
  9475. green: 0x008000,
  9476. greenyellow: 0xadff2f,
  9477. grey: 0x808080,
  9478. honeydew: 0xf0fff0,
  9479. hotpink: 0xff69b4,
  9480. indianred: 0xcd5c5c,
  9481. indigo: 0x4b0082,
  9482. ivory: 0xfffff0,
  9483. khaki: 0xf0e68c,
  9484. lavender: 0xe6e6fa,
  9485. lavenderblush: 0xfff0f5,
  9486. lawngreen: 0x7cfc00,
  9487. lemonchiffon: 0xfffacd,
  9488. lightblue: 0xadd8e6,
  9489. lightcoral: 0xf08080,
  9490. lightcyan: 0xe0ffff,
  9491. lightgoldenrodyellow: 0xfafad2,
  9492. lightgray: 0xd3d3d3,
  9493. lightgreen: 0x90ee90,
  9494. lightgrey: 0xd3d3d3,
  9495. lightpink: 0xffb6c1,
  9496. lightsalmon: 0xffa07a,
  9497. lightseagreen: 0x20b2aa,
  9498. lightskyblue: 0x87cefa,
  9499. lightslategray: 0x778899,
  9500. lightslategrey: 0x778899,
  9501. lightsteelblue: 0xb0c4de,
  9502. lightyellow: 0xffffe0,
  9503. lime: 0x00ff00,
  9504. limegreen: 0x32cd32,
  9505. linen: 0xfaf0e6,
  9506. magenta: 0xff00ff,
  9507. maroon: 0x800000,
  9508. mediumaquamarine: 0x66cdaa,
  9509. mediumblue: 0x0000cd,
  9510. mediumorchid: 0xba55d3,
  9511. mediumpurple: 0x9370db,
  9512. mediumseagreen: 0x3cb371,
  9513. mediumslateblue: 0x7b68ee,
  9514. mediumspringgreen: 0x00fa9a,
  9515. mediumturquoise: 0x48d1cc,
  9516. mediumvioletred: 0xc71585,
  9517. midnightblue: 0x191970,
  9518. mintcream: 0xf5fffa,
  9519. mistyrose: 0xffe4e1,
  9520. moccasin: 0xffe4b5,
  9521. navajowhite: 0xffdead,
  9522. navy: 0x000080,
  9523. oldlace: 0xfdf5e6,
  9524. olive: 0x808000,
  9525. olivedrab: 0x6b8e23,
  9526. orange: 0xffa500,
  9527. orangered: 0xff4500,
  9528. orchid: 0xda70d6,
  9529. palegoldenrod: 0xeee8aa,
  9530. palegreen: 0x98fb98,
  9531. paleturquoise: 0xafeeee,
  9532. palevioletred: 0xdb7093,
  9533. papayawhip: 0xffefd5,
  9534. peachpuff: 0xffdab9,
  9535. peru: 0xcd853f,
  9536. pink: 0xffc0cb,
  9537. plum: 0xdda0dd,
  9538. powderblue: 0xb0e0e6,
  9539. purple: 0x800080,
  9540. rebeccapurple: 0x663399,
  9541. red: 0xff0000,
  9542. rosybrown: 0xbc8f8f,
  9543. royalblue: 0x4169e1,
  9544. saddlebrown: 0x8b4513,
  9545. salmon: 0xfa8072,
  9546. sandybrown: 0xf4a460,
  9547. seagreen: 0x2e8b57,
  9548. seashell: 0xfff5ee,
  9549. sienna: 0xa0522d,
  9550. silver: 0xc0c0c0,
  9551. skyblue: 0x87ceeb,
  9552. slateblue: 0x6a5acd,
  9553. slategray: 0x708090,
  9554. slategrey: 0x708090,
  9555. snow: 0xfffafa,
  9556. springgreen: 0x00ff7f,
  9557. steelblue: 0x4682b4,
  9558. tan: 0xd2b48c,
  9559. teal: 0x008080,
  9560. thistle: 0xd8bfd8,
  9561. tomato: 0xff6347,
  9562. turquoise: 0x40e0d0,
  9563. violet: 0xee82ee,
  9564. wheat: 0xf5deb3,
  9565. white: 0xffffff,
  9566. whitesmoke: 0xf5f5f5,
  9567. yellow: 0xffff00,
  9568. yellowgreen: 0x9acd32
  9569. };
  9570. Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Color, color, {
  9571. copy: function (channels) {
  9572. return Object.assign(new this.constructor(), this, channels);
  9573. },
  9574. displayable: function () {
  9575. return this.rgb().displayable();
  9576. },
  9577. hex: color_formatHex,
  9578. // Deprecated! Use color.formatHex.
  9579. formatHex: color_formatHex,
  9580. formatHsl: color_formatHsl,
  9581. formatRgb: color_formatRgb,
  9582. toString: color_formatRgb
  9583. });
  9584. function color_formatHex() {
  9585. return this.rgb().formatHex();
  9586. }
  9587. function color_formatHsl() {
  9588. return hslConvert(this).formatHsl();
  9589. }
  9590. function color_formatRgb() {
  9591. return this.rgb().formatRgb();
  9592. }
  9593. function color(format) {
  9594. var m, l;
  9595. format = (format + "").trim().toLowerCase();
  9596. return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
  9597. : l === 3 ? new Rgb(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, (m & 0xf) << 4 | m & 0xf, 1) // #f00
  9598. : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
  9599. : l === 4 ? rgba(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, ((m & 0xf) << 4 | m & 0xf) / 0xff) // #f000
  9600. : null // invalid hex
  9601. ) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
  9602. : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
  9603. : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
  9604. : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
  9605. : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
  9606. : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
  9607. : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
  9608. : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
  9609. }
  9610. function rgbn(n) {
  9611. return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
  9612. }
  9613. function rgba(r, g, b, a) {
  9614. if (a <= 0) r = g = b = NaN;
  9615. return new Rgb(r, g, b, a);
  9616. }
  9617. function rgbConvert(o) {
  9618. if (!(o instanceof Color)) o = color(o);
  9619. if (!o) return new Rgb();
  9620. o = o.rgb();
  9621. return new Rgb(o.r, o.g, o.b, o.opacity);
  9622. }
  9623. function rgb(r, g, b, opacity) {
  9624. return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
  9625. }
  9626. function Rgb(r, g, b, opacity) {
  9627. this.r = +r;
  9628. this.g = +g;
  9629. this.b = +b;
  9630. this.opacity = +opacity;
  9631. }
  9632. Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Rgb, rgb, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(Color, {
  9633. brighter: function (k) {
  9634. k = k == null ? brighter : Math.pow(brighter, k);
  9635. return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
  9636. },
  9637. darker: function (k) {
  9638. k = k == null ? darker : Math.pow(darker, k);
  9639. return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
  9640. },
  9641. rgb: function () {
  9642. return this;
  9643. },
  9644. displayable: function () {
  9645. return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
  9646. },
  9647. hex: rgb_formatHex,
  9648. // Deprecated! Use color.formatHex.
  9649. formatHex: rgb_formatHex,
  9650. formatRgb: rgb_formatRgb,
  9651. toString: rgb_formatRgb
  9652. }));
  9653. function rgb_formatHex() {
  9654. return "#" + hex(this.r) + hex(this.g) + hex(this.b);
  9655. }
  9656. function rgb_formatRgb() {
  9657. var a = this.opacity;
  9658. a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
  9659. return (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")");
  9660. }
  9661. function hex(value) {
  9662. value = Math.max(0, Math.min(255, Math.round(value) || 0));
  9663. return (value < 16 ? "0" : "") + value.toString(16);
  9664. }
  9665. function hsla(h, s, l, a) {
  9666. if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN;
  9667. return new Hsl(h, s, l, a);
  9668. }
  9669. function hslConvert(o) {
  9670. if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
  9671. if (!(o instanceof Color)) o = color(o);
  9672. if (!o) return new Hsl();
  9673. if (o instanceof Hsl) return o;
  9674. o = o.rgb();
  9675. var r = o.r / 255,
  9676. g = o.g / 255,
  9677. b = o.b / 255,
  9678. min = Math.min(r, g, b),
  9679. max = Math.max(r, g, b),
  9680. h = NaN,
  9681. s = max - min,
  9682. l = (max + min) / 2;
  9683. if (s) {
  9684. if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4;
  9685. s /= l < 0.5 ? max + min : 2 - max - min;
  9686. h *= 60;
  9687. } else {
  9688. s = l > 0 && l < 1 ? 0 : h;
  9689. }
  9690. return new Hsl(h, s, l, o.opacity);
  9691. }
  9692. function hsl(h, s, l, opacity) {
  9693. return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
  9694. }
  9695. function Hsl(h, s, l, opacity) {
  9696. this.h = +h;
  9697. this.s = +s;
  9698. this.l = +l;
  9699. this.opacity = +opacity;
  9700. }
  9701. Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Hsl, hsl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(Color, {
  9702. brighter: function (k) {
  9703. k = k == null ? brighter : Math.pow(brighter, k);
  9704. return new Hsl(this.h, this.s, this.l * k, this.opacity);
  9705. },
  9706. darker: function (k) {
  9707. k = k == null ? darker : Math.pow(darker, k);
  9708. return new Hsl(this.h, this.s, this.l * k, this.opacity);
  9709. },
  9710. rgb: function () {
  9711. var h = this.h % 360 + (this.h < 0) * 360,
  9712. s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
  9713. l = this.l,
  9714. m2 = l + (l < 0.5 ? l : 1 - l) * s,
  9715. m1 = 2 * l - m2;
  9716. return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
  9717. },
  9718. displayable: function () {
  9719. return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
  9720. },
  9721. formatHsl: function () {
  9722. var a = this.opacity;
  9723. a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
  9724. return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
  9725. }
  9726. }));
  9727. /* From FvD 13.37, CSS Color Module Level 3 */
  9728. function hsl2rgb(h, m1, m2) {
  9729. return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
  9730. }
  9731. /***/ }),
  9732. /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/cubehelix.js":
  9733. /*!****************************************************************!*\
  9734. !*** ./node_modules/_d3-color@1.4.1@d3-color/src/cubehelix.js ***!
  9735. \****************************************************************/
  9736. /*! exports provided: default, Cubehelix */
  9737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9738. "use strict";
  9739. __webpack_require__.r(__webpack_exports__);
  9740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return cubehelix; });
  9741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cubehelix", function() { return Cubehelix; });
  9742. /* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js");
  9743. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js");
  9744. /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/math.js");
  9745. var A = -0.14861,
  9746. B = +1.78277,
  9747. C = -0.29227,
  9748. D = -0.90649,
  9749. E = +1.97294,
  9750. ED = E * D,
  9751. EB = E * B,
  9752. BC_DA = B * C - D * A;
  9753. function cubehelixConvert(o) {
  9754. if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
  9755. if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["rgbConvert"])(o);
  9756. var r = o.r / 255,
  9757. g = o.g / 255,
  9758. b = o.b / 255,
  9759. l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
  9760. bl = b - l,
  9761. k = (E * (g - l) - C * bl) / D,
  9762. s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)),
  9763. // NaN if l=0 or l=1
  9764. h = s ? Math.atan2(k, bl) * _math_js__WEBPACK_IMPORTED_MODULE_2__["rad2deg"] - 120 : NaN;
  9765. return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
  9766. }
  9767. function cubehelix(h, s, l, opacity) {
  9768. return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
  9769. }
  9770. function Cubehelix(h, s, l, opacity) {
  9771. this.h = +h;
  9772. this.s = +s;
  9773. this.l = +l;
  9774. this.opacity = +opacity;
  9775. }
  9776. Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Cubehelix, cubehelix, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], {
  9777. brighter: function (k) {
  9778. k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__["brighter"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__["brighter"], k);
  9779. return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
  9780. },
  9781. darker: function (k) {
  9782. k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__["darker"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__["darker"], k);
  9783. return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
  9784. },
  9785. rgb: function () {
  9786. var h = isNaN(this.h) ? 0 : (this.h + 120) * _math_js__WEBPACK_IMPORTED_MODULE_2__["deg2rad"],
  9787. l = +this.l,
  9788. a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
  9789. cosh = Math.cos(h),
  9790. sinh = Math.sin(h);
  9791. return new _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"](255 * (l + a * (A * cosh + B * sinh)), 255 * (l + a * (C * cosh + D * sinh)), 255 * (l + a * (E * cosh)), this.opacity);
  9792. }
  9793. }));
  9794. /***/ }),
  9795. /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js":
  9796. /*!*************************************************************!*\
  9797. !*** ./node_modules/_d3-color@1.4.1@d3-color/src/define.js ***!
  9798. \*************************************************************/
  9799. /*! exports provided: default, extend */
  9800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9801. "use strict";
  9802. __webpack_require__.r(__webpack_exports__);
  9803. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; });
  9804. /* harmony default export */ __webpack_exports__["default"] = (function (constructor, factory, prototype) {
  9805. constructor.prototype = factory.prototype = prototype;
  9806. prototype.constructor = constructor;
  9807. });
  9808. function extend(parent, definition) {
  9809. var prototype = Object.create(parent.prototype);
  9810. for (var key in definition) prototype[key] = definition[key];
  9811. return prototype;
  9812. }
  9813. /***/ }),
  9814. /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js":
  9815. /*!************************************************************!*\
  9816. !*** ./node_modules/_d3-color@1.4.1@d3-color/src/index.js ***!
  9817. \************************************************************/
  9818. /*! exports provided: color, rgb, hsl, lab, hcl, lch, gray, cubehelix */
  9819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9820. "use strict";
  9821. __webpack_require__.r(__webpack_exports__);
  9822. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js");
  9823. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "color", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  9824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["rgb"]; });
  9825. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["hsl"]; });
  9826. /* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lab.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/lab.js");
  9827. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lab", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  9828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["hcl"]; });
  9829. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["lch"]; });
  9830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["gray"]; });
  9831. /* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubehelix.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/cubehelix.js");
  9832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cubehelix", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  9833. /***/ }),
  9834. /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/lab.js":
  9835. /*!**********************************************************!*\
  9836. !*** ./node_modules/_d3-color@1.4.1@d3-color/src/lab.js ***!
  9837. \**********************************************************/
  9838. /*! exports provided: gray, default, Lab, lch, hcl, Hcl */
  9839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9840. "use strict";
  9841. __webpack_require__.r(__webpack_exports__);
  9842. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return gray; });
  9843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lab; });
  9844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lab", function() { return Lab; });
  9845. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return lch; });
  9846. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return hcl; });
  9847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hcl", function() { return Hcl; });
  9848. /* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/define.js");
  9849. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/color.js");
  9850. /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "./node_modules/_d3-color@1.4.1@d3-color/src/math.js");
  9851. // https://observablehq.com/@mbostock/lab-and-rgb
  9852. var K = 18,
  9853. Xn = 0.96422,
  9854. Yn = 1,
  9855. Zn = 0.82521,
  9856. t0 = 4 / 29,
  9857. t1 = 6 / 29,
  9858. t2 = 3 * t1 * t1,
  9859. t3 = t1 * t1 * t1;
  9860. function labConvert(o) {
  9861. if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
  9862. if (o instanceof Hcl) return hcl2lab(o);
  9863. if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["rgbConvert"])(o);
  9864. var r = rgb2lrgb(o.r),
  9865. g = rgb2lrgb(o.g),
  9866. b = rgb2lrgb(o.b),
  9867. y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn),
  9868. x,
  9869. z;
  9870. if (r === g && g === b) x = z = y;else {
  9871. x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
  9872. z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
  9873. }
  9874. return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
  9875. }
  9876. function gray(l, opacity) {
  9877. return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
  9878. }
  9879. function lab(l, a, b, opacity) {
  9880. return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
  9881. }
  9882. function Lab(l, a, b, opacity) {
  9883. this.l = +l;
  9884. this.a = +a;
  9885. this.b = +b;
  9886. this.opacity = +opacity;
  9887. }
  9888. Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Lab, lab, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], {
  9889. brighter: function (k) {
  9890. return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
  9891. },
  9892. darker: function (k) {
  9893. return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
  9894. },
  9895. rgb: function () {
  9896. var y = (this.l + 16) / 116,
  9897. x = isNaN(this.a) ? y : y + this.a / 500,
  9898. z = isNaN(this.b) ? y : y - this.b / 200;
  9899. x = Xn * lab2xyz(x);
  9900. y = Yn * lab2xyz(y);
  9901. z = Zn * lab2xyz(z);
  9902. return new _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"](lrgb2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), lrgb2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z), this.opacity);
  9903. }
  9904. }));
  9905. function xyz2lab(t) {
  9906. return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
  9907. }
  9908. function lab2xyz(t) {
  9909. return t > t1 ? t * t * t : t2 * (t - t0);
  9910. }
  9911. function lrgb2rgb(x) {
  9912. return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
  9913. }
  9914. function rgb2lrgb(x) {
  9915. return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
  9916. }
  9917. function hclConvert(o) {
  9918. if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
  9919. if (!(o instanceof Lab)) o = labConvert(o);
  9920. if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
  9921. var h = Math.atan2(o.b, o.a) * _math_js__WEBPACK_IMPORTED_MODULE_2__["rad2deg"];
  9922. return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
  9923. }
  9924. function lch(l, c, h, opacity) {
  9925. return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
  9926. }
  9927. function hcl(h, c, l, opacity) {
  9928. return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
  9929. }
  9930. function Hcl(h, c, l, opacity) {
  9931. this.h = +h;
  9932. this.c = +c;
  9933. this.l = +l;
  9934. this.opacity = +opacity;
  9935. }
  9936. function hcl2lab(o) {
  9937. if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
  9938. var h = o.h * _math_js__WEBPACK_IMPORTED_MODULE_2__["deg2rad"];
  9939. return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
  9940. }
  9941. Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Hcl, hcl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], {
  9942. brighter: function (k) {
  9943. return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
  9944. },
  9945. darker: function (k) {
  9946. return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
  9947. },
  9948. rgb: function () {
  9949. return hcl2lab(this).rgb();
  9950. }
  9951. }));
  9952. /***/ }),
  9953. /***/ "./node_modules/_d3-color@1.4.1@d3-color/src/math.js":
  9954. /*!***********************************************************!*\
  9955. !*** ./node_modules/_d3-color@1.4.1@d3-color/src/math.js ***!
  9956. \***********************************************************/
  9957. /*! exports provided: deg2rad, rad2deg */
  9958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9959. "use strict";
  9960. __webpack_require__.r(__webpack_exports__);
  9961. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deg2rad", function() { return deg2rad; });
  9962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rad2deg", function() { return rad2deg; });
  9963. var deg2rad = Math.PI / 180;
  9964. var rad2deg = 180 / Math.PI;
  9965. /***/ }),
  9966. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/back.js":
  9967. /*!*********************************************************!*\
  9968. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/back.js ***!
  9969. \*********************************************************/
  9970. /*! exports provided: backIn, backOut, backInOut */
  9971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9972. "use strict";
  9973. __webpack_require__.r(__webpack_exports__);
  9974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backIn", function() { return backIn; });
  9975. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backOut", function() { return backOut; });
  9976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backInOut", function() { return backInOut; });
  9977. var overshoot = 1.70158;
  9978. var backIn = function custom(s) {
  9979. s = +s;
  9980. function backIn(t) {
  9981. return t * t * ((s + 1) * t - s);
  9982. }
  9983. backIn.overshoot = custom;
  9984. return backIn;
  9985. }(overshoot);
  9986. var backOut = function custom(s) {
  9987. s = +s;
  9988. function backOut(t) {
  9989. return --t * t * ((s + 1) * t + s) + 1;
  9990. }
  9991. backOut.overshoot = custom;
  9992. return backOut;
  9993. }(overshoot);
  9994. var backInOut = function custom(s) {
  9995. s = +s;
  9996. function backInOut(t) {
  9997. return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
  9998. }
  9999. backInOut.overshoot = custom;
  10000. return backInOut;
  10001. }(overshoot);
  10002. /***/ }),
  10003. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/bounce.js":
  10004. /*!***********************************************************!*\
  10005. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/bounce.js ***!
  10006. \***********************************************************/
  10007. /*! exports provided: bounceIn, bounceOut, bounceInOut */
  10008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10009. "use strict";
  10010. __webpack_require__.r(__webpack_exports__);
  10011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceIn", function() { return bounceIn; });
  10012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceOut", function() { return bounceOut; });
  10013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceInOut", function() { return bounceInOut; });
  10014. var b1 = 4 / 11,
  10015. b2 = 6 / 11,
  10016. b3 = 8 / 11,
  10017. b4 = 3 / 4,
  10018. b5 = 9 / 11,
  10019. b6 = 10 / 11,
  10020. b7 = 15 / 16,
  10021. b8 = 21 / 22,
  10022. b9 = 63 / 64,
  10023. b0 = 1 / b1 / b1;
  10024. function bounceIn(t) {
  10025. return 1 - bounceOut(1 - t);
  10026. }
  10027. function bounceOut(t) {
  10028. return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
  10029. }
  10030. function bounceInOut(t) {
  10031. return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
  10032. }
  10033. /***/ }),
  10034. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/circle.js":
  10035. /*!***********************************************************!*\
  10036. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/circle.js ***!
  10037. \***********************************************************/
  10038. /*! exports provided: circleIn, circleOut, circleInOut */
  10039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10040. "use strict";
  10041. __webpack_require__.r(__webpack_exports__);
  10042. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleIn", function() { return circleIn; });
  10043. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleOut", function() { return circleOut; });
  10044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleInOut", function() { return circleInOut; });
  10045. function circleIn(t) {
  10046. return 1 - Math.sqrt(1 - t * t);
  10047. }
  10048. function circleOut(t) {
  10049. return Math.sqrt(1 - --t * t);
  10050. }
  10051. function circleInOut(t) {
  10052. return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
  10053. }
  10054. /***/ }),
  10055. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/cubic.js":
  10056. /*!**********************************************************!*\
  10057. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/cubic.js ***!
  10058. \**********************************************************/
  10059. /*! exports provided: cubicIn, cubicOut, cubicInOut */
  10060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10061. "use strict";
  10062. __webpack_require__.r(__webpack_exports__);
  10063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicIn", function() { return cubicIn; });
  10064. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicOut", function() { return cubicOut; });
  10065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicInOut", function() { return cubicInOut; });
  10066. function cubicIn(t) {
  10067. return t * t * t;
  10068. }
  10069. function cubicOut(t) {
  10070. return --t * t * t + 1;
  10071. }
  10072. function cubicInOut(t) {
  10073. return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
  10074. }
  10075. /***/ }),
  10076. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/elastic.js":
  10077. /*!************************************************************!*\
  10078. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/elastic.js ***!
  10079. \************************************************************/
  10080. /*! exports provided: elasticIn, elasticOut, elasticInOut */
  10081. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10082. "use strict";
  10083. __webpack_require__.r(__webpack_exports__);
  10084. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticIn", function() { return elasticIn; });
  10085. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticOut", function() { return elasticOut; });
  10086. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticInOut", function() { return elasticInOut; });
  10087. var tau = 2 * Math.PI,
  10088. amplitude = 1,
  10089. period = 0.3;
  10090. var elasticIn = function custom(a, p) {
  10091. var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
  10092. function elasticIn(t) {
  10093. return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);
  10094. }
  10095. elasticIn.amplitude = function (a) {
  10096. return custom(a, p * tau);
  10097. };
  10098. elasticIn.period = function (p) {
  10099. return custom(a, p);
  10100. };
  10101. return elasticIn;
  10102. }(amplitude, period);
  10103. var elasticOut = function custom(a, p) {
  10104. var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
  10105. function elasticOut(t) {
  10106. return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);
  10107. }
  10108. elasticOut.amplitude = function (a) {
  10109. return custom(a, p * tau);
  10110. };
  10111. elasticOut.period = function (p) {
  10112. return custom(a, p);
  10113. };
  10114. return elasticOut;
  10115. }(amplitude, period);
  10116. var elasticInOut = function custom(a, p) {
  10117. var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
  10118. function elasticInOut(t) {
  10119. return ((t = t * 2 - 1) < 0 ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p) : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;
  10120. }
  10121. elasticInOut.amplitude = function (a) {
  10122. return custom(a, p * tau);
  10123. };
  10124. elasticInOut.period = function (p) {
  10125. return custom(a, p);
  10126. };
  10127. return elasticInOut;
  10128. }(amplitude, period);
  10129. /***/ }),
  10130. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/exp.js":
  10131. /*!********************************************************!*\
  10132. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/exp.js ***!
  10133. \********************************************************/
  10134. /*! exports provided: expIn, expOut, expInOut */
  10135. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10136. "use strict";
  10137. __webpack_require__.r(__webpack_exports__);
  10138. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expIn", function() { return expIn; });
  10139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expOut", function() { return expOut; });
  10140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expInOut", function() { return expInOut; });
  10141. function expIn(t) {
  10142. return Math.pow(2, 10 * t - 10);
  10143. }
  10144. function expOut(t) {
  10145. return 1 - Math.pow(2, -10 * t);
  10146. }
  10147. function expInOut(t) {
  10148. return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;
  10149. }
  10150. /***/ }),
  10151. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/index.js":
  10152. /*!**********************************************************!*\
  10153. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/index.js ***!
  10154. \**********************************************************/
  10155. /*! exports provided: easeLinear, easeQuad, easeQuadIn, easeQuadOut, easeQuadInOut, easeCubic, easeCubicIn, easeCubicOut, easeCubicInOut, easePoly, easePolyIn, easePolyOut, easePolyInOut, easeSin, easeSinIn, easeSinOut, easeSinInOut, easeExp, easeExpIn, easeExpOut, easeExpInOut, easeCircle, easeCircleIn, easeCircleOut, easeCircleInOut, easeBounce, easeBounceIn, easeBounceOut, easeBounceInOut, easeBack, easeBackIn, easeBackOut, easeBackInOut, easeElastic, easeElasticIn, easeElasticOut, easeElasticInOut */
  10156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10157. "use strict";
  10158. __webpack_require__.r(__webpack_exports__);
  10159. /* harmony import */ var _linear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/linear.js");
  10160. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeLinear", function() { return _linear_js__WEBPACK_IMPORTED_MODULE_0__["linear"]; });
  10161. /* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/quad.js");
  10162. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuad", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadInOut"]; });
  10163. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadIn", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadIn"]; });
  10164. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadOut", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadOut"]; });
  10165. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadInOut", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadInOut"]; });
  10166. /* harmony import */ var _cubic_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubic.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/cubic.js");
  10167. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubic", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicInOut"]; });
  10168. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicIn", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicIn"]; });
  10169. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicOut", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicOut"]; });
  10170. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicInOut", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicInOut"]; });
  10171. /* harmony import */ var _poly_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./poly.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/poly.js");
  10172. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePoly", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyInOut"]; });
  10173. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyIn", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyIn"]; });
  10174. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyOut", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyOut"]; });
  10175. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyInOut", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyInOut"]; });
  10176. /* harmony import */ var _sin_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sin.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/sin.js");
  10177. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSin", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinInOut"]; });
  10178. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinIn", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinIn"]; });
  10179. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinOut", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinOut"]; });
  10180. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinInOut", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinInOut"]; });
  10181. /* harmony import */ var _exp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exp.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/exp.js");
  10182. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExp", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expInOut"]; });
  10183. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpIn", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expIn"]; });
  10184. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpOut", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expOut"]; });
  10185. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpInOut", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expInOut"]; });
  10186. /* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./circle.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/circle.js");
  10187. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircle", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleInOut"]; });
  10188. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleIn", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleIn"]; });
  10189. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleOut", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleOut"]; });
  10190. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleInOut", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleInOut"]; });
  10191. /* harmony import */ var _bounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bounce.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/bounce.js");
  10192. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounce", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceOut"]; });
  10193. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceIn", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceIn"]; });
  10194. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceOut", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceOut"]; });
  10195. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceInOut", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceInOut"]; });
  10196. /* harmony import */ var _back_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./back.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/back.js");
  10197. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBack", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backInOut"]; });
  10198. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackIn", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backIn"]; });
  10199. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackOut", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backOut"]; });
  10200. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackInOut", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backInOut"]; });
  10201. /* harmony import */ var _elastic_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elastic.js */ "./node_modules/_d3-ease@1.0.6@d3-ease/src/elastic.js");
  10202. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElastic", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticOut"]; });
  10203. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticIn", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticIn"]; });
  10204. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticOut", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticOut"]; });
  10205. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticInOut", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticInOut"]; });
  10206. /***/ }),
  10207. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/linear.js":
  10208. /*!***********************************************************!*\
  10209. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/linear.js ***!
  10210. \***********************************************************/
  10211. /*! exports provided: linear */
  10212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10213. "use strict";
  10214. __webpack_require__.r(__webpack_exports__);
  10215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linear", function() { return linear; });
  10216. function linear(t) {
  10217. return +t;
  10218. }
  10219. /***/ }),
  10220. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/poly.js":
  10221. /*!*********************************************************!*\
  10222. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/poly.js ***!
  10223. \*********************************************************/
  10224. /*! exports provided: polyIn, polyOut, polyInOut */
  10225. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10226. "use strict";
  10227. __webpack_require__.r(__webpack_exports__);
  10228. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyIn", function() { return polyIn; });
  10229. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyOut", function() { return polyOut; });
  10230. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyInOut", function() { return polyInOut; });
  10231. var exponent = 3;
  10232. var polyIn = function custom(e) {
  10233. e = +e;
  10234. function polyIn(t) {
  10235. return Math.pow(t, e);
  10236. }
  10237. polyIn.exponent = custom;
  10238. return polyIn;
  10239. }(exponent);
  10240. var polyOut = function custom(e) {
  10241. e = +e;
  10242. function polyOut(t) {
  10243. return 1 - Math.pow(1 - t, e);
  10244. }
  10245. polyOut.exponent = custom;
  10246. return polyOut;
  10247. }(exponent);
  10248. var polyInOut = function custom(e) {
  10249. e = +e;
  10250. function polyInOut(t) {
  10251. return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
  10252. }
  10253. polyInOut.exponent = custom;
  10254. return polyInOut;
  10255. }(exponent);
  10256. /***/ }),
  10257. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/quad.js":
  10258. /*!*********************************************************!*\
  10259. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/quad.js ***!
  10260. \*********************************************************/
  10261. /*! exports provided: quadIn, quadOut, quadInOut */
  10262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10263. "use strict";
  10264. __webpack_require__.r(__webpack_exports__);
  10265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadIn", function() { return quadIn; });
  10266. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadOut", function() { return quadOut; });
  10267. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadInOut", function() { return quadInOut; });
  10268. function quadIn(t) {
  10269. return t * t;
  10270. }
  10271. function quadOut(t) {
  10272. return t * (2 - t);
  10273. }
  10274. function quadInOut(t) {
  10275. return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
  10276. }
  10277. /***/ }),
  10278. /***/ "./node_modules/_d3-ease@1.0.6@d3-ease/src/sin.js":
  10279. /*!********************************************************!*\
  10280. !*** ./node_modules/_d3-ease@1.0.6@d3-ease/src/sin.js ***!
  10281. \********************************************************/
  10282. /*! exports provided: sinIn, sinOut, sinInOut */
  10283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10284. "use strict";
  10285. __webpack_require__.r(__webpack_exports__);
  10286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinIn", function() { return sinIn; });
  10287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinOut", function() { return sinOut; });
  10288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinInOut", function() { return sinInOut; });
  10289. var pi = Math.PI,
  10290. halfPi = pi / 2;
  10291. function sinIn(t) {
  10292. return 1 - Math.cos(t * halfPi);
  10293. }
  10294. function sinOut(t) {
  10295. return Math.sin(t * halfPi);
  10296. }
  10297. function sinInOut(t) {
  10298. return (1 - Math.cos(pi * t)) / 2;
  10299. }
  10300. /***/ }),
  10301. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js":
  10302. /*!************************************************************************!*\
  10303. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js ***!
  10304. \************************************************************************/
  10305. /*! exports provided: default, genericArray */
  10306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10307. "use strict";
  10308. __webpack_require__.r(__webpack_exports__);
  10309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericArray", function() { return genericArray; });
  10310. /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js");
  10311. /* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js");
  10312. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10313. return (Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_1__["isNumberArray"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : genericArray)(a, b);
  10314. });
  10315. function genericArray(a, b) {
  10316. var nb = b ? b.length : 0,
  10317. na = a ? Math.min(nb, a.length) : 0,
  10318. x = new Array(na),
  10319. c = new Array(nb),
  10320. i;
  10321. for (i = 0; i < na; ++i) x[i] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a[i], b[i]);
  10322. for (; i < nb; ++i) c[i] = b[i];
  10323. return function (t) {
  10324. for (i = 0; i < na; ++i) c[i] = x[i](t);
  10325. return c;
  10326. };
  10327. }
  10328. /***/ }),
  10329. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js":
  10330. /*!************************************************************************!*\
  10331. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js ***!
  10332. \************************************************************************/
  10333. /*! exports provided: basis, default */
  10334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10335. "use strict";
  10336. __webpack_require__.r(__webpack_exports__);
  10337. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basis", function() { return basis; });
  10338. function basis(t1, v0, v1, v2, v3) {
  10339. var t2 = t1 * t1,
  10340. t3 = t2 * t1;
  10341. return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
  10342. }
  10343. /* harmony default export */ __webpack_exports__["default"] = (function (values) {
  10344. var n = values.length - 1;
  10345. return function (t) {
  10346. var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
  10347. v1 = values[i],
  10348. v2 = values[i + 1],
  10349. v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
  10350. v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
  10351. return basis((t - i / n) * n, v0, v1, v2, v3);
  10352. };
  10353. });
  10354. /***/ }),
  10355. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js":
  10356. /*!******************************************************************************!*\
  10357. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js ***!
  10358. \******************************************************************************/
  10359. /*! exports provided: default */
  10360. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10361. "use strict";
  10362. __webpack_require__.r(__webpack_exports__);
  10363. /* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js");
  10364. /* harmony default export */ __webpack_exports__["default"] = (function (values) {
  10365. var n = values.length;
  10366. return function (t) {
  10367. var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
  10368. v0 = values[(i + n - 1) % n],
  10369. v1 = values[i % n],
  10370. v2 = values[(i + 1) % n],
  10371. v3 = values[(i + 2) % n];
  10372. return Object(_basis_js__WEBPACK_IMPORTED_MODULE_0__["basis"])((t - i / n) * n, v0, v1, v2, v3);
  10373. };
  10374. });
  10375. /***/ }),
  10376. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js":
  10377. /*!************************************************************************!*\
  10378. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js ***!
  10379. \************************************************************************/
  10380. /*! exports provided: hue, gamma, default */
  10381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10382. "use strict";
  10383. __webpack_require__.r(__webpack_exports__);
  10384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hue", function() { return hue; });
  10385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gamma", function() { return gamma; });
  10386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return nogamma; });
  10387. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js");
  10388. function linear(a, d) {
  10389. return function (t) {
  10390. return a + t * d;
  10391. };
  10392. }
  10393. function exponential(a, b, y) {
  10394. return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function (t) {
  10395. return Math.pow(a + t * b, y);
  10396. };
  10397. }
  10398. function hue(a, b) {
  10399. var d = b - a;
  10400. return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a);
  10401. }
  10402. function gamma(y) {
  10403. return (y = +y) === 1 ? nogamma : function (a, b) {
  10404. return b - a ? exponential(a, b, y) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a);
  10405. };
  10406. }
  10407. function nogamma(a, b) {
  10408. var d = b - a;
  10409. return d ? linear(a, d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a);
  10410. }
  10411. /***/ }),
  10412. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js":
  10413. /*!***************************************************************************!*\
  10414. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js ***!
  10415. \***************************************************************************/
  10416. /*! exports provided: default */
  10417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10418. "use strict";
  10419. __webpack_require__.r(__webpack_exports__);
  10420. /* harmony default export */ __webpack_exports__["default"] = (function (x) {
  10421. return function () {
  10422. return x;
  10423. };
  10424. });
  10425. /***/ }),
  10426. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/cubehelix.js":
  10427. /*!****************************************************************************!*\
  10428. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/cubehelix.js ***!
  10429. \****************************************************************************/
  10430. /*! exports provided: default, cubehelixLong */
  10431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10432. "use strict";
  10433. __webpack_require__.r(__webpack_exports__);
  10434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubehelixLong", function() { return cubehelixLong; });
  10435. /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
  10436. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
  10437. function cubehelix(hue) {
  10438. return function cubehelixGamma(y) {
  10439. y = +y;
  10440. function cubehelix(start, end) {
  10441. var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(end)).h),
  10442. s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.s, end.s),
  10443. l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l),
  10444. opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
  10445. return function (t) {
  10446. start.h = h(t);
  10447. start.s = s(t);
  10448. start.l = l(Math.pow(t, y));
  10449. start.opacity = opacity(t);
  10450. return start + "";
  10451. };
  10452. }
  10453. cubehelix.gamma = cubehelixGamma;
  10454. return cubehelix;
  10455. }(1);
  10456. }
  10457. /* harmony default export */ __webpack_exports__["default"] = (cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"]));
  10458. var cubehelixLong = cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  10459. /***/ }),
  10460. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js":
  10461. /*!***********************************************************************!*\
  10462. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js ***!
  10463. \***********************************************************************/
  10464. /*! exports provided: default */
  10465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10466. "use strict";
  10467. __webpack_require__.r(__webpack_exports__);
  10468. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10469. var d = new Date();
  10470. return a = +a, b = +b, function (t) {
  10471. return d.setTime(a * (1 - t) + b * t), d;
  10472. };
  10473. });
  10474. /***/ }),
  10475. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/discrete.js":
  10476. /*!***************************************************************************!*\
  10477. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/discrete.js ***!
  10478. \***************************************************************************/
  10479. /*! exports provided: default */
  10480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10481. "use strict";
  10482. __webpack_require__.r(__webpack_exports__);
  10483. /* harmony default export */ __webpack_exports__["default"] = (function (range) {
  10484. var n = range.length;
  10485. return function (t) {
  10486. return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
  10487. };
  10488. });
  10489. /***/ }),
  10490. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hcl.js":
  10491. /*!**********************************************************************!*\
  10492. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hcl.js ***!
  10493. \**********************************************************************/
  10494. /*! exports provided: default, hclLong */
  10495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10496. "use strict";
  10497. __webpack_require__.r(__webpack_exports__);
  10498. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hclLong", function() { return hclLong; });
  10499. /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
  10500. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
  10501. function hcl(hue) {
  10502. return function (start, end) {
  10503. var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hcl"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hcl"])(end)).h),
  10504. c = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.c, end.c),
  10505. l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l),
  10506. opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
  10507. return function (t) {
  10508. start.h = h(t);
  10509. start.c = c(t);
  10510. start.l = l(t);
  10511. start.opacity = opacity(t);
  10512. return start + "";
  10513. };
  10514. };
  10515. }
  10516. /* harmony default export */ __webpack_exports__["default"] = (hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"]));
  10517. var hclLong = hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  10518. /***/ }),
  10519. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hsl.js":
  10520. /*!**********************************************************************!*\
  10521. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hsl.js ***!
  10522. \**********************************************************************/
  10523. /*! exports provided: default, hslLong */
  10524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10525. "use strict";
  10526. __webpack_require__.r(__webpack_exports__);
  10527. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslLong", function() { return hslLong; });
  10528. /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
  10529. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
  10530. function hsl(hue) {
  10531. return function (start, end) {
  10532. var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hsl"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hsl"])(end)).h),
  10533. s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.s, end.s),
  10534. l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l),
  10535. opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
  10536. return function (t) {
  10537. start.h = h(t);
  10538. start.s = s(t);
  10539. start.l = l(t);
  10540. start.opacity = opacity(t);
  10541. return start + "";
  10542. };
  10543. };
  10544. }
  10545. /* harmony default export */ __webpack_exports__["default"] = (hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"]));
  10546. var hslLong = hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  10547. /***/ }),
  10548. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hue.js":
  10549. /*!**********************************************************************!*\
  10550. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hue.js ***!
  10551. \**********************************************************************/
  10552. /*! exports provided: default */
  10553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10554. "use strict";
  10555. __webpack_require__.r(__webpack_exports__);
  10556. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
  10557. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10558. var i = Object(_color_js__WEBPACK_IMPORTED_MODULE_0__["hue"])(+a, +b);
  10559. return function (t) {
  10560. var x = i(t);
  10561. return x - 360 * Math.floor(x / 360);
  10562. };
  10563. });
  10564. /***/ }),
  10565. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/index.js":
  10566. /*!************************************************************************!*\
  10567. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/index.js ***!
  10568. \************************************************************************/
  10569. /*! exports provided: interpolate, interpolateArray, interpolateBasis, interpolateBasisClosed, interpolateDate, interpolateDiscrete, interpolateHue, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateRound, interpolateString, interpolateTransformCss, interpolateTransformSvg, interpolateZoom, interpolateRgb, interpolateRgbBasis, interpolateRgbBasisClosed, interpolateHsl, interpolateHslLong, interpolateLab, interpolateHcl, interpolateHclLong, interpolateCubehelix, interpolateCubehelixLong, piecewise, quantize */
  10570. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10571. "use strict";
  10572. __webpack_require__.r(__webpack_exports__);
  10573. /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js");
  10574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolate", function() { return _value_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  10575. /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js");
  10576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateArray", function() { return _array_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  10577. /* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basis.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js");
  10578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasis", function() { return _basis_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  10579. /* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./basisClosed.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js");
  10580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasisClosed", function() { return _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  10581. /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./date.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js");
  10582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDate", function() { return _date_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  10583. /* harmony import */ var _discrete_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./discrete.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/discrete.js");
  10584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDiscrete", function() { return _discrete_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  10585. /* harmony import */ var _hue_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hue.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hue.js");
  10586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHue", function() { return _hue_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  10587. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
  10588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumber", function() { return _number_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  10589. /* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js");
  10590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumberArray", function() { return _numberArray_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  10591. /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./object.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js");
  10592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateObject", function() { return _object_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  10593. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./round.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/round.js");
  10594. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRound", function() { return _round_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  10595. /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./string.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js");
  10596. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateString", function() { return _string_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  10597. /* harmony import */ var _transform_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transform/index.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/index.js");
  10598. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__["interpolateTransformCss"]; });
  10599. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__["interpolateTransformSvg"]; });
  10600. /* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./zoom.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/zoom.js");
  10601. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateZoom", function() { return _zoom_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  10602. /* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rgb.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js");
  10603. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgb", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  10604. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasis", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["rgbBasis"]; });
  10605. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasisClosed", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["rgbBasisClosed"]; });
  10606. /* harmony import */ var _hsl_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hsl.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hsl.js");
  10607. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHsl", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  10608. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHslLong", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__["hslLong"]; });
  10609. /* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lab.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/lab.js");
  10610. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateLab", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  10611. /* harmony import */ var _hcl_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./hcl.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/hcl.js");
  10612. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHcl", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  10613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHclLong", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__["hclLong"]; });
  10614. /* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./cubehelix.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/cubehelix.js");
  10615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelix", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  10616. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelixLong", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__["cubehelixLong"]; });
  10617. /* harmony import */ var _piecewise_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./piecewise.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/piecewise.js");
  10618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "piecewise", function() { return _piecewise_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  10619. /* harmony import */ var _quantize_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./quantize.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/quantize.js");
  10620. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quantize", function() { return _quantize_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  10621. /***/ }),
  10622. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/lab.js":
  10623. /*!**********************************************************************!*\
  10624. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/lab.js ***!
  10625. \**********************************************************************/
  10626. /*! exports provided: default */
  10627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10628. "use strict";
  10629. __webpack_require__.r(__webpack_exports__);
  10630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lab; });
  10631. /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
  10632. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
  10633. function lab(start, end) {
  10634. var l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["lab"])(start)).l, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["lab"])(end)).l),
  10635. a = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.a, end.a),
  10636. b = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.b, end.b),
  10637. opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity);
  10638. return function (t) {
  10639. start.l = l(t);
  10640. start.a = a(t);
  10641. start.b = b(t);
  10642. start.opacity = opacity(t);
  10643. return start + "";
  10644. };
  10645. }
  10646. /***/ }),
  10647. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js":
  10648. /*!*************************************************************************!*\
  10649. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js ***!
  10650. \*************************************************************************/
  10651. /*! exports provided: default */
  10652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10653. "use strict";
  10654. __webpack_require__.r(__webpack_exports__);
  10655. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10656. return a = +a, b = +b, function (t) {
  10657. return a * (1 - t) + b * t;
  10658. };
  10659. });
  10660. /***/ }),
  10661. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js":
  10662. /*!******************************************************************************!*\
  10663. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js ***!
  10664. \******************************************************************************/
  10665. /*! exports provided: default, isNumberArray */
  10666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10667. "use strict";
  10668. __webpack_require__.r(__webpack_exports__);
  10669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumberArray", function() { return isNumberArray; });
  10670. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10671. if (!b) b = [];
  10672. var n = a ? Math.min(b.length, a.length) : 0,
  10673. c = b.slice(),
  10674. i;
  10675. return function (t) {
  10676. for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
  10677. return c;
  10678. };
  10679. });
  10680. function isNumberArray(x) {
  10681. return ArrayBuffer.isView(x) && !(x instanceof DataView);
  10682. }
  10683. /***/ }),
  10684. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js":
  10685. /*!*************************************************************************!*\
  10686. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js ***!
  10687. \*************************************************************************/
  10688. /*! exports provided: default */
  10689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10690. "use strict";
  10691. __webpack_require__.r(__webpack_exports__);
  10692. /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js");
  10693. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10694. var i = {},
  10695. c = {},
  10696. k;
  10697. if (a === null || typeof a !== "object") a = {};
  10698. if (b === null || typeof b !== "object") b = {};
  10699. for (k in b) {
  10700. if (k in a) {
  10701. i[k] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a[k], b[k]);
  10702. } else {
  10703. c[k] = b[k];
  10704. }
  10705. }
  10706. return function (t) {
  10707. for (k in i) c[k] = i[k](t);
  10708. return c;
  10709. };
  10710. });
  10711. /***/ }),
  10712. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/piecewise.js":
  10713. /*!****************************************************************************!*\
  10714. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/piecewise.js ***!
  10715. \****************************************************************************/
  10716. /*! exports provided: default */
  10717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10718. "use strict";
  10719. __webpack_require__.r(__webpack_exports__);
  10720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return piecewise; });
  10721. function piecewise(interpolate, values) {
  10722. var i = 0,
  10723. n = values.length - 1,
  10724. v = values[0],
  10725. I = new Array(n < 0 ? 0 : n);
  10726. while (i < n) I[i] = interpolate(v, v = values[++i]);
  10727. return function (t) {
  10728. var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
  10729. return I[i](t - i);
  10730. };
  10731. }
  10732. /***/ }),
  10733. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/quantize.js":
  10734. /*!***************************************************************************!*\
  10735. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/quantize.js ***!
  10736. \***************************************************************************/
  10737. /*! exports provided: default */
  10738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10739. "use strict";
  10740. __webpack_require__.r(__webpack_exports__);
  10741. /* harmony default export */ __webpack_exports__["default"] = (function (interpolator, n) {
  10742. var samples = new Array(n);
  10743. for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
  10744. return samples;
  10745. });
  10746. /***/ }),
  10747. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js":
  10748. /*!**********************************************************************!*\
  10749. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js ***!
  10750. \**********************************************************************/
  10751. /*! exports provided: default, rgbBasis, rgbBasisClosed */
  10752. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10753. "use strict";
  10754. __webpack_require__.r(__webpack_exports__);
  10755. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbBasis", function() { return rgbBasis; });
  10756. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbBasisClosed", function() { return rgbBasisClosed; });
  10757. /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
  10758. /* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./basis.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basis.js");
  10759. /* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basisClosed.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/basisClosed.js");
  10760. /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./color.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/color.js");
  10761. /* harmony default export */ __webpack_exports__["default"] = ((function rgbGamma(y) {
  10762. var color = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__["gamma"])(y);
  10763. function rgb(start, end) {
  10764. var r = color((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(start)).r, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(end)).r),
  10765. g = color(start.g, end.g),
  10766. b = color(start.b, end.b),
  10767. opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__["default"])(start.opacity, end.opacity);
  10768. return function (t) {
  10769. start.r = r(t);
  10770. start.g = g(t);
  10771. start.b = b(t);
  10772. start.opacity = opacity(t);
  10773. return start + "";
  10774. };
  10775. }
  10776. rgb.gamma = rgbGamma;
  10777. return rgb;
  10778. })(1));
  10779. function rgbSpline(spline) {
  10780. return function (colors) {
  10781. var n = colors.length,
  10782. r = new Array(n),
  10783. g = new Array(n),
  10784. b = new Array(n),
  10785. i,
  10786. color;
  10787. for (i = 0; i < n; ++i) {
  10788. color = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(colors[i]);
  10789. r[i] = color.r || 0;
  10790. g[i] = color.g || 0;
  10791. b[i] = color.b || 0;
  10792. }
  10793. r = spline(r);
  10794. g = spline(g);
  10795. b = spline(b);
  10796. color.opacity = 1;
  10797. return function (t) {
  10798. color.r = r(t);
  10799. color.g = g(t);
  10800. color.b = b(t);
  10801. return color + "";
  10802. };
  10803. };
  10804. }
  10805. var rgbBasis = rgbSpline(_basis_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  10806. var rgbBasisClosed = rgbSpline(_basisClosed_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  10807. /***/ }),
  10808. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/round.js":
  10809. /*!************************************************************************!*\
  10810. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/round.js ***!
  10811. \************************************************************************/
  10812. /*! exports provided: default */
  10813. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10814. "use strict";
  10815. __webpack_require__.r(__webpack_exports__);
  10816. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10817. return a = +a, b = +b, function (t) {
  10818. return Math.round(a * (1 - t) + b * t);
  10819. };
  10820. });
  10821. /***/ }),
  10822. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js":
  10823. /*!*************************************************************************!*\
  10824. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js ***!
  10825. \*************************************************************************/
  10826. /*! exports provided: default */
  10827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10828. "use strict";
  10829. __webpack_require__.r(__webpack_exports__);
  10830. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
  10831. var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
  10832. reB = new RegExp(reA.source, "g");
  10833. function zero(b) {
  10834. return function () {
  10835. return b;
  10836. };
  10837. }
  10838. function one(b) {
  10839. return function (t) {
  10840. return b(t) + "";
  10841. };
  10842. }
  10843. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  10844. var bi = reA.lastIndex = reB.lastIndex = 0,
  10845. // scan index for next number in b
  10846. am,
  10847. // current match in a
  10848. bm,
  10849. // current match in b
  10850. bs,
  10851. // string preceding current number in b, if any
  10852. i = -1,
  10853. // index in s
  10854. s = [],
  10855. // string constants and placeholders
  10856. q = []; // number interpolators
  10857. // Coerce inputs to strings.
  10858. a = a + "", b = b + ""; // Interpolate pairs of numbers in a & b.
  10859. while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
  10860. if ((bs = bm.index) > bi) {
  10861. // a string precedes the next number in b
  10862. bs = b.slice(bi, bs);
  10863. if (s[i]) s[i] += bs; // coalesce with previous string
  10864. else s[++i] = bs;
  10865. }
  10866. if ((am = am[0]) === (bm = bm[0])) {
  10867. // numbers in a & b match
  10868. if (s[i]) s[i] += bm; // coalesce with previous string
  10869. else s[++i] = bm;
  10870. } else {
  10871. // interpolate non-matching numbers
  10872. s[++i] = null;
  10873. q.push({
  10874. i: i,
  10875. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(am, bm)
  10876. });
  10877. }
  10878. bi = reB.lastIndex;
  10879. } // Add remains of b.
  10880. if (bi < b.length) {
  10881. bs = b.slice(bi);
  10882. if (s[i]) s[i] += bs; // coalesce with previous string
  10883. else s[++i] = bs;
  10884. } // Special optimization for only a single match.
  10885. // Otherwise, interpolate each of the numbers and rejoin the string.
  10886. return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function (t) {
  10887. for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
  10888. return s.join("");
  10889. });
  10890. });
  10891. /***/ }),
  10892. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/decompose.js":
  10893. /*!**************************************************************************************!*\
  10894. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/decompose.js ***!
  10895. \**************************************************************************************/
  10896. /*! exports provided: identity, default */
  10897. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10898. "use strict";
  10899. __webpack_require__.r(__webpack_exports__);
  10900. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  10901. var degrees = 180 / Math.PI;
  10902. var identity = {
  10903. translateX: 0,
  10904. translateY: 0,
  10905. rotate: 0,
  10906. skewX: 0,
  10907. scaleX: 1,
  10908. scaleY: 1
  10909. };
  10910. /* harmony default export */ __webpack_exports__["default"] = (function (a, b, c, d, e, f) {
  10911. var scaleX, scaleY, skewX;
  10912. if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
  10913. if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
  10914. if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
  10915. if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
  10916. return {
  10917. translateX: e,
  10918. translateY: f,
  10919. rotate: Math.atan2(b, a) * degrees,
  10920. skewX: Math.atan(skewX) * degrees,
  10921. scaleX: scaleX,
  10922. scaleY: scaleY
  10923. };
  10924. });
  10925. /***/ }),
  10926. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/index.js":
  10927. /*!**********************************************************************************!*\
  10928. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/index.js ***!
  10929. \**********************************************************************************/
  10930. /*! exports provided: interpolateTransformCss, interpolateTransformSvg */
  10931. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10932. "use strict";
  10933. __webpack_require__.r(__webpack_exports__);
  10934. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return interpolateTransformCss; });
  10935. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return interpolateTransformSvg; });
  10936. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
  10937. /* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/parse.js");
  10938. function interpolateTransform(parse, pxComma, pxParen, degParen) {
  10939. function pop(s) {
  10940. return s.length ? s.pop() + " " : "";
  10941. }
  10942. function translate(xa, ya, xb, yb, s, q) {
  10943. if (xa !== xb || ya !== yb) {
  10944. var i = s.push("translate(", null, pxComma, null, pxParen);
  10945. q.push({
  10946. i: i - 4,
  10947. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)
  10948. }, {
  10949. i: i - 2,
  10950. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)
  10951. });
  10952. } else if (xb || yb) {
  10953. s.push("translate(" + xb + pxComma + yb + pxParen);
  10954. }
  10955. }
  10956. function rotate(a, b, s, q) {
  10957. if (a !== b) {
  10958. if (a - b > 180) b += 360;else if (b - a > 180) a += 360; // shortest path
  10959. q.push({
  10960. i: s.push(pop(s) + "rotate(", null, degParen) - 2,
  10961. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)
  10962. });
  10963. } else if (b) {
  10964. s.push(pop(s) + "rotate(" + b + degParen);
  10965. }
  10966. }
  10967. function skewX(a, b, s, q) {
  10968. if (a !== b) {
  10969. q.push({
  10970. i: s.push(pop(s) + "skewX(", null, degParen) - 2,
  10971. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)
  10972. });
  10973. } else if (b) {
  10974. s.push(pop(s) + "skewX(" + b + degParen);
  10975. }
  10976. }
  10977. function scale(xa, ya, xb, yb, s, q) {
  10978. if (xa !== xb || ya !== yb) {
  10979. var i = s.push(pop(s) + "scale(", null, ",", null, ")");
  10980. q.push({
  10981. i: i - 4,
  10982. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)
  10983. }, {
  10984. i: i - 2,
  10985. x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)
  10986. });
  10987. } else if (xb !== 1 || yb !== 1) {
  10988. s.push(pop(s) + "scale(" + xb + "," + yb + ")");
  10989. }
  10990. }
  10991. return function (a, b) {
  10992. var s = [],
  10993. // string constants and placeholders
  10994. q = []; // number interpolators
  10995. a = parse(a), b = parse(b);
  10996. translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
  10997. rotate(a.rotate, b.rotate, s, q);
  10998. skewX(a.skewX, b.skewX, s, q);
  10999. scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
  11000. a = b = null; // gc
  11001. return function (t) {
  11002. var i = -1,
  11003. n = q.length,
  11004. o;
  11005. while (++i < n) s[(o = q[i]).i] = o.x(t);
  11006. return s.join("");
  11007. };
  11008. };
  11009. }
  11010. var interpolateTransformCss = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__["parseCss"], "px, ", "px)", "deg)");
  11011. var interpolateTransformSvg = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__["parseSvg"], ", ", ")", ")");
  11012. /***/ }),
  11013. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/parse.js":
  11014. /*!**********************************************************************************!*\
  11015. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/parse.js ***!
  11016. \**********************************************************************************/
  11017. /*! exports provided: parseCss, parseSvg */
  11018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11019. "use strict";
  11020. __webpack_require__.r(__webpack_exports__);
  11021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCss", function() { return parseCss; });
  11022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSvg", function() { return parseSvg; });
  11023. /* harmony import */ var _decompose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decompose.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/transform/decompose.js");
  11024. var cssNode, cssRoot, cssView, svgNode;
  11025. function parseCss(value) {
  11026. if (value === "none") return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"];
  11027. if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView;
  11028. cssNode.style.transform = value;
  11029. value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform");
  11030. cssRoot.removeChild(cssNode);
  11031. value = value.slice(7, -1).split(",");
  11032. return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);
  11033. }
  11034. function parseSvg(value) {
  11035. if (value == null) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"];
  11036. if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
  11037. svgNode.setAttribute("transform", value);
  11038. if (!(value = svgNode.transform.baseVal.consolidate())) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"];
  11039. value = value.matrix;
  11040. return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.a, value.b, value.c, value.d, value.e, value.f);
  11041. }
  11042. /***/ }),
  11043. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js":
  11044. /*!************************************************************************!*\
  11045. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/value.js ***!
  11046. \************************************************************************/
  11047. /*! exports provided: default */
  11048. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11049. "use strict";
  11050. __webpack_require__.r(__webpack_exports__);
  11051. /* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "./node_modules/_d3-color@1.4.1@d3-color/src/index.js");
  11052. /* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rgb.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/rgb.js");
  11053. /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/array.js");
  11054. /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/date.js");
  11055. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/number.js");
  11056. /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./object.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/object.js");
  11057. /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./string.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/string.js");
  11058. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constant.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/constant.js");
  11059. /* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/numberArray.js");
  11060. /* harmony default export */ __webpack_exports__["default"] = (function (a, b) {
  11061. var t = typeof b,
  11062. c;
  11063. return b == null || t === "boolean" ? Object(_constant_js__WEBPACK_IMPORTED_MODULE_7__["default"])(b) : (t === "number" ? _number_js__WEBPACK_IMPORTED_MODULE_4__["default"] : t === "string" ? (c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["color"])(b)) ? (b = c, _rgb_js__WEBPACK_IMPORTED_MODULE_1__["default"]) : _string_js__WEBPACK_IMPORTED_MODULE_6__["default"] : b instanceof d3_color__WEBPACK_IMPORTED_MODULE_0__["color"] ? _rgb_js__WEBPACK_IMPORTED_MODULE_1__["default"] : b instanceof Date ? _date_js__WEBPACK_IMPORTED_MODULE_3__["default"] : Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_8__["isNumberArray"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_8__["default"] : Array.isArray(b) ? _array_js__WEBPACK_IMPORTED_MODULE_2__["genericArray"] : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? _object_js__WEBPACK_IMPORTED_MODULE_5__["default"] : _number_js__WEBPACK_IMPORTED_MODULE_4__["default"])(a, b);
  11064. });
  11065. /***/ }),
  11066. /***/ "./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/zoom.js":
  11067. /*!***********************************************************************!*\
  11068. !*** ./node_modules/_d3-interpolate@1.4.0@d3-interpolate/src/zoom.js ***!
  11069. \***********************************************************************/
  11070. /*! exports provided: default */
  11071. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11072. "use strict";
  11073. __webpack_require__.r(__webpack_exports__);
  11074. var rho = Math.SQRT2,
  11075. rho2 = 2,
  11076. rho4 = 4,
  11077. epsilon2 = 1e-12;
  11078. function cosh(x) {
  11079. return ((x = Math.exp(x)) + 1 / x) / 2;
  11080. }
  11081. function sinh(x) {
  11082. return ((x = Math.exp(x)) - 1 / x) / 2;
  11083. }
  11084. function tanh(x) {
  11085. return ((x = Math.exp(2 * x)) - 1) / (x + 1);
  11086. } // p0 = [ux0, uy0, w0]
  11087. // p1 = [ux1, uy1, w1]
  11088. /* harmony default export */ __webpack_exports__["default"] = (function (p0, p1) {
  11089. var ux0 = p0[0],
  11090. uy0 = p0[1],
  11091. w0 = p0[2],
  11092. ux1 = p1[0],
  11093. uy1 = p1[1],
  11094. w1 = p1[2],
  11095. dx = ux1 - ux0,
  11096. dy = uy1 - uy0,
  11097. d2 = dx * dx + dy * dy,
  11098. i,
  11099. S; // Special case for u0 ≅ u1.
  11100. if (d2 < epsilon2) {
  11101. S = Math.log(w1 / w0) / rho;
  11102. i = function (t) {
  11103. return [ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S)];
  11104. };
  11105. } // General case.
  11106. else {
  11107. var d1 = Math.sqrt(d2),
  11108. b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
  11109. b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
  11110. r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
  11111. r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
  11112. S = (r1 - r0) / rho;
  11113. i = function (t) {
  11114. var s = t * S,
  11115. coshr0 = cosh(r0),
  11116. u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
  11117. return [ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s + r0)];
  11118. };
  11119. }
  11120. i.duration = S * 1000;
  11121. return i;
  11122. });
  11123. /***/ }),
  11124. /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/index.js":
  11125. /*!*************************************************************!*\
  11126. !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/index.js ***!
  11127. \*************************************************************/
  11128. /*! exports provided: now, timer, timerFlush, timeout, interval */
  11129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11130. "use strict";
  11131. __webpack_require__.r(__webpack_exports__);
  11132. /* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js");
  11133. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["now"]; });
  11134. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["timer"]; });
  11135. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["timerFlush"]; });
  11136. /* harmony import */ var _timeout_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeout.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timeout.js");
  11137. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _timeout_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  11138. /* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/interval.js");
  11139. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _interval_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  11140. /***/ }),
  11141. /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/interval.js":
  11142. /*!****************************************************************!*\
  11143. !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/interval.js ***!
  11144. \****************************************************************/
  11145. /*! exports provided: default */
  11146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11147. "use strict";
  11148. __webpack_require__.r(__webpack_exports__);
  11149. /* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js");
  11150. /* harmony default export */ __webpack_exports__["default"] = (function (callback, delay, time) {
  11151. var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__["Timer"](),
  11152. total = delay;
  11153. if (delay == null) return t.restart(callback, delay, time), t;
  11154. delay = +delay, time = time == null ? Object(_timer_js__WEBPACK_IMPORTED_MODULE_0__["now"])() : +time;
  11155. t.restart(function tick(elapsed) {
  11156. elapsed += total;
  11157. t.restart(tick, total += delay, time);
  11158. callback(elapsed);
  11159. }, delay, time);
  11160. return t;
  11161. });
  11162. /***/ }),
  11163. /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timeout.js":
  11164. /*!***************************************************************!*\
  11165. !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/timeout.js ***!
  11166. \***************************************************************/
  11167. /*! exports provided: default */
  11168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11169. "use strict";
  11170. __webpack_require__.r(__webpack_exports__);
  11171. /* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js");
  11172. /* harmony default export */ __webpack_exports__["default"] = (function (callback, delay, time) {
  11173. var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__["Timer"]();
  11174. delay = delay == null ? 0 : +delay;
  11175. t.restart(function (elapsed) {
  11176. t.stop();
  11177. callback(elapsed + delay);
  11178. }, delay, time);
  11179. return t;
  11180. });
  11181. /***/ }),
  11182. /***/ "./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js":
  11183. /*!*************************************************************!*\
  11184. !*** ./node_modules/_d3-timer@1.0.10@d3-timer/src/timer.js ***!
  11185. \*************************************************************/
  11186. /*! exports provided: now, Timer, timer, timerFlush */
  11187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11188. "use strict";
  11189. __webpack_require__.r(__webpack_exports__);
  11190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return now; });
  11191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
  11192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; });
  11193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return timerFlush; });
  11194. var frame = 0,
  11195. // is an animation frame pending?
  11196. timeout = 0,
  11197. // is a timeout pending?
  11198. interval = 0,
  11199. // are any timers active?
  11200. pokeDelay = 1000,
  11201. // how frequently we check for clock skew
  11202. taskHead,
  11203. taskTail,
  11204. clockLast = 0,
  11205. clockNow = 0,
  11206. clockSkew = 0,
  11207. clock = typeof performance === "object" && performance.now ? performance : Date,
  11208. setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) {
  11209. setTimeout(f, 17);
  11210. };
  11211. function now() {
  11212. return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
  11213. }
  11214. function clearNow() {
  11215. clockNow = 0;
  11216. }
  11217. function Timer() {
  11218. this._call = this._time = this._next = null;
  11219. }
  11220. Timer.prototype = timer.prototype = {
  11221. constructor: Timer,
  11222. restart: function (callback, delay, time) {
  11223. if (typeof callback !== "function") throw new TypeError("callback is not a function");
  11224. time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
  11225. if (!this._next && taskTail !== this) {
  11226. if (taskTail) taskTail._next = this;else taskHead = this;
  11227. taskTail = this;
  11228. }
  11229. this._call = callback;
  11230. this._time = time;
  11231. sleep();
  11232. },
  11233. stop: function () {
  11234. if (this._call) {
  11235. this._call = null;
  11236. this._time = Infinity;
  11237. sleep();
  11238. }
  11239. }
  11240. };
  11241. function timer(callback, delay, time) {
  11242. var t = new Timer();
  11243. t.restart(callback, delay, time);
  11244. return t;
  11245. }
  11246. function timerFlush() {
  11247. now(); // Get the current time, if not already set.
  11248. ++frame; // Pretend we’ve set an alarm, if we haven’t already.
  11249. var t = taskHead,
  11250. e;
  11251. while (t) {
  11252. if ((e = clockNow - t._time) >= 0) t._call.call(null, e);
  11253. t = t._next;
  11254. }
  11255. --frame;
  11256. }
  11257. function wake() {
  11258. clockNow = (clockLast = clock.now()) + clockSkew;
  11259. frame = timeout = 0;
  11260. try {
  11261. timerFlush();
  11262. } finally {
  11263. frame = 0;
  11264. nap();
  11265. clockNow = 0;
  11266. }
  11267. }
  11268. function poke() {
  11269. var now = clock.now(),
  11270. delay = now - clockLast;
  11271. if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
  11272. }
  11273. function nap() {
  11274. var t0,
  11275. t1 = taskHead,
  11276. t2,
  11277. time = Infinity;
  11278. while (t1) {
  11279. if (t1._call) {
  11280. if (time > t1._time) time = t1._time;
  11281. t0 = t1, t1 = t1._next;
  11282. } else {
  11283. t2 = t1._next, t1._next = null;
  11284. t1 = t0 ? t0._next = t2 : taskHead = t2;
  11285. }
  11286. }
  11287. taskTail = t0;
  11288. sleep(time);
  11289. }
  11290. function sleep(time) {
  11291. if (frame) return; // Soonest alarm already set, or will be.
  11292. if (timeout) timeout = clearTimeout(timeout);
  11293. var delay = time - clockNow; // Strictly less than if we recomputed clockNow.
  11294. if (delay > 24) {
  11295. if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
  11296. if (interval) interval = clearInterval(interval);
  11297. } else {
  11298. if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
  11299. frame = 1, setFrame(wake);
  11300. }
  11301. }
  11302. /***/ }),
  11303. /***/ "./node_modules/_detect-browser@5.1.0@detect-browser/index.js":
  11304. /*!********************************************************************!*\
  11305. !*** ./node_modules/_detect-browser@5.1.0@detect-browser/index.js ***!
  11306. \********************************************************************/
  11307. /*! no static exports found */
  11308. /***/ (function(module, exports, __webpack_require__) {
  11309. "use strict";
  11310. /* WEBPACK VAR INJECTION */(function(process) {
  11311. var __spreadArrays = this && this.__spreadArrays || function () {
  11312. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  11313. for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
  11314. return r;
  11315. };
  11316. Object.defineProperty(exports, "__esModule", {
  11317. value: true
  11318. });
  11319. var BrowserInfo =
  11320. /** @class */
  11321. function () {
  11322. function BrowserInfo(name, version, os) {
  11323. this.name = name;
  11324. this.version = version;
  11325. this.os = os;
  11326. this.type = 'browser';
  11327. }
  11328. return BrowserInfo;
  11329. }();
  11330. exports.BrowserInfo = BrowserInfo;
  11331. var NodeInfo =
  11332. /** @class */
  11333. function () {
  11334. function NodeInfo(version) {
  11335. this.version = version;
  11336. this.type = 'node';
  11337. this.name = 'node';
  11338. this.os = process.platform;
  11339. }
  11340. return NodeInfo;
  11341. }();
  11342. exports.NodeInfo = NodeInfo;
  11343. var SearchBotDeviceInfo =
  11344. /** @class */
  11345. function () {
  11346. function SearchBotDeviceInfo(name, version, os, bot) {
  11347. this.name = name;
  11348. this.version = version;
  11349. this.os = os;
  11350. this.bot = bot;
  11351. this.type = 'bot-device';
  11352. }
  11353. return SearchBotDeviceInfo;
  11354. }();
  11355. exports.SearchBotDeviceInfo = SearchBotDeviceInfo;
  11356. var BotInfo =
  11357. /** @class */
  11358. function () {
  11359. function BotInfo() {
  11360. this.type = 'bot';
  11361. this.bot = true; // NOTE: deprecated test name instead
  11362. this.name = 'bot';
  11363. this.version = null;
  11364. this.os = null;
  11365. }
  11366. return BotInfo;
  11367. }();
  11368. exports.BotInfo = BotInfo;
  11369. var ReactNativeInfo =
  11370. /** @class */
  11371. function () {
  11372. function ReactNativeInfo() {
  11373. this.type = 'react-native';
  11374. this.name = 'react-native';
  11375. this.version = null;
  11376. this.os = null;
  11377. }
  11378. return ReactNativeInfo;
  11379. }();
  11380. exports.ReactNativeInfo = ReactNativeInfo;
  11381. ; // tslint:disable-next-line:max-line-length
  11382. var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;
  11383. var SEARCHBOT_OS_REGEX = /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/;
  11384. var REQUIRED_VERSION_PARTS = 3;
  11385. var userAgentRules = [['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', /Edg\/([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|$)/], ['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', /FBAV\/([0-9\.]+)/], ['instagram', /Instagram\s([0-9\.]+)/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Mobile/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ['searchbot', SEARCHBOX_UA_REGEX]];
  11386. var operatingSystemRules = [['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/], ['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/]];
  11387. function detect(userAgent) {
  11388. if (!!userAgent) {
  11389. return parseUserAgent(userAgent);
  11390. }
  11391. if (typeof document === 'undefined' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
  11392. return new ReactNativeInfo();
  11393. }
  11394. if (typeof navigator !== 'undefined') {
  11395. return parseUserAgent(navigator.userAgent);
  11396. }
  11397. return getNodeVersion();
  11398. }
  11399. exports.detect = detect;
  11400. function matchUserAgent(ua) {
  11401. // opted for using reduce here rather than Array#first with a regex.test call
  11402. // this is primarily because using the reduce we only perform the regex
  11403. // execution once rather than once for the test and for the exec again below
  11404. // probably something that needs to be benchmarked though
  11405. return ua !== '' && userAgentRules.reduce(function (matched, _a) {
  11406. var browser = _a[0],
  11407. regex = _a[1];
  11408. if (matched) {
  11409. return matched;
  11410. }
  11411. var uaMatch = regex.exec(ua);
  11412. return !!uaMatch && [browser, uaMatch];
  11413. }, false);
  11414. }
  11415. function browserName(ua) {
  11416. var data = matchUserAgent(ua);
  11417. return data ? data[0] : null;
  11418. }
  11419. exports.browserName = browserName;
  11420. function parseUserAgent(ua) {
  11421. var matchedRule = matchUserAgent(ua);
  11422. if (!matchedRule) {
  11423. return null;
  11424. }
  11425. var name = matchedRule[0],
  11426. match = matchedRule[1];
  11427. if (name === 'searchbot') {
  11428. return new BotInfo();
  11429. }
  11430. var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3);
  11431. if (versionParts) {
  11432. if (versionParts.length < REQUIRED_VERSION_PARTS) {
  11433. versionParts = __spreadArrays(versionParts, createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length));
  11434. }
  11435. } else {
  11436. versionParts = [];
  11437. }
  11438. var version = versionParts.join('.');
  11439. var os = detectOS(ua);
  11440. var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);
  11441. if (searchBotMatch && searchBotMatch[1]) {
  11442. return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);
  11443. }
  11444. return new BrowserInfo(name, versionParts.join('.'), os);
  11445. }
  11446. exports.parseUserAgent = parseUserAgent;
  11447. function detectOS(ua) {
  11448. for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {
  11449. var _a = operatingSystemRules[ii],
  11450. os = _a[0],
  11451. regex = _a[1];
  11452. var match = regex.exec(ua);
  11453. if (match) {
  11454. return os;
  11455. }
  11456. }
  11457. return null;
  11458. }
  11459. exports.detectOS = detectOS;
  11460. function getNodeVersion() {
  11461. var isNode = typeof process !== 'undefined' && process.version;
  11462. return isNode ? new NodeInfo(process.version.slice(1)) : null;
  11463. }
  11464. exports.getNodeVersion = getNodeVersion;
  11465. function createVersionParts(count) {
  11466. var output = [];
  11467. for (var ii = 0; ii < count; ii++) {
  11468. output.push('0');
  11469. }
  11470. return output;
  11471. }
  11472. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../_process@0.11.10@process/browser.js */ "./node_modules/_process@0.11.10@process/browser.js")))
  11473. /***/ }),
  11474. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js":
  11475. /*!***************************************************************!*\
  11476. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js ***!
  11477. \***************************************************************/
  11478. /*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */
  11479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11480. "use strict";
  11481. __webpack_require__.r(__webpack_exports__);
  11482. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EPSILON", function() { return EPSILON; });
  11483. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_TYPE", function() { return ARRAY_TYPE; });
  11484. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RANDOM", function() { return RANDOM; });
  11485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMatrixArrayType", function() { return setMatrixArrayType; });
  11486. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toRadian", function() { return toRadian; });
  11487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  11488. /**
  11489. * Common utilities
  11490. * @module glMatrix
  11491. */
  11492. // Configuration Constants
  11493. var EPSILON = 0.000001;
  11494. var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;
  11495. var RANDOM = Math.random;
  11496. /**
  11497. * Sets the type of array used when creating new vectors and matrices
  11498. *
  11499. * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array
  11500. */
  11501. function setMatrixArrayType(type) {
  11502. ARRAY_TYPE = type;
  11503. }
  11504. var degree = Math.PI / 180;
  11505. /**
  11506. * Convert Degree To Radian
  11507. *
  11508. * @param {Number} a Angle in Degrees
  11509. */
  11510. function toRadian(a) {
  11511. return a * degree;
  11512. }
  11513. /**
  11514. * Tests whether or not the arguments have approximately the same value, within an absolute
  11515. * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
  11516. * than or equal to 1.0, and a relative tolerance is used for larger values)
  11517. *
  11518. * @param {Number} a The first number to test.
  11519. * @param {Number} b The second number to test.
  11520. * @returns {Boolean} True if the numbers are approximately equal, false otherwise.
  11521. */
  11522. function equals(a, b) {
  11523. return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));
  11524. }
  11525. if (!Math.hypot) Math.hypot = function () {
  11526. var y = 0,
  11527. i = arguments.length;
  11528. while (i--) {
  11529. y += arguments[i] * arguments[i];
  11530. }
  11531. return Math.sqrt(y);
  11532. };
  11533. /***/ }),
  11534. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js":
  11535. /*!**************************************************************!*\
  11536. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/index.js ***!
  11537. \**************************************************************/
  11538. /*! exports provided: glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 */
  11539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11540. "use strict";
  11541. __webpack_require__.r(__webpack_exports__);
  11542. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  11543. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "glMatrix", function() { return _common_js__WEBPACK_IMPORTED_MODULE_0__; });
  11544. /* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat2.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2.js");
  11545. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat2", function() { return _mat2_js__WEBPACK_IMPORTED_MODULE_1__; });
  11546. /* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat2d.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2d.js");
  11547. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat2d", function() { return _mat2d_js__WEBPACK_IMPORTED_MODULE_2__; });
  11548. /* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mat3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js");
  11549. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat3", function() { return _mat3_js__WEBPACK_IMPORTED_MODULE_3__; });
  11550. /* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mat4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js");
  11551. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "mat4", function() { return _mat4_js__WEBPACK_IMPORTED_MODULE_4__; });
  11552. /* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quat.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js");
  11553. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "quat", function() { return _quat_js__WEBPACK_IMPORTED_MODULE_5__; });
  11554. /* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quat2.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat2.js");
  11555. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "quat2", function() { return _quat2_js__WEBPACK_IMPORTED_MODULE_6__; });
  11556. /* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vec2.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js");
  11557. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "vec2", function() { return _vec2_js__WEBPACK_IMPORTED_MODULE_7__; });
  11558. /* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./vec3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js");
  11559. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "vec3", function() { return _vec3_js__WEBPACK_IMPORTED_MODULE_8__; });
  11560. /* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./vec4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js");
  11561. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "vec4", function() { return _vec4_js__WEBPACK_IMPORTED_MODULE_9__; });
  11562. /***/ }),
  11563. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2.js":
  11564. /*!*************************************************************!*\
  11565. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2.js ***!
  11566. \*************************************************************/
  11567. /*! exports provided: create, clone, copy, identity, fromValues, set, transpose, invert, adjoint, determinant, multiply, rotate, scale, fromRotation, fromScaling, str, frob, LDU, add, subtract, exactEquals, equals, multiplyScalar, multiplyScalarAndAdd, mul, sub */
  11568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11569. "use strict";
  11570. __webpack_require__.r(__webpack_exports__);
  11571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  11572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  11573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  11574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  11575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  11576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  11577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
  11578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  11579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
  11580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
  11581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  11582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  11583. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  11584. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  11585. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
  11586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  11587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
  11588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LDU", function() { return LDU; });
  11589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  11590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  11591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  11592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  11593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
  11594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
  11595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  11596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  11597. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  11598. /**
  11599. * 2x2 Matrix
  11600. * @module mat2
  11601. */
  11602. /**
  11603. * Creates a new identity mat2
  11604. *
  11605. * @returns {mat2} a new 2x2 matrix
  11606. */
  11607. function create() {
  11608. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  11609. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  11610. out[1] = 0;
  11611. out[2] = 0;
  11612. }
  11613. out[0] = 1;
  11614. out[3] = 1;
  11615. return out;
  11616. }
  11617. /**
  11618. * Creates a new mat2 initialized with values from an existing matrix
  11619. *
  11620. * @param {ReadonlyMat2} a matrix to clone
  11621. * @returns {mat2} a new 2x2 matrix
  11622. */
  11623. function clone(a) {
  11624. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  11625. out[0] = a[0];
  11626. out[1] = a[1];
  11627. out[2] = a[2];
  11628. out[3] = a[3];
  11629. return out;
  11630. }
  11631. /**
  11632. * Copy the values from one mat2 to another
  11633. *
  11634. * @param {mat2} out the receiving matrix
  11635. * @param {ReadonlyMat2} a the source matrix
  11636. * @returns {mat2} out
  11637. */
  11638. function copy(out, a) {
  11639. out[0] = a[0];
  11640. out[1] = a[1];
  11641. out[2] = a[2];
  11642. out[3] = a[3];
  11643. return out;
  11644. }
  11645. /**
  11646. * Set a mat2 to the identity matrix
  11647. *
  11648. * @param {mat2} out the receiving matrix
  11649. * @returns {mat2} out
  11650. */
  11651. function identity(out) {
  11652. out[0] = 1;
  11653. out[1] = 0;
  11654. out[2] = 0;
  11655. out[3] = 1;
  11656. return out;
  11657. }
  11658. /**
  11659. * Create a new mat2 with the given values
  11660. *
  11661. * @param {Number} m00 Component in column 0, row 0 position (index 0)
  11662. * @param {Number} m01 Component in column 0, row 1 position (index 1)
  11663. * @param {Number} m10 Component in column 1, row 0 position (index 2)
  11664. * @param {Number} m11 Component in column 1, row 1 position (index 3)
  11665. * @returns {mat2} out A new 2x2 matrix
  11666. */
  11667. function fromValues(m00, m01, m10, m11) {
  11668. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  11669. out[0] = m00;
  11670. out[1] = m01;
  11671. out[2] = m10;
  11672. out[3] = m11;
  11673. return out;
  11674. }
  11675. /**
  11676. * Set the components of a mat2 to the given values
  11677. *
  11678. * @param {mat2} out the receiving matrix
  11679. * @param {Number} m00 Component in column 0, row 0 position (index 0)
  11680. * @param {Number} m01 Component in column 0, row 1 position (index 1)
  11681. * @param {Number} m10 Component in column 1, row 0 position (index 2)
  11682. * @param {Number} m11 Component in column 1, row 1 position (index 3)
  11683. * @returns {mat2} out
  11684. */
  11685. function set(out, m00, m01, m10, m11) {
  11686. out[0] = m00;
  11687. out[1] = m01;
  11688. out[2] = m10;
  11689. out[3] = m11;
  11690. return out;
  11691. }
  11692. /**
  11693. * Transpose the values of a mat2
  11694. *
  11695. * @param {mat2} out the receiving matrix
  11696. * @param {ReadonlyMat2} a the source matrix
  11697. * @returns {mat2} out
  11698. */
  11699. function transpose(out, a) {
  11700. // If we are transposing ourselves we can skip a few steps but have to cache
  11701. // some values
  11702. if (out === a) {
  11703. var a1 = a[1];
  11704. out[1] = a[2];
  11705. out[2] = a1;
  11706. } else {
  11707. out[0] = a[0];
  11708. out[1] = a[2];
  11709. out[2] = a[1];
  11710. out[3] = a[3];
  11711. }
  11712. return out;
  11713. }
  11714. /**
  11715. * Inverts a mat2
  11716. *
  11717. * @param {mat2} out the receiving matrix
  11718. * @param {ReadonlyMat2} a the source matrix
  11719. * @returns {mat2} out
  11720. */
  11721. function invert(out, a) {
  11722. var a0 = a[0],
  11723. a1 = a[1],
  11724. a2 = a[2],
  11725. a3 = a[3]; // Calculate the determinant
  11726. var det = a0 * a3 - a2 * a1;
  11727. if (!det) {
  11728. return null;
  11729. }
  11730. det = 1.0 / det;
  11731. out[0] = a3 * det;
  11732. out[1] = -a1 * det;
  11733. out[2] = -a2 * det;
  11734. out[3] = a0 * det;
  11735. return out;
  11736. }
  11737. /**
  11738. * Calculates the adjugate of a mat2
  11739. *
  11740. * @param {mat2} out the receiving matrix
  11741. * @param {ReadonlyMat2} a the source matrix
  11742. * @returns {mat2} out
  11743. */
  11744. function adjoint(out, a) {
  11745. // Caching this value is nessecary if out == a
  11746. var a0 = a[0];
  11747. out[0] = a[3];
  11748. out[1] = -a[1];
  11749. out[2] = -a[2];
  11750. out[3] = a0;
  11751. return out;
  11752. }
  11753. /**
  11754. * Calculates the determinant of a mat2
  11755. *
  11756. * @param {ReadonlyMat2} a the source matrix
  11757. * @returns {Number} determinant of a
  11758. */
  11759. function determinant(a) {
  11760. return a[0] * a[3] - a[2] * a[1];
  11761. }
  11762. /**
  11763. * Multiplies two mat2's
  11764. *
  11765. * @param {mat2} out the receiving matrix
  11766. * @param {ReadonlyMat2} a the first operand
  11767. * @param {ReadonlyMat2} b the second operand
  11768. * @returns {mat2} out
  11769. */
  11770. function multiply(out, a, b) {
  11771. var a0 = a[0],
  11772. a1 = a[1],
  11773. a2 = a[2],
  11774. a3 = a[3];
  11775. var b0 = b[0],
  11776. b1 = b[1],
  11777. b2 = b[2],
  11778. b3 = b[3];
  11779. out[0] = a0 * b0 + a2 * b1;
  11780. out[1] = a1 * b0 + a3 * b1;
  11781. out[2] = a0 * b2 + a2 * b3;
  11782. out[3] = a1 * b2 + a3 * b3;
  11783. return out;
  11784. }
  11785. /**
  11786. * Rotates a mat2 by the given angle
  11787. *
  11788. * @param {mat2} out the receiving matrix
  11789. * @param {ReadonlyMat2} a the matrix to rotate
  11790. * @param {Number} rad the angle to rotate the matrix by
  11791. * @returns {mat2} out
  11792. */
  11793. function rotate(out, a, rad) {
  11794. var a0 = a[0],
  11795. a1 = a[1],
  11796. a2 = a[2],
  11797. a3 = a[3];
  11798. var s = Math.sin(rad);
  11799. var c = Math.cos(rad);
  11800. out[0] = a0 * c + a2 * s;
  11801. out[1] = a1 * c + a3 * s;
  11802. out[2] = a0 * -s + a2 * c;
  11803. out[3] = a1 * -s + a3 * c;
  11804. return out;
  11805. }
  11806. /**
  11807. * Scales the mat2 by the dimensions in the given vec2
  11808. *
  11809. * @param {mat2} out the receiving matrix
  11810. * @param {ReadonlyMat2} a the matrix to rotate
  11811. * @param {ReadonlyVec2} v the vec2 to scale the matrix by
  11812. * @returns {mat2} out
  11813. **/
  11814. function scale(out, a, v) {
  11815. var a0 = a[0],
  11816. a1 = a[1],
  11817. a2 = a[2],
  11818. a3 = a[3];
  11819. var v0 = v[0],
  11820. v1 = v[1];
  11821. out[0] = a0 * v0;
  11822. out[1] = a1 * v0;
  11823. out[2] = a2 * v1;
  11824. out[3] = a3 * v1;
  11825. return out;
  11826. }
  11827. /**
  11828. * Creates a matrix from a given angle
  11829. * This is equivalent to (but much faster than):
  11830. *
  11831. * mat2.identity(dest);
  11832. * mat2.rotate(dest, dest, rad);
  11833. *
  11834. * @param {mat2} out mat2 receiving operation result
  11835. * @param {Number} rad the angle to rotate the matrix by
  11836. * @returns {mat2} out
  11837. */
  11838. function fromRotation(out, rad) {
  11839. var s = Math.sin(rad);
  11840. var c = Math.cos(rad);
  11841. out[0] = c;
  11842. out[1] = s;
  11843. out[2] = -s;
  11844. out[3] = c;
  11845. return out;
  11846. }
  11847. /**
  11848. * Creates a matrix from a vector scaling
  11849. * This is equivalent to (but much faster than):
  11850. *
  11851. * mat2.identity(dest);
  11852. * mat2.scale(dest, dest, vec);
  11853. *
  11854. * @param {mat2} out mat2 receiving operation result
  11855. * @param {ReadonlyVec2} v Scaling vector
  11856. * @returns {mat2} out
  11857. */
  11858. function fromScaling(out, v) {
  11859. out[0] = v[0];
  11860. out[1] = 0;
  11861. out[2] = 0;
  11862. out[3] = v[1];
  11863. return out;
  11864. }
  11865. /**
  11866. * Returns a string representation of a mat2
  11867. *
  11868. * @param {ReadonlyMat2} a matrix to represent as a string
  11869. * @returns {String} string representation of the matrix
  11870. */
  11871. function str(a) {
  11872. return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")";
  11873. }
  11874. /**
  11875. * Returns Frobenius norm of a mat2
  11876. *
  11877. * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of
  11878. * @returns {Number} Frobenius norm
  11879. */
  11880. function frob(a) {
  11881. return Math.hypot(a[0], a[1], a[2], a[3]);
  11882. }
  11883. /**
  11884. * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
  11885. * @param {ReadonlyMat2} L the lower triangular matrix
  11886. * @param {ReadonlyMat2} D the diagonal matrix
  11887. * @param {ReadonlyMat2} U the upper triangular matrix
  11888. * @param {ReadonlyMat2} a the input matrix to factorize
  11889. */
  11890. function LDU(L, D, U, a) {
  11891. L[2] = a[2] / a[0];
  11892. U[0] = a[0];
  11893. U[1] = a[1];
  11894. U[3] = a[3] - L[2] * U[1];
  11895. return [L, D, U];
  11896. }
  11897. /**
  11898. * Adds two mat2's
  11899. *
  11900. * @param {mat2} out the receiving matrix
  11901. * @param {ReadonlyMat2} a the first operand
  11902. * @param {ReadonlyMat2} b the second operand
  11903. * @returns {mat2} out
  11904. */
  11905. function add(out, a, b) {
  11906. out[0] = a[0] + b[0];
  11907. out[1] = a[1] + b[1];
  11908. out[2] = a[2] + b[2];
  11909. out[3] = a[3] + b[3];
  11910. return out;
  11911. }
  11912. /**
  11913. * Subtracts matrix b from matrix a
  11914. *
  11915. * @param {mat2} out the receiving matrix
  11916. * @param {ReadonlyMat2} a the first operand
  11917. * @param {ReadonlyMat2} b the second operand
  11918. * @returns {mat2} out
  11919. */
  11920. function subtract(out, a, b) {
  11921. out[0] = a[0] - b[0];
  11922. out[1] = a[1] - b[1];
  11923. out[2] = a[2] - b[2];
  11924. out[3] = a[3] - b[3];
  11925. return out;
  11926. }
  11927. /**
  11928. * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
  11929. *
  11930. * @param {ReadonlyMat2} a The first matrix.
  11931. * @param {ReadonlyMat2} b The second matrix.
  11932. * @returns {Boolean} True if the matrices are equal, false otherwise.
  11933. */
  11934. function exactEquals(a, b) {
  11935. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];
  11936. }
  11937. /**
  11938. * Returns whether or not the matrices have approximately the same elements in the same position.
  11939. *
  11940. * @param {ReadonlyMat2} a The first matrix.
  11941. * @param {ReadonlyMat2} b The second matrix.
  11942. * @returns {Boolean} True if the matrices are equal, false otherwise.
  11943. */
  11944. function equals(a, b) {
  11945. var a0 = a[0],
  11946. a1 = a[1],
  11947. a2 = a[2],
  11948. a3 = a[3];
  11949. var b0 = b[0],
  11950. b1 = b[1],
  11951. b2 = b[2],
  11952. b3 = b[3];
  11953. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));
  11954. }
  11955. /**
  11956. * Multiply each element of the matrix by a scalar.
  11957. *
  11958. * @param {mat2} out the receiving matrix
  11959. * @param {ReadonlyMat2} a the matrix to scale
  11960. * @param {Number} b amount to scale the matrix's elements by
  11961. * @returns {mat2} out
  11962. */
  11963. function multiplyScalar(out, a, b) {
  11964. out[0] = a[0] * b;
  11965. out[1] = a[1] * b;
  11966. out[2] = a[2] * b;
  11967. out[3] = a[3] * b;
  11968. return out;
  11969. }
  11970. /**
  11971. * Adds two mat2's after multiplying each element of the second operand by a scalar value.
  11972. *
  11973. * @param {mat2} out the receiving vector
  11974. * @param {ReadonlyMat2} a the first operand
  11975. * @param {ReadonlyMat2} b the second operand
  11976. * @param {Number} scale the amount to scale b's elements by before adding
  11977. * @returns {mat2} out
  11978. */
  11979. function multiplyScalarAndAdd(out, a, b, scale) {
  11980. out[0] = a[0] + b[0] * scale;
  11981. out[1] = a[1] + b[1] * scale;
  11982. out[2] = a[2] + b[2] * scale;
  11983. out[3] = a[3] + b[3] * scale;
  11984. return out;
  11985. }
  11986. /**
  11987. * Alias for {@link mat2.multiply}
  11988. * @function
  11989. */
  11990. var mul = multiply;
  11991. /**
  11992. * Alias for {@link mat2.subtract}
  11993. * @function
  11994. */
  11995. var sub = subtract;
  11996. /***/ }),
  11997. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2d.js":
  11998. /*!**************************************************************!*\
  11999. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat2d.js ***!
  12000. \**************************************************************/
  12001. /*! exports provided: create, clone, copy, identity, fromValues, set, invert, determinant, multiply, rotate, scale, translate, fromRotation, fromScaling, fromTranslation, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
  12002. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12003. "use strict";
  12004. __webpack_require__.r(__webpack_exports__);
  12005. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  12006. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  12007. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  12008. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  12009. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  12010. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  12011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  12012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
  12013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  12014. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  12015. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  12016. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
  12017. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  12018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
  12019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
  12020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  12021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
  12022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  12023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  12024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
  12025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
  12026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  12027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  12028. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  12029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  12030. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  12031. /**
  12032. * 2x3 Matrix
  12033. * @module mat2d
  12034. * @description
  12035. * A mat2d contains six elements defined as:
  12036. * <pre>
  12037. * [a, b,
  12038. * c, d,
  12039. * tx, ty]
  12040. * </pre>
  12041. * This is a short form for the 3x3 matrix:
  12042. * <pre>
  12043. * [a, b, 0,
  12044. * c, d, 0,
  12045. * tx, ty, 1]
  12046. * </pre>
  12047. * The last column is ignored so the array is shorter and operations are faster.
  12048. */
  12049. /**
  12050. * Creates a new identity mat2d
  12051. *
  12052. * @returns {mat2d} a new 2x3 matrix
  12053. */
  12054. function create() {
  12055. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](6);
  12056. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  12057. out[1] = 0;
  12058. out[2] = 0;
  12059. out[4] = 0;
  12060. out[5] = 0;
  12061. }
  12062. out[0] = 1;
  12063. out[3] = 1;
  12064. return out;
  12065. }
  12066. /**
  12067. * Creates a new mat2d initialized with values from an existing matrix
  12068. *
  12069. * @param {ReadonlyMat2d} a matrix to clone
  12070. * @returns {mat2d} a new 2x3 matrix
  12071. */
  12072. function clone(a) {
  12073. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](6);
  12074. out[0] = a[0];
  12075. out[1] = a[1];
  12076. out[2] = a[2];
  12077. out[3] = a[3];
  12078. out[4] = a[4];
  12079. out[5] = a[5];
  12080. return out;
  12081. }
  12082. /**
  12083. * Copy the values from one mat2d to another
  12084. *
  12085. * @param {mat2d} out the receiving matrix
  12086. * @param {ReadonlyMat2d} a the source matrix
  12087. * @returns {mat2d} out
  12088. */
  12089. function copy(out, a) {
  12090. out[0] = a[0];
  12091. out[1] = a[1];
  12092. out[2] = a[2];
  12093. out[3] = a[3];
  12094. out[4] = a[4];
  12095. out[5] = a[5];
  12096. return out;
  12097. }
  12098. /**
  12099. * Set a mat2d to the identity matrix
  12100. *
  12101. * @param {mat2d} out the receiving matrix
  12102. * @returns {mat2d} out
  12103. */
  12104. function identity(out) {
  12105. out[0] = 1;
  12106. out[1] = 0;
  12107. out[2] = 0;
  12108. out[3] = 1;
  12109. out[4] = 0;
  12110. out[5] = 0;
  12111. return out;
  12112. }
  12113. /**
  12114. * Create a new mat2d with the given values
  12115. *
  12116. * @param {Number} a Component A (index 0)
  12117. * @param {Number} b Component B (index 1)
  12118. * @param {Number} c Component C (index 2)
  12119. * @param {Number} d Component D (index 3)
  12120. * @param {Number} tx Component TX (index 4)
  12121. * @param {Number} ty Component TY (index 5)
  12122. * @returns {mat2d} A new mat2d
  12123. */
  12124. function fromValues(a, b, c, d, tx, ty) {
  12125. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](6);
  12126. out[0] = a;
  12127. out[1] = b;
  12128. out[2] = c;
  12129. out[3] = d;
  12130. out[4] = tx;
  12131. out[5] = ty;
  12132. return out;
  12133. }
  12134. /**
  12135. * Set the components of a mat2d to the given values
  12136. *
  12137. * @param {mat2d} out the receiving matrix
  12138. * @param {Number} a Component A (index 0)
  12139. * @param {Number} b Component B (index 1)
  12140. * @param {Number} c Component C (index 2)
  12141. * @param {Number} d Component D (index 3)
  12142. * @param {Number} tx Component TX (index 4)
  12143. * @param {Number} ty Component TY (index 5)
  12144. * @returns {mat2d} out
  12145. */
  12146. function set(out, a, b, c, d, tx, ty) {
  12147. out[0] = a;
  12148. out[1] = b;
  12149. out[2] = c;
  12150. out[3] = d;
  12151. out[4] = tx;
  12152. out[5] = ty;
  12153. return out;
  12154. }
  12155. /**
  12156. * Inverts a mat2d
  12157. *
  12158. * @param {mat2d} out the receiving matrix
  12159. * @param {ReadonlyMat2d} a the source matrix
  12160. * @returns {mat2d} out
  12161. */
  12162. function invert(out, a) {
  12163. var aa = a[0],
  12164. ab = a[1],
  12165. ac = a[2],
  12166. ad = a[3];
  12167. var atx = a[4],
  12168. aty = a[5];
  12169. var det = aa * ad - ab * ac;
  12170. if (!det) {
  12171. return null;
  12172. }
  12173. det = 1.0 / det;
  12174. out[0] = ad * det;
  12175. out[1] = -ab * det;
  12176. out[2] = -ac * det;
  12177. out[3] = aa * det;
  12178. out[4] = (ac * aty - ad * atx) * det;
  12179. out[5] = (ab * atx - aa * aty) * det;
  12180. return out;
  12181. }
  12182. /**
  12183. * Calculates the determinant of a mat2d
  12184. *
  12185. * @param {ReadonlyMat2d} a the source matrix
  12186. * @returns {Number} determinant of a
  12187. */
  12188. function determinant(a) {
  12189. return a[0] * a[3] - a[1] * a[2];
  12190. }
  12191. /**
  12192. * Multiplies two mat2d's
  12193. *
  12194. * @param {mat2d} out the receiving matrix
  12195. * @param {ReadonlyMat2d} a the first operand
  12196. * @param {ReadonlyMat2d} b the second operand
  12197. * @returns {mat2d} out
  12198. */
  12199. function multiply(out, a, b) {
  12200. var a0 = a[0],
  12201. a1 = a[1],
  12202. a2 = a[2],
  12203. a3 = a[3],
  12204. a4 = a[4],
  12205. a5 = a[5];
  12206. var b0 = b[0],
  12207. b1 = b[1],
  12208. b2 = b[2],
  12209. b3 = b[3],
  12210. b4 = b[4],
  12211. b5 = b[5];
  12212. out[0] = a0 * b0 + a2 * b1;
  12213. out[1] = a1 * b0 + a3 * b1;
  12214. out[2] = a0 * b2 + a2 * b3;
  12215. out[3] = a1 * b2 + a3 * b3;
  12216. out[4] = a0 * b4 + a2 * b5 + a4;
  12217. out[5] = a1 * b4 + a3 * b5 + a5;
  12218. return out;
  12219. }
  12220. /**
  12221. * Rotates a mat2d by the given angle
  12222. *
  12223. * @param {mat2d} out the receiving matrix
  12224. * @param {ReadonlyMat2d} a the matrix to rotate
  12225. * @param {Number} rad the angle to rotate the matrix by
  12226. * @returns {mat2d} out
  12227. */
  12228. function rotate(out, a, rad) {
  12229. var a0 = a[0],
  12230. a1 = a[1],
  12231. a2 = a[2],
  12232. a3 = a[3],
  12233. a4 = a[4],
  12234. a5 = a[5];
  12235. var s = Math.sin(rad);
  12236. var c = Math.cos(rad);
  12237. out[0] = a0 * c + a2 * s;
  12238. out[1] = a1 * c + a3 * s;
  12239. out[2] = a0 * -s + a2 * c;
  12240. out[3] = a1 * -s + a3 * c;
  12241. out[4] = a4;
  12242. out[5] = a5;
  12243. return out;
  12244. }
  12245. /**
  12246. * Scales the mat2d by the dimensions in the given vec2
  12247. *
  12248. * @param {mat2d} out the receiving matrix
  12249. * @param {ReadonlyMat2d} a the matrix to translate
  12250. * @param {ReadonlyVec2} v the vec2 to scale the matrix by
  12251. * @returns {mat2d} out
  12252. **/
  12253. function scale(out, a, v) {
  12254. var a0 = a[0],
  12255. a1 = a[1],
  12256. a2 = a[2],
  12257. a3 = a[3],
  12258. a4 = a[4],
  12259. a5 = a[5];
  12260. var v0 = v[0],
  12261. v1 = v[1];
  12262. out[0] = a0 * v0;
  12263. out[1] = a1 * v0;
  12264. out[2] = a2 * v1;
  12265. out[3] = a3 * v1;
  12266. out[4] = a4;
  12267. out[5] = a5;
  12268. return out;
  12269. }
  12270. /**
  12271. * Translates the mat2d by the dimensions in the given vec2
  12272. *
  12273. * @param {mat2d} out the receiving matrix
  12274. * @param {ReadonlyMat2d} a the matrix to translate
  12275. * @param {ReadonlyVec2} v the vec2 to translate the matrix by
  12276. * @returns {mat2d} out
  12277. **/
  12278. function translate(out, a, v) {
  12279. var a0 = a[0],
  12280. a1 = a[1],
  12281. a2 = a[2],
  12282. a3 = a[3],
  12283. a4 = a[4],
  12284. a5 = a[5];
  12285. var v0 = v[0],
  12286. v1 = v[1];
  12287. out[0] = a0;
  12288. out[1] = a1;
  12289. out[2] = a2;
  12290. out[3] = a3;
  12291. out[4] = a0 * v0 + a2 * v1 + a4;
  12292. out[5] = a1 * v0 + a3 * v1 + a5;
  12293. return out;
  12294. }
  12295. /**
  12296. * Creates a matrix from a given angle
  12297. * This is equivalent to (but much faster than):
  12298. *
  12299. * mat2d.identity(dest);
  12300. * mat2d.rotate(dest, dest, rad);
  12301. *
  12302. * @param {mat2d} out mat2d receiving operation result
  12303. * @param {Number} rad the angle to rotate the matrix by
  12304. * @returns {mat2d} out
  12305. */
  12306. function fromRotation(out, rad) {
  12307. var s = Math.sin(rad),
  12308. c = Math.cos(rad);
  12309. out[0] = c;
  12310. out[1] = s;
  12311. out[2] = -s;
  12312. out[3] = c;
  12313. out[4] = 0;
  12314. out[5] = 0;
  12315. return out;
  12316. }
  12317. /**
  12318. * Creates a matrix from a vector scaling
  12319. * This is equivalent to (but much faster than):
  12320. *
  12321. * mat2d.identity(dest);
  12322. * mat2d.scale(dest, dest, vec);
  12323. *
  12324. * @param {mat2d} out mat2d receiving operation result
  12325. * @param {ReadonlyVec2} v Scaling vector
  12326. * @returns {mat2d} out
  12327. */
  12328. function fromScaling(out, v) {
  12329. out[0] = v[0];
  12330. out[1] = 0;
  12331. out[2] = 0;
  12332. out[3] = v[1];
  12333. out[4] = 0;
  12334. out[5] = 0;
  12335. return out;
  12336. }
  12337. /**
  12338. * Creates a matrix from a vector translation
  12339. * This is equivalent to (but much faster than):
  12340. *
  12341. * mat2d.identity(dest);
  12342. * mat2d.translate(dest, dest, vec);
  12343. *
  12344. * @param {mat2d} out mat2d receiving operation result
  12345. * @param {ReadonlyVec2} v Translation vector
  12346. * @returns {mat2d} out
  12347. */
  12348. function fromTranslation(out, v) {
  12349. out[0] = 1;
  12350. out[1] = 0;
  12351. out[2] = 0;
  12352. out[3] = 1;
  12353. out[4] = v[0];
  12354. out[5] = v[1];
  12355. return out;
  12356. }
  12357. /**
  12358. * Returns a string representation of a mat2d
  12359. *
  12360. * @param {ReadonlyMat2d} a matrix to represent as a string
  12361. * @returns {String} string representation of the matrix
  12362. */
  12363. function str(a) {
  12364. return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")";
  12365. }
  12366. /**
  12367. * Returns Frobenius norm of a mat2d
  12368. *
  12369. * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of
  12370. * @returns {Number} Frobenius norm
  12371. */
  12372. function frob(a) {
  12373. return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);
  12374. }
  12375. /**
  12376. * Adds two mat2d's
  12377. *
  12378. * @param {mat2d} out the receiving matrix
  12379. * @param {ReadonlyMat2d} a the first operand
  12380. * @param {ReadonlyMat2d} b the second operand
  12381. * @returns {mat2d} out
  12382. */
  12383. function add(out, a, b) {
  12384. out[0] = a[0] + b[0];
  12385. out[1] = a[1] + b[1];
  12386. out[2] = a[2] + b[2];
  12387. out[3] = a[3] + b[3];
  12388. out[4] = a[4] + b[4];
  12389. out[5] = a[5] + b[5];
  12390. return out;
  12391. }
  12392. /**
  12393. * Subtracts matrix b from matrix a
  12394. *
  12395. * @param {mat2d} out the receiving matrix
  12396. * @param {ReadonlyMat2d} a the first operand
  12397. * @param {ReadonlyMat2d} b the second operand
  12398. * @returns {mat2d} out
  12399. */
  12400. function subtract(out, a, b) {
  12401. out[0] = a[0] - b[0];
  12402. out[1] = a[1] - b[1];
  12403. out[2] = a[2] - b[2];
  12404. out[3] = a[3] - b[3];
  12405. out[4] = a[4] - b[4];
  12406. out[5] = a[5] - b[5];
  12407. return out;
  12408. }
  12409. /**
  12410. * Multiply each element of the matrix by a scalar.
  12411. *
  12412. * @param {mat2d} out the receiving matrix
  12413. * @param {ReadonlyMat2d} a the matrix to scale
  12414. * @param {Number} b amount to scale the matrix's elements by
  12415. * @returns {mat2d} out
  12416. */
  12417. function multiplyScalar(out, a, b) {
  12418. out[0] = a[0] * b;
  12419. out[1] = a[1] * b;
  12420. out[2] = a[2] * b;
  12421. out[3] = a[3] * b;
  12422. out[4] = a[4] * b;
  12423. out[5] = a[5] * b;
  12424. return out;
  12425. }
  12426. /**
  12427. * Adds two mat2d's after multiplying each element of the second operand by a scalar value.
  12428. *
  12429. * @param {mat2d} out the receiving vector
  12430. * @param {ReadonlyMat2d} a the first operand
  12431. * @param {ReadonlyMat2d} b the second operand
  12432. * @param {Number} scale the amount to scale b's elements by before adding
  12433. * @returns {mat2d} out
  12434. */
  12435. function multiplyScalarAndAdd(out, a, b, scale) {
  12436. out[0] = a[0] + b[0] * scale;
  12437. out[1] = a[1] + b[1] * scale;
  12438. out[2] = a[2] + b[2] * scale;
  12439. out[3] = a[3] + b[3] * scale;
  12440. out[4] = a[4] + b[4] * scale;
  12441. out[5] = a[5] + b[5] * scale;
  12442. return out;
  12443. }
  12444. /**
  12445. * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
  12446. *
  12447. * @param {ReadonlyMat2d} a The first matrix.
  12448. * @param {ReadonlyMat2d} b The second matrix.
  12449. * @returns {Boolean} True if the matrices are equal, false otherwise.
  12450. */
  12451. function exactEquals(a, b) {
  12452. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];
  12453. }
  12454. /**
  12455. * Returns whether or not the matrices have approximately the same elements in the same position.
  12456. *
  12457. * @param {ReadonlyMat2d} a The first matrix.
  12458. * @param {ReadonlyMat2d} b The second matrix.
  12459. * @returns {Boolean} True if the matrices are equal, false otherwise.
  12460. */
  12461. function equals(a, b) {
  12462. var a0 = a[0],
  12463. a1 = a[1],
  12464. a2 = a[2],
  12465. a3 = a[3],
  12466. a4 = a[4],
  12467. a5 = a[5];
  12468. var b0 = b[0],
  12469. b1 = b[1],
  12470. b2 = b[2],
  12471. b3 = b[3],
  12472. b4 = b[4],
  12473. b5 = b[5];
  12474. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5));
  12475. }
  12476. /**
  12477. * Alias for {@link mat2d.multiply}
  12478. * @function
  12479. */
  12480. var mul = multiply;
  12481. /**
  12482. * Alias for {@link mat2d.subtract}
  12483. * @function
  12484. */
  12485. var sub = subtract;
  12486. /***/ }),
  12487. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js":
  12488. /*!*************************************************************!*\
  12489. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js ***!
  12490. \*************************************************************/
  12491. /*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
  12492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12493. "use strict";
  12494. __webpack_require__.r(__webpack_exports__);
  12495. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  12496. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat4", function() { return fromMat4; });
  12497. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  12498. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  12499. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  12500. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  12501. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  12502. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
  12503. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  12504. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
  12505. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
  12506. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  12507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
  12508. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  12509. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  12510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
  12511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  12512. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
  12513. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat2d", function() { return fromMat2d; });
  12514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat", function() { return fromQuat; });
  12515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalFromMat4", function() { return normalFromMat4; });
  12516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "projection", function() { return projection; });
  12517. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  12518. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
  12519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  12520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  12521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
  12522. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
  12523. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  12524. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  12525. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  12526. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  12527. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  12528. /**
  12529. * 3x3 Matrix
  12530. * @module mat3
  12531. */
  12532. /**
  12533. * Creates a new identity mat3
  12534. *
  12535. * @returns {mat3} a new 3x3 matrix
  12536. */
  12537. function create() {
  12538. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
  12539. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  12540. out[1] = 0;
  12541. out[2] = 0;
  12542. out[3] = 0;
  12543. out[5] = 0;
  12544. out[6] = 0;
  12545. out[7] = 0;
  12546. }
  12547. out[0] = 1;
  12548. out[4] = 1;
  12549. out[8] = 1;
  12550. return out;
  12551. }
  12552. /**
  12553. * Copies the upper-left 3x3 values into the given mat3.
  12554. *
  12555. * @param {mat3} out the receiving 3x3 matrix
  12556. * @param {ReadonlyMat4} a the source 4x4 matrix
  12557. * @returns {mat3} out
  12558. */
  12559. function fromMat4(out, a) {
  12560. out[0] = a[0];
  12561. out[1] = a[1];
  12562. out[2] = a[2];
  12563. out[3] = a[4];
  12564. out[4] = a[5];
  12565. out[5] = a[6];
  12566. out[6] = a[8];
  12567. out[7] = a[9];
  12568. out[8] = a[10];
  12569. return out;
  12570. }
  12571. /**
  12572. * Creates a new mat3 initialized with values from an existing matrix
  12573. *
  12574. * @param {ReadonlyMat3} a matrix to clone
  12575. * @returns {mat3} a new 3x3 matrix
  12576. */
  12577. function clone(a) {
  12578. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
  12579. out[0] = a[0];
  12580. out[1] = a[1];
  12581. out[2] = a[2];
  12582. out[3] = a[3];
  12583. out[4] = a[4];
  12584. out[5] = a[5];
  12585. out[6] = a[6];
  12586. out[7] = a[7];
  12587. out[8] = a[8];
  12588. return out;
  12589. }
  12590. /**
  12591. * Copy the values from one mat3 to another
  12592. *
  12593. * @param {mat3} out the receiving matrix
  12594. * @param {ReadonlyMat3} a the source matrix
  12595. * @returns {mat3} out
  12596. */
  12597. function copy(out, a) {
  12598. out[0] = a[0];
  12599. out[1] = a[1];
  12600. out[2] = a[2];
  12601. out[3] = a[3];
  12602. out[4] = a[4];
  12603. out[5] = a[5];
  12604. out[6] = a[6];
  12605. out[7] = a[7];
  12606. out[8] = a[8];
  12607. return out;
  12608. }
  12609. /**
  12610. * Create a new mat3 with the given values
  12611. *
  12612. * @param {Number} m00 Component in column 0, row 0 position (index 0)
  12613. * @param {Number} m01 Component in column 0, row 1 position (index 1)
  12614. * @param {Number} m02 Component in column 0, row 2 position (index 2)
  12615. * @param {Number} m10 Component in column 1, row 0 position (index 3)
  12616. * @param {Number} m11 Component in column 1, row 1 position (index 4)
  12617. * @param {Number} m12 Component in column 1, row 2 position (index 5)
  12618. * @param {Number} m20 Component in column 2, row 0 position (index 6)
  12619. * @param {Number} m21 Component in column 2, row 1 position (index 7)
  12620. * @param {Number} m22 Component in column 2, row 2 position (index 8)
  12621. * @returns {mat3} A new mat3
  12622. */
  12623. function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
  12624. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](9);
  12625. out[0] = m00;
  12626. out[1] = m01;
  12627. out[2] = m02;
  12628. out[3] = m10;
  12629. out[4] = m11;
  12630. out[5] = m12;
  12631. out[6] = m20;
  12632. out[7] = m21;
  12633. out[8] = m22;
  12634. return out;
  12635. }
  12636. /**
  12637. * Set the components of a mat3 to the given values
  12638. *
  12639. * @param {mat3} out the receiving matrix
  12640. * @param {Number} m00 Component in column 0, row 0 position (index 0)
  12641. * @param {Number} m01 Component in column 0, row 1 position (index 1)
  12642. * @param {Number} m02 Component in column 0, row 2 position (index 2)
  12643. * @param {Number} m10 Component in column 1, row 0 position (index 3)
  12644. * @param {Number} m11 Component in column 1, row 1 position (index 4)
  12645. * @param {Number} m12 Component in column 1, row 2 position (index 5)
  12646. * @param {Number} m20 Component in column 2, row 0 position (index 6)
  12647. * @param {Number} m21 Component in column 2, row 1 position (index 7)
  12648. * @param {Number} m22 Component in column 2, row 2 position (index 8)
  12649. * @returns {mat3} out
  12650. */
  12651. function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {
  12652. out[0] = m00;
  12653. out[1] = m01;
  12654. out[2] = m02;
  12655. out[3] = m10;
  12656. out[4] = m11;
  12657. out[5] = m12;
  12658. out[6] = m20;
  12659. out[7] = m21;
  12660. out[8] = m22;
  12661. return out;
  12662. }
  12663. /**
  12664. * Set a mat3 to the identity matrix
  12665. *
  12666. * @param {mat3} out the receiving matrix
  12667. * @returns {mat3} out
  12668. */
  12669. function identity(out) {
  12670. out[0] = 1;
  12671. out[1] = 0;
  12672. out[2] = 0;
  12673. out[3] = 0;
  12674. out[4] = 1;
  12675. out[5] = 0;
  12676. out[6] = 0;
  12677. out[7] = 0;
  12678. out[8] = 1;
  12679. return out;
  12680. }
  12681. /**
  12682. * Transpose the values of a mat3
  12683. *
  12684. * @param {mat3} out the receiving matrix
  12685. * @param {ReadonlyMat3} a the source matrix
  12686. * @returns {mat3} out
  12687. */
  12688. function transpose(out, a) {
  12689. // If we are transposing ourselves we can skip a few steps but have to cache some values
  12690. if (out === a) {
  12691. var a01 = a[1],
  12692. a02 = a[2],
  12693. a12 = a[5];
  12694. out[1] = a[3];
  12695. out[2] = a[6];
  12696. out[3] = a01;
  12697. out[5] = a[7];
  12698. out[6] = a02;
  12699. out[7] = a12;
  12700. } else {
  12701. out[0] = a[0];
  12702. out[1] = a[3];
  12703. out[2] = a[6];
  12704. out[3] = a[1];
  12705. out[4] = a[4];
  12706. out[5] = a[7];
  12707. out[6] = a[2];
  12708. out[7] = a[5];
  12709. out[8] = a[8];
  12710. }
  12711. return out;
  12712. }
  12713. /**
  12714. * Inverts a mat3
  12715. *
  12716. * @param {mat3} out the receiving matrix
  12717. * @param {ReadonlyMat3} a the source matrix
  12718. * @returns {mat3} out
  12719. */
  12720. function invert(out, a) {
  12721. var a00 = a[0],
  12722. a01 = a[1],
  12723. a02 = a[2];
  12724. var a10 = a[3],
  12725. a11 = a[4],
  12726. a12 = a[5];
  12727. var a20 = a[6],
  12728. a21 = a[7],
  12729. a22 = a[8];
  12730. var b01 = a22 * a11 - a12 * a21;
  12731. var b11 = -a22 * a10 + a12 * a20;
  12732. var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
  12733. var det = a00 * b01 + a01 * b11 + a02 * b21;
  12734. if (!det) {
  12735. return null;
  12736. }
  12737. det = 1.0 / det;
  12738. out[0] = b01 * det;
  12739. out[1] = (-a22 * a01 + a02 * a21) * det;
  12740. out[2] = (a12 * a01 - a02 * a11) * det;
  12741. out[3] = b11 * det;
  12742. out[4] = (a22 * a00 - a02 * a20) * det;
  12743. out[5] = (-a12 * a00 + a02 * a10) * det;
  12744. out[6] = b21 * det;
  12745. out[7] = (-a21 * a00 + a01 * a20) * det;
  12746. out[8] = (a11 * a00 - a01 * a10) * det;
  12747. return out;
  12748. }
  12749. /**
  12750. * Calculates the adjugate of a mat3
  12751. *
  12752. * @param {mat3} out the receiving matrix
  12753. * @param {ReadonlyMat3} a the source matrix
  12754. * @returns {mat3} out
  12755. */
  12756. function adjoint(out, a) {
  12757. var a00 = a[0],
  12758. a01 = a[1],
  12759. a02 = a[2];
  12760. var a10 = a[3],
  12761. a11 = a[4],
  12762. a12 = a[5];
  12763. var a20 = a[6],
  12764. a21 = a[7],
  12765. a22 = a[8];
  12766. out[0] = a11 * a22 - a12 * a21;
  12767. out[1] = a02 * a21 - a01 * a22;
  12768. out[2] = a01 * a12 - a02 * a11;
  12769. out[3] = a12 * a20 - a10 * a22;
  12770. out[4] = a00 * a22 - a02 * a20;
  12771. out[5] = a02 * a10 - a00 * a12;
  12772. out[6] = a10 * a21 - a11 * a20;
  12773. out[7] = a01 * a20 - a00 * a21;
  12774. out[8] = a00 * a11 - a01 * a10;
  12775. return out;
  12776. }
  12777. /**
  12778. * Calculates the determinant of a mat3
  12779. *
  12780. * @param {ReadonlyMat3} a the source matrix
  12781. * @returns {Number} determinant of a
  12782. */
  12783. function determinant(a) {
  12784. var a00 = a[0],
  12785. a01 = a[1],
  12786. a02 = a[2];
  12787. var a10 = a[3],
  12788. a11 = a[4],
  12789. a12 = a[5];
  12790. var a20 = a[6],
  12791. a21 = a[7],
  12792. a22 = a[8];
  12793. return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
  12794. }
  12795. /**
  12796. * Multiplies two mat3's
  12797. *
  12798. * @param {mat3} out the receiving matrix
  12799. * @param {ReadonlyMat3} a the first operand
  12800. * @param {ReadonlyMat3} b the second operand
  12801. * @returns {mat3} out
  12802. */
  12803. function multiply(out, a, b) {
  12804. var a00 = a[0],
  12805. a01 = a[1],
  12806. a02 = a[2];
  12807. var a10 = a[3],
  12808. a11 = a[4],
  12809. a12 = a[5];
  12810. var a20 = a[6],
  12811. a21 = a[7],
  12812. a22 = a[8];
  12813. var b00 = b[0],
  12814. b01 = b[1],
  12815. b02 = b[2];
  12816. var b10 = b[3],
  12817. b11 = b[4],
  12818. b12 = b[5];
  12819. var b20 = b[6],
  12820. b21 = b[7],
  12821. b22 = b[8];
  12822. out[0] = b00 * a00 + b01 * a10 + b02 * a20;
  12823. out[1] = b00 * a01 + b01 * a11 + b02 * a21;
  12824. out[2] = b00 * a02 + b01 * a12 + b02 * a22;
  12825. out[3] = b10 * a00 + b11 * a10 + b12 * a20;
  12826. out[4] = b10 * a01 + b11 * a11 + b12 * a21;
  12827. out[5] = b10 * a02 + b11 * a12 + b12 * a22;
  12828. out[6] = b20 * a00 + b21 * a10 + b22 * a20;
  12829. out[7] = b20 * a01 + b21 * a11 + b22 * a21;
  12830. out[8] = b20 * a02 + b21 * a12 + b22 * a22;
  12831. return out;
  12832. }
  12833. /**
  12834. * Translate a mat3 by the given vector
  12835. *
  12836. * @param {mat3} out the receiving matrix
  12837. * @param {ReadonlyMat3} a the matrix to translate
  12838. * @param {ReadonlyVec2} v vector to translate by
  12839. * @returns {mat3} out
  12840. */
  12841. function translate(out, a, v) {
  12842. var a00 = a[0],
  12843. a01 = a[1],
  12844. a02 = a[2],
  12845. a10 = a[3],
  12846. a11 = a[4],
  12847. a12 = a[5],
  12848. a20 = a[6],
  12849. a21 = a[7],
  12850. a22 = a[8],
  12851. x = v[0],
  12852. y = v[1];
  12853. out[0] = a00;
  12854. out[1] = a01;
  12855. out[2] = a02;
  12856. out[3] = a10;
  12857. out[4] = a11;
  12858. out[5] = a12;
  12859. out[6] = x * a00 + y * a10 + a20;
  12860. out[7] = x * a01 + y * a11 + a21;
  12861. out[8] = x * a02 + y * a12 + a22;
  12862. return out;
  12863. }
  12864. /**
  12865. * Rotates a mat3 by the given angle
  12866. *
  12867. * @param {mat3} out the receiving matrix
  12868. * @param {ReadonlyMat3} a the matrix to rotate
  12869. * @param {Number} rad the angle to rotate the matrix by
  12870. * @returns {mat3} out
  12871. */
  12872. function rotate(out, a, rad) {
  12873. var a00 = a[0],
  12874. a01 = a[1],
  12875. a02 = a[2],
  12876. a10 = a[3],
  12877. a11 = a[4],
  12878. a12 = a[5],
  12879. a20 = a[6],
  12880. a21 = a[7],
  12881. a22 = a[8],
  12882. s = Math.sin(rad),
  12883. c = Math.cos(rad);
  12884. out[0] = c * a00 + s * a10;
  12885. out[1] = c * a01 + s * a11;
  12886. out[2] = c * a02 + s * a12;
  12887. out[3] = c * a10 - s * a00;
  12888. out[4] = c * a11 - s * a01;
  12889. out[5] = c * a12 - s * a02;
  12890. out[6] = a20;
  12891. out[7] = a21;
  12892. out[8] = a22;
  12893. return out;
  12894. }
  12895. /**
  12896. * Scales the mat3 by the dimensions in the given vec2
  12897. *
  12898. * @param {mat3} out the receiving matrix
  12899. * @param {ReadonlyMat3} a the matrix to rotate
  12900. * @param {ReadonlyVec2} v the vec2 to scale the matrix by
  12901. * @returns {mat3} out
  12902. **/
  12903. function scale(out, a, v) {
  12904. var x = v[0],
  12905. y = v[1];
  12906. out[0] = x * a[0];
  12907. out[1] = x * a[1];
  12908. out[2] = x * a[2];
  12909. out[3] = y * a[3];
  12910. out[4] = y * a[4];
  12911. out[5] = y * a[5];
  12912. out[6] = a[6];
  12913. out[7] = a[7];
  12914. out[8] = a[8];
  12915. return out;
  12916. }
  12917. /**
  12918. * Creates a matrix from a vector translation
  12919. * This is equivalent to (but much faster than):
  12920. *
  12921. * mat3.identity(dest);
  12922. * mat3.translate(dest, dest, vec);
  12923. *
  12924. * @param {mat3} out mat3 receiving operation result
  12925. * @param {ReadonlyVec2} v Translation vector
  12926. * @returns {mat3} out
  12927. */
  12928. function fromTranslation(out, v) {
  12929. out[0] = 1;
  12930. out[1] = 0;
  12931. out[2] = 0;
  12932. out[3] = 0;
  12933. out[4] = 1;
  12934. out[5] = 0;
  12935. out[6] = v[0];
  12936. out[7] = v[1];
  12937. out[8] = 1;
  12938. return out;
  12939. }
  12940. /**
  12941. * Creates a matrix from a given angle
  12942. * This is equivalent to (but much faster than):
  12943. *
  12944. * mat3.identity(dest);
  12945. * mat3.rotate(dest, dest, rad);
  12946. *
  12947. * @param {mat3} out mat3 receiving operation result
  12948. * @param {Number} rad the angle to rotate the matrix by
  12949. * @returns {mat3} out
  12950. */
  12951. function fromRotation(out, rad) {
  12952. var s = Math.sin(rad),
  12953. c = Math.cos(rad);
  12954. out[0] = c;
  12955. out[1] = s;
  12956. out[2] = 0;
  12957. out[3] = -s;
  12958. out[4] = c;
  12959. out[5] = 0;
  12960. out[6] = 0;
  12961. out[7] = 0;
  12962. out[8] = 1;
  12963. return out;
  12964. }
  12965. /**
  12966. * Creates a matrix from a vector scaling
  12967. * This is equivalent to (but much faster than):
  12968. *
  12969. * mat3.identity(dest);
  12970. * mat3.scale(dest, dest, vec);
  12971. *
  12972. * @param {mat3} out mat3 receiving operation result
  12973. * @param {ReadonlyVec2} v Scaling vector
  12974. * @returns {mat3} out
  12975. */
  12976. function fromScaling(out, v) {
  12977. out[0] = v[0];
  12978. out[1] = 0;
  12979. out[2] = 0;
  12980. out[3] = 0;
  12981. out[4] = v[1];
  12982. out[5] = 0;
  12983. out[6] = 0;
  12984. out[7] = 0;
  12985. out[8] = 1;
  12986. return out;
  12987. }
  12988. /**
  12989. * Copies the values from a mat2d into a mat3
  12990. *
  12991. * @param {mat3} out the receiving matrix
  12992. * @param {ReadonlyMat2d} a the matrix to copy
  12993. * @returns {mat3} out
  12994. **/
  12995. function fromMat2d(out, a) {
  12996. out[0] = a[0];
  12997. out[1] = a[1];
  12998. out[2] = 0;
  12999. out[3] = a[2];
  13000. out[4] = a[3];
  13001. out[5] = 0;
  13002. out[6] = a[4];
  13003. out[7] = a[5];
  13004. out[8] = 1;
  13005. return out;
  13006. }
  13007. /**
  13008. * Calculates a 3x3 matrix from the given quaternion
  13009. *
  13010. * @param {mat3} out mat3 receiving operation result
  13011. * @param {ReadonlyQuat} q Quaternion to create matrix from
  13012. *
  13013. * @returns {mat3} out
  13014. */
  13015. function fromQuat(out, q) {
  13016. var x = q[0],
  13017. y = q[1],
  13018. z = q[2],
  13019. w = q[3];
  13020. var x2 = x + x;
  13021. var y2 = y + y;
  13022. var z2 = z + z;
  13023. var xx = x * x2;
  13024. var yx = y * x2;
  13025. var yy = y * y2;
  13026. var zx = z * x2;
  13027. var zy = z * y2;
  13028. var zz = z * z2;
  13029. var wx = w * x2;
  13030. var wy = w * y2;
  13031. var wz = w * z2;
  13032. out[0] = 1 - yy - zz;
  13033. out[3] = yx - wz;
  13034. out[6] = zx + wy;
  13035. out[1] = yx + wz;
  13036. out[4] = 1 - xx - zz;
  13037. out[7] = zy - wx;
  13038. out[2] = zx - wy;
  13039. out[5] = zy + wx;
  13040. out[8] = 1 - xx - yy;
  13041. return out;
  13042. }
  13043. /**
  13044. * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
  13045. *
  13046. * @param {mat3} out mat3 receiving operation result
  13047. * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from
  13048. *
  13049. * @returns {mat3} out
  13050. */
  13051. function normalFromMat4(out, a) {
  13052. var a00 = a[0],
  13053. a01 = a[1],
  13054. a02 = a[2],
  13055. a03 = a[3];
  13056. var a10 = a[4],
  13057. a11 = a[5],
  13058. a12 = a[6],
  13059. a13 = a[7];
  13060. var a20 = a[8],
  13061. a21 = a[9],
  13062. a22 = a[10],
  13063. a23 = a[11];
  13064. var a30 = a[12],
  13065. a31 = a[13],
  13066. a32 = a[14],
  13067. a33 = a[15];
  13068. var b00 = a00 * a11 - a01 * a10;
  13069. var b01 = a00 * a12 - a02 * a10;
  13070. var b02 = a00 * a13 - a03 * a10;
  13071. var b03 = a01 * a12 - a02 * a11;
  13072. var b04 = a01 * a13 - a03 * a11;
  13073. var b05 = a02 * a13 - a03 * a12;
  13074. var b06 = a20 * a31 - a21 * a30;
  13075. var b07 = a20 * a32 - a22 * a30;
  13076. var b08 = a20 * a33 - a23 * a30;
  13077. var b09 = a21 * a32 - a22 * a31;
  13078. var b10 = a21 * a33 - a23 * a31;
  13079. var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
  13080. var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
  13081. if (!det) {
  13082. return null;
  13083. }
  13084. det = 1.0 / det;
  13085. out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
  13086. out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
  13087. out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
  13088. out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
  13089. out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
  13090. out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
  13091. out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
  13092. out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
  13093. out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
  13094. return out;
  13095. }
  13096. /**
  13097. * Generates a 2D projection matrix with the given bounds
  13098. *
  13099. * @param {mat3} out mat3 frustum matrix will be written into
  13100. * @param {number} width Width of your gl context
  13101. * @param {number} height Height of gl context
  13102. * @returns {mat3} out
  13103. */
  13104. function projection(out, width, height) {
  13105. out[0] = 2 / width;
  13106. out[1] = 0;
  13107. out[2] = 0;
  13108. out[3] = 0;
  13109. out[4] = -2 / height;
  13110. out[5] = 0;
  13111. out[6] = -1;
  13112. out[7] = 1;
  13113. out[8] = 1;
  13114. return out;
  13115. }
  13116. /**
  13117. * Returns a string representation of a mat3
  13118. *
  13119. * @param {ReadonlyMat3} a matrix to represent as a string
  13120. * @returns {String} string representation of the matrix
  13121. */
  13122. function str(a) {
  13123. return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")";
  13124. }
  13125. /**
  13126. * Returns Frobenius norm of a mat3
  13127. *
  13128. * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of
  13129. * @returns {Number} Frobenius norm
  13130. */
  13131. function frob(a) {
  13132. return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
  13133. }
  13134. /**
  13135. * Adds two mat3's
  13136. *
  13137. * @param {mat3} out the receiving matrix
  13138. * @param {ReadonlyMat3} a the first operand
  13139. * @param {ReadonlyMat3} b the second operand
  13140. * @returns {mat3} out
  13141. */
  13142. function add(out, a, b) {
  13143. out[0] = a[0] + b[0];
  13144. out[1] = a[1] + b[1];
  13145. out[2] = a[2] + b[2];
  13146. out[3] = a[3] + b[3];
  13147. out[4] = a[4] + b[4];
  13148. out[5] = a[5] + b[5];
  13149. out[6] = a[6] + b[6];
  13150. out[7] = a[7] + b[7];
  13151. out[8] = a[8] + b[8];
  13152. return out;
  13153. }
  13154. /**
  13155. * Subtracts matrix b from matrix a
  13156. *
  13157. * @param {mat3} out the receiving matrix
  13158. * @param {ReadonlyMat3} a the first operand
  13159. * @param {ReadonlyMat3} b the second operand
  13160. * @returns {mat3} out
  13161. */
  13162. function subtract(out, a, b) {
  13163. out[0] = a[0] - b[0];
  13164. out[1] = a[1] - b[1];
  13165. out[2] = a[2] - b[2];
  13166. out[3] = a[3] - b[3];
  13167. out[4] = a[4] - b[4];
  13168. out[5] = a[5] - b[5];
  13169. out[6] = a[6] - b[6];
  13170. out[7] = a[7] - b[7];
  13171. out[8] = a[8] - b[8];
  13172. return out;
  13173. }
  13174. /**
  13175. * Multiply each element of the matrix by a scalar.
  13176. *
  13177. * @param {mat3} out the receiving matrix
  13178. * @param {ReadonlyMat3} a the matrix to scale
  13179. * @param {Number} b amount to scale the matrix's elements by
  13180. * @returns {mat3} out
  13181. */
  13182. function multiplyScalar(out, a, b) {
  13183. out[0] = a[0] * b;
  13184. out[1] = a[1] * b;
  13185. out[2] = a[2] * b;
  13186. out[3] = a[3] * b;
  13187. out[4] = a[4] * b;
  13188. out[5] = a[5] * b;
  13189. out[6] = a[6] * b;
  13190. out[7] = a[7] * b;
  13191. out[8] = a[8] * b;
  13192. return out;
  13193. }
  13194. /**
  13195. * Adds two mat3's after multiplying each element of the second operand by a scalar value.
  13196. *
  13197. * @param {mat3} out the receiving vector
  13198. * @param {ReadonlyMat3} a the first operand
  13199. * @param {ReadonlyMat3} b the second operand
  13200. * @param {Number} scale the amount to scale b's elements by before adding
  13201. * @returns {mat3} out
  13202. */
  13203. function multiplyScalarAndAdd(out, a, b, scale) {
  13204. out[0] = a[0] + b[0] * scale;
  13205. out[1] = a[1] + b[1] * scale;
  13206. out[2] = a[2] + b[2] * scale;
  13207. out[3] = a[3] + b[3] * scale;
  13208. out[4] = a[4] + b[4] * scale;
  13209. out[5] = a[5] + b[5] * scale;
  13210. out[6] = a[6] + b[6] * scale;
  13211. out[7] = a[7] + b[7] * scale;
  13212. out[8] = a[8] + b[8] * scale;
  13213. return out;
  13214. }
  13215. /**
  13216. * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
  13217. *
  13218. * @param {ReadonlyMat3} a The first matrix.
  13219. * @param {ReadonlyMat3} b The second matrix.
  13220. * @returns {Boolean} True if the matrices are equal, false otherwise.
  13221. */
  13222. function exactEquals(a, b) {
  13223. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];
  13224. }
  13225. /**
  13226. * Returns whether or not the matrices have approximately the same elements in the same position.
  13227. *
  13228. * @param {ReadonlyMat3} a The first matrix.
  13229. * @param {ReadonlyMat3} b The second matrix.
  13230. * @returns {Boolean} True if the matrices are equal, false otherwise.
  13231. */
  13232. function equals(a, b) {
  13233. var a0 = a[0],
  13234. a1 = a[1],
  13235. a2 = a[2],
  13236. a3 = a[3],
  13237. a4 = a[4],
  13238. a5 = a[5],
  13239. a6 = a[6],
  13240. a7 = a[7],
  13241. a8 = a[8];
  13242. var b0 = b[0],
  13243. b1 = b[1],
  13244. b2 = b[2],
  13245. b3 = b[3],
  13246. b4 = b[4],
  13247. b5 = b[5],
  13248. b6 = b[6],
  13249. b7 = b[7],
  13250. b8 = b[8];
  13251. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));
  13252. }
  13253. /**
  13254. * Alias for {@link mat3.multiply}
  13255. * @function
  13256. */
  13257. var mul = multiply;
  13258. /**
  13259. * Alias for {@link mat3.subtract}
  13260. * @function
  13261. */
  13262. var sub = subtract;
  13263. /***/ }),
  13264. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js":
  13265. /*!*************************************************************!*\
  13266. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js ***!
  13267. \*************************************************************/
  13268. /*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspective, perspectiveFromFieldOfView, ortho, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
  13269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13270. "use strict";
  13271. __webpack_require__.r(__webpack_exports__);
  13272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  13273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  13274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  13275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  13276. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  13277. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  13278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return transpose; });
  13279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  13280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjoint", function() { return adjoint; });
  13281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determinant", function() { return determinant; });
  13282. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  13283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
  13284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  13285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  13286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  13287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  13288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  13289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
  13290. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromScaling", function() { return fromScaling; });
  13291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  13292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXRotation", function() { return fromXRotation; });
  13293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromYRotation", function() { return fromYRotation; });
  13294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromZRotation", function() { return fromZRotation; });
  13295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslation", function() { return fromRotationTranslation; });
  13296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat2", function() { return fromQuat2; });
  13297. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTranslation", function() { return getTranslation; });
  13298. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScaling", function() { return getScaling; });
  13299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRotation", function() { return getRotation; });
  13300. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationScale", function() { return fromRotationTranslationScale; });
  13301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationScaleOrigin", function() { return fromRotationTranslationScaleOrigin; });
  13302. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromQuat", function() { return fromQuat; });
  13303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frustum", function() { return frustum; });
  13304. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perspective", function() { return perspective; });
  13305. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perspectiveFromFieldOfView", function() { return perspectiveFromFieldOfView; });
  13306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ortho", function() { return ortho; });
  13307. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lookAt", function() { return lookAt; });
  13308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "targetTo", function() { return targetTo; });
  13309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  13310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frob", function() { return frob; });
  13311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  13312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  13313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalar", function() { return multiplyScalar; });
  13314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiplyScalarAndAdd", function() { return multiplyScalarAndAdd; });
  13315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  13316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  13317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  13318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  13319. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  13320. /**
  13321. * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.
  13322. * @module mat4
  13323. */
  13324. /**
  13325. * Creates a new identity mat4
  13326. *
  13327. * @returns {mat4} a new 4x4 matrix
  13328. */
  13329. function create() {
  13330. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
  13331. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  13332. out[1] = 0;
  13333. out[2] = 0;
  13334. out[3] = 0;
  13335. out[4] = 0;
  13336. out[6] = 0;
  13337. out[7] = 0;
  13338. out[8] = 0;
  13339. out[9] = 0;
  13340. out[11] = 0;
  13341. out[12] = 0;
  13342. out[13] = 0;
  13343. out[14] = 0;
  13344. }
  13345. out[0] = 1;
  13346. out[5] = 1;
  13347. out[10] = 1;
  13348. out[15] = 1;
  13349. return out;
  13350. }
  13351. /**
  13352. * Creates a new mat4 initialized with values from an existing matrix
  13353. *
  13354. * @param {ReadonlyMat4} a matrix to clone
  13355. * @returns {mat4} a new 4x4 matrix
  13356. */
  13357. function clone(a) {
  13358. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
  13359. out[0] = a[0];
  13360. out[1] = a[1];
  13361. out[2] = a[2];
  13362. out[3] = a[3];
  13363. out[4] = a[4];
  13364. out[5] = a[5];
  13365. out[6] = a[6];
  13366. out[7] = a[7];
  13367. out[8] = a[8];
  13368. out[9] = a[9];
  13369. out[10] = a[10];
  13370. out[11] = a[11];
  13371. out[12] = a[12];
  13372. out[13] = a[13];
  13373. out[14] = a[14];
  13374. out[15] = a[15];
  13375. return out;
  13376. }
  13377. /**
  13378. * Copy the values from one mat4 to another
  13379. *
  13380. * @param {mat4} out the receiving matrix
  13381. * @param {ReadonlyMat4} a the source matrix
  13382. * @returns {mat4} out
  13383. */
  13384. function copy(out, a) {
  13385. out[0] = a[0];
  13386. out[1] = a[1];
  13387. out[2] = a[2];
  13388. out[3] = a[3];
  13389. out[4] = a[4];
  13390. out[5] = a[5];
  13391. out[6] = a[6];
  13392. out[7] = a[7];
  13393. out[8] = a[8];
  13394. out[9] = a[9];
  13395. out[10] = a[10];
  13396. out[11] = a[11];
  13397. out[12] = a[12];
  13398. out[13] = a[13];
  13399. out[14] = a[14];
  13400. out[15] = a[15];
  13401. return out;
  13402. }
  13403. /**
  13404. * Create a new mat4 with the given values
  13405. *
  13406. * @param {Number} m00 Component in column 0, row 0 position (index 0)
  13407. * @param {Number} m01 Component in column 0, row 1 position (index 1)
  13408. * @param {Number} m02 Component in column 0, row 2 position (index 2)
  13409. * @param {Number} m03 Component in column 0, row 3 position (index 3)
  13410. * @param {Number} m10 Component in column 1, row 0 position (index 4)
  13411. * @param {Number} m11 Component in column 1, row 1 position (index 5)
  13412. * @param {Number} m12 Component in column 1, row 2 position (index 6)
  13413. * @param {Number} m13 Component in column 1, row 3 position (index 7)
  13414. * @param {Number} m20 Component in column 2, row 0 position (index 8)
  13415. * @param {Number} m21 Component in column 2, row 1 position (index 9)
  13416. * @param {Number} m22 Component in column 2, row 2 position (index 10)
  13417. * @param {Number} m23 Component in column 2, row 3 position (index 11)
  13418. * @param {Number} m30 Component in column 3, row 0 position (index 12)
  13419. * @param {Number} m31 Component in column 3, row 1 position (index 13)
  13420. * @param {Number} m32 Component in column 3, row 2 position (index 14)
  13421. * @param {Number} m33 Component in column 3, row 3 position (index 15)
  13422. * @returns {mat4} A new mat4
  13423. */
  13424. function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
  13425. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](16);
  13426. out[0] = m00;
  13427. out[1] = m01;
  13428. out[2] = m02;
  13429. out[3] = m03;
  13430. out[4] = m10;
  13431. out[5] = m11;
  13432. out[6] = m12;
  13433. out[7] = m13;
  13434. out[8] = m20;
  13435. out[9] = m21;
  13436. out[10] = m22;
  13437. out[11] = m23;
  13438. out[12] = m30;
  13439. out[13] = m31;
  13440. out[14] = m32;
  13441. out[15] = m33;
  13442. return out;
  13443. }
  13444. /**
  13445. * Set the components of a mat4 to the given values
  13446. *
  13447. * @param {mat4} out the receiving matrix
  13448. * @param {Number} m00 Component in column 0, row 0 position (index 0)
  13449. * @param {Number} m01 Component in column 0, row 1 position (index 1)
  13450. * @param {Number} m02 Component in column 0, row 2 position (index 2)
  13451. * @param {Number} m03 Component in column 0, row 3 position (index 3)
  13452. * @param {Number} m10 Component in column 1, row 0 position (index 4)
  13453. * @param {Number} m11 Component in column 1, row 1 position (index 5)
  13454. * @param {Number} m12 Component in column 1, row 2 position (index 6)
  13455. * @param {Number} m13 Component in column 1, row 3 position (index 7)
  13456. * @param {Number} m20 Component in column 2, row 0 position (index 8)
  13457. * @param {Number} m21 Component in column 2, row 1 position (index 9)
  13458. * @param {Number} m22 Component in column 2, row 2 position (index 10)
  13459. * @param {Number} m23 Component in column 2, row 3 position (index 11)
  13460. * @param {Number} m30 Component in column 3, row 0 position (index 12)
  13461. * @param {Number} m31 Component in column 3, row 1 position (index 13)
  13462. * @param {Number} m32 Component in column 3, row 2 position (index 14)
  13463. * @param {Number} m33 Component in column 3, row 3 position (index 15)
  13464. * @returns {mat4} out
  13465. */
  13466. function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
  13467. out[0] = m00;
  13468. out[1] = m01;
  13469. out[2] = m02;
  13470. out[3] = m03;
  13471. out[4] = m10;
  13472. out[5] = m11;
  13473. out[6] = m12;
  13474. out[7] = m13;
  13475. out[8] = m20;
  13476. out[9] = m21;
  13477. out[10] = m22;
  13478. out[11] = m23;
  13479. out[12] = m30;
  13480. out[13] = m31;
  13481. out[14] = m32;
  13482. out[15] = m33;
  13483. return out;
  13484. }
  13485. /**
  13486. * Set a mat4 to the identity matrix
  13487. *
  13488. * @param {mat4} out the receiving matrix
  13489. * @returns {mat4} out
  13490. */
  13491. function identity(out) {
  13492. out[0] = 1;
  13493. out[1] = 0;
  13494. out[2] = 0;
  13495. out[3] = 0;
  13496. out[4] = 0;
  13497. out[5] = 1;
  13498. out[6] = 0;
  13499. out[7] = 0;
  13500. out[8] = 0;
  13501. out[9] = 0;
  13502. out[10] = 1;
  13503. out[11] = 0;
  13504. out[12] = 0;
  13505. out[13] = 0;
  13506. out[14] = 0;
  13507. out[15] = 1;
  13508. return out;
  13509. }
  13510. /**
  13511. * Transpose the values of a mat4
  13512. *
  13513. * @param {mat4} out the receiving matrix
  13514. * @param {ReadonlyMat4} a the source matrix
  13515. * @returns {mat4} out
  13516. */
  13517. function transpose(out, a) {
  13518. // If we are transposing ourselves we can skip a few steps but have to cache some values
  13519. if (out === a) {
  13520. var a01 = a[1],
  13521. a02 = a[2],
  13522. a03 = a[3];
  13523. var a12 = a[6],
  13524. a13 = a[7];
  13525. var a23 = a[11];
  13526. out[1] = a[4];
  13527. out[2] = a[8];
  13528. out[3] = a[12];
  13529. out[4] = a01;
  13530. out[6] = a[9];
  13531. out[7] = a[13];
  13532. out[8] = a02;
  13533. out[9] = a12;
  13534. out[11] = a[14];
  13535. out[12] = a03;
  13536. out[13] = a13;
  13537. out[14] = a23;
  13538. } else {
  13539. out[0] = a[0];
  13540. out[1] = a[4];
  13541. out[2] = a[8];
  13542. out[3] = a[12];
  13543. out[4] = a[1];
  13544. out[5] = a[5];
  13545. out[6] = a[9];
  13546. out[7] = a[13];
  13547. out[8] = a[2];
  13548. out[9] = a[6];
  13549. out[10] = a[10];
  13550. out[11] = a[14];
  13551. out[12] = a[3];
  13552. out[13] = a[7];
  13553. out[14] = a[11];
  13554. out[15] = a[15];
  13555. }
  13556. return out;
  13557. }
  13558. /**
  13559. * Inverts a mat4
  13560. *
  13561. * @param {mat4} out the receiving matrix
  13562. * @param {ReadonlyMat4} a the source matrix
  13563. * @returns {mat4} out
  13564. */
  13565. function invert(out, a) {
  13566. var a00 = a[0],
  13567. a01 = a[1],
  13568. a02 = a[2],
  13569. a03 = a[3];
  13570. var a10 = a[4],
  13571. a11 = a[5],
  13572. a12 = a[6],
  13573. a13 = a[7];
  13574. var a20 = a[8],
  13575. a21 = a[9],
  13576. a22 = a[10],
  13577. a23 = a[11];
  13578. var a30 = a[12],
  13579. a31 = a[13],
  13580. a32 = a[14],
  13581. a33 = a[15];
  13582. var b00 = a00 * a11 - a01 * a10;
  13583. var b01 = a00 * a12 - a02 * a10;
  13584. var b02 = a00 * a13 - a03 * a10;
  13585. var b03 = a01 * a12 - a02 * a11;
  13586. var b04 = a01 * a13 - a03 * a11;
  13587. var b05 = a02 * a13 - a03 * a12;
  13588. var b06 = a20 * a31 - a21 * a30;
  13589. var b07 = a20 * a32 - a22 * a30;
  13590. var b08 = a20 * a33 - a23 * a30;
  13591. var b09 = a21 * a32 - a22 * a31;
  13592. var b10 = a21 * a33 - a23 * a31;
  13593. var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
  13594. var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
  13595. if (!det) {
  13596. return null;
  13597. }
  13598. det = 1.0 / det;
  13599. out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
  13600. out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
  13601. out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
  13602. out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;
  13603. out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
  13604. out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
  13605. out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
  13606. out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;
  13607. out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
  13608. out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
  13609. out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
  13610. out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;
  13611. out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;
  13612. out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;
  13613. out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;
  13614. out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
  13615. return out;
  13616. }
  13617. /**
  13618. * Calculates the adjugate of a mat4
  13619. *
  13620. * @param {mat4} out the receiving matrix
  13621. * @param {ReadonlyMat4} a the source matrix
  13622. * @returns {mat4} out
  13623. */
  13624. function adjoint(out, a) {
  13625. var a00 = a[0],
  13626. a01 = a[1],
  13627. a02 = a[2],
  13628. a03 = a[3];
  13629. var a10 = a[4],
  13630. a11 = a[5],
  13631. a12 = a[6],
  13632. a13 = a[7];
  13633. var a20 = a[8],
  13634. a21 = a[9],
  13635. a22 = a[10],
  13636. a23 = a[11];
  13637. var a30 = a[12],
  13638. a31 = a[13],
  13639. a32 = a[14],
  13640. a33 = a[15];
  13641. out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);
  13642. out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));
  13643. out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);
  13644. out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));
  13645. out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));
  13646. out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);
  13647. out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));
  13648. out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);
  13649. out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);
  13650. out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));
  13651. out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);
  13652. out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));
  13653. out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));
  13654. out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);
  13655. out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));
  13656. out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);
  13657. return out;
  13658. }
  13659. /**
  13660. * Calculates the determinant of a mat4
  13661. *
  13662. * @param {ReadonlyMat4} a the source matrix
  13663. * @returns {Number} determinant of a
  13664. */
  13665. function determinant(a) {
  13666. var a00 = a[0],
  13667. a01 = a[1],
  13668. a02 = a[2],
  13669. a03 = a[3];
  13670. var a10 = a[4],
  13671. a11 = a[5],
  13672. a12 = a[6],
  13673. a13 = a[7];
  13674. var a20 = a[8],
  13675. a21 = a[9],
  13676. a22 = a[10],
  13677. a23 = a[11];
  13678. var a30 = a[12],
  13679. a31 = a[13],
  13680. a32 = a[14],
  13681. a33 = a[15];
  13682. var b00 = a00 * a11 - a01 * a10;
  13683. var b01 = a00 * a12 - a02 * a10;
  13684. var b02 = a00 * a13 - a03 * a10;
  13685. var b03 = a01 * a12 - a02 * a11;
  13686. var b04 = a01 * a13 - a03 * a11;
  13687. var b05 = a02 * a13 - a03 * a12;
  13688. var b06 = a20 * a31 - a21 * a30;
  13689. var b07 = a20 * a32 - a22 * a30;
  13690. var b08 = a20 * a33 - a23 * a30;
  13691. var b09 = a21 * a32 - a22 * a31;
  13692. var b10 = a21 * a33 - a23 * a31;
  13693. var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
  13694. return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
  13695. }
  13696. /**
  13697. * Multiplies two mat4s
  13698. *
  13699. * @param {mat4} out the receiving matrix
  13700. * @param {ReadonlyMat4} a the first operand
  13701. * @param {ReadonlyMat4} b the second operand
  13702. * @returns {mat4} out
  13703. */
  13704. function multiply(out, a, b) {
  13705. var a00 = a[0],
  13706. a01 = a[1],
  13707. a02 = a[2],
  13708. a03 = a[3];
  13709. var a10 = a[4],
  13710. a11 = a[5],
  13711. a12 = a[6],
  13712. a13 = a[7];
  13713. var a20 = a[8],
  13714. a21 = a[9],
  13715. a22 = a[10],
  13716. a23 = a[11];
  13717. var a30 = a[12],
  13718. a31 = a[13],
  13719. a32 = a[14],
  13720. a33 = a[15]; // Cache only the current line of the second matrix
  13721. var b0 = b[0],
  13722. b1 = b[1],
  13723. b2 = b[2],
  13724. b3 = b[3];
  13725. out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
  13726. out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
  13727. out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
  13728. out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
  13729. b0 = b[4];
  13730. b1 = b[5];
  13731. b2 = b[6];
  13732. b3 = b[7];
  13733. out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
  13734. out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
  13735. out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
  13736. out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
  13737. b0 = b[8];
  13738. b1 = b[9];
  13739. b2 = b[10];
  13740. b3 = b[11];
  13741. out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
  13742. out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
  13743. out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
  13744. out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
  13745. b0 = b[12];
  13746. b1 = b[13];
  13747. b2 = b[14];
  13748. b3 = b[15];
  13749. out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
  13750. out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
  13751. out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
  13752. out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
  13753. return out;
  13754. }
  13755. /**
  13756. * Translate a mat4 by the given vector
  13757. *
  13758. * @param {mat4} out the receiving matrix
  13759. * @param {ReadonlyMat4} a the matrix to translate
  13760. * @param {ReadonlyVec3} v vector to translate by
  13761. * @returns {mat4} out
  13762. */
  13763. function translate(out, a, v) {
  13764. var x = v[0],
  13765. y = v[1],
  13766. z = v[2];
  13767. var a00, a01, a02, a03;
  13768. var a10, a11, a12, a13;
  13769. var a20, a21, a22, a23;
  13770. if (a === out) {
  13771. out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];
  13772. out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];
  13773. out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];
  13774. out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];
  13775. } else {
  13776. a00 = a[0];
  13777. a01 = a[1];
  13778. a02 = a[2];
  13779. a03 = a[3];
  13780. a10 = a[4];
  13781. a11 = a[5];
  13782. a12 = a[6];
  13783. a13 = a[7];
  13784. a20 = a[8];
  13785. a21 = a[9];
  13786. a22 = a[10];
  13787. a23 = a[11];
  13788. out[0] = a00;
  13789. out[1] = a01;
  13790. out[2] = a02;
  13791. out[3] = a03;
  13792. out[4] = a10;
  13793. out[5] = a11;
  13794. out[6] = a12;
  13795. out[7] = a13;
  13796. out[8] = a20;
  13797. out[9] = a21;
  13798. out[10] = a22;
  13799. out[11] = a23;
  13800. out[12] = a00 * x + a10 * y + a20 * z + a[12];
  13801. out[13] = a01 * x + a11 * y + a21 * z + a[13];
  13802. out[14] = a02 * x + a12 * y + a22 * z + a[14];
  13803. out[15] = a03 * x + a13 * y + a23 * z + a[15];
  13804. }
  13805. return out;
  13806. }
  13807. /**
  13808. * Scales the mat4 by the dimensions in the given vec3 not using vectorization
  13809. *
  13810. * @param {mat4} out the receiving matrix
  13811. * @param {ReadonlyMat4} a the matrix to scale
  13812. * @param {ReadonlyVec3} v the vec3 to scale the matrix by
  13813. * @returns {mat4} out
  13814. **/
  13815. function scale(out, a, v) {
  13816. var x = v[0],
  13817. y = v[1],
  13818. z = v[2];
  13819. out[0] = a[0] * x;
  13820. out[1] = a[1] * x;
  13821. out[2] = a[2] * x;
  13822. out[3] = a[3] * x;
  13823. out[4] = a[4] * y;
  13824. out[5] = a[5] * y;
  13825. out[6] = a[6] * y;
  13826. out[7] = a[7] * y;
  13827. out[8] = a[8] * z;
  13828. out[9] = a[9] * z;
  13829. out[10] = a[10] * z;
  13830. out[11] = a[11] * z;
  13831. out[12] = a[12];
  13832. out[13] = a[13];
  13833. out[14] = a[14];
  13834. out[15] = a[15];
  13835. return out;
  13836. }
  13837. /**
  13838. * Rotates a mat4 by the given angle around the given axis
  13839. *
  13840. * @param {mat4} out the receiving matrix
  13841. * @param {ReadonlyMat4} a the matrix to rotate
  13842. * @param {Number} rad the angle to rotate the matrix by
  13843. * @param {ReadonlyVec3} axis the axis to rotate around
  13844. * @returns {mat4} out
  13845. */
  13846. function rotate(out, a, rad, axis) {
  13847. var x = axis[0],
  13848. y = axis[1],
  13849. z = axis[2];
  13850. var len = Math.hypot(x, y, z);
  13851. var s, c, t;
  13852. var a00, a01, a02, a03;
  13853. var a10, a11, a12, a13;
  13854. var a20, a21, a22, a23;
  13855. var b00, b01, b02;
  13856. var b10, b11, b12;
  13857. var b20, b21, b22;
  13858. if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
  13859. return null;
  13860. }
  13861. len = 1 / len;
  13862. x *= len;
  13863. y *= len;
  13864. z *= len;
  13865. s = Math.sin(rad);
  13866. c = Math.cos(rad);
  13867. t = 1 - c;
  13868. a00 = a[0];
  13869. a01 = a[1];
  13870. a02 = a[2];
  13871. a03 = a[3];
  13872. a10 = a[4];
  13873. a11 = a[5];
  13874. a12 = a[6];
  13875. a13 = a[7];
  13876. a20 = a[8];
  13877. a21 = a[9];
  13878. a22 = a[10];
  13879. a23 = a[11]; // Construct the elements of the rotation matrix
  13880. b00 = x * x * t + c;
  13881. b01 = y * x * t + z * s;
  13882. b02 = z * x * t - y * s;
  13883. b10 = x * y * t - z * s;
  13884. b11 = y * y * t + c;
  13885. b12 = z * y * t + x * s;
  13886. b20 = x * z * t + y * s;
  13887. b21 = y * z * t - x * s;
  13888. b22 = z * z * t + c; // Perform rotation-specific matrix multiplication
  13889. out[0] = a00 * b00 + a10 * b01 + a20 * b02;
  13890. out[1] = a01 * b00 + a11 * b01 + a21 * b02;
  13891. out[2] = a02 * b00 + a12 * b01 + a22 * b02;
  13892. out[3] = a03 * b00 + a13 * b01 + a23 * b02;
  13893. out[4] = a00 * b10 + a10 * b11 + a20 * b12;
  13894. out[5] = a01 * b10 + a11 * b11 + a21 * b12;
  13895. out[6] = a02 * b10 + a12 * b11 + a22 * b12;
  13896. out[7] = a03 * b10 + a13 * b11 + a23 * b12;
  13897. out[8] = a00 * b20 + a10 * b21 + a20 * b22;
  13898. out[9] = a01 * b20 + a11 * b21 + a21 * b22;
  13899. out[10] = a02 * b20 + a12 * b21 + a22 * b22;
  13900. out[11] = a03 * b20 + a13 * b21 + a23 * b22;
  13901. if (a !== out) {
  13902. // If the source and destination differ, copy the unchanged last row
  13903. out[12] = a[12];
  13904. out[13] = a[13];
  13905. out[14] = a[14];
  13906. out[15] = a[15];
  13907. }
  13908. return out;
  13909. }
  13910. /**
  13911. * Rotates a matrix by the given angle around the X axis
  13912. *
  13913. * @param {mat4} out the receiving matrix
  13914. * @param {ReadonlyMat4} a the matrix to rotate
  13915. * @param {Number} rad the angle to rotate the matrix by
  13916. * @returns {mat4} out
  13917. */
  13918. function rotateX(out, a, rad) {
  13919. var s = Math.sin(rad);
  13920. var c = Math.cos(rad);
  13921. var a10 = a[4];
  13922. var a11 = a[5];
  13923. var a12 = a[6];
  13924. var a13 = a[7];
  13925. var a20 = a[8];
  13926. var a21 = a[9];
  13927. var a22 = a[10];
  13928. var a23 = a[11];
  13929. if (a !== out) {
  13930. // If the source and destination differ, copy the unchanged rows
  13931. out[0] = a[0];
  13932. out[1] = a[1];
  13933. out[2] = a[2];
  13934. out[3] = a[3];
  13935. out[12] = a[12];
  13936. out[13] = a[13];
  13937. out[14] = a[14];
  13938. out[15] = a[15];
  13939. } // Perform axis-specific matrix multiplication
  13940. out[4] = a10 * c + a20 * s;
  13941. out[5] = a11 * c + a21 * s;
  13942. out[6] = a12 * c + a22 * s;
  13943. out[7] = a13 * c + a23 * s;
  13944. out[8] = a20 * c - a10 * s;
  13945. out[9] = a21 * c - a11 * s;
  13946. out[10] = a22 * c - a12 * s;
  13947. out[11] = a23 * c - a13 * s;
  13948. return out;
  13949. }
  13950. /**
  13951. * Rotates a matrix by the given angle around the Y axis
  13952. *
  13953. * @param {mat4} out the receiving matrix
  13954. * @param {ReadonlyMat4} a the matrix to rotate
  13955. * @param {Number} rad the angle to rotate the matrix by
  13956. * @returns {mat4} out
  13957. */
  13958. function rotateY(out, a, rad) {
  13959. var s = Math.sin(rad);
  13960. var c = Math.cos(rad);
  13961. var a00 = a[0];
  13962. var a01 = a[1];
  13963. var a02 = a[2];
  13964. var a03 = a[3];
  13965. var a20 = a[8];
  13966. var a21 = a[9];
  13967. var a22 = a[10];
  13968. var a23 = a[11];
  13969. if (a !== out) {
  13970. // If the source and destination differ, copy the unchanged rows
  13971. out[4] = a[4];
  13972. out[5] = a[5];
  13973. out[6] = a[6];
  13974. out[7] = a[7];
  13975. out[12] = a[12];
  13976. out[13] = a[13];
  13977. out[14] = a[14];
  13978. out[15] = a[15];
  13979. } // Perform axis-specific matrix multiplication
  13980. out[0] = a00 * c - a20 * s;
  13981. out[1] = a01 * c - a21 * s;
  13982. out[2] = a02 * c - a22 * s;
  13983. out[3] = a03 * c - a23 * s;
  13984. out[8] = a00 * s + a20 * c;
  13985. out[9] = a01 * s + a21 * c;
  13986. out[10] = a02 * s + a22 * c;
  13987. out[11] = a03 * s + a23 * c;
  13988. return out;
  13989. }
  13990. /**
  13991. * Rotates a matrix by the given angle around the Z axis
  13992. *
  13993. * @param {mat4} out the receiving matrix
  13994. * @param {ReadonlyMat4} a the matrix to rotate
  13995. * @param {Number} rad the angle to rotate the matrix by
  13996. * @returns {mat4} out
  13997. */
  13998. function rotateZ(out, a, rad) {
  13999. var s = Math.sin(rad);
  14000. var c = Math.cos(rad);
  14001. var a00 = a[0];
  14002. var a01 = a[1];
  14003. var a02 = a[2];
  14004. var a03 = a[3];
  14005. var a10 = a[4];
  14006. var a11 = a[5];
  14007. var a12 = a[6];
  14008. var a13 = a[7];
  14009. if (a !== out) {
  14010. // If the source and destination differ, copy the unchanged last row
  14011. out[8] = a[8];
  14012. out[9] = a[9];
  14013. out[10] = a[10];
  14014. out[11] = a[11];
  14015. out[12] = a[12];
  14016. out[13] = a[13];
  14017. out[14] = a[14];
  14018. out[15] = a[15];
  14019. } // Perform axis-specific matrix multiplication
  14020. out[0] = a00 * c + a10 * s;
  14021. out[1] = a01 * c + a11 * s;
  14022. out[2] = a02 * c + a12 * s;
  14023. out[3] = a03 * c + a13 * s;
  14024. out[4] = a10 * c - a00 * s;
  14025. out[5] = a11 * c - a01 * s;
  14026. out[6] = a12 * c - a02 * s;
  14027. out[7] = a13 * c - a03 * s;
  14028. return out;
  14029. }
  14030. /**
  14031. * Creates a matrix from a vector translation
  14032. * This is equivalent to (but much faster than):
  14033. *
  14034. * mat4.identity(dest);
  14035. * mat4.translate(dest, dest, vec);
  14036. *
  14037. * @param {mat4} out mat4 receiving operation result
  14038. * @param {ReadonlyVec3} v Translation vector
  14039. * @returns {mat4} out
  14040. */
  14041. function fromTranslation(out, v) {
  14042. out[0] = 1;
  14043. out[1] = 0;
  14044. out[2] = 0;
  14045. out[3] = 0;
  14046. out[4] = 0;
  14047. out[5] = 1;
  14048. out[6] = 0;
  14049. out[7] = 0;
  14050. out[8] = 0;
  14051. out[9] = 0;
  14052. out[10] = 1;
  14053. out[11] = 0;
  14054. out[12] = v[0];
  14055. out[13] = v[1];
  14056. out[14] = v[2];
  14057. out[15] = 1;
  14058. return out;
  14059. }
  14060. /**
  14061. * Creates a matrix from a vector scaling
  14062. * This is equivalent to (but much faster than):
  14063. *
  14064. * mat4.identity(dest);
  14065. * mat4.scale(dest, dest, vec);
  14066. *
  14067. * @param {mat4} out mat4 receiving operation result
  14068. * @param {ReadonlyVec3} v Scaling vector
  14069. * @returns {mat4} out
  14070. */
  14071. function fromScaling(out, v) {
  14072. out[0] = v[0];
  14073. out[1] = 0;
  14074. out[2] = 0;
  14075. out[3] = 0;
  14076. out[4] = 0;
  14077. out[5] = v[1];
  14078. out[6] = 0;
  14079. out[7] = 0;
  14080. out[8] = 0;
  14081. out[9] = 0;
  14082. out[10] = v[2];
  14083. out[11] = 0;
  14084. out[12] = 0;
  14085. out[13] = 0;
  14086. out[14] = 0;
  14087. out[15] = 1;
  14088. return out;
  14089. }
  14090. /**
  14091. * Creates a matrix from a given angle around a given axis
  14092. * This is equivalent to (but much faster than):
  14093. *
  14094. * mat4.identity(dest);
  14095. * mat4.rotate(dest, dest, rad, axis);
  14096. *
  14097. * @param {mat4} out mat4 receiving operation result
  14098. * @param {Number} rad the angle to rotate the matrix by
  14099. * @param {ReadonlyVec3} axis the axis to rotate around
  14100. * @returns {mat4} out
  14101. */
  14102. function fromRotation(out, rad, axis) {
  14103. var x = axis[0],
  14104. y = axis[1],
  14105. z = axis[2];
  14106. var len = Math.hypot(x, y, z);
  14107. var s, c, t;
  14108. if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
  14109. return null;
  14110. }
  14111. len = 1 / len;
  14112. x *= len;
  14113. y *= len;
  14114. z *= len;
  14115. s = Math.sin(rad);
  14116. c = Math.cos(rad);
  14117. t = 1 - c; // Perform rotation-specific matrix multiplication
  14118. out[0] = x * x * t + c;
  14119. out[1] = y * x * t + z * s;
  14120. out[2] = z * x * t - y * s;
  14121. out[3] = 0;
  14122. out[4] = x * y * t - z * s;
  14123. out[5] = y * y * t + c;
  14124. out[6] = z * y * t + x * s;
  14125. out[7] = 0;
  14126. out[8] = x * z * t + y * s;
  14127. out[9] = y * z * t - x * s;
  14128. out[10] = z * z * t + c;
  14129. out[11] = 0;
  14130. out[12] = 0;
  14131. out[13] = 0;
  14132. out[14] = 0;
  14133. out[15] = 1;
  14134. return out;
  14135. }
  14136. /**
  14137. * Creates a matrix from the given angle around the X axis
  14138. * This is equivalent to (but much faster than):
  14139. *
  14140. * mat4.identity(dest);
  14141. * mat4.rotateX(dest, dest, rad);
  14142. *
  14143. * @param {mat4} out mat4 receiving operation result
  14144. * @param {Number} rad the angle to rotate the matrix by
  14145. * @returns {mat4} out
  14146. */
  14147. function fromXRotation(out, rad) {
  14148. var s = Math.sin(rad);
  14149. var c = Math.cos(rad); // Perform axis-specific matrix multiplication
  14150. out[0] = 1;
  14151. out[1] = 0;
  14152. out[2] = 0;
  14153. out[3] = 0;
  14154. out[4] = 0;
  14155. out[5] = c;
  14156. out[6] = s;
  14157. out[7] = 0;
  14158. out[8] = 0;
  14159. out[9] = -s;
  14160. out[10] = c;
  14161. out[11] = 0;
  14162. out[12] = 0;
  14163. out[13] = 0;
  14164. out[14] = 0;
  14165. out[15] = 1;
  14166. return out;
  14167. }
  14168. /**
  14169. * Creates a matrix from the given angle around the Y axis
  14170. * This is equivalent to (but much faster than):
  14171. *
  14172. * mat4.identity(dest);
  14173. * mat4.rotateY(dest, dest, rad);
  14174. *
  14175. * @param {mat4} out mat4 receiving operation result
  14176. * @param {Number} rad the angle to rotate the matrix by
  14177. * @returns {mat4} out
  14178. */
  14179. function fromYRotation(out, rad) {
  14180. var s = Math.sin(rad);
  14181. var c = Math.cos(rad); // Perform axis-specific matrix multiplication
  14182. out[0] = c;
  14183. out[1] = 0;
  14184. out[2] = -s;
  14185. out[3] = 0;
  14186. out[4] = 0;
  14187. out[5] = 1;
  14188. out[6] = 0;
  14189. out[7] = 0;
  14190. out[8] = s;
  14191. out[9] = 0;
  14192. out[10] = c;
  14193. out[11] = 0;
  14194. out[12] = 0;
  14195. out[13] = 0;
  14196. out[14] = 0;
  14197. out[15] = 1;
  14198. return out;
  14199. }
  14200. /**
  14201. * Creates a matrix from the given angle around the Z axis
  14202. * This is equivalent to (but much faster than):
  14203. *
  14204. * mat4.identity(dest);
  14205. * mat4.rotateZ(dest, dest, rad);
  14206. *
  14207. * @param {mat4} out mat4 receiving operation result
  14208. * @param {Number} rad the angle to rotate the matrix by
  14209. * @returns {mat4} out
  14210. */
  14211. function fromZRotation(out, rad) {
  14212. var s = Math.sin(rad);
  14213. var c = Math.cos(rad); // Perform axis-specific matrix multiplication
  14214. out[0] = c;
  14215. out[1] = s;
  14216. out[2] = 0;
  14217. out[3] = 0;
  14218. out[4] = -s;
  14219. out[5] = c;
  14220. out[6] = 0;
  14221. out[7] = 0;
  14222. out[8] = 0;
  14223. out[9] = 0;
  14224. out[10] = 1;
  14225. out[11] = 0;
  14226. out[12] = 0;
  14227. out[13] = 0;
  14228. out[14] = 0;
  14229. out[15] = 1;
  14230. return out;
  14231. }
  14232. /**
  14233. * Creates a matrix from a quaternion rotation and vector translation
  14234. * This is equivalent to (but much faster than):
  14235. *
  14236. * mat4.identity(dest);
  14237. * mat4.translate(dest, vec);
  14238. * let quatMat = mat4.create();
  14239. * quat4.toMat4(quat, quatMat);
  14240. * mat4.multiply(dest, quatMat);
  14241. *
  14242. * @param {mat4} out mat4 receiving operation result
  14243. * @param {quat4} q Rotation quaternion
  14244. * @param {ReadonlyVec3} v Translation vector
  14245. * @returns {mat4} out
  14246. */
  14247. function fromRotationTranslation(out, q, v) {
  14248. // Quaternion math
  14249. var x = q[0],
  14250. y = q[1],
  14251. z = q[2],
  14252. w = q[3];
  14253. var x2 = x + x;
  14254. var y2 = y + y;
  14255. var z2 = z + z;
  14256. var xx = x * x2;
  14257. var xy = x * y2;
  14258. var xz = x * z2;
  14259. var yy = y * y2;
  14260. var yz = y * z2;
  14261. var zz = z * z2;
  14262. var wx = w * x2;
  14263. var wy = w * y2;
  14264. var wz = w * z2;
  14265. out[0] = 1 - (yy + zz);
  14266. out[1] = xy + wz;
  14267. out[2] = xz - wy;
  14268. out[3] = 0;
  14269. out[4] = xy - wz;
  14270. out[5] = 1 - (xx + zz);
  14271. out[6] = yz + wx;
  14272. out[7] = 0;
  14273. out[8] = xz + wy;
  14274. out[9] = yz - wx;
  14275. out[10] = 1 - (xx + yy);
  14276. out[11] = 0;
  14277. out[12] = v[0];
  14278. out[13] = v[1];
  14279. out[14] = v[2];
  14280. out[15] = 1;
  14281. return out;
  14282. }
  14283. /**
  14284. * Creates a new mat4 from a dual quat.
  14285. *
  14286. * @param {mat4} out Matrix
  14287. * @param {ReadonlyQuat2} a Dual Quaternion
  14288. * @returns {mat4} mat4 receiving operation result
  14289. */
  14290. function fromQuat2(out, a) {
  14291. var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  14292. var bx = -a[0],
  14293. by = -a[1],
  14294. bz = -a[2],
  14295. bw = a[3],
  14296. ax = a[4],
  14297. ay = a[5],
  14298. az = a[6],
  14299. aw = a[7];
  14300. var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense
  14301. if (magnitude > 0) {
  14302. translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;
  14303. translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;
  14304. translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;
  14305. } else {
  14306. translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;
  14307. translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;
  14308. translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;
  14309. }
  14310. fromRotationTranslation(out, a, translation);
  14311. return out;
  14312. }
  14313. /**
  14314. * Returns the translation vector component of a transformation
  14315. * matrix. If a matrix is built with fromRotationTranslation,
  14316. * the returned vector will be the same as the translation vector
  14317. * originally supplied.
  14318. * @param {vec3} out Vector to receive translation component
  14319. * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
  14320. * @return {vec3} out
  14321. */
  14322. function getTranslation(out, mat) {
  14323. out[0] = mat[12];
  14324. out[1] = mat[13];
  14325. out[2] = mat[14];
  14326. return out;
  14327. }
  14328. /**
  14329. * Returns the scaling factor component of a transformation
  14330. * matrix. If a matrix is built with fromRotationTranslationScale
  14331. * with a normalized Quaternion paramter, the returned vector will be
  14332. * the same as the scaling vector
  14333. * originally supplied.
  14334. * @param {vec3} out Vector to receive scaling factor component
  14335. * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
  14336. * @return {vec3} out
  14337. */
  14338. function getScaling(out, mat) {
  14339. var m11 = mat[0];
  14340. var m12 = mat[1];
  14341. var m13 = mat[2];
  14342. var m21 = mat[4];
  14343. var m22 = mat[5];
  14344. var m23 = mat[6];
  14345. var m31 = mat[8];
  14346. var m32 = mat[9];
  14347. var m33 = mat[10];
  14348. out[0] = Math.hypot(m11, m12, m13);
  14349. out[1] = Math.hypot(m21, m22, m23);
  14350. out[2] = Math.hypot(m31, m32, m33);
  14351. return out;
  14352. }
  14353. /**
  14354. * Returns a quaternion representing the rotational component
  14355. * of a transformation matrix. If a matrix is built with
  14356. * fromRotationTranslation, the returned quaternion will be the
  14357. * same as the quaternion originally supplied.
  14358. * @param {quat} out Quaternion to receive the rotation component
  14359. * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
  14360. * @return {quat} out
  14361. */
  14362. function getRotation(out, mat) {
  14363. var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  14364. getScaling(scaling, mat);
  14365. var is1 = 1 / scaling[0];
  14366. var is2 = 1 / scaling[1];
  14367. var is3 = 1 / scaling[2];
  14368. var sm11 = mat[0] * is1;
  14369. var sm12 = mat[1] * is2;
  14370. var sm13 = mat[2] * is3;
  14371. var sm21 = mat[4] * is1;
  14372. var sm22 = mat[5] * is2;
  14373. var sm23 = mat[6] * is3;
  14374. var sm31 = mat[8] * is1;
  14375. var sm32 = mat[9] * is2;
  14376. var sm33 = mat[10] * is3;
  14377. var trace = sm11 + sm22 + sm33;
  14378. var S = 0;
  14379. if (trace > 0) {
  14380. S = Math.sqrt(trace + 1.0) * 2;
  14381. out[3] = 0.25 * S;
  14382. out[0] = (sm23 - sm32) / S;
  14383. out[1] = (sm31 - sm13) / S;
  14384. out[2] = (sm12 - sm21) / S;
  14385. } else if (sm11 > sm22 && sm11 > sm33) {
  14386. S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;
  14387. out[3] = (sm23 - sm32) / S;
  14388. out[0] = 0.25 * S;
  14389. out[1] = (sm12 + sm21) / S;
  14390. out[2] = (sm31 + sm13) / S;
  14391. } else if (sm22 > sm33) {
  14392. S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;
  14393. out[3] = (sm31 - sm13) / S;
  14394. out[0] = (sm12 + sm21) / S;
  14395. out[1] = 0.25 * S;
  14396. out[2] = (sm23 + sm32) / S;
  14397. } else {
  14398. S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;
  14399. out[3] = (sm12 - sm21) / S;
  14400. out[0] = (sm31 + sm13) / S;
  14401. out[1] = (sm23 + sm32) / S;
  14402. out[2] = 0.25 * S;
  14403. }
  14404. return out;
  14405. }
  14406. /**
  14407. * Creates a matrix from a quaternion rotation, vector translation and vector scale
  14408. * This is equivalent to (but much faster than):
  14409. *
  14410. * mat4.identity(dest);
  14411. * mat4.translate(dest, vec);
  14412. * let quatMat = mat4.create();
  14413. * quat4.toMat4(quat, quatMat);
  14414. * mat4.multiply(dest, quatMat);
  14415. * mat4.scale(dest, scale)
  14416. *
  14417. * @param {mat4} out mat4 receiving operation result
  14418. * @param {quat4} q Rotation quaternion
  14419. * @param {ReadonlyVec3} v Translation vector
  14420. * @param {ReadonlyVec3} s Scaling vector
  14421. * @returns {mat4} out
  14422. */
  14423. function fromRotationTranslationScale(out, q, v, s) {
  14424. // Quaternion math
  14425. var x = q[0],
  14426. y = q[1],
  14427. z = q[2],
  14428. w = q[3];
  14429. var x2 = x + x;
  14430. var y2 = y + y;
  14431. var z2 = z + z;
  14432. var xx = x * x2;
  14433. var xy = x * y2;
  14434. var xz = x * z2;
  14435. var yy = y * y2;
  14436. var yz = y * z2;
  14437. var zz = z * z2;
  14438. var wx = w * x2;
  14439. var wy = w * y2;
  14440. var wz = w * z2;
  14441. var sx = s[0];
  14442. var sy = s[1];
  14443. var sz = s[2];
  14444. out[0] = (1 - (yy + zz)) * sx;
  14445. out[1] = (xy + wz) * sx;
  14446. out[2] = (xz - wy) * sx;
  14447. out[3] = 0;
  14448. out[4] = (xy - wz) * sy;
  14449. out[5] = (1 - (xx + zz)) * sy;
  14450. out[6] = (yz + wx) * sy;
  14451. out[7] = 0;
  14452. out[8] = (xz + wy) * sz;
  14453. out[9] = (yz - wx) * sz;
  14454. out[10] = (1 - (xx + yy)) * sz;
  14455. out[11] = 0;
  14456. out[12] = v[0];
  14457. out[13] = v[1];
  14458. out[14] = v[2];
  14459. out[15] = 1;
  14460. return out;
  14461. }
  14462. /**
  14463. * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
  14464. * This is equivalent to (but much faster than):
  14465. *
  14466. * mat4.identity(dest);
  14467. * mat4.translate(dest, vec);
  14468. * mat4.translate(dest, origin);
  14469. * let quatMat = mat4.create();
  14470. * quat4.toMat4(quat, quatMat);
  14471. * mat4.multiply(dest, quatMat);
  14472. * mat4.scale(dest, scale)
  14473. * mat4.translate(dest, negativeOrigin);
  14474. *
  14475. * @param {mat4} out mat4 receiving operation result
  14476. * @param {quat4} q Rotation quaternion
  14477. * @param {ReadonlyVec3} v Translation vector
  14478. * @param {ReadonlyVec3} s Scaling vector
  14479. * @param {ReadonlyVec3} o The origin vector around which to scale and rotate
  14480. * @returns {mat4} out
  14481. */
  14482. function fromRotationTranslationScaleOrigin(out, q, v, s, o) {
  14483. // Quaternion math
  14484. var x = q[0],
  14485. y = q[1],
  14486. z = q[2],
  14487. w = q[3];
  14488. var x2 = x + x;
  14489. var y2 = y + y;
  14490. var z2 = z + z;
  14491. var xx = x * x2;
  14492. var xy = x * y2;
  14493. var xz = x * z2;
  14494. var yy = y * y2;
  14495. var yz = y * z2;
  14496. var zz = z * z2;
  14497. var wx = w * x2;
  14498. var wy = w * y2;
  14499. var wz = w * z2;
  14500. var sx = s[0];
  14501. var sy = s[1];
  14502. var sz = s[2];
  14503. var ox = o[0];
  14504. var oy = o[1];
  14505. var oz = o[2];
  14506. var out0 = (1 - (yy + zz)) * sx;
  14507. var out1 = (xy + wz) * sx;
  14508. var out2 = (xz - wy) * sx;
  14509. var out4 = (xy - wz) * sy;
  14510. var out5 = (1 - (xx + zz)) * sy;
  14511. var out6 = (yz + wx) * sy;
  14512. var out8 = (xz + wy) * sz;
  14513. var out9 = (yz - wx) * sz;
  14514. var out10 = (1 - (xx + yy)) * sz;
  14515. out[0] = out0;
  14516. out[1] = out1;
  14517. out[2] = out2;
  14518. out[3] = 0;
  14519. out[4] = out4;
  14520. out[5] = out5;
  14521. out[6] = out6;
  14522. out[7] = 0;
  14523. out[8] = out8;
  14524. out[9] = out9;
  14525. out[10] = out10;
  14526. out[11] = 0;
  14527. out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);
  14528. out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);
  14529. out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);
  14530. out[15] = 1;
  14531. return out;
  14532. }
  14533. /**
  14534. * Calculates a 4x4 matrix from the given quaternion
  14535. *
  14536. * @param {mat4} out mat4 receiving operation result
  14537. * @param {ReadonlyQuat} q Quaternion to create matrix from
  14538. *
  14539. * @returns {mat4} out
  14540. */
  14541. function fromQuat(out, q) {
  14542. var x = q[0],
  14543. y = q[1],
  14544. z = q[2],
  14545. w = q[3];
  14546. var x2 = x + x;
  14547. var y2 = y + y;
  14548. var z2 = z + z;
  14549. var xx = x * x2;
  14550. var yx = y * x2;
  14551. var yy = y * y2;
  14552. var zx = z * x2;
  14553. var zy = z * y2;
  14554. var zz = z * z2;
  14555. var wx = w * x2;
  14556. var wy = w * y2;
  14557. var wz = w * z2;
  14558. out[0] = 1 - yy - zz;
  14559. out[1] = yx + wz;
  14560. out[2] = zx - wy;
  14561. out[3] = 0;
  14562. out[4] = yx - wz;
  14563. out[5] = 1 - xx - zz;
  14564. out[6] = zy + wx;
  14565. out[7] = 0;
  14566. out[8] = zx + wy;
  14567. out[9] = zy - wx;
  14568. out[10] = 1 - xx - yy;
  14569. out[11] = 0;
  14570. out[12] = 0;
  14571. out[13] = 0;
  14572. out[14] = 0;
  14573. out[15] = 1;
  14574. return out;
  14575. }
  14576. /**
  14577. * Generates a frustum matrix with the given bounds
  14578. *
  14579. * @param {mat4} out mat4 frustum matrix will be written into
  14580. * @param {Number} left Left bound of the frustum
  14581. * @param {Number} right Right bound of the frustum
  14582. * @param {Number} bottom Bottom bound of the frustum
  14583. * @param {Number} top Top bound of the frustum
  14584. * @param {Number} near Near bound of the frustum
  14585. * @param {Number} far Far bound of the frustum
  14586. * @returns {mat4} out
  14587. */
  14588. function frustum(out, left, right, bottom, top, near, far) {
  14589. var rl = 1 / (right - left);
  14590. var tb = 1 / (top - bottom);
  14591. var nf = 1 / (near - far);
  14592. out[0] = near * 2 * rl;
  14593. out[1] = 0;
  14594. out[2] = 0;
  14595. out[3] = 0;
  14596. out[4] = 0;
  14597. out[5] = near * 2 * tb;
  14598. out[6] = 0;
  14599. out[7] = 0;
  14600. out[8] = (right + left) * rl;
  14601. out[9] = (top + bottom) * tb;
  14602. out[10] = (far + near) * nf;
  14603. out[11] = -1;
  14604. out[12] = 0;
  14605. out[13] = 0;
  14606. out[14] = far * near * 2 * nf;
  14607. out[15] = 0;
  14608. return out;
  14609. }
  14610. /**
  14611. * Generates a perspective projection matrix with the given bounds.
  14612. * Passing null/undefined/no value for far will generate infinite projection matrix.
  14613. *
  14614. * @param {mat4} out mat4 frustum matrix will be written into
  14615. * @param {number} fovy Vertical field of view in radians
  14616. * @param {number} aspect Aspect ratio. typically viewport width/height
  14617. * @param {number} near Near bound of the frustum
  14618. * @param {number} far Far bound of the frustum, can be null or Infinity
  14619. * @returns {mat4} out
  14620. */
  14621. function perspective(out, fovy, aspect, near, far) {
  14622. var f = 1.0 / Math.tan(fovy / 2),
  14623. nf;
  14624. out[0] = f / aspect;
  14625. out[1] = 0;
  14626. out[2] = 0;
  14627. out[3] = 0;
  14628. out[4] = 0;
  14629. out[5] = f;
  14630. out[6] = 0;
  14631. out[7] = 0;
  14632. out[8] = 0;
  14633. out[9] = 0;
  14634. out[11] = -1;
  14635. out[12] = 0;
  14636. out[13] = 0;
  14637. out[15] = 0;
  14638. if (far != null && far !== Infinity) {
  14639. nf = 1 / (near - far);
  14640. out[10] = (far + near) * nf;
  14641. out[14] = 2 * far * near * nf;
  14642. } else {
  14643. out[10] = -1;
  14644. out[14] = -2 * near;
  14645. }
  14646. return out;
  14647. }
  14648. /**
  14649. * Generates a perspective projection matrix with the given field of view.
  14650. * This is primarily useful for generating projection matrices to be used
  14651. * with the still experiemental WebVR API.
  14652. *
  14653. * @param {mat4} out mat4 frustum matrix will be written into
  14654. * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees
  14655. * @param {number} near Near bound of the frustum
  14656. * @param {number} far Far bound of the frustum
  14657. * @returns {mat4} out
  14658. */
  14659. function perspectiveFromFieldOfView(out, fov, near, far) {
  14660. var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);
  14661. var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);
  14662. var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);
  14663. var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);
  14664. var xScale = 2.0 / (leftTan + rightTan);
  14665. var yScale = 2.0 / (upTan + downTan);
  14666. out[0] = xScale;
  14667. out[1] = 0.0;
  14668. out[2] = 0.0;
  14669. out[3] = 0.0;
  14670. out[4] = 0.0;
  14671. out[5] = yScale;
  14672. out[6] = 0.0;
  14673. out[7] = 0.0;
  14674. out[8] = -((leftTan - rightTan) * xScale * 0.5);
  14675. out[9] = (upTan - downTan) * yScale * 0.5;
  14676. out[10] = far / (near - far);
  14677. out[11] = -1.0;
  14678. out[12] = 0.0;
  14679. out[13] = 0.0;
  14680. out[14] = far * near / (near - far);
  14681. out[15] = 0.0;
  14682. return out;
  14683. }
  14684. /**
  14685. * Generates a orthogonal projection matrix with the given bounds
  14686. *
  14687. * @param {mat4} out mat4 frustum matrix will be written into
  14688. * @param {number} left Left bound of the frustum
  14689. * @param {number} right Right bound of the frustum
  14690. * @param {number} bottom Bottom bound of the frustum
  14691. * @param {number} top Top bound of the frustum
  14692. * @param {number} near Near bound of the frustum
  14693. * @param {number} far Far bound of the frustum
  14694. * @returns {mat4} out
  14695. */
  14696. function ortho(out, left, right, bottom, top, near, far) {
  14697. var lr = 1 / (left - right);
  14698. var bt = 1 / (bottom - top);
  14699. var nf = 1 / (near - far);
  14700. out[0] = -2 * lr;
  14701. out[1] = 0;
  14702. out[2] = 0;
  14703. out[3] = 0;
  14704. out[4] = 0;
  14705. out[5] = -2 * bt;
  14706. out[6] = 0;
  14707. out[7] = 0;
  14708. out[8] = 0;
  14709. out[9] = 0;
  14710. out[10] = 2 * nf;
  14711. out[11] = 0;
  14712. out[12] = (left + right) * lr;
  14713. out[13] = (top + bottom) * bt;
  14714. out[14] = (far + near) * nf;
  14715. out[15] = 1;
  14716. return out;
  14717. }
  14718. /**
  14719. * Generates a look-at matrix with the given eye position, focal point, and up axis.
  14720. * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.
  14721. *
  14722. * @param {mat4} out mat4 frustum matrix will be written into
  14723. * @param {ReadonlyVec3} eye Position of the viewer
  14724. * @param {ReadonlyVec3} center Point the viewer is looking at
  14725. * @param {ReadonlyVec3} up vec3 pointing up
  14726. * @returns {mat4} out
  14727. */
  14728. function lookAt(out, eye, center, up) {
  14729. var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;
  14730. var eyex = eye[0];
  14731. var eyey = eye[1];
  14732. var eyez = eye[2];
  14733. var upx = up[0];
  14734. var upy = up[1];
  14735. var upz = up[2];
  14736. var centerx = center[0];
  14737. var centery = center[1];
  14738. var centerz = center[2];
  14739. if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
  14740. return identity(out);
  14741. }
  14742. z0 = eyex - centerx;
  14743. z1 = eyey - centery;
  14744. z2 = eyez - centerz;
  14745. len = 1 / Math.hypot(z0, z1, z2);
  14746. z0 *= len;
  14747. z1 *= len;
  14748. z2 *= len;
  14749. x0 = upy * z2 - upz * z1;
  14750. x1 = upz * z0 - upx * z2;
  14751. x2 = upx * z1 - upy * z0;
  14752. len = Math.hypot(x0, x1, x2);
  14753. if (!len) {
  14754. x0 = 0;
  14755. x1 = 0;
  14756. x2 = 0;
  14757. } else {
  14758. len = 1 / len;
  14759. x0 *= len;
  14760. x1 *= len;
  14761. x2 *= len;
  14762. }
  14763. y0 = z1 * x2 - z2 * x1;
  14764. y1 = z2 * x0 - z0 * x2;
  14765. y2 = z0 * x1 - z1 * x0;
  14766. len = Math.hypot(y0, y1, y2);
  14767. if (!len) {
  14768. y0 = 0;
  14769. y1 = 0;
  14770. y2 = 0;
  14771. } else {
  14772. len = 1 / len;
  14773. y0 *= len;
  14774. y1 *= len;
  14775. y2 *= len;
  14776. }
  14777. out[0] = x0;
  14778. out[1] = y0;
  14779. out[2] = z0;
  14780. out[3] = 0;
  14781. out[4] = x1;
  14782. out[5] = y1;
  14783. out[6] = z1;
  14784. out[7] = 0;
  14785. out[8] = x2;
  14786. out[9] = y2;
  14787. out[10] = z2;
  14788. out[11] = 0;
  14789. out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);
  14790. out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);
  14791. out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);
  14792. out[15] = 1;
  14793. return out;
  14794. }
  14795. /**
  14796. * Generates a matrix that makes something look at something else.
  14797. *
  14798. * @param {mat4} out mat4 frustum matrix will be written into
  14799. * @param {ReadonlyVec3} eye Position of the viewer
  14800. * @param {ReadonlyVec3} center Point the viewer is looking at
  14801. * @param {ReadonlyVec3} up vec3 pointing up
  14802. * @returns {mat4} out
  14803. */
  14804. function targetTo(out, eye, target, up) {
  14805. var eyex = eye[0],
  14806. eyey = eye[1],
  14807. eyez = eye[2],
  14808. upx = up[0],
  14809. upy = up[1],
  14810. upz = up[2];
  14811. var z0 = eyex - target[0],
  14812. z1 = eyey - target[1],
  14813. z2 = eyez - target[2];
  14814. var len = z0 * z0 + z1 * z1 + z2 * z2;
  14815. if (len > 0) {
  14816. len = 1 / Math.sqrt(len);
  14817. z0 *= len;
  14818. z1 *= len;
  14819. z2 *= len;
  14820. }
  14821. var x0 = upy * z2 - upz * z1,
  14822. x1 = upz * z0 - upx * z2,
  14823. x2 = upx * z1 - upy * z0;
  14824. len = x0 * x0 + x1 * x1 + x2 * x2;
  14825. if (len > 0) {
  14826. len = 1 / Math.sqrt(len);
  14827. x0 *= len;
  14828. x1 *= len;
  14829. x2 *= len;
  14830. }
  14831. out[0] = x0;
  14832. out[1] = x1;
  14833. out[2] = x2;
  14834. out[3] = 0;
  14835. out[4] = z1 * x2 - z2 * x1;
  14836. out[5] = z2 * x0 - z0 * x2;
  14837. out[6] = z0 * x1 - z1 * x0;
  14838. out[7] = 0;
  14839. out[8] = z0;
  14840. out[9] = z1;
  14841. out[10] = z2;
  14842. out[11] = 0;
  14843. out[12] = eyex;
  14844. out[13] = eyey;
  14845. out[14] = eyez;
  14846. out[15] = 1;
  14847. return out;
  14848. }
  14849. /**
  14850. * Returns a string representation of a mat4
  14851. *
  14852. * @param {ReadonlyMat4} a matrix to represent as a string
  14853. * @returns {String} string representation of the matrix
  14854. */
  14855. function str(a) {
  14856. return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")";
  14857. }
  14858. /**
  14859. * Returns Frobenius norm of a mat4
  14860. *
  14861. * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of
  14862. * @returns {Number} Frobenius norm
  14863. */
  14864. function frob(a) {
  14865. return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);
  14866. }
  14867. /**
  14868. * Adds two mat4's
  14869. *
  14870. * @param {mat4} out the receiving matrix
  14871. * @param {ReadonlyMat4} a the first operand
  14872. * @param {ReadonlyMat4} b the second operand
  14873. * @returns {mat4} out
  14874. */
  14875. function add(out, a, b) {
  14876. out[0] = a[0] + b[0];
  14877. out[1] = a[1] + b[1];
  14878. out[2] = a[2] + b[2];
  14879. out[3] = a[3] + b[3];
  14880. out[4] = a[4] + b[4];
  14881. out[5] = a[5] + b[5];
  14882. out[6] = a[6] + b[6];
  14883. out[7] = a[7] + b[7];
  14884. out[8] = a[8] + b[8];
  14885. out[9] = a[9] + b[9];
  14886. out[10] = a[10] + b[10];
  14887. out[11] = a[11] + b[11];
  14888. out[12] = a[12] + b[12];
  14889. out[13] = a[13] + b[13];
  14890. out[14] = a[14] + b[14];
  14891. out[15] = a[15] + b[15];
  14892. return out;
  14893. }
  14894. /**
  14895. * Subtracts matrix b from matrix a
  14896. *
  14897. * @param {mat4} out the receiving matrix
  14898. * @param {ReadonlyMat4} a the first operand
  14899. * @param {ReadonlyMat4} b the second operand
  14900. * @returns {mat4} out
  14901. */
  14902. function subtract(out, a, b) {
  14903. out[0] = a[0] - b[0];
  14904. out[1] = a[1] - b[1];
  14905. out[2] = a[2] - b[2];
  14906. out[3] = a[3] - b[3];
  14907. out[4] = a[4] - b[4];
  14908. out[5] = a[5] - b[5];
  14909. out[6] = a[6] - b[6];
  14910. out[7] = a[7] - b[7];
  14911. out[8] = a[8] - b[8];
  14912. out[9] = a[9] - b[9];
  14913. out[10] = a[10] - b[10];
  14914. out[11] = a[11] - b[11];
  14915. out[12] = a[12] - b[12];
  14916. out[13] = a[13] - b[13];
  14917. out[14] = a[14] - b[14];
  14918. out[15] = a[15] - b[15];
  14919. return out;
  14920. }
  14921. /**
  14922. * Multiply each element of the matrix by a scalar.
  14923. *
  14924. * @param {mat4} out the receiving matrix
  14925. * @param {ReadonlyMat4} a the matrix to scale
  14926. * @param {Number} b amount to scale the matrix's elements by
  14927. * @returns {mat4} out
  14928. */
  14929. function multiplyScalar(out, a, b) {
  14930. out[0] = a[0] * b;
  14931. out[1] = a[1] * b;
  14932. out[2] = a[2] * b;
  14933. out[3] = a[3] * b;
  14934. out[4] = a[4] * b;
  14935. out[5] = a[5] * b;
  14936. out[6] = a[6] * b;
  14937. out[7] = a[7] * b;
  14938. out[8] = a[8] * b;
  14939. out[9] = a[9] * b;
  14940. out[10] = a[10] * b;
  14941. out[11] = a[11] * b;
  14942. out[12] = a[12] * b;
  14943. out[13] = a[13] * b;
  14944. out[14] = a[14] * b;
  14945. out[15] = a[15] * b;
  14946. return out;
  14947. }
  14948. /**
  14949. * Adds two mat4's after multiplying each element of the second operand by a scalar value.
  14950. *
  14951. * @param {mat4} out the receiving vector
  14952. * @param {ReadonlyMat4} a the first operand
  14953. * @param {ReadonlyMat4} b the second operand
  14954. * @param {Number} scale the amount to scale b's elements by before adding
  14955. * @returns {mat4} out
  14956. */
  14957. function multiplyScalarAndAdd(out, a, b, scale) {
  14958. out[0] = a[0] + b[0] * scale;
  14959. out[1] = a[1] + b[1] * scale;
  14960. out[2] = a[2] + b[2] * scale;
  14961. out[3] = a[3] + b[3] * scale;
  14962. out[4] = a[4] + b[4] * scale;
  14963. out[5] = a[5] + b[5] * scale;
  14964. out[6] = a[6] + b[6] * scale;
  14965. out[7] = a[7] + b[7] * scale;
  14966. out[8] = a[8] + b[8] * scale;
  14967. out[9] = a[9] + b[9] * scale;
  14968. out[10] = a[10] + b[10] * scale;
  14969. out[11] = a[11] + b[11] * scale;
  14970. out[12] = a[12] + b[12] * scale;
  14971. out[13] = a[13] + b[13] * scale;
  14972. out[14] = a[14] + b[14] * scale;
  14973. out[15] = a[15] + b[15] * scale;
  14974. return out;
  14975. }
  14976. /**
  14977. * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
  14978. *
  14979. * @param {ReadonlyMat4} a The first matrix.
  14980. * @param {ReadonlyMat4} b The second matrix.
  14981. * @returns {Boolean} True if the matrices are equal, false otherwise.
  14982. */
  14983. function exactEquals(a, b) {
  14984. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];
  14985. }
  14986. /**
  14987. * Returns whether or not the matrices have approximately the same elements in the same position.
  14988. *
  14989. * @param {ReadonlyMat4} a The first matrix.
  14990. * @param {ReadonlyMat4} b The second matrix.
  14991. * @returns {Boolean} True if the matrices are equal, false otherwise.
  14992. */
  14993. function equals(a, b) {
  14994. var a0 = a[0],
  14995. a1 = a[1],
  14996. a2 = a[2],
  14997. a3 = a[3];
  14998. var a4 = a[4],
  14999. a5 = a[5],
  15000. a6 = a[6],
  15001. a7 = a[7];
  15002. var a8 = a[8],
  15003. a9 = a[9],
  15004. a10 = a[10],
  15005. a11 = a[11];
  15006. var a12 = a[12],
  15007. a13 = a[13],
  15008. a14 = a[14],
  15009. a15 = a[15];
  15010. var b0 = b[0],
  15011. b1 = b[1],
  15012. b2 = b[2],
  15013. b3 = b[3];
  15014. var b4 = b[4],
  15015. b5 = b[5],
  15016. b6 = b[6],
  15017. b7 = b[7];
  15018. var b8 = b[8],
  15019. b9 = b[9],
  15020. b10 = b[10],
  15021. b11 = b[11];
  15022. var b12 = b[12],
  15023. b13 = b[13],
  15024. b14 = b[14],
  15025. b15 = b[15];
  15026. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));
  15027. }
  15028. /**
  15029. * Alias for {@link mat4.multiply}
  15030. * @function
  15031. */
  15032. var mul = multiply;
  15033. /**
  15034. * Alias for {@link mat4.subtract}
  15035. * @function
  15036. */
  15037. var sub = subtract;
  15038. /***/ }),
  15039. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js":
  15040. /*!*************************************************************!*\
  15041. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js ***!
  15042. \*************************************************************/
  15043. /*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */
  15044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15045. "use strict";
  15046. __webpack_require__.r(__webpack_exports__);
  15047. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  15048. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  15049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisAngle", function() { return setAxisAngle; });
  15050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisAngle", function() { return getAxisAngle; });
  15051. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAngle", function() { return getAngle; });
  15052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  15053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  15054. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  15055. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  15056. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateW", function() { return calculateW; });
  15057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exp", function() { return exp; });
  15058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ln", function() { return ln; });
  15059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pow", function() { return pow; });
  15060. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slerp", function() { return slerp; });
  15061. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  15062. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  15063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conjugate", function() { return conjugate; });
  15064. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat3", function() { return fromMat3; });
  15065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEuler", function() { return fromEuler; });
  15066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  15067. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  15068. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  15069. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  15070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  15071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  15072. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  15073. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  15074. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  15075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  15076. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  15077. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  15078. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  15079. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  15080. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  15081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  15082. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  15083. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotationTo", function() { return rotationTo; });
  15084. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqlerp", function() { return sqlerp; });
  15085. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxes", function() { return setAxes; });
  15086. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  15087. /* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat3.js");
  15088. /* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js");
  15089. /* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js");
  15090. /**
  15091. * Quaternion
  15092. * @module quat
  15093. */
  15094. /**
  15095. * Creates a new identity quat
  15096. *
  15097. * @returns {quat} a new quaternion
  15098. */
  15099. function create() {
  15100. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  15101. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  15102. out[0] = 0;
  15103. out[1] = 0;
  15104. out[2] = 0;
  15105. }
  15106. out[3] = 1;
  15107. return out;
  15108. }
  15109. /**
  15110. * Set a quat to the identity quaternion
  15111. *
  15112. * @param {quat} out the receiving quaternion
  15113. * @returns {quat} out
  15114. */
  15115. function identity(out) {
  15116. out[0] = 0;
  15117. out[1] = 0;
  15118. out[2] = 0;
  15119. out[3] = 1;
  15120. return out;
  15121. }
  15122. /**
  15123. * Sets a quat from the given angle and rotation axis,
  15124. * then returns it.
  15125. *
  15126. * @param {quat} out the receiving quaternion
  15127. * @param {ReadonlyVec3} axis the axis around which to rotate
  15128. * @param {Number} rad the angle in radians
  15129. * @returns {quat} out
  15130. **/
  15131. function setAxisAngle(out, axis, rad) {
  15132. rad = rad * 0.5;
  15133. var s = Math.sin(rad);
  15134. out[0] = s * axis[0];
  15135. out[1] = s * axis[1];
  15136. out[2] = s * axis[2];
  15137. out[3] = Math.cos(rad);
  15138. return out;
  15139. }
  15140. /**
  15141. * Gets the rotation axis and angle for a given
  15142. * quaternion. If a quaternion is created with
  15143. * setAxisAngle, this method will return the same
  15144. * values as providied in the original parameter list
  15145. * OR functionally equivalent values.
  15146. * Example: The quaternion formed by axis [0, 0, 1] and
  15147. * angle -90 is the same as the quaternion formed by
  15148. * [0, 0, 1] and 270. This method favors the latter.
  15149. * @param {vec3} out_axis Vector receiving the axis of rotation
  15150. * @param {ReadonlyQuat} q Quaternion to be decomposed
  15151. * @return {Number} Angle, in radians, of the rotation
  15152. */
  15153. function getAxisAngle(out_axis, q) {
  15154. var rad = Math.acos(q[3]) * 2.0;
  15155. var s = Math.sin(rad / 2.0);
  15156. if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
  15157. out_axis[0] = q[0] / s;
  15158. out_axis[1] = q[1] / s;
  15159. out_axis[2] = q[2] / s;
  15160. } else {
  15161. // If s is zero, return any axis (no rotation - axis does not matter)
  15162. out_axis[0] = 1;
  15163. out_axis[1] = 0;
  15164. out_axis[2] = 0;
  15165. }
  15166. return rad;
  15167. }
  15168. /**
  15169. * Gets the angular distance between two unit quaternions
  15170. *
  15171. * @param {ReadonlyQuat} a Origin unit quaternion
  15172. * @param {ReadonlyQuat} b Destination unit quaternion
  15173. * @return {Number} Angle, in radians, between the two quaternions
  15174. */
  15175. function getAngle(a, b) {
  15176. var dotproduct = dot(a, b);
  15177. return Math.acos(2 * dotproduct * dotproduct - 1);
  15178. }
  15179. /**
  15180. * Multiplies two quat's
  15181. *
  15182. * @param {quat} out the receiving quaternion
  15183. * @param {ReadonlyQuat} a the first operand
  15184. * @param {ReadonlyQuat} b the second operand
  15185. * @returns {quat} out
  15186. */
  15187. function multiply(out, a, b) {
  15188. var ax = a[0],
  15189. ay = a[1],
  15190. az = a[2],
  15191. aw = a[3];
  15192. var bx = b[0],
  15193. by = b[1],
  15194. bz = b[2],
  15195. bw = b[3];
  15196. out[0] = ax * bw + aw * bx + ay * bz - az * by;
  15197. out[1] = ay * bw + aw * by + az * bx - ax * bz;
  15198. out[2] = az * bw + aw * bz + ax * by - ay * bx;
  15199. out[3] = aw * bw - ax * bx - ay * by - az * bz;
  15200. return out;
  15201. }
  15202. /**
  15203. * Rotates a quaternion by the given angle about the X axis
  15204. *
  15205. * @param {quat} out quat receiving operation result
  15206. * @param {ReadonlyQuat} a quat to rotate
  15207. * @param {number} rad angle (in radians) to rotate
  15208. * @returns {quat} out
  15209. */
  15210. function rotateX(out, a, rad) {
  15211. rad *= 0.5;
  15212. var ax = a[0],
  15213. ay = a[1],
  15214. az = a[2],
  15215. aw = a[3];
  15216. var bx = Math.sin(rad),
  15217. bw = Math.cos(rad);
  15218. out[0] = ax * bw + aw * bx;
  15219. out[1] = ay * bw + az * bx;
  15220. out[2] = az * bw - ay * bx;
  15221. out[3] = aw * bw - ax * bx;
  15222. return out;
  15223. }
  15224. /**
  15225. * Rotates a quaternion by the given angle about the Y axis
  15226. *
  15227. * @param {quat} out quat receiving operation result
  15228. * @param {ReadonlyQuat} a quat to rotate
  15229. * @param {number} rad angle (in radians) to rotate
  15230. * @returns {quat} out
  15231. */
  15232. function rotateY(out, a, rad) {
  15233. rad *= 0.5;
  15234. var ax = a[0],
  15235. ay = a[1],
  15236. az = a[2],
  15237. aw = a[3];
  15238. var by = Math.sin(rad),
  15239. bw = Math.cos(rad);
  15240. out[0] = ax * bw - az * by;
  15241. out[1] = ay * bw + aw * by;
  15242. out[2] = az * bw + ax * by;
  15243. out[3] = aw * bw - ay * by;
  15244. return out;
  15245. }
  15246. /**
  15247. * Rotates a quaternion by the given angle about the Z axis
  15248. *
  15249. * @param {quat} out quat receiving operation result
  15250. * @param {ReadonlyQuat} a quat to rotate
  15251. * @param {number} rad angle (in radians) to rotate
  15252. * @returns {quat} out
  15253. */
  15254. function rotateZ(out, a, rad) {
  15255. rad *= 0.5;
  15256. var ax = a[0],
  15257. ay = a[1],
  15258. az = a[2],
  15259. aw = a[3];
  15260. var bz = Math.sin(rad),
  15261. bw = Math.cos(rad);
  15262. out[0] = ax * bw + ay * bz;
  15263. out[1] = ay * bw - ax * bz;
  15264. out[2] = az * bw + aw * bz;
  15265. out[3] = aw * bw - az * bz;
  15266. return out;
  15267. }
  15268. /**
  15269. * Calculates the W component of a quat from the X, Y, and Z components.
  15270. * Assumes that quaternion is 1 unit in length.
  15271. * Any existing W component will be ignored.
  15272. *
  15273. * @param {quat} out the receiving quaternion
  15274. * @param {ReadonlyQuat} a quat to calculate W component of
  15275. * @returns {quat} out
  15276. */
  15277. function calculateW(out, a) {
  15278. var x = a[0],
  15279. y = a[1],
  15280. z = a[2];
  15281. out[0] = x;
  15282. out[1] = y;
  15283. out[2] = z;
  15284. out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));
  15285. return out;
  15286. }
  15287. /**
  15288. * Calculate the exponential of a unit quaternion.
  15289. *
  15290. * @param {quat} out the receiving quaternion
  15291. * @param {ReadonlyQuat} a quat to calculate the exponential of
  15292. * @returns {quat} out
  15293. */
  15294. function exp(out, a) {
  15295. var x = a[0],
  15296. y = a[1],
  15297. z = a[2],
  15298. w = a[3];
  15299. var r = Math.sqrt(x * x + y * y + z * z);
  15300. var et = Math.exp(w);
  15301. var s = r > 0 ? et * Math.sin(r) / r : 0;
  15302. out[0] = x * s;
  15303. out[1] = y * s;
  15304. out[2] = z * s;
  15305. out[3] = et * Math.cos(r);
  15306. return out;
  15307. }
  15308. /**
  15309. * Calculate the natural logarithm of a unit quaternion.
  15310. *
  15311. * @param {quat} out the receiving quaternion
  15312. * @param {ReadonlyQuat} a quat to calculate the exponential of
  15313. * @returns {quat} out
  15314. */
  15315. function ln(out, a) {
  15316. var x = a[0],
  15317. y = a[1],
  15318. z = a[2],
  15319. w = a[3];
  15320. var r = Math.sqrt(x * x + y * y + z * z);
  15321. var t = r > 0 ? Math.atan2(r, w) / r : 0;
  15322. out[0] = x * t;
  15323. out[1] = y * t;
  15324. out[2] = z * t;
  15325. out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);
  15326. return out;
  15327. }
  15328. /**
  15329. * Calculate the scalar power of a unit quaternion.
  15330. *
  15331. * @param {quat} out the receiving quaternion
  15332. * @param {ReadonlyQuat} a quat to calculate the exponential of
  15333. * @param {Number} b amount to scale the quaternion by
  15334. * @returns {quat} out
  15335. */
  15336. function pow(out, a, b) {
  15337. ln(out, a);
  15338. scale(out, out, b);
  15339. exp(out, out);
  15340. return out;
  15341. }
  15342. /**
  15343. * Performs a spherical linear interpolation between two quat
  15344. *
  15345. * @param {quat} out the receiving quaternion
  15346. * @param {ReadonlyQuat} a the first operand
  15347. * @param {ReadonlyQuat} b the second operand
  15348. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  15349. * @returns {quat} out
  15350. */
  15351. function slerp(out, a, b, t) {
  15352. // benchmarks:
  15353. // http://jsperf.com/quaternion-slerp-implementations
  15354. var ax = a[0],
  15355. ay = a[1],
  15356. az = a[2],
  15357. aw = a[3];
  15358. var bx = b[0],
  15359. by = b[1],
  15360. bz = b[2],
  15361. bw = b[3];
  15362. var omega, cosom, sinom, scale0, scale1; // calc cosine
  15363. cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)
  15364. if (cosom < 0.0) {
  15365. cosom = -cosom;
  15366. bx = -bx;
  15367. by = -by;
  15368. bz = -bz;
  15369. bw = -bw;
  15370. } // calculate coefficients
  15371. if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
  15372. // standard case (slerp)
  15373. omega = Math.acos(cosom);
  15374. sinom = Math.sin(omega);
  15375. scale0 = Math.sin((1.0 - t) * omega) / sinom;
  15376. scale1 = Math.sin(t * omega) / sinom;
  15377. } else {
  15378. // "from" and "to" quaternions are very close
  15379. // ... so we can do a linear interpolation
  15380. scale0 = 1.0 - t;
  15381. scale1 = t;
  15382. } // calculate final values
  15383. out[0] = scale0 * ax + scale1 * bx;
  15384. out[1] = scale0 * ay + scale1 * by;
  15385. out[2] = scale0 * az + scale1 * bz;
  15386. out[3] = scale0 * aw + scale1 * bw;
  15387. return out;
  15388. }
  15389. /**
  15390. * Generates a random unit quaternion
  15391. *
  15392. * @param {quat} out the receiving quaternion
  15393. * @returns {quat} out
  15394. */
  15395. function random(out) {
  15396. // Implementation of http://planning.cs.uiuc.edu/node198.html
  15397. // TODO: Calling random 3 times is probably not the fastest solution
  15398. var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
  15399. var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
  15400. var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]();
  15401. var sqrt1MinusU1 = Math.sqrt(1 - u1);
  15402. var sqrtU1 = Math.sqrt(u1);
  15403. out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);
  15404. out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);
  15405. out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);
  15406. out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);
  15407. return out;
  15408. }
  15409. /**
  15410. * Calculates the inverse of a quat
  15411. *
  15412. * @param {quat} out the receiving quaternion
  15413. * @param {ReadonlyQuat} a quat to calculate inverse of
  15414. * @returns {quat} out
  15415. */
  15416. function invert(out, a) {
  15417. var a0 = a[0],
  15418. a1 = a[1],
  15419. a2 = a[2],
  15420. a3 = a[3];
  15421. var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;
  15422. var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0
  15423. out[0] = -a0 * invDot;
  15424. out[1] = -a1 * invDot;
  15425. out[2] = -a2 * invDot;
  15426. out[3] = a3 * invDot;
  15427. return out;
  15428. }
  15429. /**
  15430. * Calculates the conjugate of a quat
  15431. * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
  15432. *
  15433. * @param {quat} out the receiving quaternion
  15434. * @param {ReadonlyQuat} a quat to calculate conjugate of
  15435. * @returns {quat} out
  15436. */
  15437. function conjugate(out, a) {
  15438. out[0] = -a[0];
  15439. out[1] = -a[1];
  15440. out[2] = -a[2];
  15441. out[3] = a[3];
  15442. return out;
  15443. }
  15444. /**
  15445. * Creates a quaternion from the given 3x3 rotation matrix.
  15446. *
  15447. * NOTE: The resultant quaternion is not normalized, so you should be sure
  15448. * to renormalize the quaternion yourself where necessary.
  15449. *
  15450. * @param {quat} out the receiving quaternion
  15451. * @param {ReadonlyMat3} m rotation matrix
  15452. * @returns {quat} out
  15453. * @function
  15454. */
  15455. function fromMat3(out, m) {
  15456. // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
  15457. // article "Quaternion Calculus and Fast Animation".
  15458. var fTrace = m[0] + m[4] + m[8];
  15459. var fRoot;
  15460. if (fTrace > 0.0) {
  15461. // |w| > 1/2, may as well choose w > 1/2
  15462. fRoot = Math.sqrt(fTrace + 1.0); // 2w
  15463. out[3] = 0.5 * fRoot;
  15464. fRoot = 0.5 / fRoot; // 1/(4w)
  15465. out[0] = (m[5] - m[7]) * fRoot;
  15466. out[1] = (m[6] - m[2]) * fRoot;
  15467. out[2] = (m[1] - m[3]) * fRoot;
  15468. } else {
  15469. // |w| <= 1/2
  15470. var i = 0;
  15471. if (m[4] > m[0]) i = 1;
  15472. if (m[8] > m[i * 3 + i]) i = 2;
  15473. var j = (i + 1) % 3;
  15474. var k = (i + 2) % 3;
  15475. fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);
  15476. out[i] = 0.5 * fRoot;
  15477. fRoot = 0.5 / fRoot;
  15478. out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;
  15479. out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;
  15480. out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;
  15481. }
  15482. return out;
  15483. }
  15484. /**
  15485. * Creates a quaternion from the given euler angle x, y, z.
  15486. *
  15487. * @param {quat} out the receiving quaternion
  15488. * @param {x} Angle to rotate around X axis in degrees.
  15489. * @param {y} Angle to rotate around Y axis in degrees.
  15490. * @param {z} Angle to rotate around Z axis in degrees.
  15491. * @returns {quat} out
  15492. * @function
  15493. */
  15494. function fromEuler(out, x, y, z) {
  15495. var halfToRad = 0.5 * Math.PI / 180.0;
  15496. x *= halfToRad;
  15497. y *= halfToRad;
  15498. z *= halfToRad;
  15499. var sx = Math.sin(x);
  15500. var cx = Math.cos(x);
  15501. var sy = Math.sin(y);
  15502. var cy = Math.cos(y);
  15503. var sz = Math.sin(z);
  15504. var cz = Math.cos(z);
  15505. out[0] = sx * cy * cz - cx * sy * sz;
  15506. out[1] = cx * sy * cz + sx * cy * sz;
  15507. out[2] = cx * cy * sz - sx * sy * cz;
  15508. out[3] = cx * cy * cz + sx * sy * sz;
  15509. return out;
  15510. }
  15511. /**
  15512. * Returns a string representation of a quatenion
  15513. *
  15514. * @param {ReadonlyQuat} a vector to represent as a string
  15515. * @returns {String} string representation of the vector
  15516. */
  15517. function str(a) {
  15518. return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")";
  15519. }
  15520. /**
  15521. * Creates a new quat initialized with values from an existing quaternion
  15522. *
  15523. * @param {ReadonlyQuat} a quaternion to clone
  15524. * @returns {quat} a new quaternion
  15525. * @function
  15526. */
  15527. var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["clone"];
  15528. /**
  15529. * Creates a new quat initialized with the given values
  15530. *
  15531. * @param {Number} x X component
  15532. * @param {Number} y Y component
  15533. * @param {Number} z Z component
  15534. * @param {Number} w W component
  15535. * @returns {quat} a new quaternion
  15536. * @function
  15537. */
  15538. var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["fromValues"];
  15539. /**
  15540. * Copy the values from one quat to another
  15541. *
  15542. * @param {quat} out the receiving quaternion
  15543. * @param {ReadonlyQuat} a the source quaternion
  15544. * @returns {quat} out
  15545. * @function
  15546. */
  15547. var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["copy"];
  15548. /**
  15549. * Set the components of a quat to the given values
  15550. *
  15551. * @param {quat} out the receiving quaternion
  15552. * @param {Number} x X component
  15553. * @param {Number} y Y component
  15554. * @param {Number} z Z component
  15555. * @param {Number} w W component
  15556. * @returns {quat} out
  15557. * @function
  15558. */
  15559. var set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["set"];
  15560. /**
  15561. * Adds two quat's
  15562. *
  15563. * @param {quat} out the receiving quaternion
  15564. * @param {ReadonlyQuat} a the first operand
  15565. * @param {ReadonlyQuat} b the second operand
  15566. * @returns {quat} out
  15567. * @function
  15568. */
  15569. var add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["add"];
  15570. /**
  15571. * Alias for {@link quat.multiply}
  15572. * @function
  15573. */
  15574. var mul = multiply;
  15575. /**
  15576. * Scales a quat by a scalar number
  15577. *
  15578. * @param {quat} out the receiving vector
  15579. * @param {ReadonlyQuat} a the vector to scale
  15580. * @param {Number} b amount to scale the vector by
  15581. * @returns {quat} out
  15582. * @function
  15583. */
  15584. var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["scale"];
  15585. /**
  15586. * Calculates the dot product of two quat's
  15587. *
  15588. * @param {ReadonlyQuat} a the first operand
  15589. * @param {ReadonlyQuat} b the second operand
  15590. * @returns {Number} dot product of a and b
  15591. * @function
  15592. */
  15593. var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["dot"];
  15594. /**
  15595. * Performs a linear interpolation between two quat's
  15596. *
  15597. * @param {quat} out the receiving quaternion
  15598. * @param {ReadonlyQuat} a the first operand
  15599. * @param {ReadonlyQuat} b the second operand
  15600. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  15601. * @returns {quat} out
  15602. * @function
  15603. */
  15604. var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["lerp"];
  15605. /**
  15606. * Calculates the length of a quat
  15607. *
  15608. * @param {ReadonlyQuat} a vector to calculate length of
  15609. * @returns {Number} length of a
  15610. */
  15611. var length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["length"];
  15612. /**
  15613. * Alias for {@link quat.length}
  15614. * @function
  15615. */
  15616. var len = length;
  15617. /**
  15618. * Calculates the squared length of a quat
  15619. *
  15620. * @param {ReadonlyQuat} a vector to calculate squared length of
  15621. * @returns {Number} squared length of a
  15622. * @function
  15623. */
  15624. var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["squaredLength"];
  15625. /**
  15626. * Alias for {@link quat.squaredLength}
  15627. * @function
  15628. */
  15629. var sqrLen = squaredLength;
  15630. /**
  15631. * Normalize a quat
  15632. *
  15633. * @param {quat} out the receiving quaternion
  15634. * @param {ReadonlyQuat} a quaternion to normalize
  15635. * @returns {quat} out
  15636. * @function
  15637. */
  15638. var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["normalize"];
  15639. /**
  15640. * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
  15641. *
  15642. * @param {ReadonlyQuat} a The first quaternion.
  15643. * @param {ReadonlyQuat} b The second quaternion.
  15644. * @returns {Boolean} True if the vectors are equal, false otherwise.
  15645. */
  15646. var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["exactEquals"];
  15647. /**
  15648. * Returns whether or not the quaternions have approximately the same elements in the same position.
  15649. *
  15650. * @param {ReadonlyQuat} a The first vector.
  15651. * @param {ReadonlyQuat} b The second vector.
  15652. * @returns {Boolean} True if the vectors are equal, false otherwise.
  15653. */
  15654. var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__["equals"];
  15655. /**
  15656. * Sets a quaternion to represent the shortest rotation from one
  15657. * vector to another.
  15658. *
  15659. * Both vectors are assumed to be unit length.
  15660. *
  15661. * @param {quat} out the receiving quaternion.
  15662. * @param {ReadonlyVec3} a the initial vector
  15663. * @param {ReadonlyVec3} b the destination vector
  15664. * @returns {quat} out
  15665. */
  15666. var rotationTo = function () {
  15667. var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["create"]();
  15668. var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["fromValues"](1, 0, 0);
  15669. var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["fromValues"](0, 1, 0);
  15670. return function (out, a, b) {
  15671. var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__["dot"](a, b);
  15672. if (dot < -0.999999) {
  15673. _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, xUnitVec3, a);
  15674. if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__["len"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, yUnitVec3, a);
  15675. _vec3_js__WEBPACK_IMPORTED_MODULE_2__["normalize"](tmpvec3, tmpvec3);
  15676. setAxisAngle(out, tmpvec3, Math.PI);
  15677. return out;
  15678. } else if (dot > 0.999999) {
  15679. out[0] = 0;
  15680. out[1] = 0;
  15681. out[2] = 0;
  15682. out[3] = 1;
  15683. return out;
  15684. } else {
  15685. _vec3_js__WEBPACK_IMPORTED_MODULE_2__["cross"](tmpvec3, a, b);
  15686. out[0] = tmpvec3[0];
  15687. out[1] = tmpvec3[1];
  15688. out[2] = tmpvec3[2];
  15689. out[3] = 1 + dot;
  15690. return normalize(out, out);
  15691. }
  15692. };
  15693. }();
  15694. /**
  15695. * Performs a spherical linear interpolation with two control points
  15696. *
  15697. * @param {quat} out the receiving quaternion
  15698. * @param {ReadonlyQuat} a the first operand
  15699. * @param {ReadonlyQuat} b the second operand
  15700. * @param {ReadonlyQuat} c the third operand
  15701. * @param {ReadonlyQuat} d the fourth operand
  15702. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  15703. * @returns {quat} out
  15704. */
  15705. var sqlerp = function () {
  15706. var temp1 = create();
  15707. var temp2 = create();
  15708. return function (out, a, b, c, d, t) {
  15709. slerp(temp1, a, d, t);
  15710. slerp(temp2, b, c, t);
  15711. slerp(out, temp1, temp2, 2 * t * (1 - t));
  15712. return out;
  15713. };
  15714. }();
  15715. /**
  15716. * Sets the specified quaternion with values corresponding to the given
  15717. * axes. Each axis is a vec3 and is expected to be unit length and
  15718. * perpendicular to all other specified axes.
  15719. *
  15720. * @param {ReadonlyVec3} view the vector representing the viewing direction
  15721. * @param {ReadonlyVec3} right the vector representing the local "right" direction
  15722. * @param {ReadonlyVec3} up the vector representing the local "up" direction
  15723. * @returns {quat} out
  15724. */
  15725. var setAxes = function () {
  15726. var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__["create"]();
  15727. return function (out, view, right, up) {
  15728. matr[0] = right[0];
  15729. matr[3] = right[1];
  15730. matr[6] = right[2];
  15731. matr[1] = up[0];
  15732. matr[4] = up[1];
  15733. matr[7] = up[2];
  15734. matr[2] = -view[0];
  15735. matr[5] = -view[1];
  15736. matr[8] = -view[2];
  15737. return normalize(out, fromMat3(out, matr));
  15738. };
  15739. }();
  15740. /***/ }),
  15741. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat2.js":
  15742. /*!**************************************************************!*\
  15743. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat2.js ***!
  15744. \**************************************************************/
  15745. /*! exports provided: create, clone, fromValues, fromRotationTranslationValues, fromRotationTranslation, fromTranslation, fromRotation, fromMat4, copy, identity, set, getReal, getDual, setReal, setDual, getTranslation, translate, rotateX, rotateY, rotateZ, rotateByQuatAppend, rotateByQuatPrepend, rotateAroundAxis, add, multiply, mul, scale, dot, lerp, invert, conjugate, length, len, squaredLength, sqrLen, normalize, str, exactEquals, equals */
  15746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15747. "use strict";
  15748. __webpack_require__.r(__webpack_exports__);
  15749. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  15750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  15751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  15752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslationValues", function() { return fromRotationTranslationValues; });
  15753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotationTranslation", function() { return fromRotationTranslation; });
  15754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromTranslation", function() { return fromTranslation; });
  15755. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromRotation", function() { return fromRotation; });
  15756. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromMat4", function() { return fromMat4; });
  15757. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  15758. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
  15759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  15760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReal", function() { return getReal; });
  15761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDual", function() { return getDual; });
  15762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setReal", function() { return setReal; });
  15763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDual", function() { return setDual; });
  15764. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTranslation", function() { return getTranslation; });
  15765. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "translate", function() { return translate; });
  15766. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  15767. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  15768. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  15769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateByQuatAppend", function() { return rotateByQuatAppend; });
  15770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateByQuatPrepend", function() { return rotateByQuatPrepend; });
  15771. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateAroundAxis", function() { return rotateAroundAxis; });
  15772. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  15773. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  15774. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  15775. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  15776. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  15777. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  15778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return invert; });
  15779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conjugate", function() { return conjugate; });
  15780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  15781. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  15782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  15783. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  15784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  15785. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  15786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  15787. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  15788. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  15789. /* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quat.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/quat.js");
  15790. /* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat4.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/mat4.js");
  15791. /**
  15792. * Dual Quaternion<br>
  15793. * Format: [real, dual]<br>
  15794. * Quaternion format: XYZW<br>
  15795. * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.<br>
  15796. * @module quat2
  15797. */
  15798. /**
  15799. * Creates a new identity dual quat
  15800. *
  15801. * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]
  15802. */
  15803. function create() {
  15804. var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
  15805. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  15806. dq[0] = 0;
  15807. dq[1] = 0;
  15808. dq[2] = 0;
  15809. dq[4] = 0;
  15810. dq[5] = 0;
  15811. dq[6] = 0;
  15812. dq[7] = 0;
  15813. }
  15814. dq[3] = 1;
  15815. return dq;
  15816. }
  15817. /**
  15818. * Creates a new quat initialized with values from an existing quaternion
  15819. *
  15820. * @param {ReadonlyQuat2} a dual quaternion to clone
  15821. * @returns {quat2} new dual quaternion
  15822. * @function
  15823. */
  15824. function clone(a) {
  15825. var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
  15826. dq[0] = a[0];
  15827. dq[1] = a[1];
  15828. dq[2] = a[2];
  15829. dq[3] = a[3];
  15830. dq[4] = a[4];
  15831. dq[5] = a[5];
  15832. dq[6] = a[6];
  15833. dq[7] = a[7];
  15834. return dq;
  15835. }
  15836. /**
  15837. * Creates a new dual quat initialized with the given values
  15838. *
  15839. * @param {Number} x1 X component
  15840. * @param {Number} y1 Y component
  15841. * @param {Number} z1 Z component
  15842. * @param {Number} w1 W component
  15843. * @param {Number} x2 X component
  15844. * @param {Number} y2 Y component
  15845. * @param {Number} z2 Z component
  15846. * @param {Number} w2 W component
  15847. * @returns {quat2} new dual quaternion
  15848. * @function
  15849. */
  15850. function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {
  15851. var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
  15852. dq[0] = x1;
  15853. dq[1] = y1;
  15854. dq[2] = z1;
  15855. dq[3] = w1;
  15856. dq[4] = x2;
  15857. dq[5] = y2;
  15858. dq[6] = z2;
  15859. dq[7] = w2;
  15860. return dq;
  15861. }
  15862. /**
  15863. * Creates a new dual quat from the given values (quat and translation)
  15864. *
  15865. * @param {Number} x1 X component
  15866. * @param {Number} y1 Y component
  15867. * @param {Number} z1 Z component
  15868. * @param {Number} w1 W component
  15869. * @param {Number} x2 X component (translation)
  15870. * @param {Number} y2 Y component (translation)
  15871. * @param {Number} z2 Z component (translation)
  15872. * @returns {quat2} new dual quaternion
  15873. * @function
  15874. */
  15875. function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {
  15876. var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](8);
  15877. dq[0] = x1;
  15878. dq[1] = y1;
  15879. dq[2] = z1;
  15880. dq[3] = w1;
  15881. var ax = x2 * 0.5,
  15882. ay = y2 * 0.5,
  15883. az = z2 * 0.5;
  15884. dq[4] = ax * w1 + ay * z1 - az * y1;
  15885. dq[5] = ay * w1 + az * x1 - ax * z1;
  15886. dq[6] = az * w1 + ax * y1 - ay * x1;
  15887. dq[7] = -ax * x1 - ay * y1 - az * z1;
  15888. return dq;
  15889. }
  15890. /**
  15891. * Creates a dual quat from a quaternion and a translation
  15892. *
  15893. * @param {ReadonlyQuat2} dual quaternion receiving operation result
  15894. * @param {ReadonlyQuat} q a normalized quaternion
  15895. * @param {ReadonlyVec3} t tranlation vector
  15896. * @returns {quat2} dual quaternion receiving operation result
  15897. * @function
  15898. */
  15899. function fromRotationTranslation(out, q, t) {
  15900. var ax = t[0] * 0.5,
  15901. ay = t[1] * 0.5,
  15902. az = t[2] * 0.5,
  15903. bx = q[0],
  15904. by = q[1],
  15905. bz = q[2],
  15906. bw = q[3];
  15907. out[0] = bx;
  15908. out[1] = by;
  15909. out[2] = bz;
  15910. out[3] = bw;
  15911. out[4] = ax * bw + ay * bz - az * by;
  15912. out[5] = ay * bw + az * bx - ax * bz;
  15913. out[6] = az * bw + ax * by - ay * bx;
  15914. out[7] = -ax * bx - ay * by - az * bz;
  15915. return out;
  15916. }
  15917. /**
  15918. * Creates a dual quat from a translation
  15919. *
  15920. * @param {ReadonlyQuat2} dual quaternion receiving operation result
  15921. * @param {ReadonlyVec3} t translation vector
  15922. * @returns {quat2} dual quaternion receiving operation result
  15923. * @function
  15924. */
  15925. function fromTranslation(out, t) {
  15926. out[0] = 0;
  15927. out[1] = 0;
  15928. out[2] = 0;
  15929. out[3] = 1;
  15930. out[4] = t[0] * 0.5;
  15931. out[5] = t[1] * 0.5;
  15932. out[6] = t[2] * 0.5;
  15933. out[7] = 0;
  15934. return out;
  15935. }
  15936. /**
  15937. * Creates a dual quat from a quaternion
  15938. *
  15939. * @param {ReadonlyQuat2} dual quaternion receiving operation result
  15940. * @param {ReadonlyQuat} q the quaternion
  15941. * @returns {quat2} dual quaternion receiving operation result
  15942. * @function
  15943. */
  15944. function fromRotation(out, q) {
  15945. out[0] = q[0];
  15946. out[1] = q[1];
  15947. out[2] = q[2];
  15948. out[3] = q[3];
  15949. out[4] = 0;
  15950. out[5] = 0;
  15951. out[6] = 0;
  15952. out[7] = 0;
  15953. return out;
  15954. }
  15955. /**
  15956. * Creates a new dual quat from a matrix (4x4)
  15957. *
  15958. * @param {quat2} out the dual quaternion
  15959. * @param {ReadonlyMat4} a the matrix
  15960. * @returns {quat2} dual quat receiving operation result
  15961. * @function
  15962. */
  15963. function fromMat4(out, a) {
  15964. //TODO Optimize this
  15965. var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__["create"]();
  15966. _mat4_js__WEBPACK_IMPORTED_MODULE_2__["getRotation"](outer, a);
  15967. var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  15968. _mat4_js__WEBPACK_IMPORTED_MODULE_2__["getTranslation"](t, a);
  15969. fromRotationTranslation(out, outer, t);
  15970. return out;
  15971. }
  15972. /**
  15973. * Copy the values from one dual quat to another
  15974. *
  15975. * @param {quat2} out the receiving dual quaternion
  15976. * @param {ReadonlyQuat2} a the source dual quaternion
  15977. * @returns {quat2} out
  15978. * @function
  15979. */
  15980. function copy(out, a) {
  15981. out[0] = a[0];
  15982. out[1] = a[1];
  15983. out[2] = a[2];
  15984. out[3] = a[3];
  15985. out[4] = a[4];
  15986. out[5] = a[5];
  15987. out[6] = a[6];
  15988. out[7] = a[7];
  15989. return out;
  15990. }
  15991. /**
  15992. * Set a dual quat to the identity dual quaternion
  15993. *
  15994. * @param {quat2} out the receiving quaternion
  15995. * @returns {quat2} out
  15996. */
  15997. function identity(out) {
  15998. out[0] = 0;
  15999. out[1] = 0;
  16000. out[2] = 0;
  16001. out[3] = 1;
  16002. out[4] = 0;
  16003. out[5] = 0;
  16004. out[6] = 0;
  16005. out[7] = 0;
  16006. return out;
  16007. }
  16008. /**
  16009. * Set the components of a dual quat to the given values
  16010. *
  16011. * @param {quat2} out the receiving quaternion
  16012. * @param {Number} x1 X component
  16013. * @param {Number} y1 Y component
  16014. * @param {Number} z1 Z component
  16015. * @param {Number} w1 W component
  16016. * @param {Number} x2 X component
  16017. * @param {Number} y2 Y component
  16018. * @param {Number} z2 Z component
  16019. * @param {Number} w2 W component
  16020. * @returns {quat2} out
  16021. * @function
  16022. */
  16023. function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {
  16024. out[0] = x1;
  16025. out[1] = y1;
  16026. out[2] = z1;
  16027. out[3] = w1;
  16028. out[4] = x2;
  16029. out[5] = y2;
  16030. out[6] = z2;
  16031. out[7] = w2;
  16032. return out;
  16033. }
  16034. /**
  16035. * Gets the real part of a dual quat
  16036. * @param {quat} out real part
  16037. * @param {ReadonlyQuat2} a Dual Quaternion
  16038. * @return {quat} real part
  16039. */
  16040. var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__["copy"];
  16041. /**
  16042. * Gets the dual part of a dual quat
  16043. * @param {quat} out dual part
  16044. * @param {ReadonlyQuat2} a Dual Quaternion
  16045. * @return {quat} dual part
  16046. */
  16047. function getDual(out, a) {
  16048. out[0] = a[4];
  16049. out[1] = a[5];
  16050. out[2] = a[6];
  16051. out[3] = a[7];
  16052. return out;
  16053. }
  16054. /**
  16055. * Set the real component of a dual quat to the given quaternion
  16056. *
  16057. * @param {quat2} out the receiving quaternion
  16058. * @param {ReadonlyQuat} q a quaternion representing the real part
  16059. * @returns {quat2} out
  16060. * @function
  16061. */
  16062. var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__["copy"];
  16063. /**
  16064. * Set the dual component of a dual quat to the given quaternion
  16065. *
  16066. * @param {quat2} out the receiving quaternion
  16067. * @param {ReadonlyQuat} q a quaternion representing the dual part
  16068. * @returns {quat2} out
  16069. * @function
  16070. */
  16071. function setDual(out, q) {
  16072. out[4] = q[0];
  16073. out[5] = q[1];
  16074. out[6] = q[2];
  16075. out[7] = q[3];
  16076. return out;
  16077. }
  16078. /**
  16079. * Gets the translation of a normalized dual quat
  16080. * @param {vec3} out translation
  16081. * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed
  16082. * @return {vec3} translation
  16083. */
  16084. function getTranslation(out, a) {
  16085. var ax = a[4],
  16086. ay = a[5],
  16087. az = a[6],
  16088. aw = a[7],
  16089. bx = -a[0],
  16090. by = -a[1],
  16091. bz = -a[2],
  16092. bw = a[3];
  16093. out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;
  16094. out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;
  16095. out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;
  16096. return out;
  16097. }
  16098. /**
  16099. * Translates a dual quat by the given vector
  16100. *
  16101. * @param {quat2} out the receiving dual quaternion
  16102. * @param {ReadonlyQuat2} a the dual quaternion to translate
  16103. * @param {ReadonlyVec3} v vector to translate by
  16104. * @returns {quat2} out
  16105. */
  16106. function translate(out, a, v) {
  16107. var ax1 = a[0],
  16108. ay1 = a[1],
  16109. az1 = a[2],
  16110. aw1 = a[3],
  16111. bx1 = v[0] * 0.5,
  16112. by1 = v[1] * 0.5,
  16113. bz1 = v[2] * 0.5,
  16114. ax2 = a[4],
  16115. ay2 = a[5],
  16116. az2 = a[6],
  16117. aw2 = a[7];
  16118. out[0] = ax1;
  16119. out[1] = ay1;
  16120. out[2] = az1;
  16121. out[3] = aw1;
  16122. out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;
  16123. out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;
  16124. out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;
  16125. out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;
  16126. return out;
  16127. }
  16128. /**
  16129. * Rotates a dual quat around the X axis
  16130. *
  16131. * @param {quat2} out the receiving dual quaternion
  16132. * @param {ReadonlyQuat2} a the dual quaternion to rotate
  16133. * @param {number} rad how far should the rotation be
  16134. * @returns {quat2} out
  16135. */
  16136. function rotateX(out, a, rad) {
  16137. var bx = -a[0],
  16138. by = -a[1],
  16139. bz = -a[2],
  16140. bw = a[3],
  16141. ax = a[4],
  16142. ay = a[5],
  16143. az = a[6],
  16144. aw = a[7],
  16145. ax1 = ax * bw + aw * bx + ay * bz - az * by,
  16146. ay1 = ay * bw + aw * by + az * bx - ax * bz,
  16147. az1 = az * bw + aw * bz + ax * by - ay * bx,
  16148. aw1 = aw * bw - ax * bx - ay * by - az * bz;
  16149. _quat_js__WEBPACK_IMPORTED_MODULE_1__["rotateX"](out, a, rad);
  16150. bx = out[0];
  16151. by = out[1];
  16152. bz = out[2];
  16153. bw = out[3];
  16154. out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
  16155. out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
  16156. out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
  16157. out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
  16158. return out;
  16159. }
  16160. /**
  16161. * Rotates a dual quat around the Y axis
  16162. *
  16163. * @param {quat2} out the receiving dual quaternion
  16164. * @param {ReadonlyQuat2} a the dual quaternion to rotate
  16165. * @param {number} rad how far should the rotation be
  16166. * @returns {quat2} out
  16167. */
  16168. function rotateY(out, a, rad) {
  16169. var bx = -a[0],
  16170. by = -a[1],
  16171. bz = -a[2],
  16172. bw = a[3],
  16173. ax = a[4],
  16174. ay = a[5],
  16175. az = a[6],
  16176. aw = a[7],
  16177. ax1 = ax * bw + aw * bx + ay * bz - az * by,
  16178. ay1 = ay * bw + aw * by + az * bx - ax * bz,
  16179. az1 = az * bw + aw * bz + ax * by - ay * bx,
  16180. aw1 = aw * bw - ax * bx - ay * by - az * bz;
  16181. _quat_js__WEBPACK_IMPORTED_MODULE_1__["rotateY"](out, a, rad);
  16182. bx = out[0];
  16183. by = out[1];
  16184. bz = out[2];
  16185. bw = out[3];
  16186. out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
  16187. out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
  16188. out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
  16189. out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
  16190. return out;
  16191. }
  16192. /**
  16193. * Rotates a dual quat around the Z axis
  16194. *
  16195. * @param {quat2} out the receiving dual quaternion
  16196. * @param {ReadonlyQuat2} a the dual quaternion to rotate
  16197. * @param {number} rad how far should the rotation be
  16198. * @returns {quat2} out
  16199. */
  16200. function rotateZ(out, a, rad) {
  16201. var bx = -a[0],
  16202. by = -a[1],
  16203. bz = -a[2],
  16204. bw = a[3],
  16205. ax = a[4],
  16206. ay = a[5],
  16207. az = a[6],
  16208. aw = a[7],
  16209. ax1 = ax * bw + aw * bx + ay * bz - az * by,
  16210. ay1 = ay * bw + aw * by + az * bx - ax * bz,
  16211. az1 = az * bw + aw * bz + ax * by - ay * bx,
  16212. aw1 = aw * bw - ax * bx - ay * by - az * bz;
  16213. _quat_js__WEBPACK_IMPORTED_MODULE_1__["rotateZ"](out, a, rad);
  16214. bx = out[0];
  16215. by = out[1];
  16216. bz = out[2];
  16217. bw = out[3];
  16218. out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
  16219. out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
  16220. out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
  16221. out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
  16222. return out;
  16223. }
  16224. /**
  16225. * Rotates a dual quat by a given quaternion (a * q)
  16226. *
  16227. * @param {quat2} out the receiving dual quaternion
  16228. * @param {ReadonlyQuat2} a the dual quaternion to rotate
  16229. * @param {ReadonlyQuat} q quaternion to rotate by
  16230. * @returns {quat2} out
  16231. */
  16232. function rotateByQuatAppend(out, a, q) {
  16233. var qx = q[0],
  16234. qy = q[1],
  16235. qz = q[2],
  16236. qw = q[3],
  16237. ax = a[0],
  16238. ay = a[1],
  16239. az = a[2],
  16240. aw = a[3];
  16241. out[0] = ax * qw + aw * qx + ay * qz - az * qy;
  16242. out[1] = ay * qw + aw * qy + az * qx - ax * qz;
  16243. out[2] = az * qw + aw * qz + ax * qy - ay * qx;
  16244. out[3] = aw * qw - ax * qx - ay * qy - az * qz;
  16245. ax = a[4];
  16246. ay = a[5];
  16247. az = a[6];
  16248. aw = a[7];
  16249. out[4] = ax * qw + aw * qx + ay * qz - az * qy;
  16250. out[5] = ay * qw + aw * qy + az * qx - ax * qz;
  16251. out[6] = az * qw + aw * qz + ax * qy - ay * qx;
  16252. out[7] = aw * qw - ax * qx - ay * qy - az * qz;
  16253. return out;
  16254. }
  16255. /**
  16256. * Rotates a dual quat by a given quaternion (q * a)
  16257. *
  16258. * @param {quat2} out the receiving dual quaternion
  16259. * @param {ReadonlyQuat} q quaternion to rotate by
  16260. * @param {ReadonlyQuat2} a the dual quaternion to rotate
  16261. * @returns {quat2} out
  16262. */
  16263. function rotateByQuatPrepend(out, q, a) {
  16264. var qx = q[0],
  16265. qy = q[1],
  16266. qz = q[2],
  16267. qw = q[3],
  16268. bx = a[0],
  16269. by = a[1],
  16270. bz = a[2],
  16271. bw = a[3];
  16272. out[0] = qx * bw + qw * bx + qy * bz - qz * by;
  16273. out[1] = qy * bw + qw * by + qz * bx - qx * bz;
  16274. out[2] = qz * bw + qw * bz + qx * by - qy * bx;
  16275. out[3] = qw * bw - qx * bx - qy * by - qz * bz;
  16276. bx = a[4];
  16277. by = a[5];
  16278. bz = a[6];
  16279. bw = a[7];
  16280. out[4] = qx * bw + qw * bx + qy * bz - qz * by;
  16281. out[5] = qy * bw + qw * by + qz * bx - qx * bz;
  16282. out[6] = qz * bw + qw * bz + qx * by - qy * bx;
  16283. out[7] = qw * bw - qx * bx - qy * by - qz * bz;
  16284. return out;
  16285. }
  16286. /**
  16287. * Rotates a dual quat around a given axis. Does the normalisation automatically
  16288. *
  16289. * @param {quat2} out the receiving dual quaternion
  16290. * @param {ReadonlyQuat2} a the dual quaternion to rotate
  16291. * @param {ReadonlyVec3} axis the axis to rotate around
  16292. * @param {Number} rad how far the rotation should be
  16293. * @returns {quat2} out
  16294. */
  16295. function rotateAroundAxis(out, a, axis, rad) {
  16296. //Special case for rad = 0
  16297. if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"]) {
  16298. return copy(out, a);
  16299. }
  16300. var axisLength = Math.hypot(axis[0], axis[1], axis[2]);
  16301. rad = rad * 0.5;
  16302. var s = Math.sin(rad);
  16303. var bx = s * axis[0] / axisLength;
  16304. var by = s * axis[1] / axisLength;
  16305. var bz = s * axis[2] / axisLength;
  16306. var bw = Math.cos(rad);
  16307. var ax1 = a[0],
  16308. ay1 = a[1],
  16309. az1 = a[2],
  16310. aw1 = a[3];
  16311. out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;
  16312. out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;
  16313. out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;
  16314. out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;
  16315. var ax = a[4],
  16316. ay = a[5],
  16317. az = a[6],
  16318. aw = a[7];
  16319. out[4] = ax * bw + aw * bx + ay * bz - az * by;
  16320. out[5] = ay * bw + aw * by + az * bx - ax * bz;
  16321. out[6] = az * bw + aw * bz + ax * by - ay * bx;
  16322. out[7] = aw * bw - ax * bx - ay * by - az * bz;
  16323. return out;
  16324. }
  16325. /**
  16326. * Adds two dual quat's
  16327. *
  16328. * @param {quat2} out the receiving dual quaternion
  16329. * @param {ReadonlyQuat2} a the first operand
  16330. * @param {ReadonlyQuat2} b the second operand
  16331. * @returns {quat2} out
  16332. * @function
  16333. */
  16334. function add(out, a, b) {
  16335. out[0] = a[0] + b[0];
  16336. out[1] = a[1] + b[1];
  16337. out[2] = a[2] + b[2];
  16338. out[3] = a[3] + b[3];
  16339. out[4] = a[4] + b[4];
  16340. out[5] = a[5] + b[5];
  16341. out[6] = a[6] + b[6];
  16342. out[7] = a[7] + b[7];
  16343. return out;
  16344. }
  16345. /**
  16346. * Multiplies two dual quat's
  16347. *
  16348. * @param {quat2} out the receiving dual quaternion
  16349. * @param {ReadonlyQuat2} a the first operand
  16350. * @param {ReadonlyQuat2} b the second operand
  16351. * @returns {quat2} out
  16352. */
  16353. function multiply(out, a, b) {
  16354. var ax0 = a[0],
  16355. ay0 = a[1],
  16356. az0 = a[2],
  16357. aw0 = a[3],
  16358. bx1 = b[4],
  16359. by1 = b[5],
  16360. bz1 = b[6],
  16361. bw1 = b[7],
  16362. ax1 = a[4],
  16363. ay1 = a[5],
  16364. az1 = a[6],
  16365. aw1 = a[7],
  16366. bx0 = b[0],
  16367. by0 = b[1],
  16368. bz0 = b[2],
  16369. bw0 = b[3];
  16370. out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;
  16371. out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;
  16372. out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;
  16373. out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;
  16374. out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;
  16375. out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;
  16376. out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;
  16377. out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;
  16378. return out;
  16379. }
  16380. /**
  16381. * Alias for {@link quat2.multiply}
  16382. * @function
  16383. */
  16384. var mul = multiply;
  16385. /**
  16386. * Scales a dual quat by a scalar number
  16387. *
  16388. * @param {quat2} out the receiving dual quat
  16389. * @param {ReadonlyQuat2} a the dual quat to scale
  16390. * @param {Number} b amount to scale the dual quat by
  16391. * @returns {quat2} out
  16392. * @function
  16393. */
  16394. function scale(out, a, b) {
  16395. out[0] = a[0] * b;
  16396. out[1] = a[1] * b;
  16397. out[2] = a[2] * b;
  16398. out[3] = a[3] * b;
  16399. out[4] = a[4] * b;
  16400. out[5] = a[5] * b;
  16401. out[6] = a[6] * b;
  16402. out[7] = a[7] * b;
  16403. return out;
  16404. }
  16405. /**
  16406. * Calculates the dot product of two dual quat's (The dot product of the real parts)
  16407. *
  16408. * @param {ReadonlyQuat2} a the first operand
  16409. * @param {ReadonlyQuat2} b the second operand
  16410. * @returns {Number} dot product of a and b
  16411. * @function
  16412. */
  16413. var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__["dot"];
  16414. /**
  16415. * Performs a linear interpolation between two dual quats's
  16416. * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)
  16417. *
  16418. * @param {quat2} out the receiving dual quat
  16419. * @param {ReadonlyQuat2} a the first operand
  16420. * @param {ReadonlyQuat2} b the second operand
  16421. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  16422. * @returns {quat2} out
  16423. */
  16424. function lerp(out, a, b, t) {
  16425. var mt = 1 - t;
  16426. if (dot(a, b) < 0) t = -t;
  16427. out[0] = a[0] * mt + b[0] * t;
  16428. out[1] = a[1] * mt + b[1] * t;
  16429. out[2] = a[2] * mt + b[2] * t;
  16430. out[3] = a[3] * mt + b[3] * t;
  16431. out[4] = a[4] * mt + b[4] * t;
  16432. out[5] = a[5] * mt + b[5] * t;
  16433. out[6] = a[6] * mt + b[6] * t;
  16434. out[7] = a[7] * mt + b[7] * t;
  16435. return out;
  16436. }
  16437. /**
  16438. * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper
  16439. *
  16440. * @param {quat2} out the receiving dual quaternion
  16441. * @param {ReadonlyQuat2} a dual quat to calculate inverse of
  16442. * @returns {quat2} out
  16443. */
  16444. function invert(out, a) {
  16445. var sqlen = squaredLength(a);
  16446. out[0] = -a[0] / sqlen;
  16447. out[1] = -a[1] / sqlen;
  16448. out[2] = -a[2] / sqlen;
  16449. out[3] = a[3] / sqlen;
  16450. out[4] = -a[4] / sqlen;
  16451. out[5] = -a[5] / sqlen;
  16452. out[6] = -a[6] / sqlen;
  16453. out[7] = a[7] / sqlen;
  16454. return out;
  16455. }
  16456. /**
  16457. * Calculates the conjugate of a dual quat
  16458. * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.
  16459. *
  16460. * @param {quat2} out the receiving quaternion
  16461. * @param {ReadonlyQuat2} a quat to calculate conjugate of
  16462. * @returns {quat2} out
  16463. */
  16464. function conjugate(out, a) {
  16465. out[0] = -a[0];
  16466. out[1] = -a[1];
  16467. out[2] = -a[2];
  16468. out[3] = a[3];
  16469. out[4] = -a[4];
  16470. out[5] = -a[5];
  16471. out[6] = -a[6];
  16472. out[7] = a[7];
  16473. return out;
  16474. }
  16475. /**
  16476. * Calculates the length of a dual quat
  16477. *
  16478. * @param {ReadonlyQuat2} a dual quat to calculate length of
  16479. * @returns {Number} length of a
  16480. * @function
  16481. */
  16482. var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__["length"];
  16483. /**
  16484. * Alias for {@link quat2.length}
  16485. * @function
  16486. */
  16487. var len = length;
  16488. /**
  16489. * Calculates the squared length of a dual quat
  16490. *
  16491. * @param {ReadonlyQuat2} a dual quat to calculate squared length of
  16492. * @returns {Number} squared length of a
  16493. * @function
  16494. */
  16495. var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__["squaredLength"];
  16496. /**
  16497. * Alias for {@link quat2.squaredLength}
  16498. * @function
  16499. */
  16500. var sqrLen = squaredLength;
  16501. /**
  16502. * Normalize a dual quat
  16503. *
  16504. * @param {quat2} out the receiving dual quaternion
  16505. * @param {ReadonlyQuat2} a dual quaternion to normalize
  16506. * @returns {quat2} out
  16507. * @function
  16508. */
  16509. function normalize(out, a) {
  16510. var magnitude = squaredLength(a);
  16511. if (magnitude > 0) {
  16512. magnitude = Math.sqrt(magnitude);
  16513. var a0 = a[0] / magnitude;
  16514. var a1 = a[1] / magnitude;
  16515. var a2 = a[2] / magnitude;
  16516. var a3 = a[3] / magnitude;
  16517. var b0 = a[4];
  16518. var b1 = a[5];
  16519. var b2 = a[6];
  16520. var b3 = a[7];
  16521. var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;
  16522. out[0] = a0;
  16523. out[1] = a1;
  16524. out[2] = a2;
  16525. out[3] = a3;
  16526. out[4] = (b0 - a0 * a_dot_b) / magnitude;
  16527. out[5] = (b1 - a1 * a_dot_b) / magnitude;
  16528. out[6] = (b2 - a2 * a_dot_b) / magnitude;
  16529. out[7] = (b3 - a3 * a_dot_b) / magnitude;
  16530. }
  16531. return out;
  16532. }
  16533. /**
  16534. * Returns a string representation of a dual quatenion
  16535. *
  16536. * @param {ReadonlyQuat2} a dual quaternion to represent as a string
  16537. * @returns {String} string representation of the dual quat
  16538. */
  16539. function str(a) {
  16540. return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")";
  16541. }
  16542. /**
  16543. * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)
  16544. *
  16545. * @param {ReadonlyQuat2} a the first dual quaternion.
  16546. * @param {ReadonlyQuat2} b the second dual quaternion.
  16547. * @returns {Boolean} true if the dual quaternions are equal, false otherwise.
  16548. */
  16549. function exactEquals(a, b) {
  16550. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];
  16551. }
  16552. /**
  16553. * Returns whether or not the dual quaternions have approximately the same elements in the same position.
  16554. *
  16555. * @param {ReadonlyQuat2} a the first dual quat.
  16556. * @param {ReadonlyQuat2} b the second dual quat.
  16557. * @returns {Boolean} true if the dual quats are equal, false otherwise.
  16558. */
  16559. function equals(a, b) {
  16560. var a0 = a[0],
  16561. a1 = a[1],
  16562. a2 = a[2],
  16563. a3 = a[3],
  16564. a4 = a[4],
  16565. a5 = a[5],
  16566. a6 = a[6],
  16567. a7 = a[7];
  16568. var b0 = b[0],
  16569. b1 = b[1],
  16570. b2 = b[2],
  16571. b3 = b[3],
  16572. b4 = b[4],
  16573. b5 = b[5],
  16574. b6 = b[6],
  16575. b7 = b[7];
  16576. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a7), Math.abs(b7));
  16577. }
  16578. /***/ }),
  16579. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js":
  16580. /*!*************************************************************!*\
  16581. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec2.js ***!
  16582. \*************************************************************/
  16583. /*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */
  16584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16585. "use strict";
  16586. __webpack_require__.r(__webpack_exports__);
  16587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  16588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  16589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  16590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  16591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  16592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  16593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  16594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  16595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
  16596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
  16597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
  16598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
  16599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
  16600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
  16601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  16602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
  16603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
  16604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
  16605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  16606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  16607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
  16608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
  16609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  16610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  16611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
  16612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  16613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  16614. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat2", function() { return transformMat2; });
  16615. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat2d", function() { return transformMat2d; });
  16616. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat3", function() { return transformMat3; });
  16617. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
  16618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotate", function() { return rotate; });
  16619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angle", function() { return angle; });
  16620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
  16621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  16622. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  16623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  16624. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  16625. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  16626. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  16627. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
  16628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
  16629. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
  16630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  16631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  16632. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  16633. /**
  16634. * 2 Dimensional Vector
  16635. * @module vec2
  16636. */
  16637. /**
  16638. * Creates a new, empty vec2
  16639. *
  16640. * @returns {vec2} a new 2D vector
  16641. */
  16642. function create() {
  16643. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
  16644. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  16645. out[0] = 0;
  16646. out[1] = 0;
  16647. }
  16648. return out;
  16649. }
  16650. /**
  16651. * Creates a new vec2 initialized with values from an existing vector
  16652. *
  16653. * @param {ReadonlyVec2} a vector to clone
  16654. * @returns {vec2} a new 2D vector
  16655. */
  16656. function clone(a) {
  16657. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
  16658. out[0] = a[0];
  16659. out[1] = a[1];
  16660. return out;
  16661. }
  16662. /**
  16663. * Creates a new vec2 initialized with the given values
  16664. *
  16665. * @param {Number} x X component
  16666. * @param {Number} y Y component
  16667. * @returns {vec2} a new 2D vector
  16668. */
  16669. function fromValues(x, y) {
  16670. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](2);
  16671. out[0] = x;
  16672. out[1] = y;
  16673. return out;
  16674. }
  16675. /**
  16676. * Copy the values from one vec2 to another
  16677. *
  16678. * @param {vec2} out the receiving vector
  16679. * @param {ReadonlyVec2} a the source vector
  16680. * @returns {vec2} out
  16681. */
  16682. function copy(out, a) {
  16683. out[0] = a[0];
  16684. out[1] = a[1];
  16685. return out;
  16686. }
  16687. /**
  16688. * Set the components of a vec2 to the given values
  16689. *
  16690. * @param {vec2} out the receiving vector
  16691. * @param {Number} x X component
  16692. * @param {Number} y Y component
  16693. * @returns {vec2} out
  16694. */
  16695. function set(out, x, y) {
  16696. out[0] = x;
  16697. out[1] = y;
  16698. return out;
  16699. }
  16700. /**
  16701. * Adds two vec2's
  16702. *
  16703. * @param {vec2} out the receiving vector
  16704. * @param {ReadonlyVec2} a the first operand
  16705. * @param {ReadonlyVec2} b the second operand
  16706. * @returns {vec2} out
  16707. */
  16708. function add(out, a, b) {
  16709. out[0] = a[0] + b[0];
  16710. out[1] = a[1] + b[1];
  16711. return out;
  16712. }
  16713. /**
  16714. * Subtracts vector b from vector a
  16715. *
  16716. * @param {vec2} out the receiving vector
  16717. * @param {ReadonlyVec2} a the first operand
  16718. * @param {ReadonlyVec2} b the second operand
  16719. * @returns {vec2} out
  16720. */
  16721. function subtract(out, a, b) {
  16722. out[0] = a[0] - b[0];
  16723. out[1] = a[1] - b[1];
  16724. return out;
  16725. }
  16726. /**
  16727. * Multiplies two vec2's
  16728. *
  16729. * @param {vec2} out the receiving vector
  16730. * @param {ReadonlyVec2} a the first operand
  16731. * @param {ReadonlyVec2} b the second operand
  16732. * @returns {vec2} out
  16733. */
  16734. function multiply(out, a, b) {
  16735. out[0] = a[0] * b[0];
  16736. out[1] = a[1] * b[1];
  16737. return out;
  16738. }
  16739. /**
  16740. * Divides two vec2's
  16741. *
  16742. * @param {vec2} out the receiving vector
  16743. * @param {ReadonlyVec2} a the first operand
  16744. * @param {ReadonlyVec2} b the second operand
  16745. * @returns {vec2} out
  16746. */
  16747. function divide(out, a, b) {
  16748. out[0] = a[0] / b[0];
  16749. out[1] = a[1] / b[1];
  16750. return out;
  16751. }
  16752. /**
  16753. * Math.ceil the components of a vec2
  16754. *
  16755. * @param {vec2} out the receiving vector
  16756. * @param {ReadonlyVec2} a vector to ceil
  16757. * @returns {vec2} out
  16758. */
  16759. function ceil(out, a) {
  16760. out[0] = Math.ceil(a[0]);
  16761. out[1] = Math.ceil(a[1]);
  16762. return out;
  16763. }
  16764. /**
  16765. * Math.floor the components of a vec2
  16766. *
  16767. * @param {vec2} out the receiving vector
  16768. * @param {ReadonlyVec2} a vector to floor
  16769. * @returns {vec2} out
  16770. */
  16771. function floor(out, a) {
  16772. out[0] = Math.floor(a[0]);
  16773. out[1] = Math.floor(a[1]);
  16774. return out;
  16775. }
  16776. /**
  16777. * Returns the minimum of two vec2's
  16778. *
  16779. * @param {vec2} out the receiving vector
  16780. * @param {ReadonlyVec2} a the first operand
  16781. * @param {ReadonlyVec2} b the second operand
  16782. * @returns {vec2} out
  16783. */
  16784. function min(out, a, b) {
  16785. out[0] = Math.min(a[0], b[0]);
  16786. out[1] = Math.min(a[1], b[1]);
  16787. return out;
  16788. }
  16789. /**
  16790. * Returns the maximum of two vec2's
  16791. *
  16792. * @param {vec2} out the receiving vector
  16793. * @param {ReadonlyVec2} a the first operand
  16794. * @param {ReadonlyVec2} b the second operand
  16795. * @returns {vec2} out
  16796. */
  16797. function max(out, a, b) {
  16798. out[0] = Math.max(a[0], b[0]);
  16799. out[1] = Math.max(a[1], b[1]);
  16800. return out;
  16801. }
  16802. /**
  16803. * Math.round the components of a vec2
  16804. *
  16805. * @param {vec2} out the receiving vector
  16806. * @param {ReadonlyVec2} a vector to round
  16807. * @returns {vec2} out
  16808. */
  16809. function round(out, a) {
  16810. out[0] = Math.round(a[0]);
  16811. out[1] = Math.round(a[1]);
  16812. return out;
  16813. }
  16814. /**
  16815. * Scales a vec2 by a scalar number
  16816. *
  16817. * @param {vec2} out the receiving vector
  16818. * @param {ReadonlyVec2} a the vector to scale
  16819. * @param {Number} b amount to scale the vector by
  16820. * @returns {vec2} out
  16821. */
  16822. function scale(out, a, b) {
  16823. out[0] = a[0] * b;
  16824. out[1] = a[1] * b;
  16825. return out;
  16826. }
  16827. /**
  16828. * Adds two vec2's after scaling the second operand by a scalar value
  16829. *
  16830. * @param {vec2} out the receiving vector
  16831. * @param {ReadonlyVec2} a the first operand
  16832. * @param {ReadonlyVec2} b the second operand
  16833. * @param {Number} scale the amount to scale b by before adding
  16834. * @returns {vec2} out
  16835. */
  16836. function scaleAndAdd(out, a, b, scale) {
  16837. out[0] = a[0] + b[0] * scale;
  16838. out[1] = a[1] + b[1] * scale;
  16839. return out;
  16840. }
  16841. /**
  16842. * Calculates the euclidian distance between two vec2's
  16843. *
  16844. * @param {ReadonlyVec2} a the first operand
  16845. * @param {ReadonlyVec2} b the second operand
  16846. * @returns {Number} distance between a and b
  16847. */
  16848. function distance(a, b) {
  16849. var x = b[0] - a[0],
  16850. y = b[1] - a[1];
  16851. return Math.hypot(x, y);
  16852. }
  16853. /**
  16854. * Calculates the squared euclidian distance between two vec2's
  16855. *
  16856. * @param {ReadonlyVec2} a the first operand
  16857. * @param {ReadonlyVec2} b the second operand
  16858. * @returns {Number} squared distance between a and b
  16859. */
  16860. function squaredDistance(a, b) {
  16861. var x = b[0] - a[0],
  16862. y = b[1] - a[1];
  16863. return x * x + y * y;
  16864. }
  16865. /**
  16866. * Calculates the length of a vec2
  16867. *
  16868. * @param {ReadonlyVec2} a vector to calculate length of
  16869. * @returns {Number} length of a
  16870. */
  16871. function length(a) {
  16872. var x = a[0],
  16873. y = a[1];
  16874. return Math.hypot(x, y);
  16875. }
  16876. /**
  16877. * Calculates the squared length of a vec2
  16878. *
  16879. * @param {ReadonlyVec2} a vector to calculate squared length of
  16880. * @returns {Number} squared length of a
  16881. */
  16882. function squaredLength(a) {
  16883. var x = a[0],
  16884. y = a[1];
  16885. return x * x + y * y;
  16886. }
  16887. /**
  16888. * Negates the components of a vec2
  16889. *
  16890. * @param {vec2} out the receiving vector
  16891. * @param {ReadonlyVec2} a vector to negate
  16892. * @returns {vec2} out
  16893. */
  16894. function negate(out, a) {
  16895. out[0] = -a[0];
  16896. out[1] = -a[1];
  16897. return out;
  16898. }
  16899. /**
  16900. * Returns the inverse of the components of a vec2
  16901. *
  16902. * @param {vec2} out the receiving vector
  16903. * @param {ReadonlyVec2} a vector to invert
  16904. * @returns {vec2} out
  16905. */
  16906. function inverse(out, a) {
  16907. out[0] = 1.0 / a[0];
  16908. out[1] = 1.0 / a[1];
  16909. return out;
  16910. }
  16911. /**
  16912. * Normalize a vec2
  16913. *
  16914. * @param {vec2} out the receiving vector
  16915. * @param {ReadonlyVec2} a vector to normalize
  16916. * @returns {vec2} out
  16917. */
  16918. function normalize(out, a) {
  16919. var x = a[0],
  16920. y = a[1];
  16921. var len = x * x + y * y;
  16922. if (len > 0) {
  16923. //TODO: evaluate use of glm_invsqrt here?
  16924. len = 1 / Math.sqrt(len);
  16925. }
  16926. out[0] = a[0] * len;
  16927. out[1] = a[1] * len;
  16928. return out;
  16929. }
  16930. /**
  16931. * Calculates the dot product of two vec2's
  16932. *
  16933. * @param {ReadonlyVec2} a the first operand
  16934. * @param {ReadonlyVec2} b the second operand
  16935. * @returns {Number} dot product of a and b
  16936. */
  16937. function dot(a, b) {
  16938. return a[0] * b[0] + a[1] * b[1];
  16939. }
  16940. /**
  16941. * Computes the cross product of two vec2's
  16942. * Note that the cross product must by definition produce a 3D vector
  16943. *
  16944. * @param {vec3} out the receiving vector
  16945. * @param {ReadonlyVec2} a the first operand
  16946. * @param {ReadonlyVec2} b the second operand
  16947. * @returns {vec3} out
  16948. */
  16949. function cross(out, a, b) {
  16950. var z = a[0] * b[1] - a[1] * b[0];
  16951. out[0] = out[1] = 0;
  16952. out[2] = z;
  16953. return out;
  16954. }
  16955. /**
  16956. * Performs a linear interpolation between two vec2's
  16957. *
  16958. * @param {vec2} out the receiving vector
  16959. * @param {ReadonlyVec2} a the first operand
  16960. * @param {ReadonlyVec2} b the second operand
  16961. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  16962. * @returns {vec2} out
  16963. */
  16964. function lerp(out, a, b, t) {
  16965. var ax = a[0],
  16966. ay = a[1];
  16967. out[0] = ax + t * (b[0] - ax);
  16968. out[1] = ay + t * (b[1] - ay);
  16969. return out;
  16970. }
  16971. /**
  16972. * Generates a random vector with the given scale
  16973. *
  16974. * @param {vec2} out the receiving vector
  16975. * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
  16976. * @returns {vec2} out
  16977. */
  16978. function random(out, scale) {
  16979. scale = scale || 1.0;
  16980. var r = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 * Math.PI;
  16981. out[0] = Math.cos(r) * scale;
  16982. out[1] = Math.sin(r) * scale;
  16983. return out;
  16984. }
  16985. /**
  16986. * Transforms the vec2 with a mat2
  16987. *
  16988. * @param {vec2} out the receiving vector
  16989. * @param {ReadonlyVec2} a the vector to transform
  16990. * @param {ReadonlyMat2} m matrix to transform with
  16991. * @returns {vec2} out
  16992. */
  16993. function transformMat2(out, a, m) {
  16994. var x = a[0],
  16995. y = a[1];
  16996. out[0] = m[0] * x + m[2] * y;
  16997. out[1] = m[1] * x + m[3] * y;
  16998. return out;
  16999. }
  17000. /**
  17001. * Transforms the vec2 with a mat2d
  17002. *
  17003. * @param {vec2} out the receiving vector
  17004. * @param {ReadonlyVec2} a the vector to transform
  17005. * @param {ReadonlyMat2d} m matrix to transform with
  17006. * @returns {vec2} out
  17007. */
  17008. function transformMat2d(out, a, m) {
  17009. var x = a[0],
  17010. y = a[1];
  17011. out[0] = m[0] * x + m[2] * y + m[4];
  17012. out[1] = m[1] * x + m[3] * y + m[5];
  17013. return out;
  17014. }
  17015. /**
  17016. * Transforms the vec2 with a mat3
  17017. * 3rd vector component is implicitly '1'
  17018. *
  17019. * @param {vec2} out the receiving vector
  17020. * @param {ReadonlyVec2} a the vector to transform
  17021. * @param {ReadonlyMat3} m matrix to transform with
  17022. * @returns {vec2} out
  17023. */
  17024. function transformMat3(out, a, m) {
  17025. var x = a[0],
  17026. y = a[1];
  17027. out[0] = m[0] * x + m[3] * y + m[6];
  17028. out[1] = m[1] * x + m[4] * y + m[7];
  17029. return out;
  17030. }
  17031. /**
  17032. * Transforms the vec2 with a mat4
  17033. * 3rd vector component is implicitly '0'
  17034. * 4th vector component is implicitly '1'
  17035. *
  17036. * @param {vec2} out the receiving vector
  17037. * @param {ReadonlyVec2} a the vector to transform
  17038. * @param {ReadonlyMat4} m matrix to transform with
  17039. * @returns {vec2} out
  17040. */
  17041. function transformMat4(out, a, m) {
  17042. var x = a[0];
  17043. var y = a[1];
  17044. out[0] = m[0] * x + m[4] * y + m[12];
  17045. out[1] = m[1] * x + m[5] * y + m[13];
  17046. return out;
  17047. }
  17048. /**
  17049. * Rotate a 2D vector
  17050. * @param {vec2} out The receiving vec2
  17051. * @param {ReadonlyVec2} a The vec2 point to rotate
  17052. * @param {ReadonlyVec2} b The origin of the rotation
  17053. * @param {Number} rad The angle of rotation in radians
  17054. * @returns {vec2} out
  17055. */
  17056. function rotate(out, a, b, rad) {
  17057. //Translate point to the origin
  17058. var p0 = a[0] - b[0],
  17059. p1 = a[1] - b[1],
  17060. sinC = Math.sin(rad),
  17061. cosC = Math.cos(rad); //perform rotation and translate to correct position
  17062. out[0] = p0 * cosC - p1 * sinC + b[0];
  17063. out[1] = p0 * sinC + p1 * cosC + b[1];
  17064. return out;
  17065. }
  17066. /**
  17067. * Get the angle between two 2D vectors
  17068. * @param {ReadonlyVec2} a The first operand
  17069. * @param {ReadonlyVec2} b The second operand
  17070. * @returns {Number} The angle in radians
  17071. */
  17072. function angle(a, b) {
  17073. var x1 = a[0],
  17074. y1 = a[1],
  17075. x2 = b[0],
  17076. y2 = b[1],
  17077. // mag is the product of the magnitudes of a and b
  17078. mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),
  17079. // mag &&.. short circuits if mag == 0
  17080. cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1
  17081. return Math.acos(Math.min(Math.max(cosine, -1), 1));
  17082. }
  17083. /**
  17084. * Set the components of a vec2 to zero
  17085. *
  17086. * @param {vec2} out the receiving vector
  17087. * @returns {vec2} out
  17088. */
  17089. function zero(out) {
  17090. out[0] = 0.0;
  17091. out[1] = 0.0;
  17092. return out;
  17093. }
  17094. /**
  17095. * Returns a string representation of a vector
  17096. *
  17097. * @param {ReadonlyVec2} a vector to represent as a string
  17098. * @returns {String} string representation of the vector
  17099. */
  17100. function str(a) {
  17101. return "vec2(" + a[0] + ", " + a[1] + ")";
  17102. }
  17103. /**
  17104. * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
  17105. *
  17106. * @param {ReadonlyVec2} a The first vector.
  17107. * @param {ReadonlyVec2} b The second vector.
  17108. * @returns {Boolean} True if the vectors are equal, false otherwise.
  17109. */
  17110. function exactEquals(a, b) {
  17111. return a[0] === b[0] && a[1] === b[1];
  17112. }
  17113. /**
  17114. * Returns whether or not the vectors have approximately the same elements in the same position.
  17115. *
  17116. * @param {ReadonlyVec2} a The first vector.
  17117. * @param {ReadonlyVec2} b The second vector.
  17118. * @returns {Boolean} True if the vectors are equal, false otherwise.
  17119. */
  17120. function equals(a, b) {
  17121. var a0 = a[0],
  17122. a1 = a[1];
  17123. var b0 = b[0],
  17124. b1 = b[1];
  17125. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));
  17126. }
  17127. /**
  17128. * Alias for {@link vec2.length}
  17129. * @function
  17130. */
  17131. var len = length;
  17132. /**
  17133. * Alias for {@link vec2.subtract}
  17134. * @function
  17135. */
  17136. var sub = subtract;
  17137. /**
  17138. * Alias for {@link vec2.multiply}
  17139. * @function
  17140. */
  17141. var mul = multiply;
  17142. /**
  17143. * Alias for {@link vec2.divide}
  17144. * @function
  17145. */
  17146. var div = divide;
  17147. /**
  17148. * Alias for {@link vec2.distance}
  17149. * @function
  17150. */
  17151. var dist = distance;
  17152. /**
  17153. * Alias for {@link vec2.squaredDistance}
  17154. * @function
  17155. */
  17156. var sqrDist = squaredDistance;
  17157. /**
  17158. * Alias for {@link vec2.squaredLength}
  17159. * @function
  17160. */
  17161. var sqrLen = squaredLength;
  17162. /**
  17163. * Perform some operation over an array of vec2s.
  17164. *
  17165. * @param {Array} a the array of vectors to iterate over
  17166. * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed
  17167. * @param {Number} offset Number of elements to skip at the beginning of the array
  17168. * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array
  17169. * @param {Function} fn Function to call for each vector in the array
  17170. * @param {Object} [arg] additional argument to pass to fn
  17171. * @returns {Array} a
  17172. * @function
  17173. */
  17174. var forEach = function () {
  17175. var vec = create();
  17176. return function (a, stride, offset, count, fn, arg) {
  17177. var i, l;
  17178. if (!stride) {
  17179. stride = 2;
  17180. }
  17181. if (!offset) {
  17182. offset = 0;
  17183. }
  17184. if (count) {
  17185. l = Math.min(count * stride + offset, a.length);
  17186. } else {
  17187. l = a.length;
  17188. }
  17189. for (i = offset; i < l; i += stride) {
  17190. vec[0] = a[i];
  17191. vec[1] = a[i + 1];
  17192. fn(vec, vec, arg);
  17193. a[i] = vec[0];
  17194. a[i + 1] = vec[1];
  17195. }
  17196. return a;
  17197. };
  17198. }();
  17199. /***/ }),
  17200. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js":
  17201. /*!*************************************************************!*\
  17202. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js ***!
  17203. \*************************************************************/
  17204. /*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
  17205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17206. "use strict";
  17207. __webpack_require__.r(__webpack_exports__);
  17208. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  17209. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  17210. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  17211. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  17212. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  17213. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  17214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  17215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  17216. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  17217. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
  17218. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
  17219. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
  17220. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
  17221. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
  17222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
  17223. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  17224. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
  17225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
  17226. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
  17227. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  17228. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
  17229. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
  17230. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  17231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  17232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
  17233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  17234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hermite", function() { return hermite; });
  17235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bezier", function() { return bezier; });
  17236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  17237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
  17238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat3", function() { return transformMat3; });
  17239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformQuat", function() { return transformQuat; });
  17240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateX", function() { return rotateX; });
  17241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateY", function() { return rotateY; });
  17242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateZ", function() { return rotateZ; });
  17243. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "angle", function() { return angle; });
  17244. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
  17245. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  17246. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  17247. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  17248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  17249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  17250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
  17251. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
  17252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
  17253. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  17254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  17255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  17256. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  17257. /**
  17258. * 3 Dimensional Vector
  17259. * @module vec3
  17260. */
  17261. /**
  17262. * Creates a new, empty vec3
  17263. *
  17264. * @returns {vec3} a new 3D vector
  17265. */
  17266. function create() {
  17267. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  17268. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  17269. out[0] = 0;
  17270. out[1] = 0;
  17271. out[2] = 0;
  17272. }
  17273. return out;
  17274. }
  17275. /**
  17276. * Creates a new vec3 initialized with values from an existing vector
  17277. *
  17278. * @param {ReadonlyVec3} a vector to clone
  17279. * @returns {vec3} a new 3D vector
  17280. */
  17281. function clone(a) {
  17282. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  17283. out[0] = a[0];
  17284. out[1] = a[1];
  17285. out[2] = a[2];
  17286. return out;
  17287. }
  17288. /**
  17289. * Calculates the length of a vec3
  17290. *
  17291. * @param {ReadonlyVec3} a vector to calculate length of
  17292. * @returns {Number} length of a
  17293. */
  17294. function length(a) {
  17295. var x = a[0];
  17296. var y = a[1];
  17297. var z = a[2];
  17298. return Math.hypot(x, y, z);
  17299. }
  17300. /**
  17301. * Creates a new vec3 initialized with the given values
  17302. *
  17303. * @param {Number} x X component
  17304. * @param {Number} y Y component
  17305. * @param {Number} z Z component
  17306. * @returns {vec3} a new 3D vector
  17307. */
  17308. function fromValues(x, y, z) {
  17309. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](3);
  17310. out[0] = x;
  17311. out[1] = y;
  17312. out[2] = z;
  17313. return out;
  17314. }
  17315. /**
  17316. * Copy the values from one vec3 to another
  17317. *
  17318. * @param {vec3} out the receiving vector
  17319. * @param {ReadonlyVec3} a the source vector
  17320. * @returns {vec3} out
  17321. */
  17322. function copy(out, a) {
  17323. out[0] = a[0];
  17324. out[1] = a[1];
  17325. out[2] = a[2];
  17326. return out;
  17327. }
  17328. /**
  17329. * Set the components of a vec3 to the given values
  17330. *
  17331. * @param {vec3} out the receiving vector
  17332. * @param {Number} x X component
  17333. * @param {Number} y Y component
  17334. * @param {Number} z Z component
  17335. * @returns {vec3} out
  17336. */
  17337. function set(out, x, y, z) {
  17338. out[0] = x;
  17339. out[1] = y;
  17340. out[2] = z;
  17341. return out;
  17342. }
  17343. /**
  17344. * Adds two vec3's
  17345. *
  17346. * @param {vec3} out the receiving vector
  17347. * @param {ReadonlyVec3} a the first operand
  17348. * @param {ReadonlyVec3} b the second operand
  17349. * @returns {vec3} out
  17350. */
  17351. function add(out, a, b) {
  17352. out[0] = a[0] + b[0];
  17353. out[1] = a[1] + b[1];
  17354. out[2] = a[2] + b[2];
  17355. return out;
  17356. }
  17357. /**
  17358. * Subtracts vector b from vector a
  17359. *
  17360. * @param {vec3} out the receiving vector
  17361. * @param {ReadonlyVec3} a the first operand
  17362. * @param {ReadonlyVec3} b the second operand
  17363. * @returns {vec3} out
  17364. */
  17365. function subtract(out, a, b) {
  17366. out[0] = a[0] - b[0];
  17367. out[1] = a[1] - b[1];
  17368. out[2] = a[2] - b[2];
  17369. return out;
  17370. }
  17371. /**
  17372. * Multiplies two vec3's
  17373. *
  17374. * @param {vec3} out the receiving vector
  17375. * @param {ReadonlyVec3} a the first operand
  17376. * @param {ReadonlyVec3} b the second operand
  17377. * @returns {vec3} out
  17378. */
  17379. function multiply(out, a, b) {
  17380. out[0] = a[0] * b[0];
  17381. out[1] = a[1] * b[1];
  17382. out[2] = a[2] * b[2];
  17383. return out;
  17384. }
  17385. /**
  17386. * Divides two vec3's
  17387. *
  17388. * @param {vec3} out the receiving vector
  17389. * @param {ReadonlyVec3} a the first operand
  17390. * @param {ReadonlyVec3} b the second operand
  17391. * @returns {vec3} out
  17392. */
  17393. function divide(out, a, b) {
  17394. out[0] = a[0] / b[0];
  17395. out[1] = a[1] / b[1];
  17396. out[2] = a[2] / b[2];
  17397. return out;
  17398. }
  17399. /**
  17400. * Math.ceil the components of a vec3
  17401. *
  17402. * @param {vec3} out the receiving vector
  17403. * @param {ReadonlyVec3} a vector to ceil
  17404. * @returns {vec3} out
  17405. */
  17406. function ceil(out, a) {
  17407. out[0] = Math.ceil(a[0]);
  17408. out[1] = Math.ceil(a[1]);
  17409. out[2] = Math.ceil(a[2]);
  17410. return out;
  17411. }
  17412. /**
  17413. * Math.floor the components of a vec3
  17414. *
  17415. * @param {vec3} out the receiving vector
  17416. * @param {ReadonlyVec3} a vector to floor
  17417. * @returns {vec3} out
  17418. */
  17419. function floor(out, a) {
  17420. out[0] = Math.floor(a[0]);
  17421. out[1] = Math.floor(a[1]);
  17422. out[2] = Math.floor(a[2]);
  17423. return out;
  17424. }
  17425. /**
  17426. * Returns the minimum of two vec3's
  17427. *
  17428. * @param {vec3} out the receiving vector
  17429. * @param {ReadonlyVec3} a the first operand
  17430. * @param {ReadonlyVec3} b the second operand
  17431. * @returns {vec3} out
  17432. */
  17433. function min(out, a, b) {
  17434. out[0] = Math.min(a[0], b[0]);
  17435. out[1] = Math.min(a[1], b[1]);
  17436. out[2] = Math.min(a[2], b[2]);
  17437. return out;
  17438. }
  17439. /**
  17440. * Returns the maximum of two vec3's
  17441. *
  17442. * @param {vec3} out the receiving vector
  17443. * @param {ReadonlyVec3} a the first operand
  17444. * @param {ReadonlyVec3} b the second operand
  17445. * @returns {vec3} out
  17446. */
  17447. function max(out, a, b) {
  17448. out[0] = Math.max(a[0], b[0]);
  17449. out[1] = Math.max(a[1], b[1]);
  17450. out[2] = Math.max(a[2], b[2]);
  17451. return out;
  17452. }
  17453. /**
  17454. * Math.round the components of a vec3
  17455. *
  17456. * @param {vec3} out the receiving vector
  17457. * @param {ReadonlyVec3} a vector to round
  17458. * @returns {vec3} out
  17459. */
  17460. function round(out, a) {
  17461. out[0] = Math.round(a[0]);
  17462. out[1] = Math.round(a[1]);
  17463. out[2] = Math.round(a[2]);
  17464. return out;
  17465. }
  17466. /**
  17467. * Scales a vec3 by a scalar number
  17468. *
  17469. * @param {vec3} out the receiving vector
  17470. * @param {ReadonlyVec3} a the vector to scale
  17471. * @param {Number} b amount to scale the vector by
  17472. * @returns {vec3} out
  17473. */
  17474. function scale(out, a, b) {
  17475. out[0] = a[0] * b;
  17476. out[1] = a[1] * b;
  17477. out[2] = a[2] * b;
  17478. return out;
  17479. }
  17480. /**
  17481. * Adds two vec3's after scaling the second operand by a scalar value
  17482. *
  17483. * @param {vec3} out the receiving vector
  17484. * @param {ReadonlyVec3} a the first operand
  17485. * @param {ReadonlyVec3} b the second operand
  17486. * @param {Number} scale the amount to scale b by before adding
  17487. * @returns {vec3} out
  17488. */
  17489. function scaleAndAdd(out, a, b, scale) {
  17490. out[0] = a[0] + b[0] * scale;
  17491. out[1] = a[1] + b[1] * scale;
  17492. out[2] = a[2] + b[2] * scale;
  17493. return out;
  17494. }
  17495. /**
  17496. * Calculates the euclidian distance between two vec3's
  17497. *
  17498. * @param {ReadonlyVec3} a the first operand
  17499. * @param {ReadonlyVec3} b the second operand
  17500. * @returns {Number} distance between a and b
  17501. */
  17502. function distance(a, b) {
  17503. var x = b[0] - a[0];
  17504. var y = b[1] - a[1];
  17505. var z = b[2] - a[2];
  17506. return Math.hypot(x, y, z);
  17507. }
  17508. /**
  17509. * Calculates the squared euclidian distance between two vec3's
  17510. *
  17511. * @param {ReadonlyVec3} a the first operand
  17512. * @param {ReadonlyVec3} b the second operand
  17513. * @returns {Number} squared distance between a and b
  17514. */
  17515. function squaredDistance(a, b) {
  17516. var x = b[0] - a[0];
  17517. var y = b[1] - a[1];
  17518. var z = b[2] - a[2];
  17519. return x * x + y * y + z * z;
  17520. }
  17521. /**
  17522. * Calculates the squared length of a vec3
  17523. *
  17524. * @param {ReadonlyVec3} a vector to calculate squared length of
  17525. * @returns {Number} squared length of a
  17526. */
  17527. function squaredLength(a) {
  17528. var x = a[0];
  17529. var y = a[1];
  17530. var z = a[2];
  17531. return x * x + y * y + z * z;
  17532. }
  17533. /**
  17534. * Negates the components of a vec3
  17535. *
  17536. * @param {vec3} out the receiving vector
  17537. * @param {ReadonlyVec3} a vector to negate
  17538. * @returns {vec3} out
  17539. */
  17540. function negate(out, a) {
  17541. out[0] = -a[0];
  17542. out[1] = -a[1];
  17543. out[2] = -a[2];
  17544. return out;
  17545. }
  17546. /**
  17547. * Returns the inverse of the components of a vec3
  17548. *
  17549. * @param {vec3} out the receiving vector
  17550. * @param {ReadonlyVec3} a vector to invert
  17551. * @returns {vec3} out
  17552. */
  17553. function inverse(out, a) {
  17554. out[0] = 1.0 / a[0];
  17555. out[1] = 1.0 / a[1];
  17556. out[2] = 1.0 / a[2];
  17557. return out;
  17558. }
  17559. /**
  17560. * Normalize a vec3
  17561. *
  17562. * @param {vec3} out the receiving vector
  17563. * @param {ReadonlyVec3} a vector to normalize
  17564. * @returns {vec3} out
  17565. */
  17566. function normalize(out, a) {
  17567. var x = a[0];
  17568. var y = a[1];
  17569. var z = a[2];
  17570. var len = x * x + y * y + z * z;
  17571. if (len > 0) {
  17572. //TODO: evaluate use of glm_invsqrt here?
  17573. len = 1 / Math.sqrt(len);
  17574. }
  17575. out[0] = a[0] * len;
  17576. out[1] = a[1] * len;
  17577. out[2] = a[2] * len;
  17578. return out;
  17579. }
  17580. /**
  17581. * Calculates the dot product of two vec3's
  17582. *
  17583. * @param {ReadonlyVec3} a the first operand
  17584. * @param {ReadonlyVec3} b the second operand
  17585. * @returns {Number} dot product of a and b
  17586. */
  17587. function dot(a, b) {
  17588. return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
  17589. }
  17590. /**
  17591. * Computes the cross product of two vec3's
  17592. *
  17593. * @param {vec3} out the receiving vector
  17594. * @param {ReadonlyVec3} a the first operand
  17595. * @param {ReadonlyVec3} b the second operand
  17596. * @returns {vec3} out
  17597. */
  17598. function cross(out, a, b) {
  17599. var ax = a[0],
  17600. ay = a[1],
  17601. az = a[2];
  17602. var bx = b[0],
  17603. by = b[1],
  17604. bz = b[2];
  17605. out[0] = ay * bz - az * by;
  17606. out[1] = az * bx - ax * bz;
  17607. out[2] = ax * by - ay * bx;
  17608. return out;
  17609. }
  17610. /**
  17611. * Performs a linear interpolation between two vec3's
  17612. *
  17613. * @param {vec3} out the receiving vector
  17614. * @param {ReadonlyVec3} a the first operand
  17615. * @param {ReadonlyVec3} b the second operand
  17616. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  17617. * @returns {vec3} out
  17618. */
  17619. function lerp(out, a, b, t) {
  17620. var ax = a[0];
  17621. var ay = a[1];
  17622. var az = a[2];
  17623. out[0] = ax + t * (b[0] - ax);
  17624. out[1] = ay + t * (b[1] - ay);
  17625. out[2] = az + t * (b[2] - az);
  17626. return out;
  17627. }
  17628. /**
  17629. * Performs a hermite interpolation with two control points
  17630. *
  17631. * @param {vec3} out the receiving vector
  17632. * @param {ReadonlyVec3} a the first operand
  17633. * @param {ReadonlyVec3} b the second operand
  17634. * @param {ReadonlyVec3} c the third operand
  17635. * @param {ReadonlyVec3} d the fourth operand
  17636. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  17637. * @returns {vec3} out
  17638. */
  17639. function hermite(out, a, b, c, d, t) {
  17640. var factorTimes2 = t * t;
  17641. var factor1 = factorTimes2 * (2 * t - 3) + 1;
  17642. var factor2 = factorTimes2 * (t - 2) + t;
  17643. var factor3 = factorTimes2 * (t - 1);
  17644. var factor4 = factorTimes2 * (3 - 2 * t);
  17645. out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
  17646. out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
  17647. out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
  17648. return out;
  17649. }
  17650. /**
  17651. * Performs a bezier interpolation with two control points
  17652. *
  17653. * @param {vec3} out the receiving vector
  17654. * @param {ReadonlyVec3} a the first operand
  17655. * @param {ReadonlyVec3} b the second operand
  17656. * @param {ReadonlyVec3} c the third operand
  17657. * @param {ReadonlyVec3} d the fourth operand
  17658. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  17659. * @returns {vec3} out
  17660. */
  17661. function bezier(out, a, b, c, d, t) {
  17662. var inverseFactor = 1 - t;
  17663. var inverseFactorTimesTwo = inverseFactor * inverseFactor;
  17664. var factorTimes2 = t * t;
  17665. var factor1 = inverseFactorTimesTwo * inverseFactor;
  17666. var factor2 = 3 * t * inverseFactorTimesTwo;
  17667. var factor3 = 3 * factorTimes2 * inverseFactor;
  17668. var factor4 = factorTimes2 * t;
  17669. out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
  17670. out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
  17671. out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
  17672. return out;
  17673. }
  17674. /**
  17675. * Generates a random vector with the given scale
  17676. *
  17677. * @param {vec3} out the receiving vector
  17678. * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
  17679. * @returns {vec3} out
  17680. */
  17681. function random(out, scale) {
  17682. scale = scale || 1.0;
  17683. var r = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 * Math.PI;
  17684. var z = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2.0 - 1.0;
  17685. var zScale = Math.sqrt(1.0 - z * z) * scale;
  17686. out[0] = Math.cos(r) * zScale;
  17687. out[1] = Math.sin(r) * zScale;
  17688. out[2] = z * scale;
  17689. return out;
  17690. }
  17691. /**
  17692. * Transforms the vec3 with a mat4.
  17693. * 4th vector component is implicitly '1'
  17694. *
  17695. * @param {vec3} out the receiving vector
  17696. * @param {ReadonlyVec3} a the vector to transform
  17697. * @param {ReadonlyMat4} m matrix to transform with
  17698. * @returns {vec3} out
  17699. */
  17700. function transformMat4(out, a, m) {
  17701. var x = a[0],
  17702. y = a[1],
  17703. z = a[2];
  17704. var w = m[3] * x + m[7] * y + m[11] * z + m[15];
  17705. w = w || 1.0;
  17706. out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
  17707. out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
  17708. out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
  17709. return out;
  17710. }
  17711. /**
  17712. * Transforms the vec3 with a mat3.
  17713. *
  17714. * @param {vec3} out the receiving vector
  17715. * @param {ReadonlyVec3} a the vector to transform
  17716. * @param {ReadonlyMat3} m the 3x3 matrix to transform with
  17717. * @returns {vec3} out
  17718. */
  17719. function transformMat3(out, a, m) {
  17720. var x = a[0],
  17721. y = a[1],
  17722. z = a[2];
  17723. out[0] = x * m[0] + y * m[3] + z * m[6];
  17724. out[1] = x * m[1] + y * m[4] + z * m[7];
  17725. out[2] = x * m[2] + y * m[5] + z * m[8];
  17726. return out;
  17727. }
  17728. /**
  17729. * Transforms the vec3 with a quat
  17730. * Can also be used for dual quaternions. (Multiply it with the real part)
  17731. *
  17732. * @param {vec3} out the receiving vector
  17733. * @param {ReadonlyVec3} a the vector to transform
  17734. * @param {ReadonlyQuat} q quaternion to transform with
  17735. * @returns {vec3} out
  17736. */
  17737. function transformQuat(out, a, q) {
  17738. // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed
  17739. var qx = q[0],
  17740. qy = q[1],
  17741. qz = q[2],
  17742. qw = q[3];
  17743. var x = a[0],
  17744. y = a[1],
  17745. z = a[2]; // var qvec = [qx, qy, qz];
  17746. // var uv = vec3.cross([], qvec, a);
  17747. var uvx = qy * z - qz * y,
  17748. uvy = qz * x - qx * z,
  17749. uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);
  17750. var uuvx = qy * uvz - qz * uvy,
  17751. uuvy = qz * uvx - qx * uvz,
  17752. uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);
  17753. var w2 = qw * 2;
  17754. uvx *= w2;
  17755. uvy *= w2;
  17756. uvz *= w2; // vec3.scale(uuv, uuv, 2);
  17757. uuvx *= 2;
  17758. uuvy *= 2;
  17759. uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));
  17760. out[0] = x + uvx + uuvx;
  17761. out[1] = y + uvy + uuvy;
  17762. out[2] = z + uvz + uuvz;
  17763. return out;
  17764. }
  17765. /**
  17766. * Rotate a 3D vector around the x-axis
  17767. * @param {vec3} out The receiving vec3
  17768. * @param {ReadonlyVec3} a The vec3 point to rotate
  17769. * @param {ReadonlyVec3} b The origin of the rotation
  17770. * @param {Number} rad The angle of rotation in radians
  17771. * @returns {vec3} out
  17772. */
  17773. function rotateX(out, a, b, rad) {
  17774. var p = [],
  17775. r = []; //Translate point to the origin
  17776. p[0] = a[0] - b[0];
  17777. p[1] = a[1] - b[1];
  17778. p[2] = a[2] - b[2]; //perform rotation
  17779. r[0] = p[0];
  17780. r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);
  17781. r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position
  17782. out[0] = r[0] + b[0];
  17783. out[1] = r[1] + b[1];
  17784. out[2] = r[2] + b[2];
  17785. return out;
  17786. }
  17787. /**
  17788. * Rotate a 3D vector around the y-axis
  17789. * @param {vec3} out The receiving vec3
  17790. * @param {ReadonlyVec3} a The vec3 point to rotate
  17791. * @param {ReadonlyVec3} b The origin of the rotation
  17792. * @param {Number} rad The angle of rotation in radians
  17793. * @returns {vec3} out
  17794. */
  17795. function rotateY(out, a, b, rad) {
  17796. var p = [],
  17797. r = []; //Translate point to the origin
  17798. p[0] = a[0] - b[0];
  17799. p[1] = a[1] - b[1];
  17800. p[2] = a[2] - b[2]; //perform rotation
  17801. r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);
  17802. r[1] = p[1];
  17803. r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position
  17804. out[0] = r[0] + b[0];
  17805. out[1] = r[1] + b[1];
  17806. out[2] = r[2] + b[2];
  17807. return out;
  17808. }
  17809. /**
  17810. * Rotate a 3D vector around the z-axis
  17811. * @param {vec3} out The receiving vec3
  17812. * @param {ReadonlyVec3} a The vec3 point to rotate
  17813. * @param {ReadonlyVec3} b The origin of the rotation
  17814. * @param {Number} rad The angle of rotation in radians
  17815. * @returns {vec3} out
  17816. */
  17817. function rotateZ(out, a, b, rad) {
  17818. var p = [],
  17819. r = []; //Translate point to the origin
  17820. p[0] = a[0] - b[0];
  17821. p[1] = a[1] - b[1];
  17822. p[2] = a[2] - b[2]; //perform rotation
  17823. r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);
  17824. r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);
  17825. r[2] = p[2]; //translate to correct position
  17826. out[0] = r[0] + b[0];
  17827. out[1] = r[1] + b[1];
  17828. out[2] = r[2] + b[2];
  17829. return out;
  17830. }
  17831. /**
  17832. * Get the angle between two 3D vectors
  17833. * @param {ReadonlyVec3} a The first operand
  17834. * @param {ReadonlyVec3} b The second operand
  17835. * @returns {Number} The angle in radians
  17836. */
  17837. function angle(a, b) {
  17838. var ax = a[0],
  17839. ay = a[1],
  17840. az = a[2],
  17841. bx = b[0],
  17842. by = b[1],
  17843. bz = b[2],
  17844. mag1 = Math.sqrt(ax * ax + ay * ay + az * az),
  17845. mag2 = Math.sqrt(bx * bx + by * by + bz * bz),
  17846. mag = mag1 * mag2,
  17847. cosine = mag && dot(a, b) / mag;
  17848. return Math.acos(Math.min(Math.max(cosine, -1), 1));
  17849. }
  17850. /**
  17851. * Set the components of a vec3 to zero
  17852. *
  17853. * @param {vec3} out the receiving vector
  17854. * @returns {vec3} out
  17855. */
  17856. function zero(out) {
  17857. out[0] = 0.0;
  17858. out[1] = 0.0;
  17859. out[2] = 0.0;
  17860. return out;
  17861. }
  17862. /**
  17863. * Returns a string representation of a vector
  17864. *
  17865. * @param {ReadonlyVec3} a vector to represent as a string
  17866. * @returns {String} string representation of the vector
  17867. */
  17868. function str(a) {
  17869. return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")";
  17870. }
  17871. /**
  17872. * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
  17873. *
  17874. * @param {ReadonlyVec3} a The first vector.
  17875. * @param {ReadonlyVec3} b The second vector.
  17876. * @returns {Boolean} True if the vectors are equal, false otherwise.
  17877. */
  17878. function exactEquals(a, b) {
  17879. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
  17880. }
  17881. /**
  17882. * Returns whether or not the vectors have approximately the same elements in the same position.
  17883. *
  17884. * @param {ReadonlyVec3} a The first vector.
  17885. * @param {ReadonlyVec3} b The second vector.
  17886. * @returns {Boolean} True if the vectors are equal, false otherwise.
  17887. */
  17888. function equals(a, b) {
  17889. var a0 = a[0],
  17890. a1 = a[1],
  17891. a2 = a[2];
  17892. var b0 = b[0],
  17893. b1 = b[1],
  17894. b2 = b[2];
  17895. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));
  17896. }
  17897. /**
  17898. * Alias for {@link vec3.subtract}
  17899. * @function
  17900. */
  17901. var sub = subtract;
  17902. /**
  17903. * Alias for {@link vec3.multiply}
  17904. * @function
  17905. */
  17906. var mul = multiply;
  17907. /**
  17908. * Alias for {@link vec3.divide}
  17909. * @function
  17910. */
  17911. var div = divide;
  17912. /**
  17913. * Alias for {@link vec3.distance}
  17914. * @function
  17915. */
  17916. var dist = distance;
  17917. /**
  17918. * Alias for {@link vec3.squaredDistance}
  17919. * @function
  17920. */
  17921. var sqrDist = squaredDistance;
  17922. /**
  17923. * Alias for {@link vec3.length}
  17924. * @function
  17925. */
  17926. var len = length;
  17927. /**
  17928. * Alias for {@link vec3.squaredLength}
  17929. * @function
  17930. */
  17931. var sqrLen = squaredLength;
  17932. /**
  17933. * Perform some operation over an array of vec3s.
  17934. *
  17935. * @param {Array} a the array of vectors to iterate over
  17936. * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed
  17937. * @param {Number} offset Number of elements to skip at the beginning of the array
  17938. * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array
  17939. * @param {Function} fn Function to call for each vector in the array
  17940. * @param {Object} [arg] additional argument to pass to fn
  17941. * @returns {Array} a
  17942. * @function
  17943. */
  17944. var forEach = function () {
  17945. var vec = create();
  17946. return function (a, stride, offset, count, fn, arg) {
  17947. var i, l;
  17948. if (!stride) {
  17949. stride = 3;
  17950. }
  17951. if (!offset) {
  17952. offset = 0;
  17953. }
  17954. if (count) {
  17955. l = Math.min(count * stride + offset, a.length);
  17956. } else {
  17957. l = a.length;
  17958. }
  17959. for (i = offset; i < l; i += stride) {
  17960. vec[0] = a[i];
  17961. vec[1] = a[i + 1];
  17962. vec[2] = a[i + 2];
  17963. fn(vec, vec, arg);
  17964. a[i] = vec[0];
  17965. a[i + 1] = vec[1];
  17966. a[i + 2] = vec[2];
  17967. }
  17968. return a;
  17969. };
  17970. }();
  17971. /***/ }),
  17972. /***/ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js":
  17973. /*!*************************************************************!*\
  17974. !*** ./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec4.js ***!
  17975. \*************************************************************/
  17976. /*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
  17977. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17978. "use strict";
  17979. __webpack_require__.r(__webpack_exports__);
  17980. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  17981. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return clone; });
  17982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromValues", function() { return fromValues; });
  17983. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; });
  17984. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  17985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  17986. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; });
  17987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return multiply; });
  17988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return divide; });
  17989. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; });
  17990. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; });
  17991. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
  17992. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
  17993. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return round; });
  17994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scale", function() { return scale; });
  17995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scaleAndAdd", function() { return scaleAndAdd; });
  17996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distance", function() { return distance; });
  17997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDistance", function() { return squaredDistance; });
  17998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "length", function() { return length; });
  17999. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredLength", function() { return squaredLength; });
  18000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return negate; });
  18001. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inverse", function() { return inverse; });
  18002. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; });
  18003. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return dot; });
  18004. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return cross; });
  18005. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lerp", function() { return lerp; });
  18006. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
  18007. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformMat4", function() { return transformMat4; });
  18008. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformQuat", function() { return transformQuat; });
  18009. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zero", function() { return zero; });
  18010. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "str", function() { return str; });
  18011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exactEquals", function() { return exactEquals; });
  18012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  18013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return sub; });
  18014. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return mul; });
  18015. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return div; });
  18016. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dist", function() { return dist; });
  18017. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrDist", function() { return sqrDist; });
  18018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "len", function() { return len; });
  18019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrLen", function() { return sqrLen; });
  18020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  18021. /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/common.js");
  18022. /**
  18023. * 4 Dimensional Vector
  18024. * @module vec4
  18025. */
  18026. /**
  18027. * Creates a new, empty vec4
  18028. *
  18029. * @returns {vec4} a new 4D vector
  18030. */
  18031. function create() {
  18032. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  18033. if (_common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"] != Float32Array) {
  18034. out[0] = 0;
  18035. out[1] = 0;
  18036. out[2] = 0;
  18037. out[3] = 0;
  18038. }
  18039. return out;
  18040. }
  18041. /**
  18042. * Creates a new vec4 initialized with values from an existing vector
  18043. *
  18044. * @param {ReadonlyVec4} a vector to clone
  18045. * @returns {vec4} a new 4D vector
  18046. */
  18047. function clone(a) {
  18048. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  18049. out[0] = a[0];
  18050. out[1] = a[1];
  18051. out[2] = a[2];
  18052. out[3] = a[3];
  18053. return out;
  18054. }
  18055. /**
  18056. * Creates a new vec4 initialized with the given values
  18057. *
  18058. * @param {Number} x X component
  18059. * @param {Number} y Y component
  18060. * @param {Number} z Z component
  18061. * @param {Number} w W component
  18062. * @returns {vec4} a new 4D vector
  18063. */
  18064. function fromValues(x, y, z, w) {
  18065. var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__["ARRAY_TYPE"](4);
  18066. out[0] = x;
  18067. out[1] = y;
  18068. out[2] = z;
  18069. out[3] = w;
  18070. return out;
  18071. }
  18072. /**
  18073. * Copy the values from one vec4 to another
  18074. *
  18075. * @param {vec4} out the receiving vector
  18076. * @param {ReadonlyVec4} a the source vector
  18077. * @returns {vec4} out
  18078. */
  18079. function copy(out, a) {
  18080. out[0] = a[0];
  18081. out[1] = a[1];
  18082. out[2] = a[2];
  18083. out[3] = a[3];
  18084. return out;
  18085. }
  18086. /**
  18087. * Set the components of a vec4 to the given values
  18088. *
  18089. * @param {vec4} out the receiving vector
  18090. * @param {Number} x X component
  18091. * @param {Number} y Y component
  18092. * @param {Number} z Z component
  18093. * @param {Number} w W component
  18094. * @returns {vec4} out
  18095. */
  18096. function set(out, x, y, z, w) {
  18097. out[0] = x;
  18098. out[1] = y;
  18099. out[2] = z;
  18100. out[3] = w;
  18101. return out;
  18102. }
  18103. /**
  18104. * Adds two vec4's
  18105. *
  18106. * @param {vec4} out the receiving vector
  18107. * @param {ReadonlyVec4} a the first operand
  18108. * @param {ReadonlyVec4} b the second operand
  18109. * @returns {vec4} out
  18110. */
  18111. function add(out, a, b) {
  18112. out[0] = a[0] + b[0];
  18113. out[1] = a[1] + b[1];
  18114. out[2] = a[2] + b[2];
  18115. out[3] = a[3] + b[3];
  18116. return out;
  18117. }
  18118. /**
  18119. * Subtracts vector b from vector a
  18120. *
  18121. * @param {vec4} out the receiving vector
  18122. * @param {ReadonlyVec4} a the first operand
  18123. * @param {ReadonlyVec4} b the second operand
  18124. * @returns {vec4} out
  18125. */
  18126. function subtract(out, a, b) {
  18127. out[0] = a[0] - b[0];
  18128. out[1] = a[1] - b[1];
  18129. out[2] = a[2] - b[2];
  18130. out[3] = a[3] - b[3];
  18131. return out;
  18132. }
  18133. /**
  18134. * Multiplies two vec4's
  18135. *
  18136. * @param {vec4} out the receiving vector
  18137. * @param {ReadonlyVec4} a the first operand
  18138. * @param {ReadonlyVec4} b the second operand
  18139. * @returns {vec4} out
  18140. */
  18141. function multiply(out, a, b) {
  18142. out[0] = a[0] * b[0];
  18143. out[1] = a[1] * b[1];
  18144. out[2] = a[2] * b[2];
  18145. out[3] = a[3] * b[3];
  18146. return out;
  18147. }
  18148. /**
  18149. * Divides two vec4's
  18150. *
  18151. * @param {vec4} out the receiving vector
  18152. * @param {ReadonlyVec4} a the first operand
  18153. * @param {ReadonlyVec4} b the second operand
  18154. * @returns {vec4} out
  18155. */
  18156. function divide(out, a, b) {
  18157. out[0] = a[0] / b[0];
  18158. out[1] = a[1] / b[1];
  18159. out[2] = a[2] / b[2];
  18160. out[3] = a[3] / b[3];
  18161. return out;
  18162. }
  18163. /**
  18164. * Math.ceil the components of a vec4
  18165. *
  18166. * @param {vec4} out the receiving vector
  18167. * @param {ReadonlyVec4} a vector to ceil
  18168. * @returns {vec4} out
  18169. */
  18170. function ceil(out, a) {
  18171. out[0] = Math.ceil(a[0]);
  18172. out[1] = Math.ceil(a[1]);
  18173. out[2] = Math.ceil(a[2]);
  18174. out[3] = Math.ceil(a[3]);
  18175. return out;
  18176. }
  18177. /**
  18178. * Math.floor the components of a vec4
  18179. *
  18180. * @param {vec4} out the receiving vector
  18181. * @param {ReadonlyVec4} a vector to floor
  18182. * @returns {vec4} out
  18183. */
  18184. function floor(out, a) {
  18185. out[0] = Math.floor(a[0]);
  18186. out[1] = Math.floor(a[1]);
  18187. out[2] = Math.floor(a[2]);
  18188. out[3] = Math.floor(a[3]);
  18189. return out;
  18190. }
  18191. /**
  18192. * Returns the minimum of two vec4's
  18193. *
  18194. * @param {vec4} out the receiving vector
  18195. * @param {ReadonlyVec4} a the first operand
  18196. * @param {ReadonlyVec4} b the second operand
  18197. * @returns {vec4} out
  18198. */
  18199. function min(out, a, b) {
  18200. out[0] = Math.min(a[0], b[0]);
  18201. out[1] = Math.min(a[1], b[1]);
  18202. out[2] = Math.min(a[2], b[2]);
  18203. out[3] = Math.min(a[3], b[3]);
  18204. return out;
  18205. }
  18206. /**
  18207. * Returns the maximum of two vec4's
  18208. *
  18209. * @param {vec4} out the receiving vector
  18210. * @param {ReadonlyVec4} a the first operand
  18211. * @param {ReadonlyVec4} b the second operand
  18212. * @returns {vec4} out
  18213. */
  18214. function max(out, a, b) {
  18215. out[0] = Math.max(a[0], b[0]);
  18216. out[1] = Math.max(a[1], b[1]);
  18217. out[2] = Math.max(a[2], b[2]);
  18218. out[3] = Math.max(a[3], b[3]);
  18219. return out;
  18220. }
  18221. /**
  18222. * Math.round the components of a vec4
  18223. *
  18224. * @param {vec4} out the receiving vector
  18225. * @param {ReadonlyVec4} a vector to round
  18226. * @returns {vec4} out
  18227. */
  18228. function round(out, a) {
  18229. out[0] = Math.round(a[0]);
  18230. out[1] = Math.round(a[1]);
  18231. out[2] = Math.round(a[2]);
  18232. out[3] = Math.round(a[3]);
  18233. return out;
  18234. }
  18235. /**
  18236. * Scales a vec4 by a scalar number
  18237. *
  18238. * @param {vec4} out the receiving vector
  18239. * @param {ReadonlyVec4} a the vector to scale
  18240. * @param {Number} b amount to scale the vector by
  18241. * @returns {vec4} out
  18242. */
  18243. function scale(out, a, b) {
  18244. out[0] = a[0] * b;
  18245. out[1] = a[1] * b;
  18246. out[2] = a[2] * b;
  18247. out[3] = a[3] * b;
  18248. return out;
  18249. }
  18250. /**
  18251. * Adds two vec4's after scaling the second operand by a scalar value
  18252. *
  18253. * @param {vec4} out the receiving vector
  18254. * @param {ReadonlyVec4} a the first operand
  18255. * @param {ReadonlyVec4} b the second operand
  18256. * @param {Number} scale the amount to scale b by before adding
  18257. * @returns {vec4} out
  18258. */
  18259. function scaleAndAdd(out, a, b, scale) {
  18260. out[0] = a[0] + b[0] * scale;
  18261. out[1] = a[1] + b[1] * scale;
  18262. out[2] = a[2] + b[2] * scale;
  18263. out[3] = a[3] + b[3] * scale;
  18264. return out;
  18265. }
  18266. /**
  18267. * Calculates the euclidian distance between two vec4's
  18268. *
  18269. * @param {ReadonlyVec4} a the first operand
  18270. * @param {ReadonlyVec4} b the second operand
  18271. * @returns {Number} distance between a and b
  18272. */
  18273. function distance(a, b) {
  18274. var x = b[0] - a[0];
  18275. var y = b[1] - a[1];
  18276. var z = b[2] - a[2];
  18277. var w = b[3] - a[3];
  18278. return Math.hypot(x, y, z, w);
  18279. }
  18280. /**
  18281. * Calculates the squared euclidian distance between two vec4's
  18282. *
  18283. * @param {ReadonlyVec4} a the first operand
  18284. * @param {ReadonlyVec4} b the second operand
  18285. * @returns {Number} squared distance between a and b
  18286. */
  18287. function squaredDistance(a, b) {
  18288. var x = b[0] - a[0];
  18289. var y = b[1] - a[1];
  18290. var z = b[2] - a[2];
  18291. var w = b[3] - a[3];
  18292. return x * x + y * y + z * z + w * w;
  18293. }
  18294. /**
  18295. * Calculates the length of a vec4
  18296. *
  18297. * @param {ReadonlyVec4} a vector to calculate length of
  18298. * @returns {Number} length of a
  18299. */
  18300. function length(a) {
  18301. var x = a[0];
  18302. var y = a[1];
  18303. var z = a[2];
  18304. var w = a[3];
  18305. return Math.hypot(x, y, z, w);
  18306. }
  18307. /**
  18308. * Calculates the squared length of a vec4
  18309. *
  18310. * @param {ReadonlyVec4} a vector to calculate squared length of
  18311. * @returns {Number} squared length of a
  18312. */
  18313. function squaredLength(a) {
  18314. var x = a[0];
  18315. var y = a[1];
  18316. var z = a[2];
  18317. var w = a[3];
  18318. return x * x + y * y + z * z + w * w;
  18319. }
  18320. /**
  18321. * Negates the components of a vec4
  18322. *
  18323. * @param {vec4} out the receiving vector
  18324. * @param {ReadonlyVec4} a vector to negate
  18325. * @returns {vec4} out
  18326. */
  18327. function negate(out, a) {
  18328. out[0] = -a[0];
  18329. out[1] = -a[1];
  18330. out[2] = -a[2];
  18331. out[3] = -a[3];
  18332. return out;
  18333. }
  18334. /**
  18335. * Returns the inverse of the components of a vec4
  18336. *
  18337. * @param {vec4} out the receiving vector
  18338. * @param {ReadonlyVec4} a vector to invert
  18339. * @returns {vec4} out
  18340. */
  18341. function inverse(out, a) {
  18342. out[0] = 1.0 / a[0];
  18343. out[1] = 1.0 / a[1];
  18344. out[2] = 1.0 / a[2];
  18345. out[3] = 1.0 / a[3];
  18346. return out;
  18347. }
  18348. /**
  18349. * Normalize a vec4
  18350. *
  18351. * @param {vec4} out the receiving vector
  18352. * @param {ReadonlyVec4} a vector to normalize
  18353. * @returns {vec4} out
  18354. */
  18355. function normalize(out, a) {
  18356. var x = a[0];
  18357. var y = a[1];
  18358. var z = a[2];
  18359. var w = a[3];
  18360. var len = x * x + y * y + z * z + w * w;
  18361. if (len > 0) {
  18362. len = 1 / Math.sqrt(len);
  18363. }
  18364. out[0] = x * len;
  18365. out[1] = y * len;
  18366. out[2] = z * len;
  18367. out[3] = w * len;
  18368. return out;
  18369. }
  18370. /**
  18371. * Calculates the dot product of two vec4's
  18372. *
  18373. * @param {ReadonlyVec4} a the first operand
  18374. * @param {ReadonlyVec4} b the second operand
  18375. * @returns {Number} dot product of a and b
  18376. */
  18377. function dot(a, b) {
  18378. return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
  18379. }
  18380. /**
  18381. * Returns the cross-product of three vectors in a 4-dimensional space
  18382. *
  18383. * @param {ReadonlyVec4} result the receiving vector
  18384. * @param {ReadonlyVec4} U the first vector
  18385. * @param {ReadonlyVec4} V the second vector
  18386. * @param {ReadonlyVec4} W the third vector
  18387. * @returns {vec4} result
  18388. */
  18389. function cross(out, u, v, w) {
  18390. var A = v[0] * w[1] - v[1] * w[0],
  18391. B = v[0] * w[2] - v[2] * w[0],
  18392. C = v[0] * w[3] - v[3] * w[0],
  18393. D = v[1] * w[2] - v[2] * w[1],
  18394. E = v[1] * w[3] - v[3] * w[1],
  18395. F = v[2] * w[3] - v[3] * w[2];
  18396. var G = u[0];
  18397. var H = u[1];
  18398. var I = u[2];
  18399. var J = u[3];
  18400. out[0] = H * F - I * E + J * D;
  18401. out[1] = -(G * F) + I * C - J * B;
  18402. out[2] = G * E - H * C + J * A;
  18403. out[3] = -(G * D) + H * B - I * A;
  18404. return out;
  18405. }
  18406. /**
  18407. * Performs a linear interpolation between two vec4's
  18408. *
  18409. * @param {vec4} out the receiving vector
  18410. * @param {ReadonlyVec4} a the first operand
  18411. * @param {ReadonlyVec4} b the second operand
  18412. * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
  18413. * @returns {vec4} out
  18414. */
  18415. function lerp(out, a, b, t) {
  18416. var ax = a[0];
  18417. var ay = a[1];
  18418. var az = a[2];
  18419. var aw = a[3];
  18420. out[0] = ax + t * (b[0] - ax);
  18421. out[1] = ay + t * (b[1] - ay);
  18422. out[2] = az + t * (b[2] - az);
  18423. out[3] = aw + t * (b[3] - aw);
  18424. return out;
  18425. }
  18426. /**
  18427. * Generates a random vector with the given scale
  18428. *
  18429. * @param {vec4} out the receiving vector
  18430. * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
  18431. * @returns {vec4} out
  18432. */
  18433. function random(out, scale) {
  18434. scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a
  18435. // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.
  18436. // http://projecteuclid.org/euclid.aoms/1177692644;
  18437. var v1, v2, v3, v4;
  18438. var s1, s2;
  18439. do {
  18440. v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
  18441. v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
  18442. s1 = v1 * v1 + v2 * v2;
  18443. } while (s1 >= 1);
  18444. do {
  18445. v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
  18446. v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__["RANDOM"]() * 2 - 1;
  18447. s2 = v3 * v3 + v4 * v4;
  18448. } while (s2 >= 1);
  18449. var d = Math.sqrt((1 - s1) / s2);
  18450. out[0] = scale * v1;
  18451. out[1] = scale * v2;
  18452. out[2] = scale * v3 * d;
  18453. out[3] = scale * v4 * d;
  18454. return out;
  18455. }
  18456. /**
  18457. * Transforms the vec4 with a mat4.
  18458. *
  18459. * @param {vec4} out the receiving vector
  18460. * @param {ReadonlyVec4} a the vector to transform
  18461. * @param {ReadonlyMat4} m matrix to transform with
  18462. * @returns {vec4} out
  18463. */
  18464. function transformMat4(out, a, m) {
  18465. var x = a[0],
  18466. y = a[1],
  18467. z = a[2],
  18468. w = a[3];
  18469. out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;
  18470. out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;
  18471. out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;
  18472. out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
  18473. return out;
  18474. }
  18475. /**
  18476. * Transforms the vec4 with a quat
  18477. *
  18478. * @param {vec4} out the receiving vector
  18479. * @param {ReadonlyVec4} a the vector to transform
  18480. * @param {ReadonlyQuat} q quaternion to transform with
  18481. * @returns {vec4} out
  18482. */
  18483. function transformQuat(out, a, q) {
  18484. var x = a[0],
  18485. y = a[1],
  18486. z = a[2];
  18487. var qx = q[0],
  18488. qy = q[1],
  18489. qz = q[2],
  18490. qw = q[3]; // calculate quat * vec
  18491. var ix = qw * x + qy * z - qz * y;
  18492. var iy = qw * y + qz * x - qx * z;
  18493. var iz = qw * z + qx * y - qy * x;
  18494. var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat
  18495. out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
  18496. out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
  18497. out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
  18498. out[3] = a[3];
  18499. return out;
  18500. }
  18501. /**
  18502. * Set the components of a vec4 to zero
  18503. *
  18504. * @param {vec4} out the receiving vector
  18505. * @returns {vec4} out
  18506. */
  18507. function zero(out) {
  18508. out[0] = 0.0;
  18509. out[1] = 0.0;
  18510. out[2] = 0.0;
  18511. out[3] = 0.0;
  18512. return out;
  18513. }
  18514. /**
  18515. * Returns a string representation of a vector
  18516. *
  18517. * @param {ReadonlyVec4} a vector to represent as a string
  18518. * @returns {String} string representation of the vector
  18519. */
  18520. function str(a) {
  18521. return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")";
  18522. }
  18523. /**
  18524. * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
  18525. *
  18526. * @param {ReadonlyVec4} a The first vector.
  18527. * @param {ReadonlyVec4} b The second vector.
  18528. * @returns {Boolean} True if the vectors are equal, false otherwise.
  18529. */
  18530. function exactEquals(a, b) {
  18531. return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];
  18532. }
  18533. /**
  18534. * Returns whether or not the vectors have approximately the same elements in the same position.
  18535. *
  18536. * @param {ReadonlyVec4} a The first vector.
  18537. * @param {ReadonlyVec4} b The second vector.
  18538. * @returns {Boolean} True if the vectors are equal, false otherwise.
  18539. */
  18540. function equals(a, b) {
  18541. var a0 = a[0],
  18542. a1 = a[1],
  18543. a2 = a[2],
  18544. a3 = a[3];
  18545. var b0 = b[0],
  18546. b1 = b[1],
  18547. b2 = b[2],
  18548. b3 = b[3];
  18549. return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__["EPSILON"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));
  18550. }
  18551. /**
  18552. * Alias for {@link vec4.subtract}
  18553. * @function
  18554. */
  18555. var sub = subtract;
  18556. /**
  18557. * Alias for {@link vec4.multiply}
  18558. * @function
  18559. */
  18560. var mul = multiply;
  18561. /**
  18562. * Alias for {@link vec4.divide}
  18563. * @function
  18564. */
  18565. var div = divide;
  18566. /**
  18567. * Alias for {@link vec4.distance}
  18568. * @function
  18569. */
  18570. var dist = distance;
  18571. /**
  18572. * Alias for {@link vec4.squaredDistance}
  18573. * @function
  18574. */
  18575. var sqrDist = squaredDistance;
  18576. /**
  18577. * Alias for {@link vec4.length}
  18578. * @function
  18579. */
  18580. var len = length;
  18581. /**
  18582. * Alias for {@link vec4.squaredLength}
  18583. * @function
  18584. */
  18585. var sqrLen = squaredLength;
  18586. /**
  18587. * Perform some operation over an array of vec4s.
  18588. *
  18589. * @param {Array} a the array of vectors to iterate over
  18590. * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed
  18591. * @param {Number} offset Number of elements to skip at the beginning of the array
  18592. * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array
  18593. * @param {Function} fn Function to call for each vector in the array
  18594. * @param {Object} [arg] additional argument to pass to fn
  18595. * @returns {Array} a
  18596. * @function
  18597. */
  18598. var forEach = function () {
  18599. var vec = create();
  18600. return function (a, stride, offset, count, fn, arg) {
  18601. var i, l;
  18602. if (!stride) {
  18603. stride = 4;
  18604. }
  18605. if (!offset) {
  18606. offset = 0;
  18607. }
  18608. if (count) {
  18609. l = Math.min(count * stride + offset, a.length);
  18610. } else {
  18611. l = a.length;
  18612. }
  18613. for (i = offset; i < l; i += stride) {
  18614. vec[0] = a[i];
  18615. vec[1] = a[i + 1];
  18616. vec[2] = a[i + 2];
  18617. vec[3] = a[i + 3];
  18618. fn(vec, vec, arg);
  18619. a[i] = vec[0];
  18620. a[i + 1] = vec[1];
  18621. a[i + 2] = vec[2];
  18622. a[i + 3] = vec[3];
  18623. }
  18624. return a;
  18625. };
  18626. }();
  18627. /***/ }),
  18628. /***/ "./node_modules/_process@0.11.10@process/browser.js":
  18629. /*!**********************************************************!*\
  18630. !*** ./node_modules/_process@0.11.10@process/browser.js ***!
  18631. \**********************************************************/
  18632. /*! no static exports found */
  18633. /***/ (function(module, exports) {
  18634. // shim for using process in browser
  18635. var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
  18636. // don't break things. But we need to wrap it in a try catch in case it is
  18637. // wrapped in strict mode code which doesn't define any globals. It's inside a
  18638. // function because try/catches deoptimize in certain engines.
  18639. var cachedSetTimeout;
  18640. var cachedClearTimeout;
  18641. function defaultSetTimout() {
  18642. throw new Error('setTimeout has not been defined');
  18643. }
  18644. function defaultClearTimeout() {
  18645. throw new Error('clearTimeout has not been defined');
  18646. }
  18647. (function () {
  18648. try {
  18649. if (typeof setTimeout === 'function') {
  18650. cachedSetTimeout = setTimeout;
  18651. } else {
  18652. cachedSetTimeout = defaultSetTimout;
  18653. }
  18654. } catch (e) {
  18655. cachedSetTimeout = defaultSetTimout;
  18656. }
  18657. try {
  18658. if (typeof clearTimeout === 'function') {
  18659. cachedClearTimeout = clearTimeout;
  18660. } else {
  18661. cachedClearTimeout = defaultClearTimeout;
  18662. }
  18663. } catch (e) {
  18664. cachedClearTimeout = defaultClearTimeout;
  18665. }
  18666. })();
  18667. function runTimeout(fun) {
  18668. if (cachedSetTimeout === setTimeout) {
  18669. //normal enviroments in sane situations
  18670. return setTimeout(fun, 0);
  18671. } // if setTimeout wasn't available but was latter defined
  18672. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  18673. cachedSetTimeout = setTimeout;
  18674. return setTimeout(fun, 0);
  18675. }
  18676. try {
  18677. // when when somebody has screwed with setTimeout but no I.E. maddness
  18678. return cachedSetTimeout(fun, 0);
  18679. } catch (e) {
  18680. try {
  18681. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  18682. return cachedSetTimeout.call(null, fun, 0);
  18683. } catch (e) {
  18684. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  18685. return cachedSetTimeout.call(this, fun, 0);
  18686. }
  18687. }
  18688. }
  18689. function runClearTimeout(marker) {
  18690. if (cachedClearTimeout === clearTimeout) {
  18691. //normal enviroments in sane situations
  18692. return clearTimeout(marker);
  18693. } // if clearTimeout wasn't available but was latter defined
  18694. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  18695. cachedClearTimeout = clearTimeout;
  18696. return clearTimeout(marker);
  18697. }
  18698. try {
  18699. // when when somebody has screwed with setTimeout but no I.E. maddness
  18700. return cachedClearTimeout(marker);
  18701. } catch (e) {
  18702. try {
  18703. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  18704. return cachedClearTimeout.call(null, marker);
  18705. } catch (e) {
  18706. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  18707. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  18708. return cachedClearTimeout.call(this, marker);
  18709. }
  18710. }
  18711. }
  18712. var queue = [];
  18713. var draining = false;
  18714. var currentQueue;
  18715. var queueIndex = -1;
  18716. function cleanUpNextTick() {
  18717. if (!draining || !currentQueue) {
  18718. return;
  18719. }
  18720. draining = false;
  18721. if (currentQueue.length) {
  18722. queue = currentQueue.concat(queue);
  18723. } else {
  18724. queueIndex = -1;
  18725. }
  18726. if (queue.length) {
  18727. drainQueue();
  18728. }
  18729. }
  18730. function drainQueue() {
  18731. if (draining) {
  18732. return;
  18733. }
  18734. var timeout = runTimeout(cleanUpNextTick);
  18735. draining = true;
  18736. var len = queue.length;
  18737. while (len) {
  18738. currentQueue = queue;
  18739. queue = [];
  18740. while (++queueIndex < len) {
  18741. if (currentQueue) {
  18742. currentQueue[queueIndex].run();
  18743. }
  18744. }
  18745. queueIndex = -1;
  18746. len = queue.length;
  18747. }
  18748. currentQueue = null;
  18749. draining = false;
  18750. runClearTimeout(timeout);
  18751. }
  18752. process.nextTick = function (fun) {
  18753. var args = new Array(arguments.length - 1);
  18754. if (arguments.length > 1) {
  18755. for (var i = 1; i < arguments.length; i++) {
  18756. args[i - 1] = arguments[i];
  18757. }
  18758. }
  18759. queue.push(new Item(fun, args));
  18760. if (queue.length === 1 && !draining) {
  18761. runTimeout(drainQueue);
  18762. }
  18763. }; // v8 likes predictible objects
  18764. function Item(fun, array) {
  18765. this.fun = fun;
  18766. this.array = array;
  18767. }
  18768. Item.prototype.run = function () {
  18769. this.fun.apply(null, this.array);
  18770. };
  18771. process.title = 'browser';
  18772. process.browser = true;
  18773. process.env = {};
  18774. process.argv = [];
  18775. process.version = ''; // empty string to avoid regexp issues
  18776. process.versions = {};
  18777. function noop() {}
  18778. process.on = noop;
  18779. process.addListener = noop;
  18780. process.once = noop;
  18781. process.off = noop;
  18782. process.removeListener = noop;
  18783. process.removeAllListeners = noop;
  18784. process.emit = noop;
  18785. process.prependListener = noop;
  18786. process.prependOnceListener = noop;
  18787. process.listeners = function (name) {
  18788. return [];
  18789. };
  18790. process.binding = function (name) {
  18791. throw new Error('process.binding is not supported');
  18792. };
  18793. process.cwd = function () {
  18794. return '/';
  18795. };
  18796. process.chdir = function (dir) {
  18797. throw new Error('process.chdir is not supported');
  18798. };
  18799. process.umask = function () {
  18800. return 0;
  18801. };
  18802. /***/ }),
  18803. /***/ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js":
  18804. /*!*******************************************************!*\
  18805. !*** ./node_modules/_tslib@1.13.0@tslib/tslib.es6.js ***!
  18806. \*******************************************************/
  18807. /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
  18808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18809. "use strict";
  18810. __webpack_require__.r(__webpack_exports__);
  18811. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
  18812. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
  18813. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
  18814. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
  18815. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
  18816. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
  18817. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
  18818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
  18819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
  18820. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
  18821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
  18822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
  18823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
  18824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
  18825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
  18826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
  18827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
  18828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
  18829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
  18830. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
  18831. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
  18832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
  18833. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
  18834. /*! *****************************************************************************
  18835. Copyright (c) Microsoft Corporation.
  18836. Permission to use, copy, modify, and/or distribute this software for any
  18837. purpose with or without fee is hereby granted.
  18838. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  18839. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  18840. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  18841. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  18842. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  18843. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  18844. PERFORMANCE OF THIS SOFTWARE.
  18845. ***************************************************************************** */
  18846. /* global Reflect, Promise */
  18847. var extendStatics = function (d, b) {
  18848. extendStatics = Object.setPrototypeOf || {
  18849. __proto__: []
  18850. } instanceof Array && function (d, b) {
  18851. d.__proto__ = b;
  18852. } || function (d, b) {
  18853. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  18854. };
  18855. return extendStatics(d, b);
  18856. };
  18857. function __extends(d, b) {
  18858. extendStatics(d, b);
  18859. function __() {
  18860. this.constructor = d;
  18861. }
  18862. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  18863. }
  18864. var __assign = function () {
  18865. __assign = Object.assign || function __assign(t) {
  18866. for (var s, i = 1, n = arguments.length; i < n; i++) {
  18867. s = arguments[i];
  18868. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  18869. }
  18870. return t;
  18871. };
  18872. return __assign.apply(this, arguments);
  18873. };
  18874. function __rest(s, e) {
  18875. var t = {};
  18876. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  18877. if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  18878. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  18879. }
  18880. return t;
  18881. }
  18882. function __decorate(decorators, target, key, desc) {
  18883. var c = arguments.length,
  18884. r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
  18885. d;
  18886. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  18887. return c > 3 && r && Object.defineProperty(target, key, r), r;
  18888. }
  18889. function __param(paramIndex, decorator) {
  18890. return function (target, key) {
  18891. decorator(target, key, paramIndex);
  18892. };
  18893. }
  18894. function __metadata(metadataKey, metadataValue) {
  18895. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  18896. }
  18897. function __awaiter(thisArg, _arguments, P, generator) {
  18898. function adopt(value) {
  18899. return value instanceof P ? value : new P(function (resolve) {
  18900. resolve(value);
  18901. });
  18902. }
  18903. return new (P || (P = Promise))(function (resolve, reject) {
  18904. function fulfilled(value) {
  18905. try {
  18906. step(generator.next(value));
  18907. } catch (e) {
  18908. reject(e);
  18909. }
  18910. }
  18911. function rejected(value) {
  18912. try {
  18913. step(generator["throw"](value));
  18914. } catch (e) {
  18915. reject(e);
  18916. }
  18917. }
  18918. function step(result) {
  18919. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  18920. }
  18921. step((generator = generator.apply(thisArg, _arguments || [])).next());
  18922. });
  18923. }
  18924. function __generator(thisArg, body) {
  18925. var _ = {
  18926. label: 0,
  18927. sent: function () {
  18928. if (t[0] & 1) throw t[1];
  18929. return t[1];
  18930. },
  18931. trys: [],
  18932. ops: []
  18933. },
  18934. f,
  18935. y,
  18936. t,
  18937. g;
  18938. return g = {
  18939. next: verb(0),
  18940. "throw": verb(1),
  18941. "return": verb(2)
  18942. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  18943. return this;
  18944. }), g;
  18945. function verb(n) {
  18946. return function (v) {
  18947. return step([n, v]);
  18948. };
  18949. }
  18950. function step(op) {
  18951. if (f) throw new TypeError("Generator is already executing.");
  18952. while (_) try {
  18953. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  18954. if (y = 0, t) op = [op[0] & 2, t.value];
  18955. switch (op[0]) {
  18956. case 0:
  18957. case 1:
  18958. t = op;
  18959. break;
  18960. case 4:
  18961. _.label++;
  18962. return {
  18963. value: op[1],
  18964. done: false
  18965. };
  18966. case 5:
  18967. _.label++;
  18968. y = op[1];
  18969. op = [0];
  18970. continue;
  18971. case 7:
  18972. op = _.ops.pop();
  18973. _.trys.pop();
  18974. continue;
  18975. default:
  18976. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  18977. _ = 0;
  18978. continue;
  18979. }
  18980. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  18981. _.label = op[1];
  18982. break;
  18983. }
  18984. if (op[0] === 6 && _.label < t[1]) {
  18985. _.label = t[1];
  18986. t = op;
  18987. break;
  18988. }
  18989. if (t && _.label < t[2]) {
  18990. _.label = t[2];
  18991. _.ops.push(op);
  18992. break;
  18993. }
  18994. if (t[2]) _.ops.pop();
  18995. _.trys.pop();
  18996. continue;
  18997. }
  18998. op = body.call(thisArg, _);
  18999. } catch (e) {
  19000. op = [6, e];
  19001. y = 0;
  19002. } finally {
  19003. f = t = 0;
  19004. }
  19005. if (op[0] & 5) throw op[1];
  19006. return {
  19007. value: op[0] ? op[1] : void 0,
  19008. done: true
  19009. };
  19010. }
  19011. }
  19012. function __createBinding(o, m, k, k2) {
  19013. if (k2 === undefined) k2 = k;
  19014. o[k2] = m[k];
  19015. }
  19016. function __exportStar(m, exports) {
  19017. for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
  19018. }
  19019. function __values(o) {
  19020. var s = typeof Symbol === "function" && Symbol.iterator,
  19021. m = s && o[s],
  19022. i = 0;
  19023. if (m) return m.call(o);
  19024. if (o && typeof o.length === "number") return {
  19025. next: function () {
  19026. if (o && i >= o.length) o = void 0;
  19027. return {
  19028. value: o && o[i++],
  19029. done: !o
  19030. };
  19031. }
  19032. };
  19033. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  19034. }
  19035. function __read(o, n) {
  19036. var m = typeof Symbol === "function" && o[Symbol.iterator];
  19037. if (!m) return o;
  19038. var i = m.call(o),
  19039. r,
  19040. ar = [],
  19041. e;
  19042. try {
  19043. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  19044. } catch (error) {
  19045. e = {
  19046. error: error
  19047. };
  19048. } finally {
  19049. try {
  19050. if (r && !r.done && (m = i["return"])) m.call(i);
  19051. } finally {
  19052. if (e) throw e.error;
  19053. }
  19054. }
  19055. return ar;
  19056. }
  19057. function __spread() {
  19058. for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
  19059. return ar;
  19060. }
  19061. function __spreadArrays() {
  19062. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  19063. for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
  19064. return r;
  19065. }
  19066. ;
  19067. function __await(v) {
  19068. return this instanceof __await ? (this.v = v, this) : new __await(v);
  19069. }
  19070. function __asyncGenerator(thisArg, _arguments, generator) {
  19071. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  19072. var g = generator.apply(thisArg, _arguments || []),
  19073. i,
  19074. q = [];
  19075. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
  19076. return this;
  19077. }, i;
  19078. function verb(n) {
  19079. if (g[n]) i[n] = function (v) {
  19080. return new Promise(function (a, b) {
  19081. q.push([n, v, a, b]) > 1 || resume(n, v);
  19082. });
  19083. };
  19084. }
  19085. function resume(n, v) {
  19086. try {
  19087. step(g[n](v));
  19088. } catch (e) {
  19089. settle(q[0][3], e);
  19090. }
  19091. }
  19092. function step(r) {
  19093. r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  19094. }
  19095. function fulfill(value) {
  19096. resume("next", value);
  19097. }
  19098. function reject(value) {
  19099. resume("throw", value);
  19100. }
  19101. function settle(f, v) {
  19102. if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  19103. }
  19104. }
  19105. function __asyncDelegator(o) {
  19106. var i, p;
  19107. return i = {}, verb("next"), verb("throw", function (e) {
  19108. throw e;
  19109. }), verb("return"), i[Symbol.iterator] = function () {
  19110. return this;
  19111. }, i;
  19112. function verb(n, f) {
  19113. i[n] = o[n] ? function (v) {
  19114. return (p = !p) ? {
  19115. value: __await(o[n](v)),
  19116. done: n === "return"
  19117. } : f ? f(v) : v;
  19118. } : f;
  19119. }
  19120. }
  19121. function __asyncValues(o) {
  19122. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  19123. var m = o[Symbol.asyncIterator],
  19124. i;
  19125. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
  19126. return this;
  19127. }, i);
  19128. function verb(n) {
  19129. i[n] = o[n] && function (v) {
  19130. return new Promise(function (resolve, reject) {
  19131. v = o[n](v), settle(resolve, reject, v.done, v.value);
  19132. });
  19133. };
  19134. }
  19135. function settle(resolve, reject, d, v) {
  19136. Promise.resolve(v).then(function (v) {
  19137. resolve({
  19138. value: v,
  19139. done: d
  19140. });
  19141. }, reject);
  19142. }
  19143. }
  19144. function __makeTemplateObject(cooked, raw) {
  19145. if (Object.defineProperty) {
  19146. Object.defineProperty(cooked, "raw", {
  19147. value: raw
  19148. });
  19149. } else {
  19150. cooked.raw = raw;
  19151. }
  19152. return cooked;
  19153. }
  19154. ;
  19155. function __importStar(mod) {
  19156. if (mod && mod.__esModule) return mod;
  19157. var result = {};
  19158. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  19159. result.default = mod;
  19160. return result;
  19161. }
  19162. function __importDefault(mod) {
  19163. return mod && mod.__esModule ? mod : {
  19164. default: mod
  19165. };
  19166. }
  19167. function __classPrivateFieldGet(receiver, privateMap) {
  19168. if (!privateMap.has(receiver)) {
  19169. throw new TypeError("attempted to get private field on non-instance");
  19170. }
  19171. return privateMap.get(receiver);
  19172. }
  19173. function __classPrivateFieldSet(receiver, privateMap, value) {
  19174. if (!privateMap.has(receiver)) {
  19175. throw new TypeError("attempted to set private field on non-instance");
  19176. }
  19177. privateMap.set(receiver, value);
  19178. return value;
  19179. }
  19180. /***/ }),
  19181. /***/ "./package.json":
  19182. /*!**********************!*\
  19183. !*** ./package.json ***!
  19184. \**********************/
  19185. /*! exports provided: name, version, description, main, module, unpkg, types, files, scripts, repository, keywords, publishConfig, author, license, bugs, devDependencies, homepage, dependencies, __npminstall_done, default */
  19186. /***/ (function(module) {
  19187. module.exports = JSON.parse("{\"name\":\"@antv/g-canvas\",\"version\":\"0.5.0-beta.1\",\"description\":\"A canvas library which providing 2d\",\"main\":\"lib/index.js\",\"module\":\"esm/index.js\",\"unpkg\":\"dist/g.min.js\",\"types\":\"lib/index.d.ts\",\"files\":[\"package.json\",\"esm\",\"lib\",\"dist\",\"LICENSE\",\"README.md\"],\"scripts\":{\"build\":\"npm run clean && run-p build:*\",\"buildx\":\"run-p build:*\",\"build:esm\":\"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm\",\"build:cjs\":\"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib\",\"build:umd\":\"webpack --config webpack.config.js --mode development\",\"clean\":\"rm -rf esm lib dist\",\"coverage\":\"npm run coverage-generator && npm run coverage-viewer\",\"coverage-generator\":\"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts\",\"coverage-viewer\":\"torch-coverage\",\"test\":\"torch --renderer --compile --opts tests/mocha.opts\",\"test-live\":\"torch --compile --interactive tests/unit/\",\"tsc\":\"tsc --noEmit\",\"typecheck\":\"tsc --noEmit\",\"dist\":\"webpack --config webpack.config.js --mode production\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/antvis/g.git\"},\"keywords\":[\"util\",\"antv\",\"g\"],\"publishConfig\":{\"access\":\"public\"},\"author\":\"https://github.com/orgs/antvis/people\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/antvis/g/issues\"},\"devDependencies\":{\"@antv/torch\":\"^1.0.0\",\"less\":\"^3.9.0\",\"npm-run-all\":\"^4.1.5\",\"webpack\":\"^4.26.1\",\"webpack-cli\":\"^3.1.2\"},\"homepage\":\"https://github.com/antvis/g#readme\",\"dependencies\":{\"@antv/g-base\":\"^0.5.0-beta.1\",\"@antv/g-math\":\"^0.1.3\",\"@antv/matrix-util\":\"^3.0.2\",\"@antv/path-util\":\"~2.0.5\",\"@antv/util\":\"~2.0.0\",\"gl-matrix\":\"^3.0.0\"},\"__npminstall_done\":false}");
  19188. /***/ }),
  19189. /***/ "./src/canvas.ts":
  19190. /*!***********************!*\
  19191. !*** ./src/canvas.ts ***!
  19192. \***********************/
  19193. /*! no static exports found */
  19194. /***/ (function(module, exports, __webpack_require__) {
  19195. "use strict";
  19196. Object.defineProperty(exports, "__esModule", { value: true });
  19197. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19198. var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
  19199. var hit_1 = __webpack_require__(/*! ./util/hit */ "./src/util/hit.ts");
  19200. var Shape = __webpack_require__(/*! ./shape */ "./src/shape/index.ts");
  19201. var group_1 = __webpack_require__(/*! ./group */ "./src/group.ts");
  19202. var draw_1 = __webpack_require__(/*! ./util/draw */ "./src/util/draw.ts");
  19203. var util_1 = __webpack_require__(/*! ./util/util */ "./src/util/util.ts");
  19204. var Canvas = /** @class */ (function (_super) {
  19205. tslib_1.__extends(Canvas, _super);
  19206. function Canvas() {
  19207. return _super !== null && _super.apply(this, arguments) || this;
  19208. }
  19209. Canvas.prototype.getDefaultCfg = function () {
  19210. var cfg = _super.prototype.getDefaultCfg.call(this);
  19211. // 设置渲染引擎为 canvas,只读属性
  19212. cfg['renderer'] = 'canvas';
  19213. // 是否自动绘制,不需要用户调用 draw 方法
  19214. cfg['autoDraw'] = true;
  19215. // 是否允许局部刷新图表
  19216. cfg['localRefresh'] = true;
  19217. cfg['refreshElements'] = [];
  19218. // 是否在视图内自动裁剪
  19219. cfg['clipView'] = true;
  19220. // 是否使用快速拾取的方案,默认为 false,上层可以打开
  19221. cfg['quickHit'] = false;
  19222. return cfg;
  19223. };
  19224. /**
  19225. * 一些方法调用会引起画布变化
  19226. * @param {ChangeType} changeType 改变的类型
  19227. */
  19228. Canvas.prototype.onCanvasChange = function (changeType) {
  19229. /**
  19230. * 触发画布更新的三种 changeType
  19231. * 1. attr: 修改画布的绘图属性
  19232. * 2. sort: 画布排序,图形的层次会发生变化
  19233. * 3. changeSize: 改变画布大小
  19234. */
  19235. if (changeType === 'attr' || changeType === 'sort' || changeType === 'changeSize') {
  19236. this.set('refreshElements', [this]);
  19237. this.draw();
  19238. }
  19239. };
  19240. Canvas.prototype.getShapeBase = function () {
  19241. return Shape;
  19242. };
  19243. Canvas.prototype.getGroupBase = function () {
  19244. return group_1.default;
  19245. };
  19246. /**
  19247. * 获取屏幕像素比
  19248. */
  19249. Canvas.prototype.getPixelRatio = function () {
  19250. var pixelRatio = this.get('pixelRatio') || util_1.getPixelRatio();
  19251. // 不足 1 的取 1,超出 1 的取整
  19252. return pixelRatio >= 1 ? Math.floor(pixelRatio) : 1;
  19253. };
  19254. Canvas.prototype.getViewRange = function () {
  19255. return {
  19256. minX: 0,
  19257. minY: 0,
  19258. maxX: this.cfg.width,
  19259. maxY: this.cfg.height,
  19260. };
  19261. };
  19262. // 复写基类的方法生成标签
  19263. Canvas.prototype.createDom = function () {
  19264. var element = document.createElement('canvas');
  19265. var context = element.getContext('2d');
  19266. // 缓存 context 对象
  19267. this.set('context', context);
  19268. return element;
  19269. };
  19270. Canvas.prototype.setDOMSize = function (width, height) {
  19271. _super.prototype.setDOMSize.call(this, width, height);
  19272. var context = this.get('context');
  19273. var el = this.get('el');
  19274. var pixelRatio = this.getPixelRatio();
  19275. el.width = pixelRatio * width;
  19276. el.height = pixelRatio * height;
  19277. // 设置 canvas 元素的宽度和高度,会重置缩放,因此 context.scale 需要在每次设置宽、高后调用
  19278. if (pixelRatio > 1) {
  19279. context.scale(pixelRatio, pixelRatio);
  19280. }
  19281. };
  19282. // 复写基类方法
  19283. Canvas.prototype.clear = function () {
  19284. _super.prototype.clear.call(this);
  19285. this._clearFrame(); // 需要清理掉延迟绘制的帧
  19286. var context = this.get('context');
  19287. var element = this.get('el');
  19288. context.clearRect(0, 0, element.width, element.height);
  19289. };
  19290. Canvas.prototype.getShape = function (x, y) {
  19291. var shape;
  19292. if (this.get('quickHit')) {
  19293. shape = hit_1.getShape(this, x, y);
  19294. }
  19295. else {
  19296. shape = _super.prototype.getShape.call(this, x, y, null);
  19297. }
  19298. return shape;
  19299. };
  19300. // 对绘制区域边缘取整,避免浮点数问题
  19301. Canvas.prototype._getRefreshRegion = function () {
  19302. var elements = this.get('refreshElements');
  19303. var viewRegion = this.getViewRange();
  19304. var region;
  19305. // 如果是当前画布整体发生了变化,则直接重绘整个画布
  19306. if (elements.length && elements[0] === this) {
  19307. region = viewRegion;
  19308. }
  19309. else {
  19310. region = draw_1.getMergedRegion(elements);
  19311. if (region) {
  19312. region.minX = Math.floor(region.minX);
  19313. region.minY = Math.floor(region.minY);
  19314. region.maxX = Math.ceil(region.maxX);
  19315. region.maxY = Math.ceil(region.maxY);
  19316. var clipView = this.get('clipView');
  19317. // 自动裁剪不在 view 内的区域
  19318. if (clipView) {
  19319. region = draw_1.mergeView(region, viewRegion);
  19320. }
  19321. }
  19322. }
  19323. return region;
  19324. };
  19325. /**
  19326. * 刷新图形元素,这里仅仅是放入队列,下次绘制时进行绘制
  19327. * @param {IElement} element 图形元素
  19328. */
  19329. Canvas.prototype.refreshElement = function (element) {
  19330. var refreshElements = this.get('refreshElements');
  19331. refreshElements.push(element);
  19332. // if (this.get('autoDraw')) {
  19333. // this._startDraw();
  19334. // }
  19335. };
  19336. // 清理还在进行的绘制
  19337. Canvas.prototype._clearFrame = function () {
  19338. var drawFrame = this.get('drawFrame');
  19339. if (drawFrame) {
  19340. // 如果全部渲染时,存在局部渲染,则抛弃掉局部渲染
  19341. util_1.clearAnimationFrame(drawFrame);
  19342. this.set('drawFrame', null);
  19343. this.set('refreshElements', []);
  19344. }
  19345. };
  19346. // 手工调用绘制接口
  19347. Canvas.prototype.draw = function () {
  19348. var drawFrame = this.get('drawFrame');
  19349. if (this.get('autoDraw') && drawFrame) {
  19350. return;
  19351. }
  19352. this._startDraw();
  19353. };
  19354. // 绘制所有图形
  19355. Canvas.prototype._drawAll = function () {
  19356. var context = this.get('context');
  19357. var element = this.get('el');
  19358. var children = this.getChildren();
  19359. context.clearRect(0, 0, element.width, element.height);
  19360. draw_1.applyAttrsToContext(context, this);
  19361. draw_1.drawChildren(context, children);
  19362. // 对于 https://github.com/antvis/g/issues/422 的场景,全局渲染的模式下也会记录更新的元素队列,因此全局渲染完后也需要置空
  19363. this.set('refreshElements', []);
  19364. };
  19365. // 绘制局部
  19366. Canvas.prototype._drawRegion = function () {
  19367. var context = this.get('context');
  19368. var children = this.getChildren();
  19369. var region = this._getRefreshRegion();
  19370. var refreshElements = this.get('refreshElements');
  19371. // 需要注意可能没有 region 的场景
  19372. // 一般发生在设置了 localRefresh ,在没有图形发生变化的情况下,用户调用了 draw
  19373. if (region) {
  19374. // 清理指定区域
  19375. context.clearRect(region.minX, region.minY, region.maxX - region.minX, region.maxY - region.minY);
  19376. // 保存上下文,设置 clip
  19377. context.save();
  19378. context.beginPath();
  19379. context.rect(region.minX, region.minY, region.maxX - region.minX, region.maxY - region.minY);
  19380. context.clip();
  19381. draw_1.applyAttrsToContext(context, this);
  19382. // 确认更新的元素,这个优化可以提升 10 倍左右的性能,10W 个带有 group 的节点,局部渲染会从 90ms 下降到 5-6 ms
  19383. draw_1.checkRefresh(this, children, region);
  19384. // 绘制子元素
  19385. draw_1.drawChildren(context, children, region);
  19386. context.restore();
  19387. }
  19388. else if (refreshElements.length) {
  19389. // 防止发生改变的 elements 没有 region 的场景,这会发生在多个情况下
  19390. // 1. 空的 group
  19391. // 2. 所有 elements 没有在绘图区域
  19392. // 3. group 下面的 elements 隐藏掉
  19393. // 如果不进行清理 hasChanged 的状态会不正确
  19394. draw_1.clearChanged(refreshElements);
  19395. }
  19396. this.set('refreshElements', []);
  19397. };
  19398. // 触发绘制
  19399. Canvas.prototype._startDraw = function () {
  19400. var _this = this;
  19401. var drawFrame = this.get('drawFrame');
  19402. if (!drawFrame) {
  19403. drawFrame = util_1.requestAnimationFrame(function () {
  19404. if (_this.get('localRefresh')) {
  19405. _this._drawRegion();
  19406. }
  19407. else {
  19408. _this._drawAll();
  19409. }
  19410. _this.set('drawFrame', null);
  19411. });
  19412. this.set('drawFrame', drawFrame);
  19413. }
  19414. };
  19415. Canvas.prototype.skipDraw = function () { };
  19416. return Canvas;
  19417. }(g_base_1.AbstractCanvas));
  19418. exports.default = Canvas;
  19419. /***/ }),
  19420. /***/ "./src/group.ts":
  19421. /*!**********************!*\
  19422. !*** ./src/group.ts ***!
  19423. \**********************/
  19424. /*! no static exports found */
  19425. /***/ (function(module, exports, __webpack_require__) {
  19426. "use strict";
  19427. Object.defineProperty(exports, "__esModule", { value: true });
  19428. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19429. var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
  19430. var Shape = __webpack_require__(/*! ./shape */ "./src/shape/index.ts");
  19431. var draw_1 = __webpack_require__(/*! ./util/draw */ "./src/util/draw.ts");
  19432. var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  19433. var util_2 = __webpack_require__(/*! ./util/util */ "./src/util/util.ts");
  19434. var Group = /** @class */ (function (_super) {
  19435. tslib_1.__extends(Group, _super);
  19436. function Group() {
  19437. return _super !== null && _super.apply(this, arguments) || this;
  19438. }
  19439. /**
  19440. * 一些方法调用会引起画布变化
  19441. * @param {ChangeType} changeType 改变的类型
  19442. */
  19443. Group.prototype.onCanvasChange = function (changeType) {
  19444. draw_1.refreshElement(this, changeType);
  19445. };
  19446. Group.prototype.getShapeBase = function () {
  19447. return Shape;
  19448. };
  19449. Group.prototype.getGroupBase = function () {
  19450. return Group;
  19451. };
  19452. // 同 shape 中的方法重复了
  19453. Group.prototype._applyClip = function (context, clip) {
  19454. if (clip) {
  19455. context.save();
  19456. // 将 clip 的属性挂载到 context 上
  19457. draw_1.applyAttrsToContext(context, clip);
  19458. // 绘制 clip 路径
  19459. clip.createPath(context);
  19460. context.restore();
  19461. // 裁剪
  19462. context.clip();
  19463. clip._afterDraw();
  19464. }
  19465. };
  19466. // 这个方法以前直接使用的 getCanvasBBox,由于 group 上没有缓存,所以每次重新计算,导致性能开销比较大
  19467. // 大概能够节省全局渲染 15-20% 的性能,如果不在这里加缓存优化后 10W 个节点无法达到 5-6 ms,大概能够 30-40ms
  19468. Group.prototype.cacheCanvasBBox = function () {
  19469. var children = this.cfg.children;
  19470. var xArr = [];
  19471. var yArr = [];
  19472. util_1.each(children, function (child) {
  19473. var bbox = child.cfg.cacheCanvasBBox;
  19474. // isInview 的判定是一旦图形或者分组渲染就要计算是否在视图内,
  19475. // 这个判定 10W 个图形下差不多能够节省 5-6 ms 的开销
  19476. if (bbox && child.cfg.isInView) {
  19477. xArr.push(bbox.minX, bbox.maxX);
  19478. yArr.push(bbox.minY, bbox.maxY);
  19479. }
  19480. });
  19481. var bbox = null;
  19482. if (xArr.length) {
  19483. var minX = Math.min.apply(null, xArr);
  19484. var maxX = Math.max.apply(null, xArr);
  19485. var minY = Math.min.apply(null, yArr);
  19486. var maxY = Math.max.apply(null, yArr);
  19487. bbox = {
  19488. minX: minX,
  19489. minY: minY,
  19490. x: minX,
  19491. y: minY,
  19492. maxX: maxX,
  19493. maxY: maxY,
  19494. width: maxX - minX,
  19495. height: maxY - minY,
  19496. };
  19497. var canvas = this.cfg.canvas;
  19498. if (canvas) {
  19499. var viewRange = canvas.getViewRange();
  19500. // 如果这个地方判定 isInView == false 设置 bbox 为 false 的话,拾取的性能会更高
  19501. // 但是目前 10W 图形的拾取在 2-5ms 内,这个优化意义不大,可以后期观察再看
  19502. this.set('isInView', util_2.intersectRect(bbox, viewRange));
  19503. }
  19504. }
  19505. else {
  19506. this.set('isInView', false);
  19507. }
  19508. this.set('cacheCanvasBBox', bbox);
  19509. };
  19510. Group.prototype.draw = function (context, region) {
  19511. var children = this.cfg.children;
  19512. var allowDraw = region ? this.cfg.refresh : true; // 局部刷新需要判定
  19513. // 这个地方需要判定,在 G6 的场景每个 group 都有 transform 的场景下性能会开销非常大
  19514. // 通过 refresh 的判定,可以不刷新没有发生过变化的分组,不在视窗内的分组等等
  19515. // 如果想进一步提升局部渲染性能,可以进一步优化 refresh 的判定,依然有潜力
  19516. if (children.length && allowDraw) {
  19517. context.save();
  19518. // group 上的矩阵和属性也会应用到上下文上
  19519. // 先将 attrs 应用到上下文中,再设置 clip。因为 clip 应该被当前元素的 matrix 所影响
  19520. draw_1.applyAttrsToContext(context, this);
  19521. this._applyClip(context, this.getClip());
  19522. draw_1.drawChildren(context, children, region);
  19523. context.restore();
  19524. this.cacheCanvasBBox();
  19525. }
  19526. // 这里的成本比较大,如果不绘制则不再
  19527. // this.set('cacheCanvasBBox', this.getCanvasBBox());
  19528. this.cfg.refresh = null;
  19529. // 绘制后,消除更新标记
  19530. this.set('hasChanged', false);
  19531. };
  19532. // 绘制时被跳过,一般发生在分组隐藏时
  19533. Group.prototype.skipDraw = function () {
  19534. this.set('cacheCanvasBBox', null);
  19535. this.set('hasChanged', false);
  19536. };
  19537. return Group;
  19538. }(g_base_1.AbstractGroup));
  19539. exports.default = Group;
  19540. /***/ }),
  19541. /***/ "./src/index.ts":
  19542. /*!**********************!*\
  19543. !*** ./src/index.ts ***!
  19544. \**********************/
  19545. /*! no static exports found */
  19546. /***/ (function(module, exports, __webpack_require__) {
  19547. "use strict";
  19548. Object.defineProperty(exports, "__esModule", { value: true });
  19549. exports.Shape = exports.version = void 0;
  19550. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19551. var Shape = __webpack_require__(/*! ./shape */ "./src/shape/index.ts");
  19552. exports.Shape = Shape;
  19553. var pkg = __webpack_require__(/*! ../package.json */ "./package.json");
  19554. exports.version = pkg.version;
  19555. tslib_1.__exportStar(__webpack_require__(/*! ./types */ "./src/types.ts"), exports);
  19556. tslib_1.__exportStar(__webpack_require__(/*! ./interfaces */ "./src/interfaces.ts"), exports);
  19557. var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
  19558. Object.defineProperty(exports, "Event", { enumerable: true, get: function () { return g_base_1.Event; } });
  19559. var canvas_1 = __webpack_require__(/*! ./canvas */ "./src/canvas.ts");
  19560. Object.defineProperty(exports, "Canvas", { enumerable: true, get: function () { return canvas_1.default; } });
  19561. var group_1 = __webpack_require__(/*! ./group */ "./src/group.ts");
  19562. Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return group_1.default; } });
  19563. /***/ }),
  19564. /***/ "./src/interfaces.ts":
  19565. /*!***************************!*\
  19566. !*** ./src/interfaces.ts ***!
  19567. \***************************/
  19568. /*! no static exports found */
  19569. /***/ (function(module, exports, __webpack_require__) {
  19570. "use strict";
  19571. Object.defineProperty(exports, "__esModule", { value: true });
  19572. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19573. // 导出 g-base 中的 interfaces
  19574. tslib_1.__exportStar(__webpack_require__(/*! @antv/g-base/lib/interfaces */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/interfaces.js"), exports);
  19575. /***/ }),
  19576. /***/ "./src/shape/base.ts":
  19577. /*!***************************!*\
  19578. !*** ./src/shape/base.ts ***!
  19579. \***************************/
  19580. /*! no static exports found */
  19581. /***/ (function(module, exports, __webpack_require__) {
  19582. "use strict";
  19583. Object.defineProperty(exports, "__esModule", { value: true });
  19584. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19585. var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
  19586. var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
  19587. var draw_1 = __webpack_require__(/*! ../util/draw */ "./src/util/draw.ts");
  19588. var index_1 = __webpack_require__(/*! @antv/g-base/lib/bbox/index */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/bbox/index.js");
  19589. var Shape = __webpack_require__(/*! ./index */ "./src/shape/index.ts");
  19590. var group_1 = __webpack_require__(/*! ../group */ "./src/group.ts");
  19591. var ShapeBase = /** @class */ (function (_super) {
  19592. tslib_1.__extends(ShapeBase, _super);
  19593. function ShapeBase() {
  19594. return _super !== null && _super.apply(this, arguments) || this;
  19595. }
  19596. ShapeBase.prototype.getDefaultAttrs = function () {
  19597. var attrs = _super.prototype.getDefaultAttrs.call(this);
  19598. // 设置默认值
  19599. return tslib_1.__assign(tslib_1.__assign({}, attrs), { lineWidth: 1, lineAppendWidth: 0, strokeOpacity: 1, fillOpacity: 1 });
  19600. };
  19601. ShapeBase.prototype.getShapeBase = function () {
  19602. return Shape;
  19603. };
  19604. ShapeBase.prototype.getGroupBase = function () {
  19605. return group_1.default;
  19606. };
  19607. /**
  19608. * 一些方法调用会引起画布变化
  19609. * @param {ChangeType} changeType 改变的类型
  19610. */
  19611. ShapeBase.prototype.onCanvasChange = function (changeType) {
  19612. draw_1.refreshElement(this, changeType);
  19613. };
  19614. ShapeBase.prototype.calculateBBox = function () {
  19615. var type = this.get('type');
  19616. var lineWidth = this.getHitLineWidth();
  19617. // const attrs = this.attr();
  19618. var bboxMethod = index_1.getBBoxMethod(type);
  19619. var box = bboxMethod(this);
  19620. var halfLineWidth = lineWidth / 2;
  19621. var minX = box.x - halfLineWidth;
  19622. var minY = box.y - halfLineWidth;
  19623. var maxX = box.x + box.width + halfLineWidth;
  19624. var maxY = box.y + box.height + halfLineWidth;
  19625. return {
  19626. x: minX,
  19627. minX: minX,
  19628. y: minY,
  19629. minY: minY,
  19630. width: box.width + lineWidth,
  19631. height: box.height + lineWidth,
  19632. maxX: maxX,
  19633. maxY: maxY,
  19634. };
  19635. };
  19636. ShapeBase.prototype.isFill = function () {
  19637. return !!this.attrs['fill'] || this.isClipShape();
  19638. };
  19639. ShapeBase.prototype.isStroke = function () {
  19640. return !!this.attrs['stroke'];
  19641. };
  19642. // 同 shape 中的方法重复了
  19643. ShapeBase.prototype._applyClip = function (context, clip) {
  19644. if (clip) {
  19645. context.save();
  19646. // 将 clip 的属性挂载到 context 上
  19647. draw_1.applyAttrsToContext(context, clip);
  19648. // 绘制 clip 路径
  19649. clip.createPath(context);
  19650. context.restore();
  19651. // 裁剪
  19652. context.clip();
  19653. clip._afterDraw();
  19654. }
  19655. };
  19656. // 绘制图形时需要考虑 region 限制
  19657. ShapeBase.prototype.draw = function (context, region) {
  19658. var clip = this.cfg.clipShape;
  19659. // 如果指定了 region,同时不允许刷新时,直接返回
  19660. if (region) {
  19661. if (this.cfg.refresh === false) {
  19662. // this._afterDraw();
  19663. this.set('hasChanged', false);
  19664. return;
  19665. }
  19666. // 是否相交需要考虑 clip 的包围盒
  19667. var bbox = this.getCanvasBBox();
  19668. if (!util_1.intersectRect(region, bbox)) {
  19669. this.set('hasChanged', false);
  19670. // 存在多种情形需要更新 cacheCanvasBBox 和 isInview 的判定
  19671. // 1. 之前图形在视窗内,但是现在不再视窗内
  19672. // 2. 如果当前的图形以及父元素都没有发生过变化,refresh = false 不会走到这里,所以这里的图形都是父元素发生变化,但是没有在视图内的元素
  19673. if (this.cfg.isInView) {
  19674. this._afterDraw();
  19675. }
  19676. return;
  19677. }
  19678. }
  19679. context.save();
  19680. // 先将 attrs 应用到上下文中,再设置 clip。因为 clip 应该被当前元素的 matrix 所影响
  19681. draw_1.applyAttrsToContext(context, this);
  19682. this._applyClip(context, clip);
  19683. this.drawPath(context);
  19684. context.restore();
  19685. this._afterDraw();
  19686. };
  19687. ShapeBase.prototype.getCanvasViewBox = function () {
  19688. var canvas = this.cfg.canvas;
  19689. if (canvas) {
  19690. // @ts-ignore
  19691. return canvas.getViewRange();
  19692. }
  19693. return null;
  19694. };
  19695. ShapeBase.prototype.cacheCanvasBBox = function () {
  19696. var canvasBBox = this.getCanvasViewBox();
  19697. // 绘制的时候缓存包围盒
  19698. if (canvasBBox) {
  19699. var bbox = this.getCanvasBBox();
  19700. var isInView = util_1.intersectRect(bbox, canvasBBox);
  19701. this.set('isInView', isInView);
  19702. // 不再视窗内 cacheCanvasBBox 设置成 null,会提升局部渲染的性能,
  19703. // 因为在局部渲染影响的包围盒计算时不考虑这个图形的包围盒
  19704. // 父元素 cacheCanvasBBox 计算的时候也不计算
  19705. if (isInView) {
  19706. this.set('cacheCanvasBBox', bbox);
  19707. }
  19708. else {
  19709. this.set('cacheCanvasBBox', null);
  19710. }
  19711. }
  19712. };
  19713. ShapeBase.prototype._afterDraw = function () {
  19714. this.cacheCanvasBBox();
  19715. // 绘制后消除标记
  19716. this.set('hasChanged', false);
  19717. this.set('refresh', null);
  19718. };
  19719. ShapeBase.prototype.skipDraw = function () {
  19720. this.set('cacheCanvasBBox', null);
  19721. this.set('isInView', null);
  19722. this.set('hasChanged', false);
  19723. };
  19724. /**
  19725. * 绘制图形的路径
  19726. * @param {CanvasRenderingContext2D} context 上下文
  19727. */
  19728. ShapeBase.prototype.drawPath = function (context) {
  19729. this.createPath(context);
  19730. this.strokeAndFill(context);
  19731. this.afterDrawPath(context);
  19732. };
  19733. /**
  19734. * @protected
  19735. * 填充图形
  19736. * @param {CanvasRenderingContext2D} context context 上下文
  19737. */
  19738. ShapeBase.prototype.fill = function (context) {
  19739. context.fill();
  19740. };
  19741. /**
  19742. * @protected
  19743. * 绘制图形边框
  19744. * @param {CanvasRenderingContext2D} context context 上下文
  19745. */
  19746. ShapeBase.prototype.stroke = function (context) {
  19747. context.stroke();
  19748. };
  19749. // 绘制或者填充
  19750. ShapeBase.prototype.strokeAndFill = function (context) {
  19751. var _a = this.attrs, lineWidth = _a.lineWidth, opacity = _a.opacity, strokeOpacity = _a.strokeOpacity, fillOpacity = _a.fillOpacity;
  19752. if (this.isFill()) {
  19753. if (!util_1.isNil(fillOpacity) && fillOpacity !== 1) {
  19754. context.globalAlpha = fillOpacity;
  19755. this.fill(context);
  19756. context.globalAlpha = opacity;
  19757. }
  19758. else {
  19759. this.fill(context);
  19760. }
  19761. }
  19762. if (this.isStroke()) {
  19763. if (lineWidth > 0) {
  19764. if (!util_1.isNil(strokeOpacity) && strokeOpacity !== 1) {
  19765. context.globalAlpha = strokeOpacity;
  19766. }
  19767. this.stroke(context);
  19768. }
  19769. }
  19770. this.afterDrawPath(context);
  19771. };
  19772. /**
  19773. * @protected
  19774. * 绘制图形的路径
  19775. * @param {CanvasRenderingContext2D} context 上下文
  19776. */
  19777. ShapeBase.prototype.createPath = function (context) { };
  19778. /**
  19779. * 绘制完成 path 后的操作
  19780. * @param {CanvasRenderingContext2D} context 上下文
  19781. */
  19782. ShapeBase.prototype.afterDrawPath = function (context) { };
  19783. ShapeBase.prototype.isInShape = function (refX, refY) {
  19784. // return HitUtil.isHitShape(this, refX, refY);
  19785. var isStroke = this.isStroke();
  19786. var isFill = this.isFill();
  19787. var lineWidth = this.getHitLineWidth();
  19788. return this.isInStrokeOrPath(refX, refY, isStroke, isFill, lineWidth);
  19789. };
  19790. // 之所以不拆成 isInStroke 和 isInPath 在于两者存在一些共同的计算
  19791. ShapeBase.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  19792. return false;
  19793. };
  19794. /**
  19795. * 获取线拾取的宽度
  19796. * @returns {number} 线的拾取宽度
  19797. */
  19798. ShapeBase.prototype.getHitLineWidth = function () {
  19799. if (!this.isStroke()) {
  19800. return 0;
  19801. }
  19802. var attrs = this.attrs;
  19803. return attrs['lineWidth'] + attrs['lineAppendWidth'];
  19804. };
  19805. return ShapeBase;
  19806. }(g_base_1.AbstractShape));
  19807. exports.default = ShapeBase;
  19808. /***/ }),
  19809. /***/ "./src/shape/circle.ts":
  19810. /*!*****************************!*\
  19811. !*** ./src/shape/circle.ts ***!
  19812. \*****************************/
  19813. /*! no static exports found */
  19814. /***/ (function(module, exports, __webpack_require__) {
  19815. "use strict";
  19816. /**
  19817. * @fileoverview 圆
  19818. * @author dxq613@gmail.com
  19819. */
  19820. Object.defineProperty(exports, "__esModule", { value: true });
  19821. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19822. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  19823. var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
  19824. // TODO: 暂时不需要圆的工具方法,后续如果需要支持 pointAt,tangentAngle 时再引入
  19825. // import CircleUtil from '@antv/g-math/lib/circle';
  19826. var Circle = /** @class */ (function (_super) {
  19827. tslib_1.__extends(Circle, _super);
  19828. function Circle() {
  19829. return _super !== null && _super.apply(this, arguments) || this;
  19830. }
  19831. Circle.prototype.getDefaultAttrs = function () {
  19832. var attrs = _super.prototype.getDefaultAttrs.call(this);
  19833. return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, r: 0 });
  19834. };
  19835. Circle.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  19836. var attrs = this.attr();
  19837. var cx = attrs.x;
  19838. var cy = attrs.y;
  19839. var r = attrs.r;
  19840. var halfLineWidth = lineWidth / 2;
  19841. var absDistance = util_1.distance(cx, cy, x, y);
  19842. // 直接用距离,如果同时存在边和填充时,可以减少两次计算
  19843. if (isFill && isStroke) {
  19844. return absDistance <= r + halfLineWidth;
  19845. }
  19846. if (isFill) {
  19847. return absDistance <= r;
  19848. }
  19849. if (isStroke) {
  19850. return absDistance >= r - halfLineWidth && absDistance <= r + halfLineWidth;
  19851. }
  19852. return false;
  19853. };
  19854. Circle.prototype.createPath = function (context) {
  19855. var attrs = this.attr();
  19856. var cx = attrs.x;
  19857. var cy = attrs.y;
  19858. var r = attrs.r;
  19859. context.beginPath();
  19860. context.arc(cx, cy, r, 0, Math.PI * 2, false);
  19861. context.closePath();
  19862. };
  19863. return Circle;
  19864. }(base_1.default));
  19865. exports.default = Circle;
  19866. /***/ }),
  19867. /***/ "./src/shape/ellipse.ts":
  19868. /*!******************************!*\
  19869. !*** ./src/shape/ellipse.ts ***!
  19870. \******************************/
  19871. /*! no static exports found */
  19872. /***/ (function(module, exports, __webpack_require__) {
  19873. "use strict";
  19874. /**
  19875. * @fileoverview 椭圆
  19876. * @author dxq613@gmail.com
  19877. */
  19878. Object.defineProperty(exports, "__esModule", { value: true });
  19879. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19880. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  19881. // 暂时不需要
  19882. // import EllipseUtil from '@antv/g-math/lib/ellipse';
  19883. // 根据椭圆公式计算 x*x/rx*rx + y*y/ry*ry;
  19884. function ellipseDistance(squareX, squareY, rx, ry) {
  19885. return squareX / (rx * rx) + squareY / (ry * ry);
  19886. }
  19887. var Ellipse = /** @class */ (function (_super) {
  19888. tslib_1.__extends(Ellipse, _super);
  19889. function Ellipse() {
  19890. return _super !== null && _super.apply(this, arguments) || this;
  19891. }
  19892. Ellipse.prototype.getDefaultAttrs = function () {
  19893. var attrs = _super.prototype.getDefaultAttrs.call(this);
  19894. return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, rx: 0, ry: 0 });
  19895. };
  19896. Ellipse.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  19897. var attrs = this.attr();
  19898. var halfLineWith = lineWidth / 2;
  19899. var cx = attrs.x;
  19900. var cy = attrs.y;
  19901. var rx = attrs.rx, ry = attrs.ry;
  19902. var squareX = (x - cx) * (x - cx);
  19903. var squareY = (y - cy) * (y - cy);
  19904. // 使用椭圆的公式: x*x/rx*rx + y*y/ry*ry = 1;
  19905. if (isFill && isStroke) {
  19906. return ellipseDistance(squareX, squareY, rx + halfLineWith, ry + halfLineWith) <= 1;
  19907. }
  19908. if (isFill) {
  19909. return ellipseDistance(squareX, squareY, rx, ry) <= 1;
  19910. }
  19911. if (isStroke) {
  19912. return (ellipseDistance(squareX, squareY, rx - halfLineWith, ry - halfLineWith) >= 1 &&
  19913. ellipseDistance(squareX, squareY, rx + halfLineWith, ry + halfLineWith) <= 1);
  19914. }
  19915. return false;
  19916. };
  19917. Ellipse.prototype.createPath = function (context) {
  19918. var attrs = this.attr();
  19919. var cx = attrs.x;
  19920. var cy = attrs.y;
  19921. var rx = attrs.rx;
  19922. var ry = attrs.ry;
  19923. context.beginPath();
  19924. // 兼容逻辑
  19925. if (context.ellipse) {
  19926. context.ellipse(cx, cy, rx, ry, 0, 0, Math.PI * 2, false);
  19927. }
  19928. else {
  19929. // 如果不支持,则使用圆来绘制,进行变形
  19930. var r = rx > ry ? rx : ry;
  19931. var scaleX = rx > ry ? 1 : rx / ry;
  19932. var scaleY = rx > ry ? ry / rx : 1;
  19933. context.save();
  19934. context.translate(cx, cy);
  19935. context.scale(scaleX, scaleY);
  19936. context.arc(0, 0, r, 0, Math.PI * 2);
  19937. context.restore();
  19938. context.closePath();
  19939. }
  19940. };
  19941. return Ellipse;
  19942. }(base_1.default));
  19943. exports.default = Ellipse;
  19944. /***/ }),
  19945. /***/ "./src/shape/image.ts":
  19946. /*!****************************!*\
  19947. !*** ./src/shape/image.ts ***!
  19948. \****************************/
  19949. /*! no static exports found */
  19950. /***/ (function(module, exports, __webpack_require__) {
  19951. "use strict";
  19952. /**
  19953. * @fileoverview 图片
  19954. * @author dxq613@gmail.com
  19955. */
  19956. Object.defineProperty(exports, "__esModule", { value: true });
  19957. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  19958. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  19959. var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
  19960. function isCanvas(dom) {
  19961. return dom instanceof HTMLElement && util_1.isString(dom.nodeName) && dom.nodeName.toUpperCase() === 'CANVAS';
  19962. }
  19963. var ImageShape = /** @class */ (function (_super) {
  19964. tslib_1.__extends(ImageShape, _super);
  19965. function ImageShape() {
  19966. return _super !== null && _super.apply(this, arguments) || this;
  19967. }
  19968. ImageShape.prototype.getDefaultAttrs = function () {
  19969. var attrs = _super.prototype.getDefaultAttrs.call(this);
  19970. return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0 });
  19971. };
  19972. ImageShape.prototype.initAttrs = function (attrs) {
  19973. this._setImage(attrs.img);
  19974. };
  19975. // image 不计算 stroke
  19976. ImageShape.prototype.isStroke = function () {
  19977. return false;
  19978. };
  19979. // 仅仅使用包围盒检测来进行拾取
  19980. // 所以不需要复写 isInStrokeOrPath 的方法
  19981. ImageShape.prototype.isOnlyHitBox = function () {
  19982. return true;
  19983. };
  19984. ImageShape.prototype._afterLoading = function () {
  19985. if (this.get('toDraw') === true) {
  19986. var canvas = this.get('canvas');
  19987. if (canvas) {
  19988. // 这段应该改成局部渲染
  19989. canvas.draw();
  19990. }
  19991. else {
  19992. // 这种方式如果发生遮挡会出现问题
  19993. this.createPath(this.get('context'));
  19994. }
  19995. }
  19996. };
  19997. ImageShape.prototype._setImage = function (img) {
  19998. var _this = this;
  19999. var attrs = this.attrs;
  20000. if (util_1.isString(img)) {
  20001. var image_1 = new Image();
  20002. image_1.onload = function () {
  20003. // 图片未加载完,则已经被销毁
  20004. if (_this.destroyed) {
  20005. return false;
  20006. }
  20007. // 缓存原始地址,可以做对比,防止重复加载图片
  20008. // 如果考虑到在加载过程中可能替换 img 属性,则情况更加复杂
  20009. // this.set('imgSrc', img);
  20010. // 这里会循环调用 _setImage 方法,但不会再走这个分支
  20011. _this.attr('img', image_1);
  20012. _this.set('loading', false);
  20013. _this._afterLoading();
  20014. var callback = _this.get('callback');
  20015. if (callback) {
  20016. callback.call(_this);
  20017. }
  20018. };
  20019. image_1.src = img;
  20020. // 设置跨域
  20021. image_1.crossOrigin = 'Anonymous';
  20022. // loading 过程中不绘制
  20023. this.set('loading', true);
  20024. }
  20025. else if (img instanceof Image) {
  20026. // 如果是一个 image 对象,则设置宽高
  20027. if (!attrs.width) {
  20028. attrs.width = img.width;
  20029. }
  20030. if (!attrs.height) {
  20031. attrs.height = img.height;
  20032. }
  20033. }
  20034. else if (isCanvas(img)) {
  20035. // 如果设置了 canvas 对象
  20036. if (!attrs.width) {
  20037. attrs.width = Number(img.getAttribute('width'));
  20038. }
  20039. if (!attrs.height) {
  20040. attrs.height, Number(img.getAttribute('height'));
  20041. }
  20042. }
  20043. };
  20044. ImageShape.prototype.onAttrChange = function (name, value, originValue) {
  20045. _super.prototype.onAttrChange.call(this, name, value, originValue);
  20046. // 如果加载的已经是当前图片,则不再处理
  20047. if (name === 'img') {
  20048. // 可以加缓冲,&& this.get('imgSrc') !== value
  20049. this._setImage(value);
  20050. }
  20051. };
  20052. ImageShape.prototype.createPath = function (context) {
  20053. // 正在加载则不绘制
  20054. if (this.get('loading')) {
  20055. this.set('toDraw', true); // 加载完成后绘制
  20056. this.set('context', context);
  20057. return;
  20058. }
  20059. var attrs = this.attr();
  20060. var x = attrs.x, y = attrs.y, width = attrs.width, height = attrs.height, sx = attrs.sx, sy = attrs.sy, swidth = attrs.swidth, sheight = attrs.sheight;
  20061. var img = attrs.img;
  20062. if (img instanceof Image || isCanvas(img)) {
  20063. if (!util_1.isNil(sx) && !util_1.isNil(sy) && !util_1.isNil(swidth) && !util_1.isNil(sheight)) {
  20064. context.drawImage(img, sx, sy, swidth, sheight, x, y, width, height);
  20065. }
  20066. else {
  20067. context.drawImage(img, x, y, width, height);
  20068. }
  20069. }
  20070. };
  20071. return ImageShape;
  20072. }(base_1.default));
  20073. exports.default = ImageShape;
  20074. /***/ }),
  20075. /***/ "./src/shape/index.ts":
  20076. /*!****************************!*\
  20077. !*** ./src/shape/index.ts ***!
  20078. \****************************/
  20079. /*! no static exports found */
  20080. /***/ (function(module, exports, __webpack_require__) {
  20081. "use strict";
  20082. Object.defineProperty(exports, "__esModule", { value: true });
  20083. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20084. Object.defineProperty(exports, "Base", { enumerable: true, get: function () { return base_1.default; } });
  20085. var circle_1 = __webpack_require__(/*! ./circle */ "./src/shape/circle.ts");
  20086. Object.defineProperty(exports, "Circle", { enumerable: true, get: function () { return circle_1.default; } });
  20087. var ellipse_1 = __webpack_require__(/*! ./ellipse */ "./src/shape/ellipse.ts");
  20088. Object.defineProperty(exports, "Ellipse", { enumerable: true, get: function () { return ellipse_1.default; } });
  20089. var image_1 = __webpack_require__(/*! ./image */ "./src/shape/image.ts");
  20090. Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return image_1.default; } });
  20091. var line_1 = __webpack_require__(/*! ./line */ "./src/shape/line.ts");
  20092. Object.defineProperty(exports, "Line", { enumerable: true, get: function () { return line_1.default; } });
  20093. var marker_1 = __webpack_require__(/*! ./marker */ "./src/shape/marker.ts");
  20094. Object.defineProperty(exports, "Marker", { enumerable: true, get: function () { return marker_1.default; } });
  20095. var path_1 = __webpack_require__(/*! ./path */ "./src/shape/path.ts");
  20096. Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return path_1.default; } });
  20097. var polygon_1 = __webpack_require__(/*! ./polygon */ "./src/shape/polygon.ts");
  20098. Object.defineProperty(exports, "Polygon", { enumerable: true, get: function () { return polygon_1.default; } });
  20099. var polyline_1 = __webpack_require__(/*! ./polyline */ "./src/shape/polyline.ts");
  20100. Object.defineProperty(exports, "Polyline", { enumerable: true, get: function () { return polyline_1.default; } });
  20101. var rect_1 = __webpack_require__(/*! ./rect */ "./src/shape/rect.ts");
  20102. Object.defineProperty(exports, "Rect", { enumerable: true, get: function () { return rect_1.default; } });
  20103. var text_1 = __webpack_require__(/*! ./text */ "./src/shape/text.ts");
  20104. Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return text_1.default; } });
  20105. /***/ }),
  20106. /***/ "./src/shape/line.ts":
  20107. /*!***************************!*\
  20108. !*** ./src/shape/line.ts ***!
  20109. \***************************/
  20110. /*! no static exports found */
  20111. /***/ (function(module, exports, __webpack_require__) {
  20112. "use strict";
  20113. Object.defineProperty(exports, "__esModule", { value: true });
  20114. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20115. /**
  20116. * @fileoverview 圆
  20117. * @author dxq613@gmail.com
  20118. */
  20119. var line_1 = __webpack_require__(/*! @antv/g-math/lib/line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
  20120. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20121. var line_2 = __webpack_require__(/*! ../util/in-stroke/line */ "./src/util/in-stroke/line.ts");
  20122. var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
  20123. var Line = /** @class */ (function (_super) {
  20124. tslib_1.__extends(Line, _super);
  20125. function Line() {
  20126. return _super !== null && _super.apply(this, arguments) || this;
  20127. }
  20128. Line.prototype.getDefaultAttrs = function () {
  20129. var attrs = _super.prototype.getDefaultAttrs.call(this);
  20130. return tslib_1.__assign(tslib_1.__assign({}, attrs), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: false, endArrow: false });
  20131. };
  20132. Line.prototype.initAttrs = function (attrs) {
  20133. this.setArrow();
  20134. };
  20135. // 更新属性时,检测是否更改了箭头
  20136. Line.prototype.onAttrChange = function (name, value, originValue) {
  20137. _super.prototype.onAttrChange.call(this, name, value, originValue);
  20138. // 由于箭头的绘制依赖于 line 的诸多 attrs,因此这里不再对每个 attr 进行判断,attr 每次变化都会影响箭头的更新
  20139. this.setArrow();
  20140. };
  20141. Line.prototype.setArrow = function () {
  20142. var attrs = this.attr();
  20143. var x1 = attrs.x1, y1 = attrs.y1, x2 = attrs.x2, y2 = attrs.y2, startArrow = attrs.startArrow, endArrow = attrs.endArrow;
  20144. if (startArrow) {
  20145. ArrowUtil.addStartArrow(this, attrs, x2, y2, x1, y1);
  20146. }
  20147. if (endArrow) {
  20148. ArrowUtil.addEndArrow(this, attrs, x1, y1, x2, y2);
  20149. }
  20150. };
  20151. Line.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  20152. if (!isStroke || !lineWidth) {
  20153. return false;
  20154. }
  20155. var _a = this.attr(), x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2;
  20156. return line_2.default(x1, y1, x2, y2, lineWidth, x, y);
  20157. };
  20158. Line.prototype.createPath = function (context) {
  20159. var attrs = this.attr();
  20160. var x1 = attrs.x1, y1 = attrs.y1, x2 = attrs.x2, y2 = attrs.y2, startArrow = attrs.startArrow, endArrow = attrs.endArrow;
  20161. var startArrowDistance = {
  20162. dx: 0,
  20163. dy: 0,
  20164. };
  20165. var endArrowDistance = {
  20166. dx: 0,
  20167. dy: 0,
  20168. };
  20169. if (startArrow && startArrow.d) {
  20170. startArrowDistance = ArrowUtil.getShortenOffset(x1, y1, x2, y2, attrs.startArrow.d);
  20171. }
  20172. if (endArrow && endArrow.d) {
  20173. endArrowDistance = ArrowUtil.getShortenOffset(x1, y1, x2, y2, attrs.endArrow.d);
  20174. }
  20175. context.beginPath();
  20176. // 如果自定义箭头,线条相应缩进
  20177. context.moveTo(x1 + startArrowDistance.dx, y1 + startArrowDistance.dy);
  20178. context.lineTo(x2 - endArrowDistance.dx, y2 - endArrowDistance.dy);
  20179. };
  20180. Line.prototype.afterDrawPath = function (context) {
  20181. var startArrowShape = this.get('startArrowShape');
  20182. var endArrowShape = this.get('endArrowShape');
  20183. if (startArrowShape) {
  20184. startArrowShape.draw(context);
  20185. }
  20186. if (endArrowShape) {
  20187. endArrowShape.draw(context);
  20188. }
  20189. };
  20190. /**
  20191. * Get length of line
  20192. * @return {number} length
  20193. */
  20194. Line.prototype.getTotalLength = function () {
  20195. var _a = this.attr(), x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2;
  20196. return line_1.default.length(x1, y1, x2, y2);
  20197. };
  20198. /**
  20199. * Get point according to ratio
  20200. * @param {number} ratio
  20201. * @return {Point} point
  20202. */
  20203. Line.prototype.getPoint = function (ratio) {
  20204. var _a = this.attr(), x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2;
  20205. return line_1.default.pointAt(x1, y1, x2, y2, ratio);
  20206. };
  20207. return Line;
  20208. }(base_1.default));
  20209. exports.default = Line;
  20210. /***/ }),
  20211. /***/ "./src/shape/marker.ts":
  20212. /*!*****************************!*\
  20213. !*** ./src/shape/marker.ts ***!
  20214. \*****************************/
  20215. /*! no static exports found */
  20216. /***/ (function(module, exports, __webpack_require__) {
  20217. "use strict";
  20218. /**
  20219. * @fileoverview Marker
  20220. * @author dxq613@gmail.com
  20221. */
  20222. Object.defineProperty(exports, "__esModule", { value: true });
  20223. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20224. var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  20225. var path_2_absolute_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-absolute */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js");
  20226. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20227. var util_2 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
  20228. var draw_1 = __webpack_require__(/*! ../util/draw */ "./src/util/draw.ts");
  20229. var Symbols = {
  20230. // 圆
  20231. circle: function (x, y, r) {
  20232. return [
  20233. ['M', x - r, y],
  20234. ['A', r, r, 0, 1, 0, x + r, y],
  20235. ['A', r, r, 0, 1, 0, x - r, y],
  20236. ];
  20237. },
  20238. // 正方形
  20239. square: function (x, y, r) {
  20240. return [['M', x - r, y - r], ['L', x + r, y - r], ['L', x + r, y + r], ['L', x - r, y + r], ['Z']];
  20241. },
  20242. // 菱形
  20243. diamond: function (x, y, r) {
  20244. return [['M', x - r, y], ['L', x, y - r], ['L', x + r, y], ['L', x, y + r], ['Z']];
  20245. },
  20246. // 三角形
  20247. triangle: function (x, y, r) {
  20248. var diffY = r * Math.sin((1 / 3) * Math.PI);
  20249. return [['M', x - r, y + diffY], ['L', x, y - diffY], ['L', x + r, y + diffY], ['Z']];
  20250. },
  20251. // 倒三角形
  20252. 'triangle-down': function (x, y, r) {
  20253. var diffY = r * Math.sin((1 / 3) * Math.PI);
  20254. return [['M', x - r, y - diffY], ['L', x + r, y - diffY], ['L', x, y + diffY], ['Z']];
  20255. },
  20256. };
  20257. var Marker = /** @class */ (function (_super) {
  20258. tslib_1.__extends(Marker, _super);
  20259. function Marker() {
  20260. return _super !== null && _super.apply(this, arguments) || this;
  20261. }
  20262. Marker.prototype.initAttrs = function (attrs) {
  20263. this._resetParamsCache();
  20264. };
  20265. // 重置绘制 path 存储的缓存
  20266. Marker.prototype._resetParamsCache = function () {
  20267. // 为了加速 path 的绘制、拾取和计算,这个地方可以缓存很多东西
  20268. // 这些缓存都是第一次需要时计算和存储,虽然增加了复杂度,但是频繁调用的方法,性能有很大提升
  20269. this.set('paramsCache', {}); // 清理缓存
  20270. };
  20271. // 更新属性时,检测是否更改了 path
  20272. Marker.prototype.onAttrChange = function (name, value, originValue) {
  20273. _super.prototype.onAttrChange.call(this, name, value, originValue);
  20274. if (['symbol', 'x', 'y', 'r', 'radius'].indexOf(name) !== -1) {
  20275. // path 相关属性更改时,清理缓存
  20276. this._resetParamsCache();
  20277. }
  20278. };
  20279. // 仅仅使用包围盒检测来进行拾取
  20280. // 所以不需要复写 isInStrokeOrPath 的方法
  20281. Marker.prototype.isOnlyHitBox = function () {
  20282. return true;
  20283. };
  20284. Marker.prototype._getR = function (attrs) {
  20285. // 兼容 r 和 radius 两种写法,推荐使用 r
  20286. return util_1.isNil(attrs.r) ? attrs.radius : attrs.r;
  20287. };
  20288. Marker.prototype._getPath = function () {
  20289. var attrs = this.attr();
  20290. var x = attrs.x, y = attrs.y;
  20291. var symbol = attrs.symbol || 'circle';
  20292. var r = this._getR(attrs);
  20293. var method;
  20294. var path;
  20295. if (util_2.isFunction(symbol)) {
  20296. method = symbol;
  20297. path = method(x, y, r);
  20298. // 将 path 转成绝对路径
  20299. path = path_2_absolute_1.default(path);
  20300. }
  20301. else {
  20302. // 内置 symbol 的 path 都是绝对路径,直接绘制即可,不需要对 path 进行特殊处理
  20303. method = Marker.Symbols[symbol];
  20304. path = method(x, y, r);
  20305. }
  20306. if (!method) {
  20307. console.warn(symbol + " marker is not supported.");
  20308. return null;
  20309. }
  20310. return path;
  20311. };
  20312. Marker.prototype.createPath = function (context) {
  20313. var path = this._getPath();
  20314. var paramsCache = this.get('paramsCache');
  20315. draw_1.drawPath(this, context, { path: path }, paramsCache);
  20316. };
  20317. Marker.Symbols = Symbols;
  20318. return Marker;
  20319. }(base_1.default));
  20320. exports.default = Marker;
  20321. /***/ }),
  20322. /***/ "./src/shape/path.ts":
  20323. /*!***************************!*\
  20324. !*** ./src/shape/path.ts ***!
  20325. \***************************/
  20326. /*! no static exports found */
  20327. /***/ (function(module, exports, __webpack_require__) {
  20328. "use strict";
  20329. Object.defineProperty(exports, "__esModule", { value: true });
  20330. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20331. var cubic_1 = __webpack_require__(/*! @antv/g-math/lib/cubic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js");
  20332. var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  20333. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20334. var path_2_absolute_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-absolute */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-absolute.js");
  20335. var path_2_segments_1 = __webpack_require__(/*! @antv/path-util/lib/path-2-segments */ "./node_modules/_@antv_path-util@2.0.8@@antv/path-util/lib/path-2-segments.js");
  20336. var draw_1 = __webpack_require__(/*! ../util/draw */ "./src/util/draw.ts");
  20337. var point_in_path_1 = __webpack_require__(/*! ../util/in-path/point-in-path */ "./src/util/in-path/point-in-path.ts");
  20338. var polygon_1 = __webpack_require__(/*! ../util/in-path/polygon */ "./src/util/in-path/polygon.ts");
  20339. var path_1 = __webpack_require__(/*! ../util/path */ "./src/util/path.ts");
  20340. var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
  20341. // 是否在多个多边形内部
  20342. function isInPolygons(polygons, x, y) {
  20343. var isHit = false;
  20344. for (var i = 0; i < polygons.length; i++) {
  20345. var points = polygons[i];
  20346. isHit = polygon_1.default(points, x, y);
  20347. if (isHit) {
  20348. break;
  20349. }
  20350. }
  20351. return isHit;
  20352. }
  20353. var Path = /** @class */ (function (_super) {
  20354. tslib_1.__extends(Path, _super);
  20355. function Path() {
  20356. return _super !== null && _super.apply(this, arguments) || this;
  20357. }
  20358. Path.prototype.getDefaultAttrs = function () {
  20359. var attrs = _super.prototype.getDefaultAttrs.call(this);
  20360. return tslib_1.__assign(tslib_1.__assign({}, attrs), { startArrow: false, endArrow: false });
  20361. };
  20362. Path.prototype.initAttrs = function (attrs) {
  20363. this._setPathArr(attrs.path);
  20364. this.setArrow();
  20365. };
  20366. // 更新属性时,检测是否更改了 path
  20367. Path.prototype.onAttrChange = function (name, value, originValue) {
  20368. _super.prototype.onAttrChange.call(this, name, value, originValue);
  20369. if (name === 'path') {
  20370. this._setPathArr(value);
  20371. }
  20372. // 由于箭头的绘制依赖于 line 的诸多 attrs,因此这里不再对每个 attr 进行判断,attr 每次变化都会影响箭头的更新
  20373. this.setArrow();
  20374. };
  20375. // 将 path 转换成绝对路径
  20376. Path.prototype._setPathArr = function (path) {
  20377. // 转换 path 的格式
  20378. this.attrs.path = path_2_absolute_1.default(path);
  20379. var hasArc = path_1.default.hasArc(path);
  20380. // 为了加速 path 的绘制、拾取和计算,这个地方可以缓存很多东西
  20381. // 这些缓存都是第一次需要时计算和存储,虽然增加了复杂度,但是频繁调用的方法,性能有很大提升
  20382. this.set('hasArc', hasArc);
  20383. this.set('paramsCache', {}); // 清理缓存
  20384. this.set('segments', null); // 延迟生成 path,在动画场景下可能不会有拾取
  20385. this.set('curve', null);
  20386. this.set('tCache', null);
  20387. this.set('totalLength', null);
  20388. };
  20389. Path.prototype.getSegments = function () {
  20390. var segments = this.get('segements');
  20391. if (!segments) {
  20392. segments = path_2_segments_1.default(this.attr('path'));
  20393. this.set('segments', segments);
  20394. }
  20395. return segments;
  20396. };
  20397. Path.prototype.setArrow = function () {
  20398. var attrs = this.attr();
  20399. var startArrow = attrs.startArrow, endArrow = attrs.endArrow;
  20400. if (startArrow) {
  20401. var tangent = this.getStartTangent();
  20402. ArrowUtil.addStartArrow(this, attrs, tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1]);
  20403. }
  20404. if (endArrow) {
  20405. var tangent = this.getEndTangent();
  20406. ArrowUtil.addEndArrow(this, attrs, tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1]);
  20407. }
  20408. };
  20409. Path.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  20410. var segments = this.getSegments();
  20411. var hasArc = this.get('hasArc');
  20412. var isHit = false;
  20413. if (isStroke) {
  20414. isHit = path_1.default.isPointInStroke(segments, lineWidth, x, y);
  20415. }
  20416. if (!isHit && isFill) {
  20417. if (hasArc) {
  20418. // 存在曲线时,暂时使用 canvas 的 api 计算,后续可以进行多边形切割
  20419. isHit = point_in_path_1.default(this, x, y);
  20420. }
  20421. else {
  20422. var path = this.attr('path');
  20423. var extractResutl = path_1.default.extractPolygons(path);
  20424. // 提取出来的多边形包含闭合的和非闭合的,在这里统一按照多边形处理
  20425. isHit = isInPolygons(extractResutl.polygons, x, y) || isInPolygons(extractResutl.polylines, x, y);
  20426. }
  20427. }
  20428. return isHit;
  20429. };
  20430. Path.prototype.createPath = function (context) {
  20431. var attrs = this.attr();
  20432. var paramsCache = this.get('paramsCache'); // 由于计算圆弧的参数成本很大,所以要缓存
  20433. draw_1.drawPath(this, context, attrs, paramsCache);
  20434. };
  20435. Path.prototype.afterDrawPath = function (context) {
  20436. var startArrowShape = this.get('startArrowShape');
  20437. var endArrowShape = this.get('endArrowShape');
  20438. if (startArrowShape) {
  20439. startArrowShape.draw(context);
  20440. }
  20441. if (endArrowShape) {
  20442. endArrowShape.draw(context);
  20443. }
  20444. };
  20445. /**
  20446. * Get total length of path
  20447. * @return {number} length
  20448. */
  20449. Path.prototype.getTotalLength = function () {
  20450. var totalLength = this.get('totalLength');
  20451. if (!util_1.isNil(totalLength)) {
  20452. return totalLength;
  20453. }
  20454. this._calculateCurve();
  20455. this._setTcache();
  20456. return this.get('totalLength');
  20457. };
  20458. /**
  20459. * Get point according to ratio
  20460. * @param {number} ratio
  20461. * @return {Point} point
  20462. */
  20463. Path.prototype.getPoint = function (ratio) {
  20464. var tCache = this.get('tCache');
  20465. if (!tCache) {
  20466. this._calculateCurve();
  20467. this._setTcache();
  20468. tCache = this.get('tCache');
  20469. }
  20470. var subt;
  20471. var index;
  20472. var curve = this.get('curve');
  20473. if (!tCache || tCache.length === 0) {
  20474. if (curve) {
  20475. return {
  20476. x: curve[0][1],
  20477. y: curve[0][2],
  20478. };
  20479. }
  20480. return null;
  20481. }
  20482. util_1.each(tCache, function (v, i) {
  20483. if (ratio >= v[0] && ratio <= v[1]) {
  20484. subt = (ratio - v[0]) / (v[1] - v[0]);
  20485. index = i;
  20486. }
  20487. });
  20488. var seg = curve[index];
  20489. if (util_1.isNil(seg) || util_1.isNil(index)) {
  20490. return null;
  20491. }
  20492. var l = seg.length;
  20493. var nextSeg = curve[index + 1];
  20494. return cubic_1.default.pointAt(seg[l - 2], seg[l - 1], nextSeg[1], nextSeg[2], nextSeg[3], nextSeg[4], nextSeg[5], nextSeg[6], subt);
  20495. };
  20496. Path.prototype._calculateCurve = function () {
  20497. var path = this.attr().path;
  20498. this.set('curve', path_1.default.pathToCurve(path));
  20499. };
  20500. Path.prototype._setTcache = function () {
  20501. var totalLength = 0;
  20502. var tempLength = 0;
  20503. // 每段 curve 对应起止点的长度比例列表,形如: [[0, 0.25], [0.25, 0.6]. [0.6, 0.9], [0.9, 1]]
  20504. var tCache = [];
  20505. var segmentT;
  20506. var segmentL;
  20507. var segmentN;
  20508. var l;
  20509. var curve = this.get('curve');
  20510. if (!curve) {
  20511. return;
  20512. }
  20513. util_1.each(curve, function (segment, i) {
  20514. segmentN = curve[i + 1];
  20515. l = segment.length;
  20516. if (segmentN) {
  20517. totalLength +=
  20518. cubic_1.default.length(segment[l - 2], segment[l - 1], segmentN[1], segmentN[2], segmentN[3], segmentN[4], segmentN[5], segmentN[6]) || 0;
  20519. }
  20520. });
  20521. this.set('totalLength', totalLength);
  20522. if (totalLength === 0) {
  20523. this.set('tCache', []);
  20524. return;
  20525. }
  20526. util_1.each(curve, function (segment, i) {
  20527. segmentN = curve[i + 1];
  20528. l = segment.length;
  20529. if (segmentN) {
  20530. segmentT = [];
  20531. segmentT[0] = tempLength / totalLength;
  20532. segmentL = cubic_1.default.length(segment[l - 2], segment[l - 1], segmentN[1], segmentN[2], segmentN[3], segmentN[4], segmentN[5], segmentN[6]);
  20533. // 当 path 不连续时,segmentL 可能为空,为空时需要作为 0 处理
  20534. tempLength += segmentL || 0;
  20535. segmentT[1] = tempLength / totalLength;
  20536. tCache.push(segmentT);
  20537. }
  20538. });
  20539. this.set('tCache', tCache);
  20540. };
  20541. /**
  20542. * Get start tangent vector
  20543. * @return {Array}
  20544. */
  20545. Path.prototype.getStartTangent = function () {
  20546. var segments = this.getSegments();
  20547. var result;
  20548. if (segments.length > 1) {
  20549. var startPoint = segments[0].currentPoint;
  20550. var endPoint = segments[1].currentPoint;
  20551. var tangent = segments[1].startTangent;
  20552. result = [];
  20553. if (tangent) {
  20554. result.push([startPoint[0] - tangent[0], startPoint[1] - tangent[1]]);
  20555. result.push([startPoint[0], startPoint[1]]);
  20556. }
  20557. else {
  20558. result.push([endPoint[0], endPoint[1]]);
  20559. result.push([startPoint[0], startPoint[1]]);
  20560. }
  20561. }
  20562. return result;
  20563. };
  20564. /**
  20565. * Get end tangent vector
  20566. * @return {Array}
  20567. */
  20568. Path.prototype.getEndTangent = function () {
  20569. var segments = this.getSegments();
  20570. var length = segments.length;
  20571. var result;
  20572. if (length > 1) {
  20573. var startPoint = segments[length - 2].currentPoint;
  20574. var endPoint = segments[length - 1].currentPoint;
  20575. var tangent = segments[length - 1].endTangent;
  20576. result = [];
  20577. if (tangent) {
  20578. result.push([endPoint[0] - tangent[0], endPoint[1] - tangent[1]]);
  20579. result.push([endPoint[0], endPoint[1]]);
  20580. }
  20581. else {
  20582. result.push([startPoint[0], startPoint[1]]);
  20583. result.push([endPoint[0], endPoint[1]]);
  20584. }
  20585. }
  20586. return result;
  20587. };
  20588. return Path;
  20589. }(base_1.default));
  20590. exports.default = Path;
  20591. /***/ }),
  20592. /***/ "./src/shape/polygon.ts":
  20593. /*!******************************!*\
  20594. !*** ./src/shape/polygon.ts ***!
  20595. \******************************/
  20596. /*! no static exports found */
  20597. /***/ (function(module, exports, __webpack_require__) {
  20598. "use strict";
  20599. /**
  20600. * @fileoverview 多边形
  20601. * @author dxq613@gmail.com
  20602. */
  20603. Object.defineProperty(exports, "__esModule", { value: true });
  20604. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20605. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20606. var polyline_1 = __webpack_require__(/*! ../util/in-stroke/polyline */ "./src/util/in-stroke/polyline.ts");
  20607. var polygon_1 = __webpack_require__(/*! ../util/in-path/polygon */ "./src/util/in-path/polygon.ts");
  20608. var Polygon = /** @class */ (function (_super) {
  20609. tslib_1.__extends(Polygon, _super);
  20610. function Polygon() {
  20611. return _super !== null && _super.apply(this, arguments) || this;
  20612. }
  20613. Polygon.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  20614. var points = this.attr().points;
  20615. var isHit = false;
  20616. if (isStroke) {
  20617. isHit = polyline_1.default(points, lineWidth, x, y, true);
  20618. }
  20619. if (!isHit && isFill) {
  20620. isHit = polygon_1.default(points, x, y); // isPointInPath(shape, x, y);
  20621. }
  20622. return isHit;
  20623. };
  20624. Polygon.prototype.createPath = function (context) {
  20625. var attrs = this.attr();
  20626. var points = attrs.points;
  20627. if (points.length < 2) {
  20628. return;
  20629. }
  20630. context.beginPath();
  20631. for (var i = 0; i < points.length; i++) {
  20632. var point = points[i];
  20633. if (i === 0) {
  20634. context.moveTo(point[0], point[1]);
  20635. }
  20636. else {
  20637. context.lineTo(point[0], point[1]);
  20638. }
  20639. }
  20640. context.closePath();
  20641. };
  20642. return Polygon;
  20643. }(base_1.default));
  20644. exports.default = Polygon;
  20645. /***/ }),
  20646. /***/ "./src/shape/polyline.ts":
  20647. /*!*******************************!*\
  20648. !*** ./src/shape/polyline.ts ***!
  20649. \*******************************/
  20650. /*! no static exports found */
  20651. /***/ (function(module, exports, __webpack_require__) {
  20652. "use strict";
  20653. Object.defineProperty(exports, "__esModule", { value: true });
  20654. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20655. var line_1 = __webpack_require__(/*! @antv/g-math/lib/line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
  20656. var polyline_1 = __webpack_require__(/*! @antv/g-math/lib/polyline */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/polyline.js");
  20657. var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  20658. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20659. var polyline_2 = __webpack_require__(/*! ../util/in-stroke/polyline */ "./src/util/in-stroke/polyline.ts");
  20660. var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
  20661. var PolyLine = /** @class */ (function (_super) {
  20662. tslib_1.__extends(PolyLine, _super);
  20663. function PolyLine() {
  20664. return _super !== null && _super.apply(this, arguments) || this;
  20665. }
  20666. PolyLine.prototype.getDefaultAttrs = function () {
  20667. var attrs = _super.prototype.getDefaultAttrs.call(this);
  20668. return tslib_1.__assign(tslib_1.__assign({}, attrs), { startArrow: false, endArrow: false });
  20669. };
  20670. PolyLine.prototype.initAttrs = function (attrs) {
  20671. this.setArrow();
  20672. };
  20673. // 更新属性时,检测是否更改了 points
  20674. PolyLine.prototype.onAttrChange = function (name, value, originValue) {
  20675. _super.prototype.onAttrChange.call(this, name, value, originValue);
  20676. this.setArrow();
  20677. if (['points'].indexOf(name) !== -1) {
  20678. this._resetCache();
  20679. }
  20680. };
  20681. PolyLine.prototype._resetCache = function () {
  20682. this.set('totalLength', null);
  20683. this.set('tCache', null);
  20684. };
  20685. PolyLine.prototype.setArrow = function () {
  20686. var attrs = this.attr();
  20687. var _a = this.attrs, points = _a.points, startArrow = _a.startArrow, endArrow = _a.endArrow;
  20688. var length = points.length;
  20689. var x1 = points[0][0];
  20690. var y1 = points[0][1];
  20691. var x2 = points[length - 1][0];
  20692. var y2 = points[length - 1][1];
  20693. if (startArrow) {
  20694. ArrowUtil.addStartArrow(this, attrs, points[1][0], points[1][1], x1, y1);
  20695. }
  20696. if (endArrow) {
  20697. ArrowUtil.addEndArrow(this, attrs, points[length - 2][0], points[length - 2][1], x2, y2);
  20698. }
  20699. };
  20700. // 不允许 fill
  20701. PolyLine.prototype.isFill = function () {
  20702. return false;
  20703. };
  20704. PolyLine.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  20705. // 没有设置 stroke 不能被拾取, 没有线宽不能被拾取
  20706. if (!isStroke || !lineWidth) {
  20707. return false;
  20708. }
  20709. var points = this.attr().points;
  20710. return polyline_2.default(points, lineWidth, x, y, false);
  20711. };
  20712. // 始终填充
  20713. PolyLine.prototype.isStroke = function () {
  20714. return true;
  20715. };
  20716. PolyLine.prototype.createPath = function (context) {
  20717. var _a = this.attr(), points = _a.points, startArrow = _a.startArrow, endArrow = _a.endArrow;
  20718. var length = points.length;
  20719. if (points.length < 2) {
  20720. return;
  20721. }
  20722. var x1 = points[0][0];
  20723. var y1 = points[0][1];
  20724. var x2 = points[length - 1][0];
  20725. var y2 = points[length - 1][1];
  20726. // 如果定义了箭头,并且是自定义箭头,线条相应缩进
  20727. if (startArrow && startArrow.d) {
  20728. var distance = ArrowUtil.getShortenOffset(x1, y1, points[1][0], points[1][1], startArrow.d);
  20729. x1 += distance.dx;
  20730. y1 += distance.dy;
  20731. }
  20732. if (endArrow && endArrow.d) {
  20733. var distance = ArrowUtil.getShortenOffset(points[length - 2][0], points[length - 2][1], x2, y2, endArrow.d);
  20734. x2 -= distance.dx;
  20735. y2 -= distance.dy;
  20736. }
  20737. context.beginPath();
  20738. context.moveTo(x1, y1);
  20739. for (var i = 0; i < length - 1; i++) {
  20740. var point = points[i];
  20741. context.lineTo(point[0], point[1]);
  20742. }
  20743. context.lineTo(x2, y2);
  20744. };
  20745. PolyLine.prototype.afterDrawPath = function (context) {
  20746. var startArrowShape = this.get('startArrowShape');
  20747. var endArrowShape = this.get('endArrowShape');
  20748. if (startArrowShape) {
  20749. startArrowShape.draw(context);
  20750. }
  20751. if (endArrowShape) {
  20752. endArrowShape.draw(context);
  20753. }
  20754. };
  20755. /**
  20756. * Get length of polyline
  20757. * @return {number} length
  20758. */
  20759. PolyLine.prototype.getTotalLength = function () {
  20760. var points = this.attr().points;
  20761. // get totalLength from cache
  20762. var totalLength = this.get('totalLength');
  20763. if (!util_1.isNil(totalLength)) {
  20764. return totalLength;
  20765. }
  20766. this.set('totalLength', polyline_1.default.length(points));
  20767. return this.get('totalLength');
  20768. };
  20769. /**
  20770. * Get point according to ratio
  20771. * @param {number} ratio
  20772. * @return {Point} point
  20773. */
  20774. PolyLine.prototype.getPoint = function (ratio) {
  20775. var points = this.attr().points;
  20776. // get tCache from cache
  20777. var tCache = this.get('tCache');
  20778. if (!tCache) {
  20779. this._setTcache();
  20780. tCache = this.get('tCache');
  20781. }
  20782. var subt;
  20783. var index;
  20784. util_1.each(tCache, function (v, i) {
  20785. if (ratio >= v[0] && ratio <= v[1]) {
  20786. subt = (ratio - v[0]) / (v[1] - v[0]);
  20787. index = i;
  20788. }
  20789. });
  20790. return line_1.default.pointAt(points[index][0], points[index][1], points[index + 1][0], points[index + 1][1], subt);
  20791. };
  20792. PolyLine.prototype._setTcache = function () {
  20793. var points = this.attr().points;
  20794. if (!points || points.length === 0) {
  20795. return;
  20796. }
  20797. var totalLength = this.getTotalLength();
  20798. if (totalLength <= 0) {
  20799. return;
  20800. }
  20801. var tempLength = 0;
  20802. var tCache = [];
  20803. var segmentT;
  20804. var segmentL;
  20805. util_1.each(points, function (p, i) {
  20806. if (points[i + 1]) {
  20807. segmentT = [];
  20808. segmentT[0] = tempLength / totalLength;
  20809. segmentL = line_1.default.length(p[0], p[1], points[i + 1][0], points[i + 1][1]);
  20810. tempLength += segmentL;
  20811. segmentT[1] = tempLength / totalLength;
  20812. tCache.push(segmentT);
  20813. }
  20814. });
  20815. this.set('tCache', tCache);
  20816. };
  20817. /**
  20818. * Get start tangent vector
  20819. * @return {Array}
  20820. */
  20821. PolyLine.prototype.getStartTangent = function () {
  20822. var points = this.attr().points;
  20823. var result = [];
  20824. result.push([points[1][0], points[1][1]]);
  20825. result.push([points[0][0], points[0][1]]);
  20826. return result;
  20827. };
  20828. /**
  20829. * Get end tangent vector
  20830. * @return {Array}
  20831. */
  20832. PolyLine.prototype.getEndTangent = function () {
  20833. var points = this.attr().points;
  20834. var l = points.length - 1;
  20835. var result = [];
  20836. result.push([points[l - 1][0], points[l - 1][1]]);
  20837. result.push([points[l][0], points[l][1]]);
  20838. return result;
  20839. };
  20840. return PolyLine;
  20841. }(base_1.default));
  20842. exports.default = PolyLine;
  20843. /***/ }),
  20844. /***/ "./src/shape/rect.ts":
  20845. /*!***************************!*\
  20846. !*** ./src/shape/rect.ts ***!
  20847. \***************************/
  20848. /*! no static exports found */
  20849. /***/ (function(module, exports, __webpack_require__) {
  20850. "use strict";
  20851. /**
  20852. * @fileoverview 矩形
  20853. * @author dxq613@gmail.com
  20854. */
  20855. Object.defineProperty(exports, "__esModule", { value: true });
  20856. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20857. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20858. var parse_1 = __webpack_require__(/*! ../util/parse */ "./src/util/parse.ts");
  20859. var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
  20860. var rect_1 = __webpack_require__(/*! ../util/in-stroke/rect */ "./src/util/in-stroke/rect.ts");
  20861. var rect_radius_1 = __webpack_require__(/*! ../util/in-stroke/rect-radius */ "./src/util/in-stroke/rect-radius.ts");
  20862. var point_in_path_1 = __webpack_require__(/*! ../util/in-path/point-in-path */ "./src/util/in-path/point-in-path.ts");
  20863. var Rect = /** @class */ (function (_super) {
  20864. tslib_1.__extends(Rect, _super);
  20865. function Rect() {
  20866. return _super !== null && _super.apply(this, arguments) || this;
  20867. }
  20868. Rect.prototype.getDefaultAttrs = function () {
  20869. var attrs = _super.prototype.getDefaultAttrs.call(this);
  20870. return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, width: 0, height: 0, radius: 0 });
  20871. };
  20872. Rect.prototype.isInStrokeOrPath = function (x, y, isStroke, isFill, lineWidth) {
  20873. var attrs = this.attr();
  20874. var minX = attrs.x;
  20875. var minY = attrs.y;
  20876. var width = attrs.width;
  20877. var height = attrs.height;
  20878. var radius = attrs.radius;
  20879. // 无圆角时的策略
  20880. if (!radius) {
  20881. var halfWidth = lineWidth / 2;
  20882. // 同时填充和带有边框
  20883. if (isFill && isStroke) {
  20884. return util_1.inBox(minX - halfWidth, minY - halfWidth, width + halfWidth, height + halfWidth, x, y);
  20885. }
  20886. // 仅填充
  20887. if (isFill) {
  20888. return util_1.inBox(minX, minY, width, height, x, y);
  20889. }
  20890. if (isStroke) {
  20891. return rect_1.default(minX, minY, width, height, lineWidth, x, y);
  20892. }
  20893. }
  20894. else {
  20895. var isHit = false;
  20896. if (isStroke) {
  20897. isHit = rect_radius_1.default(minX, minY, width, height, radius, lineWidth, x, y);
  20898. }
  20899. // 仅填充时带有圆角的矩形直接通过图形拾取
  20900. // 以后可以改成纯数学的近似拾取,将圆弧切割成多边形
  20901. if (!isHit && isFill) {
  20902. isHit = point_in_path_1.default(this, x, y);
  20903. }
  20904. return isHit;
  20905. }
  20906. };
  20907. Rect.prototype.createPath = function (context) {
  20908. var attrs = this.attr();
  20909. var x = attrs.x;
  20910. var y = attrs.y;
  20911. var width = attrs.width;
  20912. var height = attrs.height;
  20913. var radius = attrs.radius;
  20914. context.beginPath();
  20915. if (radius === 0) {
  20916. // 改成原生的rect方法
  20917. context.rect(x, y, width, height);
  20918. }
  20919. else {
  20920. var _a = parse_1.parseRadius(radius), r1 = _a[0], r2 = _a[1], r3 = _a[2], r4 = _a[3];
  20921. context.moveTo(x + r1, y);
  20922. context.lineTo(x + width - r2, y);
  20923. r2 !== 0 && context.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);
  20924. context.lineTo(x + width, y + height - r3);
  20925. r3 !== 0 && context.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);
  20926. context.lineTo(x + r4, y + height);
  20927. r4 !== 0 && context.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);
  20928. context.lineTo(x, y + r1);
  20929. r1 !== 0 && context.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);
  20930. context.closePath();
  20931. }
  20932. };
  20933. return Rect;
  20934. }(base_1.default));
  20935. exports.default = Rect;
  20936. /***/ }),
  20937. /***/ "./src/shape/text.ts":
  20938. /*!***************************!*\
  20939. !*** ./src/shape/text.ts ***!
  20940. \***************************/
  20941. /*! no static exports found */
  20942. /***/ (function(module, exports, __webpack_require__) {
  20943. "use strict";
  20944. /**
  20945. * @fileoverview 文本
  20946. * @author dxq613@gmail.com
  20947. */
  20948. Object.defineProperty(exports, "__esModule", { value: true });
  20949. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  20950. var base_1 = __webpack_require__(/*! ./base */ "./src/shape/base.ts");
  20951. var util_1 = __webpack_require__(/*! ../util/util */ "./src/util/util.ts");
  20952. var text_1 = __webpack_require__(/*! @antv/g-base/lib/util/text */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/text.js");
  20953. var Text = /** @class */ (function (_super) {
  20954. tslib_1.__extends(Text, _super);
  20955. function Text() {
  20956. return _super !== null && _super.apply(this, arguments) || this;
  20957. }
  20958. // 默认文本属性
  20959. Text.prototype.getDefaultAttrs = function () {
  20960. var attrs = _super.prototype.getDefaultAttrs.call(this);
  20961. return tslib_1.__assign(tslib_1.__assign({}, attrs), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: 'sans-serif', fontStyle: 'normal', fontWeight: 'normal', fontVariant: 'normal', textAlign: 'start', textBaseline: 'bottom' });
  20962. };
  20963. // 仅仅使用包围盒检测来进行拾取
  20964. Text.prototype.isOnlyHitBox = function () {
  20965. return true;
  20966. };
  20967. // 初始化时组合 font,同时判断 text 是否换行
  20968. Text.prototype.initAttrs = function (attrs) {
  20969. this._assembleFont();
  20970. if (attrs.text) {
  20971. this._setText(attrs.text);
  20972. }
  20973. };
  20974. // 组装字体
  20975. Text.prototype._assembleFont = function () {
  20976. var attrs = this.attrs;
  20977. attrs.font = text_1.assembleFont(attrs);
  20978. };
  20979. // 如果文本换行,则缓存数组
  20980. Text.prototype._setText = function (text) {
  20981. var textArr = null;
  20982. if (util_1.isString(text) && text.indexOf('\n') !== -1) {
  20983. textArr = text.split('\n');
  20984. }
  20985. this.set('textArr', textArr);
  20986. };
  20987. // 更新属性时,检测是否更改了 font、text
  20988. Text.prototype.onAttrChange = function (name, value, originValue) {
  20989. _super.prototype.onAttrChange.call(this, name, value, originValue);
  20990. if (name.startsWith('font')) {
  20991. this._assembleFont();
  20992. }
  20993. if (name === 'text') {
  20994. this._setText(value);
  20995. }
  20996. };
  20997. // 这个方法在 text 时没有可以做的事情,如果要支持文字背景时可以考虑
  20998. // createPath(context) {
  20999. // }
  21000. // 如果文本多行,需要获取文本间距
  21001. Text.prototype._getSpaceingY = function () {
  21002. var attrs = this.attrs;
  21003. var lineHeight = attrs.lineHeight;
  21004. var fontSize = attrs.fontSize * 1;
  21005. return lineHeight ? lineHeight - fontSize : fontSize * 0.14;
  21006. };
  21007. // 绘制文本,考虑多行的场景
  21008. Text.prototype._drawTextArr = function (context, textArr, isFill) {
  21009. var attrs = this.attrs;
  21010. var textBaseline = attrs.textBaseline;
  21011. var x = attrs.x;
  21012. var y = attrs.y;
  21013. var fontSize = attrs.fontSize * 1;
  21014. var spaceingY = this._getSpaceingY();
  21015. var height = text_1.getTextHeight(attrs.text, attrs.fontSize, attrs.lineHeight);
  21016. var subY;
  21017. util_1.each(textArr, function (subText, index) {
  21018. subY = y + index * (spaceingY + fontSize) - height + fontSize; // bottom;
  21019. if (textBaseline === 'middle')
  21020. subY += height - fontSize - (height - fontSize) / 2;
  21021. if (textBaseline === 'top')
  21022. subY += height - fontSize;
  21023. if (isFill) {
  21024. context.fillText(subText, x, subY);
  21025. }
  21026. else {
  21027. context.strokeText(subText, x, subY);
  21028. }
  21029. });
  21030. };
  21031. // 绘制文本,同时考虑填充和绘制边框
  21032. Text.prototype._drawText = function (context, isFill) {
  21033. var attrs = this.attr();
  21034. var x = attrs.x;
  21035. var y = attrs.y;
  21036. var textArr = this.get('textArr');
  21037. if (textArr) {
  21038. this._drawTextArr(context, textArr, isFill);
  21039. }
  21040. else {
  21041. var text = attrs.text;
  21042. if (isFill) {
  21043. context.fillText(text, x, y);
  21044. }
  21045. else {
  21046. context.strokeText(text, x, y);
  21047. }
  21048. }
  21049. };
  21050. // 复写绘制和填充的逻辑:对于文本,应该先绘制边框,再进行填充
  21051. Text.prototype.strokeAndFill = function (context) {
  21052. var _a = this.attrs, lineWidth = _a.lineWidth, opacity = _a.opacity, strokeOpacity = _a.strokeOpacity, fillOpacity = _a.fillOpacity;
  21053. if (this.isStroke()) {
  21054. if (lineWidth > 0) {
  21055. if (!util_1.isNil(strokeOpacity) && strokeOpacity !== 1) {
  21056. context.globalAlpha = opacity;
  21057. }
  21058. this.stroke(context);
  21059. }
  21060. }
  21061. if (this.isFill()) {
  21062. if (!util_1.isNil(fillOpacity) && fillOpacity !== 1) {
  21063. context.globalAlpha = fillOpacity;
  21064. this.fill(context);
  21065. context.globalAlpha = opacity;
  21066. }
  21067. else {
  21068. this.fill(context);
  21069. }
  21070. }
  21071. this.afterDrawPath(context);
  21072. };
  21073. // 复写填充逻辑
  21074. Text.prototype.fill = function (context) {
  21075. this._drawText(context, true);
  21076. };
  21077. // 复写绘制边框的逻辑
  21078. Text.prototype.stroke = function (context) {
  21079. this._drawText(context, false);
  21080. };
  21081. return Text;
  21082. }(base_1.default));
  21083. exports.default = Text;
  21084. /***/ }),
  21085. /***/ "./src/types.ts":
  21086. /*!**********************!*\
  21087. !*** ./src/types.ts ***!
  21088. \**********************/
  21089. /*! no static exports found */
  21090. /***/ (function(module, exports, __webpack_require__) {
  21091. "use strict";
  21092. Object.defineProperty(exports, "__esModule", { value: true });
  21093. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  21094. // 导出 g-base 中的 types
  21095. tslib_1.__exportStar(__webpack_require__(/*! @antv/g-base/lib/types */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/types.js"), exports);
  21096. /***/ }),
  21097. /***/ "./src/util/arc-params.ts":
  21098. /*!********************************!*\
  21099. !*** ./src/util/arc-params.ts ***!
  21100. \********************************/
  21101. /*! no static exports found */
  21102. /***/ (function(module, exports, __webpack_require__) {
  21103. "use strict";
  21104. Object.defineProperty(exports, "__esModule", { value: true });
  21105. var util_1 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
  21106. // 向量长度
  21107. function vMag(v) {
  21108. return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
  21109. }
  21110. // u.v/|u||v|,计算夹角的余弦值
  21111. function vRatio(u, v) {
  21112. // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1
  21113. return vMag(u) * vMag(v) ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)) : 1;
  21114. }
  21115. // 向量角度
  21116. function vAngle(u, v) {
  21117. return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));
  21118. }
  21119. // A 0:rx 1:ry 2:x-axis-rotation 3:large-arc-flag 4:sweep-flag 5: x 6: y
  21120. function getArcParams(startPoint, params) {
  21121. var rx = params[1];
  21122. var ry = params[2];
  21123. var xRotation = util_1.mod(util_1.toRadian(params[3]), Math.PI * 2);
  21124. var arcFlag = params[4];
  21125. var sweepFlag = params[5];
  21126. // 弧形起点坐标
  21127. var x1 = startPoint[0];
  21128. var y1 = startPoint[1];
  21129. // 弧形终点坐标
  21130. var x2 = params[6];
  21131. var y2 = params[7];
  21132. var xp = (Math.cos(xRotation) * (x1 - x2)) / 2.0 + (Math.sin(xRotation) * (y1 - y2)) / 2.0;
  21133. var yp = (-1 * Math.sin(xRotation) * (x1 - x2)) / 2.0 + (Math.cos(xRotation) * (y1 - y2)) / 2.0;
  21134. var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);
  21135. if (lambda > 1) {
  21136. rx *= Math.sqrt(lambda);
  21137. ry *= Math.sqrt(lambda);
  21138. }
  21139. var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);
  21140. var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;
  21141. if (arcFlag === sweepFlag) {
  21142. f *= -1;
  21143. }
  21144. if (isNaN(f)) {
  21145. f = 0;
  21146. }
  21147. // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理
  21148. var cxp = ry ? (f * rx * yp) / ry : 0;
  21149. var cyp = rx ? (f * -ry * xp) / rx : 0;
  21150. // 椭圆圆心坐标
  21151. var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;
  21152. var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp;
  21153. // 起始点的单位向量
  21154. var u = [(xp - cxp) / rx, (yp - cyp) / ry];
  21155. // 终止点的单位向量
  21156. var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];
  21157. // 计算起始点和圆心的连线,与 x 轴正方向的夹角
  21158. var theta = vAngle([1, 0], u);
  21159. // 计算圆弧起始点和终止点与椭圆圆心连线的夹角
  21160. var dTheta = vAngle(u, v);
  21161. if (vRatio(u, v) <= -1) {
  21162. dTheta = Math.PI;
  21163. }
  21164. if (vRatio(u, v) >= 1) {
  21165. dTheta = 0;
  21166. }
  21167. if (sweepFlag === 0 && dTheta > 0) {
  21168. dTheta = dTheta - 2 * Math.PI;
  21169. }
  21170. if (sweepFlag === 1 && dTheta < 0) {
  21171. dTheta = dTheta + 2 * Math.PI;
  21172. }
  21173. return {
  21174. cx: cx,
  21175. cy: cy,
  21176. // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理
  21177. rx: util_1.isSamePoint(startPoint, [x2, y2]) ? 0 : rx,
  21178. ry: util_1.isSamePoint(startPoint, [x2, y2]) ? 0 : ry,
  21179. startAngle: theta,
  21180. endAngle: theta + dTheta,
  21181. xRotation: xRotation,
  21182. arcFlag: arcFlag,
  21183. sweepFlag: sweepFlag,
  21184. };
  21185. }
  21186. exports.default = getArcParams;
  21187. /***/ }),
  21188. /***/ "./src/util/arrow.ts":
  21189. /*!***************************!*\
  21190. !*** ./src/util/arrow.ts ***!
  21191. \***************************/
  21192. /*! no static exports found */
  21193. /***/ (function(module, exports, __webpack_require__) {
  21194. "use strict";
  21195. Object.defineProperty(exports, "__esModule", { value: true });
  21196. exports.addEndArrow = exports.addStartArrow = exports.getShortenOffset = void 0;
  21197. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  21198. var shape_1 = __webpack_require__(/*! ../shape */ "./src/shape/index.ts");
  21199. var sin = Math.sin, cos = Math.cos, atan2 = Math.atan2, PI = Math.PI;
  21200. function _addDefaultArrow(shape, attrs, x1, y1, x2, y2, isStart) {
  21201. var stroke = attrs.stroke, lineWidth = attrs.lineWidth;
  21202. var x = x1 - x2;
  21203. var y = y1 - y2;
  21204. var rad = atan2(y, x);
  21205. var arrowShape = new shape_1.Path({
  21206. type: 'path',
  21207. canvas: shape.get('canvas'),
  21208. isArrowShape: true,
  21209. attrs: {
  21210. // 默认箭头的边长为 10,夹角为 60 度
  21211. path: "M" + 10 * cos(PI / 6) + "," + 10 * sin(PI / 6) + " L0,0 L" + 10 * cos(PI / 6) + ",-" + 10 * sin(PI / 6),
  21212. // 使用 shape stroke 值
  21213. stroke: stroke,
  21214. lineWidth: lineWidth,
  21215. },
  21216. });
  21217. arrowShape.translate(x2, y2);
  21218. arrowShape.rotateAtPoint(x2, y2, rad);
  21219. shape.set(isStart ? 'startArrowShape' : 'endArrowShape', arrowShape);
  21220. }
  21221. /**
  21222. * 箭头 path 的设置要求
  21223. * 1. 箭头顶点坐标需要为 (0, 0)
  21224. * 2. 箭头夹角的中心分割线需要与 X 轴正方向对齐
  21225. */
  21226. function _addCustomizedArrow(shape, attrs, x1, y1, x2, y2, isStart) {
  21227. var startArrow = attrs.startArrow, endArrow = attrs.endArrow, stroke = attrs.stroke, lineWidth = attrs.lineWidth;
  21228. var arrowAttrs = isStart ? startArrow : endArrow;
  21229. var d = arrowAttrs.d, arrowFill = arrowAttrs.fill, arrowStroke = arrowAttrs.stroke, arrowLineWidth = arrowAttrs.lineWidth, restAttrs = tslib_1.__rest(arrowAttrs, ["d", "fill", "stroke", "lineWidth"]);
  21230. var x = x1 - x2;
  21231. var y = y1 - y2;
  21232. var rad = atan2(y, x);
  21233. if (d) {
  21234. x2 = x2 - cos(rad) * d;
  21235. y2 = y2 - sin(rad) * d;
  21236. }
  21237. var arrowShape = new shape_1.Path({
  21238. type: 'path',
  21239. canvas: shape.get('canvas'),
  21240. isArrowShape: true,
  21241. attrs: tslib_1.__assign(tslib_1.__assign({}, restAttrs), {
  21242. // 支持单独设置箭头的 stroke 和 lineWidth,若为空则使用 shape 的值
  21243. stroke: arrowStroke || stroke, lineWidth: arrowLineWidth || lineWidth,
  21244. // 箭头是否填充需要手动设置,不会继承自 shape 的值
  21245. fill: arrowFill }),
  21246. });
  21247. arrowShape.translate(x2, y2);
  21248. arrowShape.rotateAtPoint(x2, y2, rad);
  21249. shape.set(isStart ? 'startArrowShape' : 'endArrowShape', arrowShape);
  21250. }
  21251. /**
  21252. * 如果自定义箭头并且有 d 需要做偏移,如果直接画,线条会超出箭头尖端,因此需要根据箭头偏移 d, 返回线需要缩短的距离
  21253. * |----------------
  21254. * |<|--------------
  21255. * |
  21256. * @param {number} x1 起始点 x
  21257. * @param {number} y1 起始点 y
  21258. * @param {number} x2 箭头作用点 x
  21259. * @param {number} y2 箭头作用点 y
  21260. * @param {number} d 箭头沿线条方向的偏移距离
  21261. * @return {{dx: number, dy: number}} 返回线条偏移距离
  21262. */
  21263. function getShortenOffset(x1, y1, x2, y2, d) {
  21264. var rad = atan2(y2 - y1, x2 - x1);
  21265. return {
  21266. dx: cos(rad) * d,
  21267. dy: sin(rad) * d,
  21268. };
  21269. }
  21270. exports.getShortenOffset = getShortenOffset;
  21271. /**
  21272. * 绘制起始箭头
  21273. * @param {IShape} shape 图形
  21274. * @param {ShapeAttrs} attrs shape 的绘图属性
  21275. * @param {number} x1 起始点 x
  21276. * @param {number} y1 起始点 y
  21277. * @param {number} x2 箭头作用点 x
  21278. * @param {number} y2 箭头作用点 y
  21279. */
  21280. function addStartArrow(shape, attrs, x1, y1, x2, y2) {
  21281. if (typeof attrs.startArrow === 'object') {
  21282. _addCustomizedArrow(shape, attrs, x1, y1, x2, y2, true);
  21283. }
  21284. else if (attrs.startArrow) {
  21285. _addDefaultArrow(shape, attrs, x1, y1, x2, y2, true);
  21286. }
  21287. else {
  21288. shape.set('startArrowShape', null);
  21289. }
  21290. }
  21291. exports.addStartArrow = addStartArrow;
  21292. /**
  21293. * 绘制结束箭头
  21294. * @param {IShape} shape 图形
  21295. * @param {ShapeAttrs} attrs shape 的绘图属性
  21296. * @param {number} x1 起始点 x
  21297. * @param {number} y1 起始点 y
  21298. * @param {number} x2 箭头作用点 x
  21299. * @param {number} y2 箭头作用点 y
  21300. */
  21301. function addEndArrow(shape, attrs, x1, y1, x2, y2) {
  21302. if (typeof attrs.endArrow === 'object') {
  21303. _addCustomizedArrow(shape, attrs, x1, y1, x2, y2, false);
  21304. }
  21305. else if (attrs.endArrow) {
  21306. _addDefaultArrow(shape, attrs, x1, y1, x2, y2, false);
  21307. }
  21308. else {
  21309. shape.set('startArrowShape', null);
  21310. }
  21311. }
  21312. exports.addEndArrow = addEndArrow;
  21313. /***/ }),
  21314. /***/ "./src/util/draw.ts":
  21315. /*!**************************!*\
  21316. !*** ./src/util/draw.ts ***!
  21317. \**************************/
  21318. /*! no static exports found */
  21319. /***/ (function(module, exports, __webpack_require__) {
  21320. "use strict";
  21321. Object.defineProperty(exports, "__esModule", { value: true });
  21322. exports.mergeView = exports.getMergedRegion = exports.getRefreshRegion = exports.refreshElement = exports.drawPath = exports.clearChanged = exports.checkChildrenRefresh = exports.checkRefresh = exports.drawChildren = exports.applyAttrsToContext = void 0;
  21323. var util_1 = __webpack_require__(/*! @antv/util */ "./node_modules/_@antv_util@2.0.9@@antv/util/esm/index.js");
  21324. var parse_1 = __webpack_require__(/*! ./parse */ "./src/util/parse.ts");
  21325. var arc_params_1 = __webpack_require__(/*! ./arc-params */ "./src/util/arc-params.ts");
  21326. var util_2 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
  21327. var ArrowUtil = __webpack_require__(/*! ../util/arrow */ "./src/util/arrow.ts");
  21328. var SHAPE_ATTRS_MAP = {
  21329. fill: 'fillStyle',
  21330. stroke: 'strokeStyle',
  21331. opacity: 'globalAlpha',
  21332. };
  21333. function applyAttrsToContext(context, element) {
  21334. var attrs = element.attr();
  21335. for (var k in attrs) {
  21336. var v = attrs[k];
  21337. // 转换一下不与 canvas 兼容的属性名
  21338. var name = SHAPE_ATTRS_MAP[k] ? SHAPE_ATTRS_MAP[k] : k;
  21339. if (name === 'matrix' && v) {
  21340. // 设置矩阵
  21341. context.transform(v[0], v[1], v[3], v[4], v[6], v[7]);
  21342. }
  21343. else if (name === 'lineDash' && context.setLineDash) {
  21344. // 设置虚线,只支持数组形式,非数组形式不做任何操作
  21345. util_1.isArray(v) && context.setLineDash(v);
  21346. }
  21347. else {
  21348. if (name === 'strokeStyle' || name === 'fillStyle') {
  21349. // 如果存在渐变、pattern 这个开销有些大
  21350. // 可以考虑缓存机制,通过 hasUpdate 来避免一些运算
  21351. v = parse_1.parseStyle(context, element, v);
  21352. }
  21353. else if (name === 'globalAlpha') {
  21354. // opacity 效果可以叠加,子元素的 opacity 需要与父元素 opacity 相乘
  21355. v = v * context.globalAlpha;
  21356. }
  21357. context[name] = v;
  21358. }
  21359. }
  21360. }
  21361. exports.applyAttrsToContext = applyAttrsToContext;
  21362. function drawChildren(context, children, region) {
  21363. for (var i = 0; i < children.length; i++) {
  21364. var child = children[i];
  21365. if (child.cfg.visible) {
  21366. child.draw(context, region);
  21367. }
  21368. else {
  21369. child.skipDraw();
  21370. }
  21371. }
  21372. }
  21373. exports.drawChildren = drawChildren;
  21374. // 这个地方的逻辑比较复杂,简单画了一张图:https://www.yuque.com/antv/ou292n/pcgt5g#OW1QE
  21375. function checkRefresh(canvas, children, region) {
  21376. var refreshElements = canvas.get('refreshElements');
  21377. // 先遍历需要刷新的元素,将这些元素的父元素也设置 refresh
  21378. util_1.each(refreshElements, function (el) {
  21379. if (el !== canvas) {
  21380. var parent = el.cfg.parent;
  21381. while (parent && parent !== canvas && !parent.cfg.refresh) {
  21382. parent.cfg.refresh = true;
  21383. parent = parent.cfg.parent;
  21384. }
  21385. }
  21386. });
  21387. if (refreshElements[0] === canvas) {
  21388. setChildrenRefresh(children, region);
  21389. }
  21390. else {
  21391. // 检查所有子元素是否可以刷新
  21392. checkChildrenRefresh(children, region);
  21393. }
  21394. }
  21395. exports.checkRefresh = checkRefresh;
  21396. // 检查所有的子元素是否应该更新
  21397. function checkChildrenRefresh(children, region) {
  21398. for (var i = 0; i < children.length; i++) {
  21399. var child = children[i];
  21400. if (child.cfg.visible) {
  21401. // 如果当前图形/分组 refresh = true,说明其子节点存在 changed
  21402. if (child.cfg.refresh) {
  21403. if (child.isGroup()) {
  21404. checkChildrenRefresh(child.cfg.children, region);
  21405. }
  21406. }
  21407. else if (child.cfg.hasChanged) {
  21408. // 如果节点发生了 change,则需要级联设置子元素的 refresh
  21409. child.cfg.refresh = true;
  21410. if (child.isGroup()) {
  21411. setChildrenRefresh(child.cfg.children, region);
  21412. }
  21413. }
  21414. else {
  21415. // 这个分支说明此次局部刷新,所有的节点和父元素没有发生变化,仅需要检查包围盒(缓存)是否相交即可
  21416. child.cfg.refresh = checkElementRefresh(child, region);
  21417. }
  21418. }
  21419. }
  21420. }
  21421. exports.checkChildrenRefresh = checkChildrenRefresh;
  21422. // 由于对改变的图形放入 refreshElements 时做了优化,判定父元素 changed 时不加入
  21423. // 那么有可能会出现 elements 都为空,所以最终 group
  21424. function clearChanged(elements) {
  21425. for (var i = 0; i < elements.length; i++) {
  21426. var el = elements[i];
  21427. el.cfg.hasChanged = false;
  21428. // 级联清理
  21429. if (el.isGroup()) {
  21430. clearChanged(el.cfg.children);
  21431. }
  21432. }
  21433. }
  21434. exports.clearChanged = clearChanged;
  21435. // 当某个父元素发生改变时,调用这个方法级联设置 refresh
  21436. function setChildrenRefresh(children, region) {
  21437. for (var i = 0; i < children.length; i++) {
  21438. var child = children[i];
  21439. // let refresh = true;
  21440. // 获取缓存的 bbox,如果这个 bbox 还存在则说明父元素不是矩阵发生了改变
  21441. // const bbox = child.cfg.canvasBBox;
  21442. // if (bbox) {
  21443. // // 如果这时候
  21444. // refresh = intersectRect(bbox, region);
  21445. // }
  21446. child.cfg.refresh = true;
  21447. // 如果需要刷新当前节点,所有的子元素设置 refresh
  21448. if (child.isGroup()) {
  21449. setChildrenRefresh(child.get('children'), region);
  21450. }
  21451. }
  21452. }
  21453. function checkElementRefresh(shape, region) {
  21454. var bbox = shape.cfg.cacheCanvasBBox;
  21455. var isAllow = shape.cfg.isInView && bbox && util_2.intersectRect(bbox, region);
  21456. return isAllow;
  21457. }
  21458. // 绘制 path
  21459. function drawPath(shape, context, attrs, arcParamsCache) {
  21460. var path = attrs.path, startArrow = attrs.startArrow, endArrow = attrs.endArrow;
  21461. var currentPoint = [0, 0]; // 当前图形
  21462. var startMovePoint = [0, 0]; // 开始 M 的点,可能会有多个
  21463. var distance = {
  21464. dx: 0,
  21465. dy: 0,
  21466. };
  21467. context.beginPath();
  21468. for (var i = 0; i < path.length; i++) {
  21469. var params = path[i];
  21470. var command = params[0];
  21471. if (i === 0 && startArrow && startArrow.d) {
  21472. var tangent = shape.getStartTangent();
  21473. distance = ArrowUtil.getShortenOffset(tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], startArrow.d);
  21474. }
  21475. else if (i === path.length - 2 && path[i + 1][0] === 'Z' && endArrow && endArrow.d) {
  21476. // 为了防止结尾为 Z 的 segment 缩短不起效,需要取最后两个 segment 特殊处理
  21477. var lastPath = path[i + 1];
  21478. if (lastPath[0] === 'Z') {
  21479. var tangent = shape.getEndTangent();
  21480. distance = ArrowUtil.getShortenOffset(tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);
  21481. }
  21482. }
  21483. else if (i === path.length - 1 && endArrow && endArrow.d) {
  21484. if (path[0] !== 'Z') {
  21485. var tangent = shape.getEndTangent();
  21486. distance = ArrowUtil.getShortenOffset(tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);
  21487. }
  21488. }
  21489. var dx = distance.dx, dy = distance.dy;
  21490. // V,H,S,T 都在前面被转换成标准形式
  21491. switch (command) {
  21492. case 'M':
  21493. context.moveTo(params[1] - dx, params[2] - dy);
  21494. startMovePoint = [params[1], params[2]];
  21495. break;
  21496. case 'L':
  21497. context.lineTo(params[1] - dx, params[2] - dy);
  21498. break;
  21499. case 'Q':
  21500. context.quadraticCurveTo(params[1], params[2], params[3] - dx, params[4] - dy);
  21501. break;
  21502. case 'C':
  21503. context.bezierCurveTo(params[1], params[2], params[3], params[4], params[5] - dx, params[6] - dy);
  21504. break;
  21505. case 'A': {
  21506. var arcParams = void 0;
  21507. // 为了加速绘制,可以提供参数的缓存,各个图形自己缓存
  21508. if (arcParamsCache) {
  21509. arcParams = arcParamsCache[i];
  21510. if (!arcParams) {
  21511. arcParams = arc_params_1.default(currentPoint, params);
  21512. arcParamsCache[i] = arcParams;
  21513. }
  21514. }
  21515. else {
  21516. arcParams = arc_params_1.default(currentPoint, params);
  21517. }
  21518. var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation, sweepFlag = arcParams.sweepFlag;
  21519. // 直接使用椭圆的 api
  21520. if (context.ellipse) {
  21521. context.ellipse(cx, cy, rx, ry, xRotation, startAngle, endAngle, 1 - sweepFlag);
  21522. }
  21523. else {
  21524. var r = rx > ry ? rx : ry;
  21525. var scaleX = rx > ry ? 1 : rx / ry;
  21526. var scaleY = rx > ry ? ry / rx : 1;
  21527. context.translate(cx, cy);
  21528. context.rotate(xRotation);
  21529. context.scale(scaleX, scaleY);
  21530. context.arc(0, 0, r, startAngle, endAngle, 1 - sweepFlag);
  21531. context.scale(1 / scaleX, 1 / scaleY);
  21532. context.rotate(-xRotation);
  21533. context.translate(-cx, -cy);
  21534. }
  21535. break;
  21536. }
  21537. case 'Z':
  21538. context.closePath();
  21539. break;
  21540. default:
  21541. break;
  21542. }
  21543. // 有了 Z 后,当前节点从开始 M 的点开始
  21544. if (command === 'Z') {
  21545. currentPoint = startMovePoint;
  21546. }
  21547. else {
  21548. var len = params.length;
  21549. currentPoint = [params[len - 2], params[len - 1]];
  21550. }
  21551. }
  21552. }
  21553. exports.drawPath = drawPath;
  21554. // 刷新图形元素(Shape 或者 Group)
  21555. function refreshElement(element, changeType) {
  21556. var canvas = element.get('canvas');
  21557. // 只有存在于 canvas 上时生效
  21558. if (canvas) {
  21559. if (changeType === 'remove') {
  21560. // 一旦 remove,则无法在 element 上拿到包围盒
  21561. // destroy 后所有属性都拿不到,所以需要暂存一下
  21562. // 这是一段 hack 的代码
  21563. element._cacheCanvasBBox = element.get('cacheCanvasBBox');
  21564. }
  21565. // 防止反复刷新
  21566. if (!element.get('hasChanged')) {
  21567. // 但是始终要标记为 hasChanged,便于后面进行局部渲染
  21568. element.set('hasChanged', true);
  21569. // 本来只有局部渲染模式下,才需要记录更新的元素队列
  21570. // if (canvas.get('localRefresh')) {
  21571. // canvas.refreshElement(element, changeType, canvas);
  21572. // }
  21573. // 但对于 https://github.com/antvis/g/issues/422 的场景,全局渲染的模式下也需要记录更新的元素队列
  21574. // 如果当前元素的父元素发生了改变,可以不放入队列,这句话大概能够提升 15% 的初次渲染性能
  21575. if (!(element.cfg.parent && element.cfg.parent.get('hasChanged'))) {
  21576. canvas.refreshElement(element, changeType, canvas);
  21577. if (canvas.get('autoDraw')) {
  21578. canvas.draw();
  21579. }
  21580. }
  21581. }
  21582. }
  21583. }
  21584. exports.refreshElement = refreshElement;
  21585. function getRefreshRegion(element) {
  21586. var region;
  21587. if (!element.destroyed) {
  21588. var cacheBox = element.get('cacheCanvasBBox');
  21589. var validCache = cacheBox && !!(cacheBox.width && cacheBox.height);
  21590. var bbox = element.getCanvasBBox();
  21591. var validBBox = bbox && !!(bbox.width && bbox.height);
  21592. // 是否是有效 bbox 判定,一些 NaN 或者 宽高为 0 的情况过滤掉
  21593. if (validCache && validBBox) {
  21594. region = util_2.mergeRegion(cacheBox, bbox);
  21595. }
  21596. else if (validCache) {
  21597. region = cacheBox;
  21598. }
  21599. else if (validBBox) {
  21600. region = bbox;
  21601. }
  21602. }
  21603. else {
  21604. // 因为元素已经销毁所以无法获取到缓存的包围盒
  21605. region = element['_cacheCanvasBBox'];
  21606. }
  21607. return region;
  21608. }
  21609. exports.getRefreshRegion = getRefreshRegion;
  21610. function getMergedRegion(elements) {
  21611. if (!elements.length) {
  21612. return null;
  21613. }
  21614. var minXArr = [];
  21615. var minYArr = [];
  21616. var maxXArr = [];
  21617. var maxYArr = [];
  21618. util_1.each(elements, function (el) {
  21619. var region = getRefreshRegion(el);
  21620. if (region) {
  21621. minXArr.push(region.minX);
  21622. minYArr.push(region.minY);
  21623. maxXArr.push(region.maxX);
  21624. maxYArr.push(region.maxY);
  21625. }
  21626. });
  21627. return {
  21628. minX: Math.min.apply(null, minXArr),
  21629. minY: Math.min.apply(null, minYArr),
  21630. maxX: Math.max.apply(null, maxXArr),
  21631. maxY: Math.max.apply(null, maxYArr),
  21632. };
  21633. }
  21634. exports.getMergedRegion = getMergedRegion;
  21635. function mergeView(region, viewRegion) {
  21636. if (!region || !viewRegion) {
  21637. return null;
  21638. }
  21639. // 不相交,则直接返回 null
  21640. if (!util_2.intersectRect(region, viewRegion)) {
  21641. return null;
  21642. }
  21643. return {
  21644. minX: Math.max(region.minX, viewRegion.minX),
  21645. minY: Math.max(region.minY, viewRegion.minY),
  21646. maxX: Math.min(region.maxX, viewRegion.maxX),
  21647. maxY: Math.min(region.maxY, viewRegion.maxY),
  21648. };
  21649. }
  21650. exports.mergeView = mergeView;
  21651. /***/ }),
  21652. /***/ "./src/util/hit.ts":
  21653. /*!*************************!*\
  21654. !*** ./src/util/hit.ts ***!
  21655. \*************************/
  21656. /*! no static exports found */
  21657. /***/ (function(module, exports, __webpack_require__) {
  21658. "use strict";
  21659. Object.defineProperty(exports, "__esModule", { value: true });
  21660. exports.getShape = void 0;
  21661. var util_1 = __webpack_require__(/*! @antv/g-base/lib/util/util */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/util.js");
  21662. var matrix_1 = __webpack_require__(/*! @antv/g-base/lib/util/matrix */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/matrix.js");
  21663. function invertFromMatrix(v, matrix) {
  21664. if (matrix) {
  21665. var invertMatrix = matrix_1.invert(matrix);
  21666. return matrix_1.multiplyVec2(invertMatrix, v);
  21667. }
  21668. return v;
  21669. }
  21670. function getRefXY(element, x, y) {
  21671. // @ts-ignore
  21672. var totalMatrix = element.getTotalMatrix();
  21673. if (totalMatrix) {
  21674. var _a = invertFromMatrix([x, y, 1], totalMatrix), refX = _a[0], refY = _a[1];
  21675. return [refX, refY];
  21676. }
  21677. return [x, y];
  21678. }
  21679. // 拾取前的检测,只有通过检测才能继续拾取
  21680. function preTest(element, x, y) {
  21681. // @ts-ignore
  21682. if (element.isCanvas && element.isCanvas()) {
  21683. return true;
  21684. }
  21685. // 不允许被拾取,则返回 null
  21686. // @ts-ignore
  21687. if (!util_1.isAllowCapture(element) || element.cfg.isInView === false) {
  21688. return false;
  21689. }
  21690. if (element.cfg.clipShape) {
  21691. // 如果存在 clip
  21692. var _a = getRefXY(element, x, y), refX = _a[0], refY = _a[1];
  21693. if (element.isClipped(refX, refY)) {
  21694. return false;
  21695. }
  21696. }
  21697. // @ts-ignore ,这个地方调用过于频繁
  21698. var bbox = element.cfg.cacheCanvasBBox || element.getCanvasBBox();
  21699. // 如果没有缓存 bbox,则说明不可见
  21700. // 注释掉的这段可能会加速拾取,上面的语句改写成 const bbox = element.cfg.cacheCanvasBBox;
  21701. // 这时候的拾取假设图形/分组在上一次绘制都在视窗内,但是上面已经判定了 isInView 所以意义不大
  21702. // 现在还调用 element.getCanvasBBox(); 一个很大的原因是便于单元测试
  21703. // if (!bbox) {
  21704. // return false;
  21705. // }
  21706. if (!(x >= bbox.minX && x <= bbox.maxX && y >= bbox.minY && y <= bbox.maxY)) {
  21707. return false;
  21708. }
  21709. return true;
  21710. }
  21711. // 这个方法复写了 g-base 的 getShape
  21712. function getShape(container, x, y) {
  21713. // 没有通过检测,则返回 null
  21714. if (!preTest(container, x, y)) {
  21715. return null;
  21716. }
  21717. var shape = null;
  21718. var children = container.getChildren();
  21719. var count = children.length;
  21720. for (var i = count - 1; i >= 0; i--) {
  21721. var child = children[i];
  21722. if (child.isGroup()) {
  21723. shape = getShape(child, x, y);
  21724. }
  21725. else if (preTest(child, x, y)) {
  21726. var curShape = child;
  21727. var _a = getRefXY(child, x, y), refX = _a[0], refY = _a[1];
  21728. // @ts-ignore
  21729. if (curShape.isInShape(refX, refY)) {
  21730. shape = child;
  21731. }
  21732. }
  21733. if (shape) {
  21734. break;
  21735. }
  21736. }
  21737. return shape;
  21738. }
  21739. exports.getShape = getShape;
  21740. /***/ }),
  21741. /***/ "./src/util/in-path/point-in-path.ts":
  21742. /*!*******************************************!*\
  21743. !*** ./src/util/in-path/point-in-path.ts ***!
  21744. \*******************************************/
  21745. /*! no static exports found */
  21746. /***/ (function(module, exports, __webpack_require__) {
  21747. "use strict";
  21748. Object.defineProperty(exports, "__esModule", { value: true });
  21749. var offscreen_1 = __webpack_require__(/*! @antv/g-base/lib/util/offscreen */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/lib/util/offscreen.js");
  21750. function isPointInPath(shape, x, y) {
  21751. var ctx = offscreen_1.getOffScreenContext();
  21752. shape.createPath(ctx);
  21753. return ctx.isPointInPath(x, y);
  21754. }
  21755. exports.default = isPointInPath;
  21756. /***/ }),
  21757. /***/ "./src/util/in-path/polygon.ts":
  21758. /*!*************************************!*\
  21759. !*** ./src/util/in-path/polygon.ts ***!
  21760. \*************************************/
  21761. /*! no static exports found */
  21762. /***/ (function(module, exports, __webpack_require__) {
  21763. "use strict";
  21764. /**
  21765. * @fileoverview 判断点是否在多边形内
  21766. * @author dxq613@gmail.com
  21767. */
  21768. Object.defineProperty(exports, "__esModule", { value: true });
  21769. // 多边形的射线检测,参考:https://blog.csdn.net/WilliamSun0122/article/details/77994526
  21770. var tolerance = 1e-6;
  21771. // 三态函数,判断两个double在eps精度下的大小关系
  21772. function dcmp(x) {
  21773. if (Math.abs(x) < tolerance) {
  21774. return 0;
  21775. }
  21776. return x < 0 ? -1 : 1;
  21777. }
  21778. // 判断点Q是否在p1和p2的线段上
  21779. function onSegment(p1, p2, q) {
  21780. if ((q[0] - p1[0]) * (p2[1] - p1[1]) === (p2[0] - p1[0]) * (q[1] - p1[1]) &&
  21781. Math.min(p1[0], p2[0]) <= q[0] &&
  21782. q[0] <= Math.max(p1[0], p2[0]) &&
  21783. Math.min(p1[1], p2[1]) <= q[1] &&
  21784. q[1] <= Math.max(p1[1], p2[1])) {
  21785. return true;
  21786. }
  21787. return false;
  21788. }
  21789. // 判断点P在多边形内-射线法
  21790. function isInPolygon(points, x, y) {
  21791. var isHit = false;
  21792. var n = points.length;
  21793. if (n <= 2) {
  21794. // svg 中点小于 3 个时,不显示,也无法被拾取
  21795. return false;
  21796. }
  21797. for (var i = 0; i < n; i++) {
  21798. var p1 = points[i];
  21799. var p2 = points[(i + 1) % n];
  21800. if (onSegment(p1, p2, [x, y])) {
  21801. // 点在多边形一条边上
  21802. return true;
  21803. }
  21804. // 前一个判断min(p1[1],p2[1])<P.y<=max(p1[1],p2[1])
  21805. // 后一个判断被测点 在 射线与边交点 的左边
  21806. if (dcmp(p1[1] - y) > 0 !== dcmp(p2[1] - y) > 0 &&
  21807. dcmp(x - ((y - p1[1]) * (p1[0] - p2[0])) / (p1[1] - p2[1]) - p1[0]) < 0) {
  21808. isHit = !isHit;
  21809. }
  21810. }
  21811. return isHit;
  21812. }
  21813. exports.default = isInPolygon;
  21814. /***/ }),
  21815. /***/ "./src/util/in-stroke/arc.ts":
  21816. /*!***********************************!*\
  21817. !*** ./src/util/in-stroke/arc.ts ***!
  21818. \***********************************/
  21819. /*! no static exports found */
  21820. /***/ (function(module, exports, __webpack_require__) {
  21821. "use strict";
  21822. Object.defineProperty(exports, "__esModule", { value: true });
  21823. var util_1 = __webpack_require__(/*! ../util */ "./src/util/util.ts");
  21824. function arc(cx, cy, r, startAngle, endAngle, lineWidth, x, y) {
  21825. var angle = (Math.atan2(y - cy, x - cx) + Math.PI * 2) % (Math.PI * 2); // 转换到 0 - 2 * Math.PI 之间
  21826. if (angle < startAngle || angle > endAngle) {
  21827. return false;
  21828. }
  21829. var point = {
  21830. x: cx + r * Math.cos(angle),
  21831. y: cy + r * Math.sin(angle),
  21832. };
  21833. return util_1.distance(point.x, point.y, x, y) <= lineWidth / 2;
  21834. }
  21835. exports.default = arc;
  21836. /***/ }),
  21837. /***/ "./src/util/in-stroke/line.ts":
  21838. /*!************************************!*\
  21839. !*** ./src/util/in-stroke/line.ts ***!
  21840. \************************************/
  21841. /*! no static exports found */
  21842. /***/ (function(module, exports, __webpack_require__) {
  21843. "use strict";
  21844. Object.defineProperty(exports, "__esModule", { value: true });
  21845. var line_1 = __webpack_require__(/*! @antv/g-math/lib/line */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/line.js");
  21846. function inLine(x1, y1, x2, y2, lineWidth, x, y) {
  21847. var minX = Math.min(x1, x2);
  21848. var maxX = Math.max(x1, x2);
  21849. var minY = Math.min(y1, y2);
  21850. var maxY = Math.max(y1, y2);
  21851. var halfWidth = lineWidth / 2;
  21852. // 因为目前的方案是计算点到直线的距离,而有可能会在延长线上,所以要先判断是否在包围盒内
  21853. // 这种方案会在水平或者竖直的情况下载线的延长线上有半 lineWidth 的误差
  21854. if (!(x >= minX - halfWidth && x <= maxX + halfWidth && y >= minY - halfWidth && y <= maxY + halfWidth)) {
  21855. return false;
  21856. }
  21857. // 因为已经计算了包围盒,所以仅需要计算到直线的距离即可,可以显著提升性能
  21858. return line_1.default.pointToLine(x1, y1, x2, y2, x, y) <= lineWidth / 2;
  21859. }
  21860. exports.default = inLine;
  21861. /***/ }),
  21862. /***/ "./src/util/in-stroke/polyline.ts":
  21863. /*!****************************************!*\
  21864. !*** ./src/util/in-stroke/polyline.ts ***!
  21865. \****************************************/
  21866. /*! no static exports found */
  21867. /***/ (function(module, exports, __webpack_require__) {
  21868. "use strict";
  21869. Object.defineProperty(exports, "__esModule", { value: true });
  21870. var line_1 = __webpack_require__(/*! ./line */ "./src/util/in-stroke/line.ts");
  21871. function inPolyline(points, lineWidth, x, y, isClose) {
  21872. var count = points.length;
  21873. if (count < 2) {
  21874. return false;
  21875. }
  21876. for (var i = 0; i < count - 1; i++) {
  21877. var x1 = points[i][0];
  21878. var y1 = points[i][1];
  21879. var x2 = points[i + 1][0];
  21880. var y2 = points[i + 1][1];
  21881. if (line_1.default(x1, y1, x2, y2, lineWidth, x, y)) {
  21882. return true;
  21883. }
  21884. }
  21885. // 如果封闭,则计算起始点和结束点的边
  21886. if (isClose) {
  21887. var first = points[0];
  21888. var last = points[count - 1];
  21889. if (line_1.default(first[0], first[1], last[0], last[1], lineWidth, x, y)) {
  21890. return true;
  21891. }
  21892. }
  21893. return false;
  21894. }
  21895. exports.default = inPolyline;
  21896. /***/ }),
  21897. /***/ "./src/util/in-stroke/rect-radius.ts":
  21898. /*!*******************************************!*\
  21899. !*** ./src/util/in-stroke/rect-radius.ts ***!
  21900. \*******************************************/
  21901. /*! no static exports found */
  21902. /***/ (function(module, exports, __webpack_require__) {
  21903. "use strict";
  21904. Object.defineProperty(exports, "__esModule", { value: true });
  21905. var line_1 = __webpack_require__(/*! ./line */ "./src/util/in-stroke/line.ts");
  21906. var arc_1 = __webpack_require__(/*! ./arc */ "./src/util/in-stroke/arc.ts");
  21907. function rectWithRadius(minX, minY, width, height, radius, lineWidth, x, y) {
  21908. var halfWidth = lineWidth / 2;
  21909. return (line_1.default(minX + radius, minY, minX + width - radius, minY, lineWidth, x, y) ||
  21910. line_1.default(minX + width, minY + radius, minX + width, minY + height - radius, lineWidth, x, y) ||
  21911. line_1.default(minX + width - radius, minY + height, minX + radius, minY + height, lineWidth, x, y) ||
  21912. line_1.default(minX, minY + height - radius, minX, minY + radius, lineWidth, x, y) ||
  21913. arc_1.default(minX + width - radius, minY + radius, radius, 1.5 * Math.PI, 2 * Math.PI, lineWidth, x, y) ||
  21914. arc_1.default(minX + width - radius, minY + height - radius, radius, 0, 0.5 * Math.PI, lineWidth, x, y) ||
  21915. arc_1.default(minX + radius, minY + height - radius, radius, 0.5 * Math.PI, Math.PI, lineWidth, x, y) ||
  21916. arc_1.default(minX + radius, minY + radius, radius, Math.PI, 1.5 * Math.PI, lineWidth, x, y));
  21917. }
  21918. exports.default = rectWithRadius;
  21919. /***/ }),
  21920. /***/ "./src/util/in-stroke/rect.ts":
  21921. /*!************************************!*\
  21922. !*** ./src/util/in-stroke/rect.ts ***!
  21923. \************************************/
  21924. /*! no static exports found */
  21925. /***/ (function(module, exports, __webpack_require__) {
  21926. "use strict";
  21927. Object.defineProperty(exports, "__esModule", { value: true });
  21928. var util_1 = __webpack_require__(/*! ../util */ "./src/util/util.ts");
  21929. function inRect(minX, minY, width, height, lineWidth, x, y) {
  21930. var halfWidth = lineWidth / 2;
  21931. // 将四个边看做矩形来检测,比边的检测算法要快
  21932. return (util_1.inBox(minX - halfWidth, minY - halfWidth, width, lineWidth, x, y) || // 上边
  21933. util_1.inBox(minX + width - halfWidth, minY - halfWidth, lineWidth, height, x, y) || // 右边
  21934. util_1.inBox(minX + halfWidth, minY + height - halfWidth, width, lineWidth, x, y) || // 下边
  21935. util_1.inBox(minX - halfWidth, minY + halfWidth, lineWidth, height, x, y)); // 左边
  21936. }
  21937. exports.default = inRect;
  21938. /***/ }),
  21939. /***/ "./src/util/parse.ts":
  21940. /*!***************************!*\
  21941. !*** ./src/util/parse.ts ***!
  21942. \***************************/
  21943. /*! no static exports found */
  21944. /***/ (function(module, exports, __webpack_require__) {
  21945. "use strict";
  21946. Object.defineProperty(exports, "__esModule", { value: true });
  21947. exports.parseRadius = exports.parseStyle = exports.parsePattern = exports.parseRadialGradient = exports.parseLineGradient = void 0;
  21948. var util_1 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
  21949. var regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi;
  21950. var regexDot = /[^\s\,]+/gi;
  21951. var regexLG = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i;
  21952. var regexRG = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i;
  21953. var regexPR = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i;
  21954. var regexColorStop = /[\d.]+:(#[^\s]+|[^\)]+\))/gi;
  21955. function addStop(steps, gradient) {
  21956. var arr = steps.match(regexColorStop);
  21957. util_1.each(arr, function (item) {
  21958. var itemArr = item.split(':');
  21959. gradient.addColorStop(itemArr[0], itemArr[1]);
  21960. });
  21961. }
  21962. /**
  21963. * 将边和填充设置的颜色转换成线性渐变对象
  21964. * @param {CanvasRenderingContext2D} context canvas 上下文
  21965. * @param {IElement} element 图形元素
  21966. * @param {string} gradientStr 颜色
  21967. * @returns {any} 渐变对象
  21968. */
  21969. function parseLineGradient(context, element, gradientStr) {
  21970. var arr = regexLG.exec(gradientStr);
  21971. var angle = (parseFloat(arr[1]) % 360) * (Math.PI / 180);
  21972. var steps = arr[2];
  21973. var box = element.getBBox();
  21974. var start;
  21975. var end;
  21976. if (angle >= 0 && angle < (1 / 2) * Math.PI) {
  21977. start = {
  21978. x: box.minX,
  21979. y: box.minY,
  21980. };
  21981. end = {
  21982. x: box.maxX,
  21983. y: box.maxY,
  21984. };
  21985. }
  21986. else if ((1 / 2) * Math.PI <= angle && angle < Math.PI) {
  21987. start = {
  21988. x: box.maxX,
  21989. y: box.minY,
  21990. };
  21991. end = {
  21992. x: box.minX,
  21993. y: box.maxY,
  21994. };
  21995. }
  21996. else if (Math.PI <= angle && angle < (3 / 2) * Math.PI) {
  21997. start = {
  21998. x: box.maxX,
  21999. y: box.maxY,
  22000. };
  22001. end = {
  22002. x: box.minX,
  22003. y: box.minY,
  22004. };
  22005. }
  22006. else {
  22007. start = {
  22008. x: box.minX,
  22009. y: box.maxY,
  22010. };
  22011. end = {
  22012. x: box.maxX,
  22013. y: box.minY,
  22014. };
  22015. }
  22016. var tanTheta = Math.tan(angle);
  22017. var tanTheta2 = tanTheta * tanTheta;
  22018. var x = (end.x - start.x + tanTheta * (end.y - start.y)) / (tanTheta2 + 1) + start.x;
  22019. var y = (tanTheta * (end.x - start.x + tanTheta * (end.y - start.y))) / (tanTheta2 + 1) + start.y;
  22020. var gradient = context.createLinearGradient(start.x, start.y, x, y);
  22021. addStop(steps, gradient);
  22022. return gradient;
  22023. }
  22024. exports.parseLineGradient = parseLineGradient;
  22025. /**
  22026. * 将边和填充设置的颜色转换成圆形渐变对象
  22027. * @param {CanvasRenderingContext2D} context canvas 上下文
  22028. * @param {IElement} element 图形元素
  22029. * @param {string} gradientStr 颜色
  22030. * @returns {any} 渐变对象
  22031. */
  22032. function parseRadialGradient(context, element, gradientStr) {
  22033. var arr = regexRG.exec(gradientStr);
  22034. var fx = parseFloat(arr[1]);
  22035. var fy = parseFloat(arr[2]);
  22036. var fr = parseFloat(arr[3]);
  22037. var steps = arr[4];
  22038. // 环半径为0时,默认无渐变,取渐变序列的最后一个颜色
  22039. if (fr === 0) {
  22040. var colors = steps.match(regexColorStop);
  22041. return colors[colors.length - 1].split(':')[1];
  22042. }
  22043. var box = element.getBBox();
  22044. var width = box.maxX - box.minX;
  22045. var height = box.maxY - box.minY;
  22046. var r = Math.sqrt(width * width + height * height) / 2;
  22047. var gradient = context.createRadialGradient(box.minX + width * fx, box.minY + height * fy, 0, box.minX + width / 2, box.minY + height / 2, fr * r);
  22048. addStop(steps, gradient);
  22049. return gradient;
  22050. }
  22051. exports.parseRadialGradient = parseRadialGradient;
  22052. /**
  22053. * 边和填充设置的颜色转换成 pattern
  22054. * @param {CanvasRenderingContext2D} context canvas 上下文
  22055. * @param {IElement} element 图形元素
  22056. * @param {string} patternStr 生成 pattern 的字符串
  22057. */
  22058. function parsePattern(context, element, patternStr) {
  22059. // 在转换过程中进行了缓存
  22060. if (element.get('patternSource') && element.get('patternSource') === patternStr) {
  22061. return element.get('pattern');
  22062. }
  22063. var pattern;
  22064. var img;
  22065. var arr = regexPR.exec(patternStr);
  22066. var repeat = arr[1];
  22067. var source = arr[2];
  22068. // Function to be called when pattern loads
  22069. function onload() {
  22070. // Create pattern
  22071. pattern = context.createPattern(img, repeat);
  22072. element.set('pattern', pattern); // be a cache
  22073. element.set('patternSource', patternStr);
  22074. }
  22075. switch (repeat) {
  22076. case 'a':
  22077. repeat = 'repeat';
  22078. break;
  22079. case 'x':
  22080. repeat = 'repeat-x';
  22081. break;
  22082. case 'y':
  22083. repeat = 'repeat-y';
  22084. break;
  22085. case 'n':
  22086. repeat = 'no-repeat';
  22087. break;
  22088. default:
  22089. repeat = 'no-repeat';
  22090. }
  22091. img = new Image();
  22092. // If source URL is not a data URL
  22093. if (!source.match(/^data:/i)) {
  22094. // Set crossOrigin for this image
  22095. img.crossOrigin = 'Anonymous';
  22096. }
  22097. img.src = source;
  22098. if (img.complete) {
  22099. onload();
  22100. }
  22101. else {
  22102. img.onload = onload;
  22103. // Fix onload() bug in IE9
  22104. img.src = img.src;
  22105. }
  22106. return pattern;
  22107. }
  22108. exports.parsePattern = parsePattern;
  22109. function parseStyle(context, element, color) {
  22110. if (util_1.isString(color)) {
  22111. if (color[1] === '(' || color[2] === '(') {
  22112. if (color[0] === 'l') {
  22113. // regexLG.test(color)
  22114. return parseLineGradient(context, element, color);
  22115. }
  22116. if (color[0] === 'r') {
  22117. // regexRG.test(color)
  22118. return parseRadialGradient(context, element, color);
  22119. }
  22120. if (color[0] === 'p') {
  22121. // regexPR.test(color)
  22122. return parsePattern(context, element, color);
  22123. }
  22124. }
  22125. return color;
  22126. }
  22127. }
  22128. exports.parseStyle = parseStyle;
  22129. function parseRadius(radius) {
  22130. var r1 = 0;
  22131. var r2 = 0;
  22132. var r3 = 0;
  22133. var r4 = 0;
  22134. if (util_1.isArray(radius)) {
  22135. if (radius.length === 1) {
  22136. r1 = r2 = r3 = r4 = radius[0];
  22137. }
  22138. else if (radius.length === 2) {
  22139. r1 = r3 = radius[0];
  22140. r2 = r4 = radius[1];
  22141. }
  22142. else if (radius.length === 3) {
  22143. r1 = radius[0];
  22144. r2 = r4 = radius[1];
  22145. r3 = radius[2];
  22146. }
  22147. else {
  22148. r1 = radius[0];
  22149. r2 = radius[1];
  22150. r3 = radius[2];
  22151. r4 = radius[3];
  22152. }
  22153. }
  22154. else {
  22155. r1 = r2 = r3 = r4 = radius;
  22156. }
  22157. return [r1, r2, r3, r4];
  22158. }
  22159. exports.parseRadius = parseRadius;
  22160. /***/ }),
  22161. /***/ "./src/util/path.ts":
  22162. /*!**************************!*\
  22163. !*** ./src/util/path.ts ***!
  22164. \**************************/
  22165. /*! no static exports found */
  22166. /***/ (function(module, exports, __webpack_require__) {
  22167. "use strict";
  22168. Object.defineProperty(exports, "__esModule", { value: true });
  22169. var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/_tslib@1.13.0@tslib/tslib.es6.js");
  22170. /**
  22171. * @fileoverview path 的一些工具
  22172. * @author dxq613@gmail.com
  22173. */
  22174. var g_base_1 = __webpack_require__(/*! @antv/g-base */ "./node_modules/_@antv_g-base@0.5.0-beta.1@@antv/g-base/esm/index.js");
  22175. var quadratic_1 = __webpack_require__(/*! @antv/g-math/lib/quadratic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/quadratic.js");
  22176. var cubic_1 = __webpack_require__(/*! @antv/g-math/lib/cubic */ "./node_modules/_@antv_g-math@0.1.3@@antv/g-math/lib/cubic.js");
  22177. var util_1 = __webpack_require__(/*! ./util */ "./src/util/util.ts");
  22178. var line_1 = __webpack_require__(/*! ./in-stroke/line */ "./src/util/in-stroke/line.ts");
  22179. var arc_1 = __webpack_require__(/*! ./in-stroke/arc */ "./src/util/in-stroke/arc.ts");
  22180. var mat3_1 = __webpack_require__(/*! @antv/matrix-util/lib/mat3 */ "./node_modules/_@antv_matrix-util@3.0.3@@antv/matrix-util/lib/mat3.js");
  22181. var vec3 = __webpack_require__(/*! gl-matrix/vec3 */ "./node_modules/_gl-matrix@3.3.0@gl-matrix/esm/vec3.js");
  22182. function hasArc(path) {
  22183. var hasArc = false;
  22184. var count = path.length;
  22185. for (var i = 0; i < count; i++) {
  22186. var params = path[i];
  22187. var cmd = params[0];
  22188. if (cmd === 'C' || cmd === 'A' || cmd === 'Q') {
  22189. hasArc = true;
  22190. break;
  22191. }
  22192. }
  22193. return hasArc;
  22194. }
  22195. function isPointInStroke(segments, lineWidth, x, y) {
  22196. var isHit = false;
  22197. var halfWidth = lineWidth / 2;
  22198. for (var i = 0; i < segments.length; i++) {
  22199. var segment = segments[i];
  22200. var currentPoint = segment.currentPoint, params = segment.params, prePoint = segment.prePoint, box = segment.box;
  22201. // 如果在前面已经生成过包围盒,直接按照包围盒计算
  22202. if (box && !util_1.inBox(box.x - halfWidth, box.y - halfWidth, box.width + lineWidth, box.height + lineWidth, x, y)) {
  22203. continue;
  22204. }
  22205. switch (segment.command) {
  22206. // L 和 Z 都是直线, M 不进行拾取
  22207. case 'L':
  22208. case 'Z':
  22209. isHit = line_1.default(prePoint[0], prePoint[1], currentPoint[0], currentPoint[1], lineWidth, x, y);
  22210. break;
  22211. case 'Q':
  22212. var qDistance = quadratic_1.default.pointDistance(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], x, y);
  22213. isHit = qDistance <= lineWidth / 2;
  22214. break;
  22215. case 'C':
  22216. var cDistance = cubic_1.default.pointDistance(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], params[5], params[6], x, y);
  22217. isHit = cDistance <= lineWidth / 2;
  22218. break;
  22219. case 'A':
  22220. // 计算点到椭圆圆弧的距离,暂时使用近似算法,后面可以改成切割法求最近距离
  22221. var arcParams = segment.arcParams;
  22222. var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation;
  22223. var p = [x, y, 1];
  22224. var r = rx > ry ? rx : ry;
  22225. var scaleX = rx > ry ? 1 : rx / ry;
  22226. var scaleY = rx > ry ? ry / rx : 1;
  22227. var m = mat3_1.transform(null, [
  22228. ['t', -cx, -cy],
  22229. ['r', -xRotation],
  22230. ['s', 1 / scaleX, 1 / scaleY],
  22231. ]);
  22232. vec3.transformMat3(p, p, m);
  22233. isHit = arc_1.default(0, 0, r, startAngle, endAngle, lineWidth, p[0], p[1]);
  22234. break;
  22235. default:
  22236. break;
  22237. }
  22238. if (isHit) {
  22239. break;
  22240. }
  22241. }
  22242. return isHit;
  22243. }
  22244. /**
  22245. * 提取出内部的闭合多边形和非闭合的多边形,假设 path 不存在圆弧
  22246. * @param {Array} path 路径
  22247. * @returns {Array} 点的集合
  22248. */
  22249. function extractPolygons(path) {
  22250. var count = path.length;
  22251. var polygons = [];
  22252. var polylines = [];
  22253. var points = []; // 防止第一个命令不是 'M'
  22254. for (var i = 0; i < count; i++) {
  22255. var params = path[i];
  22256. var cmd = params[0];
  22257. if (cmd === 'M') {
  22258. // 遇到 'M' 判定是否是新数组,新数组中没有点
  22259. if (points.length) {
  22260. // 如果存在点,则说明没有遇到 'Z',开始了一个新的多边形
  22261. polylines.push(points);
  22262. points = []; // 创建新的点
  22263. }
  22264. points.push([params[1], params[2]]);
  22265. }
  22266. else if (cmd === 'Z') {
  22267. if (points.length) {
  22268. // 存在点
  22269. polygons.push(points);
  22270. points = []; // 开始新的点集合
  22271. }
  22272. // 如果不存在点,同时 'Z',则说明是错误,不处理
  22273. }
  22274. else {
  22275. points.push([params[1], params[2]]);
  22276. }
  22277. }
  22278. // 说明 points 未放入 polygons 或者 polyline
  22279. // 仅当只有一个 M,没有 Z 时会发生这种情况
  22280. if (points.length > 0) {
  22281. polylines.push(points);
  22282. }
  22283. return {
  22284. polygons: polygons,
  22285. polylines: polylines,
  22286. };
  22287. }
  22288. exports.default = tslib_1.__assign({ hasArc: hasArc,
  22289. extractPolygons: extractPolygons,
  22290. isPointInStroke: isPointInStroke }, g_base_1.PathUtil);
  22291. /***/ }),
  22292. /***/ "./src/util/util.ts":
  22293. /*!**************************!*\
  22294. !*** ./src/util/util.ts ***!
  22295. \**************************/
  22296. /*! no static exports found */
  22297. /***/ (function(module, exports, __webpack_require__) {
  22298. "use strict";
  22299. Object.defineProperty(exports, "__esModule", { value: true });
  22300. exports.isSamePoint = exports.mergeRegion = exports.intersectRect = exports.inBox = exports.distance = exports.getPixelRatio = void 0;
  22301. function getPixelRatio() {
  22302. return window ? window.devicePixelRatio : 1;
  22303. }
  22304. exports.getPixelRatio = getPixelRatio;
  22305. /**
  22306. * 两点之间的距离
  22307. * @param {number} x1 起始点 x
  22308. * @param {number} y1 起始点 y
  22309. * @param {number} x2 结束点 x
  22310. * @param {number} y2 结束点 y
  22311. */
  22312. function distance(x1, y1, x2, y2) {
  22313. var dx = x1 - x2;
  22314. var dy = y1 - y2;
  22315. return Math.sqrt(dx * dx + dy * dy);
  22316. }
  22317. exports.distance = distance;
  22318. /**
  22319. * 是否在包围盒内
  22320. * @param {number} minX 包围盒开始的点 x
  22321. * @param {number} minY 包围盒开始的点 y
  22322. * @param {number} width 宽度
  22323. * @param {number} height 高度
  22324. * @param {[type]} x 检测点的 x
  22325. * @param {[type]} y 监测点的 y
  22326. */
  22327. function inBox(minX, minY, width, height, x, y) {
  22328. return x >= minX && x <= minX + width && y >= minY && y <= minY + height;
  22329. }
  22330. exports.inBox = inBox;
  22331. function intersectRect(box1, box2) {
  22332. return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);
  22333. }
  22334. exports.intersectRect = intersectRect;
  22335. // 合并两个区域
  22336. function mergeRegion(region1, region2) {
  22337. if (!region1 || !region2) {
  22338. return region1 || region2;
  22339. }
  22340. return {
  22341. minX: Math.min(region1.minX, region2.minX),
  22342. minY: Math.min(region1.minY, region2.minY),
  22343. maxX: Math.max(region1.maxX, region2.maxX),
  22344. maxY: Math.max(region1.maxY, region2.maxY),
  22345. };
  22346. }
  22347. exports.mergeRegion = mergeRegion;
  22348. /**
  22349. * 判断两个点是否重合,点坐标的格式为 [x, y]
  22350. * @param {Array} point1 第一个点
  22351. * @param {Array} point2 第二个点
  22352. */
  22353. function isSamePoint(point1, point2) {
  22354. return point1[0] === point2[0] && point1[1] === point2[1];
  22355. }
  22356. exports.isSamePoint = isSamePoint;
  22357. var is_nil_1 = __webpack_require__(/*! @antv/util/lib/is-nil */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-nil.js");
  22358. Object.defineProperty(exports, "isNil", { enumerable: true, get: function () { return is_nil_1.default; } });
  22359. var is_string_1 = __webpack_require__(/*! @antv/util/lib/is-string */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-string.js");
  22360. Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return is_string_1.default; } });
  22361. var is_function_1 = __webpack_require__(/*! @antv/util/lib/is-function */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-function.js");
  22362. Object.defineProperty(exports, "isFunction", { enumerable: true, get: function () { return is_function_1.default; } });
  22363. var is_array_1 = __webpack_require__(/*! @antv/util/lib/is-array */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-array.js");
  22364. Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return is_array_1.default; } });
  22365. var each_1 = __webpack_require__(/*! @antv/util/lib/each */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/each.js");
  22366. Object.defineProperty(exports, "each", { enumerable: true, get: function () { return each_1.default; } });
  22367. var to_radian_1 = __webpack_require__(/*! @antv/util/lib/to-radian */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/to-radian.js");
  22368. Object.defineProperty(exports, "toRadian", { enumerable: true, get: function () { return to_radian_1.default; } });
  22369. var mod_1 = __webpack_require__(/*! @antv/util/lib/mod */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/mod.js");
  22370. Object.defineProperty(exports, "mod", { enumerable: true, get: function () { return mod_1.default; } });
  22371. var is_number_equal_1 = __webpack_require__(/*! @antv/util/lib/is-number-equal */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/is-number-equal.js");
  22372. Object.defineProperty(exports, "isNumberEqual", { enumerable: true, get: function () { return is_number_equal_1.default; } });
  22373. var request_animation_frame_1 = __webpack_require__(/*! @antv/util/lib/request-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/request-animation-frame.js");
  22374. Object.defineProperty(exports, "requestAnimationFrame", { enumerable: true, get: function () { return request_animation_frame_1.default; } });
  22375. var clear_animation_frame_1 = __webpack_require__(/*! @antv/util/lib/clear-animation-frame */ "./node_modules/_@antv_util@2.0.9@@antv/util/lib/clear-animation-frame.js");
  22376. Object.defineProperty(exports, "clearAnimationFrame", { enumerable: true, get: function () { return clear_animation_frame_1.default; } });
  22377. /***/ })
  22378. /******/ });
  22379. });
  22380. //# sourceMappingURL=g.min.js.map