mapViewDeps-J6NKGEYU.js 270 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088
  1. import {
  2. i as i4
  3. } from "./chunk-EEMLKLSH.js";
  4. import {
  5. ae
  6. } from "./chunk-OBOLLK7J.js";
  7. import "./chunk-CR67YDNV.js";
  8. import "./chunk-3XO4E4TL.js";
  9. import "./chunk-6G6XHVK2.js";
  10. import "./chunk-3RTOMVBL.js";
  11. import "./chunk-YR7YKE3S.js";
  12. import "./chunk-GSORSXL5.js";
  13. import {
  14. W as W3,
  15. m2 as m6,
  16. n as n13,
  17. n2 as n14,
  18. t as t8
  19. } from "./chunk-H3QCF24A.js";
  20. import {
  21. a as a6,
  22. s as s9
  23. } from "./chunk-YJKEIUMW.js";
  24. import {
  25. m as m5
  26. } from "./chunk-XWA3NEEY.js";
  27. import {
  28. n as n12,
  29. s as s8
  30. } from "./chunk-DHDOH23F.js";
  31. import {
  32. e as e5,
  33. e2 as e6
  34. } from "./chunk-JH3PLIM6.js";
  35. import "./chunk-UFOCENZS.js";
  36. import "./chunk-FCDUTNBY.js";
  37. import "./chunk-GZJP6H3U.js";
  38. import {
  39. e2 as e3
  40. } from "./chunk-PS4B3D6M.js";
  41. import "./chunk-DO6JJUZG.js";
  42. import {
  43. e as e2,
  44. n as n10,
  45. o as o8
  46. } from "./chunk-54X4RLMR.js";
  47. import {
  48. n as n6,
  49. o as o7,
  50. r2 as r7,
  51. s as s6
  52. } from "./chunk-MWIFVNKP.js";
  53. import "./chunk-MIWGTTJJ.js";
  54. import {
  55. P as P2
  56. } from "./chunk-LL6JU3GU.js";
  57. import {
  58. t as t4
  59. } from "./chunk-LSDW2622.js";
  60. import "./chunk-ZIWBDWEW.js";
  61. import "./chunk-IQNZZCQJ.js";
  62. import "./chunk-B2HJOMLZ.js";
  63. import "./chunk-II7RCTF3.js";
  64. import "./chunk-VS4BIQ2O.js";
  65. import "./chunk-HWIURR7X.js";
  66. import {
  67. Ae,
  68. Be,
  69. De,
  70. Ee,
  71. Ie,
  72. Me,
  73. Ne,
  74. Te,
  75. Ue,
  76. _e,
  77. ve,
  78. we
  79. } from "./chunk-Q4LKAPDF.js";
  80. import "./chunk-TODU7HVH.js";
  81. import {
  82. E as E2,
  83. I as I3,
  84. O as O4,
  85. S as S2
  86. } from "./chunk-23ONSYIH.js";
  87. import {
  88. t as t7
  89. } from "./chunk-P2L4QEOI.js";
  90. import {
  91. s as s7
  92. } from "./chunk-D6FGJON6.js";
  93. import {
  94. T as T2
  95. } from "./chunk-VGSBB3MM.js";
  96. import "./chunk-3T4BXU2T.js";
  97. import "./chunk-SRMDO2KR.js";
  98. import "./chunk-PZKZIMMP.js";
  99. import {
  100. d as d2
  101. } from "./chunk-YLVXZ2PS.js";
  102. import "./chunk-EE6TL7XD.js";
  103. import {
  104. A as A3,
  105. M as M3,
  106. W as W2,
  107. t as t5
  108. } from "./chunk-G3TNMPDJ.js";
  109. import {
  110. D as D2,
  111. c as c3,
  112. f as f5,
  113. i as i3,
  114. r as r9
  115. } from "./chunk-GDB2KX4Y.js";
  116. import {
  117. n as n8,
  118. u as u4
  119. } from "./chunk-546QCRS4.js";
  120. import {
  121. u as u3
  122. } from "./chunk-QXZVBSBH.js";
  123. import {
  124. t as t6
  125. } from "./chunk-EPIK5VPD.js";
  126. import "./chunk-T4GXZJ3D.js";
  127. import {
  128. m as m4
  129. } from "./chunk-DO7VQYJK.js";
  130. import "./chunk-773XI6MQ.js";
  131. import "./chunk-ILP23N26.js";
  132. import "./chunk-5NM43FFO.js";
  133. import {
  134. B as B2,
  135. C as C2,
  136. I as I2,
  137. J,
  138. N as N2,
  139. O as O3,
  140. U as U3,
  141. V as V2,
  142. Y as Y2,
  143. et,
  144. y as y2,
  145. z
  146. } from "./chunk-WFSV2B2I.js";
  147. import "./chunk-M5BTTMP6.js";
  148. import "./chunk-XZA4MVET.js";
  149. import {
  150. t as t3
  151. } from "./chunk-J525NRN3.js";
  152. import {
  153. A as A2,
  154. B,
  155. C,
  156. D,
  157. E,
  158. F,
  159. G,
  160. I,
  161. L as L2,
  162. M,
  163. N,
  164. O as O2,
  165. P,
  166. R,
  167. S,
  168. T,
  169. U as U2,
  170. V,
  171. W,
  172. X,
  173. Y,
  174. _,
  175. f as f3,
  176. n as n5,
  177. r as r6,
  178. t as t2
  179. } from "./chunk-MI7HWWFL.js";
  180. import "./chunk-Q34L5KZA.js";
  181. import {
  182. e as e4,
  183. e2 as e8,
  184. g as g2
  185. } from "./chunk-RATJTB73.js";
  186. import {
  187. $,
  188. Gt,
  189. Rt,
  190. St,
  191. bt,
  192. nt,
  193. pt,
  194. u as u5
  195. } from "./chunk-7BTL34ZE.js";
  196. import {
  197. e as e7
  198. } from "./chunk-ZHRMTKME.js";
  199. import "./chunk-ZVHTCCQC.js";
  200. import "./chunk-PCGDLSZ4.js";
  201. import "./chunk-CAYFEZCR.js";
  202. import {
  203. n as n9
  204. } from "./chunk-MFFE4I2S.js";
  205. import "./chunk-XBH7TGC2.js";
  206. import "./chunk-K3NA3LQS.js";
  207. import {
  208. l as l3
  209. } from "./chunk-LMCIAW5S.js";
  210. import "./chunk-OTS3UE5B.js";
  211. import "./chunk-6RAL4JPQ.js";
  212. import "./chunk-VAY3LZG7.js";
  213. import "./chunk-4E6K4P67.js";
  214. import "./chunk-TRK7CKWP.js";
  215. import {
  216. n as n7,
  217. o as o6
  218. } from "./chunk-LGW7TID4.js";
  219. import "./chunk-3OHML7FO.js";
  220. import {
  221. n as n11,
  222. r as r8
  223. } from "./chunk-G5AI6ZNE.js";
  224. import {
  225. m as m3,
  226. p
  227. } from "./chunk-5JK4DCPE.js";
  228. import {
  229. a as a5
  230. } from "./chunk-PK35UGFJ.js";
  231. import "./chunk-H6ETEALK.js";
  232. import "./chunk-FIYKFRB2.js";
  233. import "./chunk-P4UZNLD5.js";
  234. import "./chunk-FYNVVMWY.js";
  235. import "./chunk-Q52DVFYK.js";
  236. import "./chunk-HBMVUVZX.js";
  237. import {
  238. M as M2,
  239. f as f4,
  240. h as h2,
  241. l as l2
  242. } from "./chunk-CRGVDJI6.js";
  243. import "./chunk-QOV6ITMI.js";
  244. import "./chunk-DH2OBAUC.js";
  245. import "./chunk-TNLRDNTC.js";
  246. import {
  247. a as a3,
  248. r as r5,
  249. s as s5
  250. } from "./chunk-6P6NA7JB.js";
  251. import "./chunk-S7R5EXHN.js";
  252. import "./chunk-QTOOFNRV.js";
  253. import "./chunk-6EU7GFUT.js";
  254. import "./chunk-HZJYXMI6.js";
  255. import "./chunk-UPD4MTCL.js";
  256. import "./chunk-GRBROWI6.js";
  257. import {
  258. i as i2
  259. } from "./chunk-5NKYXKIA.js";
  260. import "./chunk-FTI5VP6T.js";
  261. import "./chunk-RZFGRBD7.js";
  262. import "./chunk-PUSPZYFZ.js";
  263. import "./chunk-EN7YGJWG.js";
  264. import "./chunk-VBNMTM7L.js";
  265. import "./chunk-3D3QEPRE.js";
  266. import "./chunk-JFNNSBWL.js";
  267. import "./chunk-LY74KTXV.js";
  268. import "./chunk-EWE6EXPY.js";
  269. import "./chunk-KUXNUNAI.js";
  270. import "./chunk-KMAHKQ2G.js";
  271. import "./chunk-522WBHUO.js";
  272. import "./chunk-WNCU6BFU.js";
  273. import "./chunk-PIGRDDRG.js";
  274. import "./chunk-XLV7RUSE.js";
  275. import "./chunk-NTUXR253.js";
  276. import "./chunk-C43UE3Z5.js";
  277. import "./chunk-H2KDMZTR.js";
  278. import {
  279. a as a4
  280. } from "./chunk-RMX2AZ4P.js";
  281. import {
  282. u
  283. } from "./chunk-NE3ESGA6.js";
  284. import {
  285. f as f2,
  286. h,
  287. l
  288. } from "./chunk-YIS6BAC3.js";
  289. import "./chunk-7XXXCK2A.js";
  290. import "./chunk-7ZIDBK7B.js";
  291. import {
  292. m as m2
  293. } from "./chunk-FONIFA5N.js";
  294. import "./chunk-65BYCSII.js";
  295. import "./chunk-WZQZRKNH.js";
  296. import "./chunk-LRDX4TO7.js";
  297. import "./chunk-6A4U74YA.js";
  298. import "./chunk-WJW5DUN6.js";
  299. import "./chunk-PJ7ZQ4VD.js";
  300. import {
  301. o as o5
  302. } from "./chunk-WDLTDV2L.js";
  303. import "./chunk-TERAW6FT.js";
  304. import "./chunk-N2663GRX.js";
  305. import "./chunk-O4FY3ITT.js";
  306. import {
  307. c as c2,
  308. i,
  309. u as u2
  310. } from "./chunk-WEMIK25H.js";
  311. import "./chunk-7N4X6GF3.js";
  312. import "./chunk-JXW4QTJA.js";
  313. import "./chunk-UXF37FQ4.js";
  314. import "./chunk-ZOEK6QHJ.js";
  315. import {
  316. o as o3,
  317. o2 as o4,
  318. q,
  319. s as s4
  320. } from "./chunk-XNLG7T2T.js";
  321. import {
  322. n as n4,
  323. o as o2,
  324. r as r4
  325. } from "./chunk-IR4PV7VK.js";
  326. import "./chunk-2Z6LERTI.js";
  327. import "./chunk-OWVBLVP3.js";
  328. import "./chunk-AFZ7XSEW.js";
  329. import "./chunk-4NKD334K.js";
  330. import "./chunk-65K7LC56.js";
  331. import "./chunk-ATPLLI5W.js";
  332. import "./chunk-MXB2XLKV.js";
  333. import "./chunk-XH7RUGVZ.js";
  334. import "./chunk-TBBTRX4O.js";
  335. import "./chunk-YBSUITLL.js";
  336. import "./chunk-ALDCDSPV.js";
  337. import {
  338. n as n3
  339. } from "./chunk-DT6EAZQ5.js";
  340. import "./chunk-HNOZUNJ4.js";
  341. import {
  342. U
  343. } from "./chunk-VNFRAYHO.js";
  344. import "./chunk-R5IG2D6H.js";
  345. import {
  346. It
  347. } from "./chunk-VBRY5KJM.js";
  348. import "./chunk-PDKDCAAD.js";
  349. import {
  350. j2 as j
  351. } from "./chunk-ECW2QABR.js";
  352. import "./chunk-GCDJLKH4.js";
  353. import "./chunk-MRJEICT6.js";
  354. import {
  355. A,
  356. d,
  357. e,
  358. n2 as n,
  359. n6 as n2,
  360. y3 as y
  361. } from "./chunk-Y3WMVFTW.js";
  362. import "./chunk-SAS7RONY.js";
  363. import "./chunk-WSRBH7BF.js";
  364. import "./chunk-IHXECKQQ.js";
  365. import {
  366. L,
  367. O,
  368. b,
  369. f,
  370. g,
  371. m,
  372. r2 as r3,
  373. v
  374. } from "./chunk-ULGDPLM2.js";
  375. import {
  376. r as r2,
  377. s as s2,
  378. s3
  379. } from "./chunk-EMJ4ZSM2.js";
  380. import "./chunk-IKP3YN53.js";
  381. import {
  382. a,
  383. a3 as a2,
  384. c,
  385. o,
  386. r,
  387. s,
  388. t
  389. } from "./chunk-GZT4BVFP.js";
  390. import "./chunk-A5ICIBVI.js";
  391. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js
  392. var e9 = { background: { "background.frag": "#ifdef PATTERN\nuniform lowp float u_opacity;\nuniform lowp sampler2D u_texture;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_tileTextureCoord;\n#else\nuniform lowp vec4 u_color;\n#endif\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main() {\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\ngl_FragColor = u_opacity * color;\n#else\ngl_FragColor = u_color;\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "background.vert": "precision mediump float;\nattribute vec2 a_pos;\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_coord_range;\nuniform mediump float u_depth;\n#ifdef PATTERN\nuniform mediump mat3 u_pattern_matrix;\nvarying mediump vec2 v_tileTextureCoord;\nuniform mediump vec4 u_tlbr;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\n#endif\nvoid main() {\ngl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0);\n#ifdef PATTERN\nv_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy;\nv_tlbr = u_tlbr / u_mosaicSize.xyxy;\n#endif\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\n}" }, circle: { "circle.frag": "precision lowp float;\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nmediump float dist = length(v_offset);\nmediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0);\nlowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width));\ngl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio);\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "circle.vert": "precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_circleTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_antialiasingWidth;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_stroke_color = stroke_color * stroke_opacity;\nv_stroke_width = stroke_width;\nv_radius = radius;\nv_blur = max(blur, u_antialiasingWidth / (radius + stroke_width));\nmediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\nv_offset = offset;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}" }, fill: { "fill.frag": "precision lowp float;\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\ngl_FragColor = v_color[3] * color;\n#else\ngl_FragColor = v_color;\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "fill.vert": "precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_fillTranslation;\n#ifdef PATTERN\n#include <util/util.glsl>\nuniform mediump vec2 u_mosaicSize;\nuniform mediump float u_patternFactor;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\n#ifdef PATTERN\nfloat patternWidth = nextPOT(tlbr.z - tlbr.x);\nfloat patternHeight = nextPOT(tlbr.w - tlbr.y);\nfloat scaleX = 1.0 / (patternWidth * u_patternFactor);\nfloat scaleY = 1.0 / (patternHeight * u_patternFactor);\nmat3 patterMat = mat3(scaleX, 0.0, 0.0,\n0.0, -scaleY, 0.0,\n0.0, 0.0, 1.0);\nv_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy;\nv_tlbr = tlbr / u_mosaicSize.xyxy;\n#endif\nvec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}" }, icon: { "icon.frag": "precision mediump float;\nuniform lowp sampler2D u_texture;\n#ifdef SDF\nuniform lowp vec4 u_color;\nuniform lowp vec4 u_outlineColor;\n#endif\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump flaot v_halo_width;\n#endif\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\n#include <util/encoding.glsl>\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef SDF\nlowp vec4 fillPixelColor = v_color;\nfloat d = rgba2float(texture2D(u_texture, v_tex)) - 0.5;\nconst float softEdgeRatio = 0.248062016;\nfloat size = max(v_size.x, v_size.y);\nfloat dist = d * softEdgeRatio * size;\nfillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\nif (v_halo_width > 0.25) {\nlowp vec4 outlinePixelColor = u_outlineColor;\nconst float outlineLimitRatio = (16.0 / 86.0);\nfloat clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y));\noutlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0);\ngl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor);\n}\nelse {\ngl_FragColor = v_opacity * fillPixelColor;\n}\n#else\nlowp vec4 texColor = texture2D(u_texture, v_tex);\ngl_FragColor = v_opacity * texColor;\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "icon.vert": "attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump float v_halo_width;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_iconTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nconst float C_OFFSET_PRECISION = 1.0 / 8.0;\nconst float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float tileCoordRatio = 1.0 / 8.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nv_color = color;\nv_opacity = opacity;\n#ifdef SDF\nv_halo_width = halo_width;\n#endif\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_opacity *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float delta_z = 0.0;\nmediump float rotated = mod(a_angle + u_mapRotation, 256.0);\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated));\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_opacity, 0.0);\nvec2 offset = C_OFFSET_PRECISION * a_vertexOffset;\nv_size = abs(offset);\n#ifdef SDF\noffset = (120.0 / 86.0) * offset;\n#endif\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nv_tex = a_tex.xy / u_mosaicSize;\n}" }, line: { "line.frag": "precision lowp float;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying mediump float v_blur;\n#if defined (PATTERN) || defined(SDF)\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\nuniform sampler2D u_texture;\nuniform mediump float u_antialiasing;\n#endif\n#ifdef SDF\n#include <util/encoding.glsl>\n#endif\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nmediump float fragDist = length(v_normal) * v_lineHalfWidth;\nlowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0);\n#ifdef PATTERN\nmediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio);\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nlowp vec4 color = texture2D(u_texture, texCoord);\ngl_FragColor = alpha * v_color[3] * color;\n#elif defined(SDF)\nmediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + 0.25 * v_normal.y;\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist = d * (v_lineHalfWidth + u_antialiasing / 2.0);\ngl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color;\n#else\ngl_FragColor = alpha * v_color;\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "line.vert": "precision mediump float;\nattribute vec2 a_pos;\nattribute vec4 a_extrude_offset;\nattribute vec4 a_dir_normal;\nattribute vec2 a_accumulatedDistance;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump float u_zoomFactor;\nuniform mediump vec2 u_lineTranslation;\nuniform mediump float u_antialiasing;\nuniform mediump float u_depth;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nconst float scale = 1.0 / 31.0;\nconst mediump float tileCoordRatio = 8.0;\n#if defined (SDF)\nconst mediump float sdfPatternHalfWidth = 15.5;\n#endif\n#if defined (PATTERN) || defined(SDF)\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\n#endif\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\nvarying mediump float v_lineHalfWidth;\nvarying mediump float v_blur;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_blur = blur + u_antialiasing;\nv_normal = a_dir_normal.zw * scale;\n#if defined (PATTERN) || defined(SDF)\nv_tlbr = tlbr / u_mosaicSize.xyxy;\nv_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w);\n#if defined (PATTERN)\nv_widthRatio = width / v_patternSize.y;\n#else\nv_widthRatio = width / sdfPatternHalfWidth / 2.0;\n#endif\n#endif\nv_lineHalfWidth = (width + u_antialiasing) * 0.5;\nmediump vec2 dir = a_dir_normal.xy * scale;\nmediump vec2 offset_ = a_extrude_offset.zw * scale * offset;\nmediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n#if defined (PATTERN) || defined(SDF)\nv_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_);\n#endif\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\n}" }, outline: { "outline.frag": "varying lowp vec4 v_color;\nvarying mediump vec2 v_normal;\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nlowp float dist = abs(v_normal.y);\nlowp float alpha = smoothstep(1.0, 0.0, dist);\ngl_FragColor = alpha * v_color;\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "outline.vert": "attribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_xnormal;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_fillTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_outline_width;\nvarying lowp vec2 v_normal;\nconst float scale = 1.0 / 15.0;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nv_normal = a_xnormal;\nmediump vec2 dist = u_outline_width * scale * a_offset;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}" }, text: { "text.frag": "uniform lowp sampler2D u_texture;\nvarying lowp vec2 v_tex;\nvarying lowp vec4 v_color;\nvarying mediump float v_edgeWidth;\nvarying mediump float v_edgeDistance;\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nlowp float dist = texture2D(u_texture, v_tex).a;\nmediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist);\ngl_FragColor = alpha * v_color;\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}", "text.vert": "attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_textTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying lowp vec2 v_tex;\nconst float offsetPrecision = 1.0 / 8.0;\nconst mediump float edgePos = 0.75;\nuniform mediump float u_antialiasingWidth;\nvarying mediump float v_edgeDistance;\nvarying mediump float v_edgeWidth;\nuniform lowp float u_halo;\nconst float sdfFontScale = 1.0 / 24.0;\nconst float sdfPixel = 3.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nif (u_halo > 0.5)\n{\nv_color = halo_color * opacity;\nhalo_width *= sdfPixel;\nhalo_blur *= sdfPixel;\n}\nelse\n{\nv_color = color * opacity;\nhalo_width = 0.0;\nhalo_blur = 0.0;\n}\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_color *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float a_visMinAngle = a_texAngleRange.z;\nmediump float a_visMaxAngle = a_texAngleRange.w;\nmediump float delta_z = 0.0;\nmediump float angle = mod(a_angle + u_mapRotation, 256.0);\nif (a_visMinAngle < a_visMaxAngle)\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle)));\n}\nelse\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle)));\n}\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_color[3], 0.0);\nv_tex = a_tex.xy / u_mosaicSize;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nv_edgeDistance = edgePos - halo_width / size;\nv_edgeWidth = (u_antialiasingWidth + halo_blur) / size;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\n}" }, util: { "encoding.glsl": "const vec4 rgba2float_factors = vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}", "util.glsl": "float nextPOT(in float x) {\nreturn pow(2.0, ceil(log2(abs(x))));\n}" } };
  393. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/sources/resolver.js
  394. function o9(e19) {
  395. let o27 = e9;
  396. return e19.split("/").forEach((r22) => {
  397. o27 && (o27 = o27[r22]);
  398. }), o27;
  399. }
  400. var t9 = new e5(o9);
  401. function n15(r22) {
  402. return t9.resolveIncludes(r22);
  403. }
  404. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/Programs.js
  405. var t10 = (e19) => n12({ ID: e19.id, PATTERN: e19.pattern });
  406. var a7 = { shaders: (r22) => ({ vertexShader: t10(r22) + n15("background/background.vert"), fragmentShader: t10(r22) + n15("background/background.frag") }) };
  407. var d3 = (e19) => n12({ ID: e19.id });
  408. var i5 = { shaders: (r22) => ({ vertexShader: d3(r22) + n15("circle/circle.vert"), fragmentShader: d3(r22) + n15("circle/circle.frag") }) };
  409. var n16 = (e19) => n12({ ID: e19.id, PATTERN: e19.pattern });
  410. var l4 = { shaders: (r22) => ({ vertexShader: n16(r22) + n15("fill/fill.vert"), fragmentShader: n16(r22) + n15("fill/fill.frag") }) };
  411. var s10 = (e19) => n12({ ID: e19.id });
  412. var f6 = { shaders: (r22) => ({ vertexShader: s10(r22) + n15("outline/outline.vert"), fragmentShader: s10(r22) + n15("outline/outline.frag") }) };
  413. var h3 = (e19) => n12({ ID: e19.id, SDF: e19.sdf });
  414. var o10 = { shaders: (r22) => ({ vertexShader: h3(r22) + n15("icon/icon.vert"), fragmentShader: h3(r22) + n15("icon/icon.frag") }) };
  415. var g3 = (e19) => n12({ ID: e19.id, PATTERN: e19.pattern, SDF: e19.sdf });
  416. var c4 = { shaders: (r22) => ({ vertexShader: g3(r22) + n15("line/line.vert"), fragmentShader: g3(r22) + n15("line/line.frag") }) };
  417. var S3 = (e19) => n12({ ID: e19.id });
  418. var v2 = { shaders: (r22) => ({ vertexShader: S3(r22) + n15("text/text.vert"), fragmentShader: S3(r22) + n15("text/text.frag") }) };
  419. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js
  420. var o11 = class {
  421. constructor() {
  422. this._programByKey = new Map();
  423. }
  424. dispose() {
  425. this._programByKey.forEach((e19) => e19.dispose()), this._programByKey.clear();
  426. }
  427. getMaterialProgram(e19, r22, t21) {
  428. const a16 = r22.key << 3 | this._getMaterialOptionsValue(r22.type, t21);
  429. if (this._programByKey.has(a16))
  430. return this._programByKey.get(a16);
  431. const s22 = this._getProgramTemplate(r22.type), { shaders: n26 } = s22, { vertexShader: c18, fragmentShader: i15 } = n26(t21), o27 = r22.getShaderHeader(), u15 = r22.getShaderMain(), p9 = c18.replace("#pragma header", o27).replace("#pragma main", u15), g10 = e19.programCache.acquire(p9, i15, r22.getAttributeLocations());
  432. return this._programByKey.set(a16, g10), g10;
  433. }
  434. _getMaterialOptionsValue(r22, t21) {
  435. switch (r22) {
  436. case T2.BACKGROUND: {
  437. const e19 = t21;
  438. return (e19.pattern ? 1 : 0) << 1 | (e19.id ? 1 : 0);
  439. }
  440. case T2.FILL: {
  441. const e19 = t21;
  442. return (e19.pattern ? 1 : 0) << 1 | (e19.id ? 1 : 0);
  443. }
  444. case T2.OUTLINE:
  445. return t21.id ? 1 : 0;
  446. case T2.LINE: {
  447. const e19 = t21;
  448. return (e19.sdf ? 1 : 0) << 2 | (e19.pattern ? 1 : 0) << 1 | (e19.id ? 1 : 0);
  449. }
  450. case T2.ICON: {
  451. const e19 = t21;
  452. return (e19.sdf ? 1 : 0) << 1 | (e19.id ? 1 : 0);
  453. }
  454. case T2.CIRCLE:
  455. return t21.id ? 1 : 0;
  456. case T2.TEXT:
  457. return t21.id ? 1 : 0;
  458. default:
  459. return 0;
  460. }
  461. }
  462. _getProgramTemplate(o27) {
  463. switch (o27) {
  464. case T2.BACKGROUND:
  465. return a7;
  466. case T2.CIRCLE:
  467. return i5;
  468. case T2.FILL:
  469. return l4;
  470. case T2.ICON:
  471. return o10;
  472. case T2.LINE:
  473. return c4;
  474. case T2.OUTLINE:
  475. return f6;
  476. case T2.TEXT:
  477. return v2;
  478. default:
  479. return null;
  480. }
  481. }
  482. };
  483. // node_modules/@arcgis/core/views/2d/engine/webgl/shaders/BitBlitPrograms.js
  484. var e10 = { shaders: { vertexShader: n14("bitBlit/bitBlit.vert"), fragmentShader: n14("bitBlit/bitBlit.frag") }, attributes: new Map([["a_pos", 0], ["a_tex", 1]]) };
  485. // node_modules/@arcgis/core/views/2d/engine/webgl/BitBlitRenderer.js
  486. var _2 = class {
  487. constructor() {
  488. this._initialized = false;
  489. }
  490. dispose() {
  491. this._program = s(this._program), this._vertexArrayObject = s(this._vertexArrayObject);
  492. }
  493. render(r22, t21, e19, i15) {
  494. r22 && (this._initialized || this._initialize(r22), r22.setBlendFunctionSeparate(R.ONE, R.ONE_MINUS_SRC_ALPHA, R.ONE, R.ONE_MINUS_SRC_ALPHA), r22.bindVAO(this._vertexArrayObject), r22.useProgram(this._program), t21.setSamplingMode(e19), r22.bindTexture(t21, 0), this._program.setUniform1i("u_tex", 0), this._program.setUniform1f("u_opacity", i15), r22.drawArrays(E.TRIANGLE_STRIP, 0, 4), r22.bindTexture(null, 0), r22.bindVAO());
  495. }
  496. _initialize(r22) {
  497. if (this._initialized)
  498. return true;
  499. const s22 = e6(r22, e10);
  500. if (!s22)
  501. return false;
  502. const o27 = new Int8Array(16);
  503. o27[0] = -1, o27[1] = -1, o27[2] = 0, o27[3] = 0, o27[4] = 1, o27[5] = -1, o27[6] = 1, o27[7] = 0, o27[8] = -1, o27[9] = 1, o27[10] = 0, o27[11] = 1, o27[12] = 1, o27[13] = 1, o27[14] = 1, o27[15] = 1;
  504. const _13 = e10.attributes, p9 = new f5(r22, _13, t8, { geometry: c3.createVertex(r22, F.STATIC_DRAW, o27) });
  505. return this._program = s22, this._vertexArrayObject = p9, this._initialized = true, true;
  506. }
  507. };
  508. // node_modules/@arcgis/core/views/2d/engine/webgl/shaders/MaterialPrograms.js
  509. var e11 = (r22) => {
  510. let t21 = "";
  511. t21 += r22[0].toUpperCase();
  512. for (let e19 = 1; e19 < r22.length; e19++) {
  513. const s22 = r22[e19];
  514. s22 === s22.toUpperCase() ? (t21 += "_", t21 += s22) : t21 += s22.toUpperCase();
  515. }
  516. return t21;
  517. };
  518. var s11 = (r22) => {
  519. const s22 = {};
  520. for (const t21 in r22) {
  521. s22[e11(t21)] = r22[t21];
  522. }
  523. return n12(s22);
  524. };
  525. var o12 = (t21, e19, o27, n26) => {
  526. const a16 = t21 + t21.substring(t21.lastIndexOf("/")), p9 = e19 + e19.substring(e19.lastIndexOf("/")), f14 = s11(n26);
  527. return { attributes: o27, shaders: { vertexShader: f14 + n14(`${a16}.vert`), fragmentShader: f14 + n14(`${p9}.frag`) } };
  528. };
  529. // node_modules/@arcgis/core/views/2d/engine/webgl/MaterialManager.js
  530. var a8 = (r22) => r22 === I3.HITTEST || r22 === I3.LABEL_ALPHA;
  531. var s12 = (r22) => (a8(r22) ? 1 : 0) | (r22 === I3.HIGHLIGHT ? 2 : 0);
  532. var o13 = ({ rendererInfo: e19, drawPhase: t21 }, a16, o27, i15) => `${a16.getVariationHash()}-${i15.join(".")}-${s12(t21)}-${e19.getVariationHash()}-${r(o27) && o27.join(".")}`;
  533. var i6 = (t21, s22, o27, i15) => {
  534. const h15 = i15.reduce((r22, e19) => ({ ...r22, [e19]: t21.context.driverTest[e19] }), {}), n26 = { ...s22.getVariation(), ...t21.rendererInfo.getVariation(), highlight: t21.drawPhase === I3.HIGHLIGHT, id: a8(t21.drawPhase), ...h15 };
  535. if (r(o27))
  536. for (const r22 of o27)
  537. n26[r22] = true;
  538. return n26;
  539. };
  540. var h4 = class {
  541. constructor(r22) {
  542. this._rctx = r22, this._programByKey = new Map();
  543. }
  544. dispose() {
  545. this._programByKey.forEach((r22) => r22.dispose()), this._programByKey.clear();
  546. }
  547. getProgram(r22, e19 = [], a16 = []) {
  548. const s22 = r22.vsPath + "." + r22.fsPath + JSON.stringify(e19) + a16.join(".");
  549. if (this._programByKey.has(s22))
  550. return this._programByKey.get(s22);
  551. const o27 = a16.reduce((r23, e20) => ({ ...r23, [e20]: this._rctx.driverTest[e20] }), {}), i15 = { ...e19.map((r23) => typeof r23 == "string" ? { name: r23, value: true } : r23).reduce((r23, e20) => ({ ...r23, [e20.name]: e20.value }), {}), ...o27 }, { vsPath: h15, fsPath: n26, attributes: g10 } = r22, m14 = o12(h15, n26, g10, i15), c18 = this._rctx.programCache.acquire(m14.shaders.vertexShader, m14.shaders.fragmentShader, m14.attributes);
  552. if (!c18)
  553. throw new Error("Unable to get program for key: ${key}");
  554. return this._programByKey.set(s22, c18), c18;
  555. }
  556. getMaterialProgram(r22, e19, a16, s22, h15, n26 = ["ignoresSamplerPrecision"]) {
  557. const g10 = o13(r22, e19, h15, n26);
  558. if (this._programByKey.has(g10))
  559. return this._programByKey.get(g10);
  560. const m14 = i6(r22, e19, h15, n26), c18 = o12(a16, a16, s22, m14), y6 = this._rctx.programCache.acquire(c18.shaders.vertexShader, c18.shaders.fragmentShader, c18.attributes);
  561. if (!y6)
  562. throw new Error("Unable to get program for key: ${key}");
  563. return this._programByKey.set(g10, y6), y6;
  564. }
  565. };
  566. // node_modules/@arcgis/core/views/2d/engine/webgl/RectangleBinPack.js
  567. var t11 = class {
  568. constructor(t21, e19) {
  569. this._width = 0, this._height = 0, this._free = [], this._width = t21, this._height = e19, this._free.push(new t4(0, 0, t21, e19));
  570. }
  571. get width() {
  572. return this._width;
  573. }
  574. get height() {
  575. return this._height;
  576. }
  577. allocate(t21, e19) {
  578. if (t21 > this._width || e19 > this._height)
  579. return new t4();
  580. let i15 = null, s22 = -1;
  581. for (let h15 = 0; h15 < this._free.length; ++h15) {
  582. const r22 = this._free[h15];
  583. t21 <= r22.width && e19 <= r22.height && (i15 === null || r22.y <= i15.y && r22.x <= i15.x) && (i15 = r22, s22 = h15);
  584. }
  585. return i15 === null ? new t4() : (this._free.splice(s22, 1), i15.width < i15.height ? (i15.width > t21 && this._free.push(new t4(i15.x + t21, i15.y, i15.width - t21, e19)), i15.height > e19 && this._free.push(new t4(i15.x, i15.y + e19, i15.width, i15.height - e19))) : (i15.width > t21 && this._free.push(new t4(i15.x + t21, i15.y, i15.width - t21, i15.height)), i15.height > e19 && this._free.push(new t4(i15.x, i15.y + e19, t21, i15.height - e19))), new t4(i15.x, i15.y, t21, e19));
  586. }
  587. release(h15) {
  588. for (let t21 = 0; t21 < this._free.length; ++t21) {
  589. const e19 = this._free[t21];
  590. if (e19.y === h15.y && e19.height === h15.height && e19.x + e19.width === h15.x)
  591. e19.width += h15.width;
  592. else if (e19.x === h15.x && e19.width === h15.width && e19.y + e19.height === h15.y)
  593. e19.height += h15.height;
  594. else if (h15.y === e19.y && h15.height === e19.height && h15.x + h15.width === e19.x)
  595. e19.x = h15.x, e19.width += h15.width;
  596. else {
  597. if (h15.x !== e19.x || h15.width !== e19.width || h15.y + h15.height !== e19.y)
  598. continue;
  599. e19.y = h15.y, e19.height += h15.height;
  600. }
  601. this._free.splice(t21, 1), this.release(h15);
  602. }
  603. this._free.push(h15);
  604. }
  605. };
  606. // node_modules/@arcgis/core/views/2d/engine/webgl/GlyphMosaic.js
  607. var n17 = 256;
  608. var c5 = (t21) => Math.floor(t21 / 256);
  609. function o14(t21) {
  610. const e19 = new Set();
  611. for (const i15 of t21)
  612. e19.add(c5(i15));
  613. return e19;
  614. }
  615. function l5(t21, i15, h15) {
  616. return t21.has(i15) || t21.set(i15, h15().then(() => {
  617. t21.delete(i15);
  618. }).catch((h16) => {
  619. t21.delete(i15), b(h16);
  620. })), t21.get(i15);
  621. }
  622. var g4 = (t21) => ({ rect: new t4(0, 0, 0, 0), page: 0, metrics: { left: 0, width: 0, height: 0, advance: 0, top: 0 }, code: t21, sdf: true });
  623. var _3 = class {
  624. constructor(t21, e19, i15) {
  625. this.width = 0, this.height = 0, this._dirties = [], this._glyphData = [], this._currentPage = 0, this._glyphCache = {}, this._textures = [], this._rangePromises = new Map(), this.width = t21, this.height = e19, this._glyphSource = i15, this._binPack = new t11(t21 - 4, e19 - 4), this._glyphData.push(new Uint8Array(t21 * e19)), this._dirties.push(true), this._textures.push(null), this._initDecorationGlyph();
  626. }
  627. dispose() {
  628. this._binPack = null;
  629. for (const t21 of this._textures)
  630. t21 && t21.dispose();
  631. this._textures.length = 0, this._glyphData.length = 0;
  632. }
  633. _initDecorationGlyph() {
  634. const t21 = [117, 149, 181, 207, 207, 181, 149, 117], e19 = [];
  635. for (let h15 = 0; h15 < t21.length; h15++) {
  636. const i16 = t21[h15];
  637. for (let t22 = 0; t22 < 11; t22++)
  638. e19.push(i16);
  639. }
  640. const i15 = { metrics: { width: 5, height: 2, left: 0, top: 0, advance: 0 }, bitmap: new Uint8Array(e19) };
  641. this._recordGlyph(i15);
  642. }
  643. async getGlyphItems(t21, e19, i15) {
  644. const h15 = this._getGlyphCache(t21);
  645. return await this._fetchRanges(t21, e19, i15), e19.map((e20) => this._getMosaicItem(h15, t21, e20));
  646. }
  647. bind(t21, e19, i15, h15) {
  648. const s22 = this._getTexture(t21, i15);
  649. s22.setSamplingMode(e19), this._dirties[i15] && (s22.setData(this._glyphData[i15]), this._dirties[i15] = false), t21.bindTexture(s22, h15);
  650. }
  651. _getGlyphCache(t21) {
  652. return this._glyphCache[t21] || (this._glyphCache[t21] = {}), this._glyphCache[t21];
  653. }
  654. _getTexture(t21, e19) {
  655. return this._textures[e19] || (this._textures[e19] = new u4(t21, { pixelFormat: P.ALPHA, dataType: G.UNSIGNED_BYTE, width: this.width, height: this.height }, new Uint8Array(this.width * this.height))), this._textures[e19];
  656. }
  657. _invalidate() {
  658. this._dirties[this._currentPage] = true;
  659. }
  660. async _fetchRanges(t21, e19, i15) {
  661. const h15 = o14(e19), s22 = [];
  662. h15.forEach((e20) => {
  663. s22.push(this._fetchRange(t21, e20, i15));
  664. }), await Promise.all(s22);
  665. }
  666. async _fetchRange(t21, e19, i15) {
  667. if (e19 > n17)
  668. return null;
  669. const h15 = t21 + e19;
  670. return l5(this._rangePromises, h15, () => this._glyphSource.getRange(t21, e19, i15));
  671. }
  672. _getMosaicItem(t21, e19, i15) {
  673. if (!t21[i15]) {
  674. const h15 = this._glyphSource.getGlyph(e19, i15);
  675. if (!h15 || !h15.metrics)
  676. return g4(i15);
  677. const s22 = this._recordGlyph(h15), r22 = this._currentPage, a16 = h15.metrics;
  678. t21[i15] = { rect: s22, page: r22, metrics: a16, code: i15, sdf: true }, this._invalidate();
  679. }
  680. return t21[i15];
  681. }
  682. _recordGlyph(e19) {
  683. const s22 = e19.metrics;
  684. let r22;
  685. if (s22.width === 0)
  686. r22 = new t4(0, 0, 0, 0);
  687. else {
  688. const i15 = 3, a16 = s22.width + 2 * i15, n26 = s22.height + 2 * i15;
  689. r22 = this._binPack.allocate(a16, n26), r22.isEmpty && (this._dirties[this._currentPage] || (this._glyphData[this._currentPage] = null), this._currentPage = this._glyphData.length, this._glyphData.push(new Uint8Array(this.width * this.height)), this._dirties.push(true), this._textures.push(null), this._initDecorationGlyph(), this._binPack = new t11(this.width - 4, this.height - 4), r22 = this._binPack.allocate(a16, n26));
  690. const c18 = this._glyphData[this._currentPage], o27 = e19.bitmap;
  691. let l17, g10;
  692. if (o27)
  693. for (let t21 = 0; t21 < n26; t21++) {
  694. l17 = a16 * t21, g10 = this.width * (r22.y + t21) + r22.x;
  695. for (let t22 = 0; t22 < a16; t22++)
  696. c18[g10 + t22] = o27[l17 + t22];
  697. }
  698. a("esri-glyph-debug") && this._showDebugPage(c18);
  699. }
  700. return r22;
  701. }
  702. _showDebugPage(t21) {
  703. const e19 = document.createElement("canvas"), i15 = e19.getContext("2d"), h15 = new ImageData(this.width, this.height), s22 = h15.data;
  704. e19.width = this.width, e19.height = this.height, e19.style.border = "1px solid black";
  705. for (let r22 = 0; r22 < t21.length; ++r22)
  706. s22[4 * r22 + 0] = t21[r22], s22[4 * r22 + 1] = 0, s22[4 * r22 + 2] = 0, s22[4 * r22 + 3] = 255;
  707. i15.putImageData(h15, 0, 0), document.body.appendChild(e19);
  708. }
  709. };
  710. // node_modules/@arcgis/core/views/2d/engine/webgl/GlyphSource.js
  711. var s13 = class {
  712. constructor(t21) {
  713. for (this._metrics = [], this._bitmaps = []; t21.next(); )
  714. switch (t21.tag()) {
  715. case 1: {
  716. const e19 = t21.getMessage();
  717. for (; e19.next(); )
  718. switch (e19.tag()) {
  719. case 3: {
  720. const t22 = e19.getMessage();
  721. let s22, a16, r22, n26, i15, c18, g10;
  722. for (; t22.next(); )
  723. switch (t22.tag()) {
  724. case 1:
  725. s22 = t22.getUInt32();
  726. break;
  727. case 2:
  728. a16 = t22.getBytes();
  729. break;
  730. case 3:
  731. r22 = t22.getUInt32();
  732. break;
  733. case 4:
  734. n26 = t22.getUInt32();
  735. break;
  736. case 5:
  737. i15 = t22.getSInt32();
  738. break;
  739. case 6:
  740. c18 = t22.getSInt32();
  741. break;
  742. case 7:
  743. g10 = t22.getUInt32();
  744. break;
  745. default:
  746. t22.skip();
  747. }
  748. t22.release(), s22 && (this._metrics[s22] = { width: r22, height: n26, left: i15, top: c18, advance: g10 }, this._bitmaps[s22] = a16);
  749. break;
  750. }
  751. default:
  752. e19.skip();
  753. }
  754. e19.release();
  755. break;
  756. }
  757. default:
  758. t21.skip();
  759. }
  760. }
  761. getMetrics(t21) {
  762. return this._metrics[t21];
  763. }
  764. getBitmap(t21) {
  765. return this._bitmaps[t21];
  766. }
  767. };
  768. var a9 = class {
  769. constructor() {
  770. this._ranges = [];
  771. }
  772. getRange(t21) {
  773. return this._ranges[t21];
  774. }
  775. addRange(t21, e19) {
  776. this._ranges[t21] = e19;
  777. }
  778. };
  779. var r10 = class {
  780. constructor(t21) {
  781. this._glyphInfo = {}, this._baseURL = t21;
  782. }
  783. getRange(a16, r22, n26) {
  784. const i15 = this._getFontStack(a16);
  785. if (i15.getRange(r22))
  786. return Promise.resolve();
  787. const c18 = 256 * r22, g10 = c18 + 255, o27 = this._baseURL.replace("{fontstack}", a16).replace("{range}", c18 + "-" + g10);
  788. return U(o27, { responseType: "array-buffer", ...n26 }).then((t21) => {
  789. i15.addRange(r22, new s13(new a5(new Uint8Array(t21.data), new DataView(t21.data))));
  790. });
  791. }
  792. getGlyph(t21, e19) {
  793. const s22 = this._getFontStack(t21);
  794. if (!s22)
  795. return;
  796. const a16 = Math.floor(e19 / 256);
  797. if (a16 > 256)
  798. return;
  799. const r22 = s22.getRange(a16);
  800. return r22 ? { metrics: r22.getMetrics(e19), bitmap: r22.getBitmap(e19) } : void 0;
  801. }
  802. _getFontStack(t21) {
  803. let e19 = this._glyphInfo[t21];
  804. return e19 || (e19 = this._glyphInfo[t21] = new a9()), e19;
  805. }
  806. };
  807. // node_modules/@arcgis/core/views/2d/engine/webgl/SDFConverter.js
  808. var i7 = 1e20;
  809. var r11 = class {
  810. constructor(t21) {
  811. this.size = t21;
  812. const s22 = document.createElement("canvas");
  813. s22.width = s22.height = t21, this._context = s22.getContext("2d"), this._gridOuter = new Float64Array(t21 * t21), this._gridInner = new Float64Array(t21 * t21), this._f = new Float64Array(t21), this._d = new Float64Array(t21), this._z = new Float64Array(t21 + 1), this._v = new Int16Array(t21);
  814. }
  815. dispose() {
  816. this._context = this._gridOuter = this._gridInner = this._f = this._d = this._z = this._v = null, this._svg && (document.body.removeChild(this._svg), this._svg = null);
  817. }
  818. draw(r22, h15, n26 = 31) {
  819. this._initSVG();
  820. const o27 = this.createSVGString(r22);
  821. return new Promise((r23, a16) => {
  822. const d14 = new Image();
  823. d14.src = "data:image/svg+xml; charset=utf8, " + encodeURIComponent(o27), d14.onload = () => {
  824. d14.onload = null, this._context.clearRect(0, 0, this.size, this.size), this._context.drawImage(d14, 0, 0, this.size, this.size);
  825. const s22 = this._context.getImageData(0, 0, this.size, this.size), e19 = new Uint8Array(this.size * this.size * 4);
  826. for (let t21 = 0; t21 < this.size * this.size; t21++) {
  827. const e20 = s22.data[4 * t21 + 3] / 255;
  828. this._gridOuter[t21] = e20 === 1 ? 0 : e20 === 0 ? i7 : Math.max(0, 0.5 - e20) ** 2, this._gridInner[t21] = e20 === 1 ? i7 : e20 === 0 ? 0 : Math.max(0, e20 - 0.5) ** 2;
  829. }
  830. this._edt(this._gridOuter, this.size, this.size), this._edt(this._gridInner, this.size, this.size);
  831. for (let i15 = 0; i15 < this.size * this.size; i15++) {
  832. const s23 = this._gridOuter[i15] - this._gridInner[i15];
  833. o7(0.5 - s23 / (2 * n26), e19, 4 * i15);
  834. }
  835. r23(e19);
  836. };
  837. const l17 = h15 && h15.signal;
  838. l17 && v(l17, () => a16(m()));
  839. });
  840. }
  841. _initSVG() {
  842. if (!this._svg) {
  843. const t21 = document.createElementNS("http://www.w3.org/2000/svg", "svg");
  844. t21.setAttribute("style", "position: absolute;"), t21.setAttribute("width", "0"), t21.setAttribute("height", "0"), t21.setAttribute("aria-hidden", "true"), t21.setAttribute("role", "presentation"), document.body.appendChild(t21), this._svg = t21;
  845. }
  846. }
  847. createSVGString(t21) {
  848. this._initSVG();
  849. const s22 = document.createElementNS("http://www.w3.org/2000/svg", "path");
  850. s22.setAttribute("d", t21), this._svg.appendChild(s22);
  851. const e19 = s22.getBBox(), i15 = e19.width / e19.height, r22 = this.size / 2;
  852. let h15, n26, o27, a16;
  853. if (i15 > 1) {
  854. n26 = h15 = r22 / e19.width;
  855. const t22 = r22 * (1 / i15);
  856. o27 = this.size / 4, a16 = r22 - t22 / 2;
  857. } else {
  858. h15 = n26 = r22 / e19.height;
  859. o27 = r22 - r22 * i15 / 2, a16 = this.size / 4;
  860. }
  861. const d14 = -e19.x * h15 + o27, l17 = -e19.y * n26 + a16;
  862. s22.setAttribute("style", `transform: matrix(${h15}, 0, 0, ${n26}, ${d14}, ${l17})`);
  863. const _13 = `<svg style="fill:red;" height="${this.size}" width="${this.size}" xmlns="http://www.w3.org/2000/svg">${this._svg.innerHTML}</svg>`;
  864. return this._svg.removeChild(s22), _13;
  865. }
  866. _edt(t21, s22, e19) {
  867. const i15 = this._f, r22 = this._d, h15 = this._v, n26 = this._z;
  868. for (let o27 = 0; o27 < s22; o27++) {
  869. for (let r23 = 0; r23 < e19; r23++)
  870. i15[r23] = t21[r23 * s22 + o27];
  871. this._edt1d(i15, r22, h15, n26, e19);
  872. for (let i16 = 0; i16 < e19; i16++)
  873. t21[i16 * s22 + o27] = r22[i16];
  874. }
  875. for (let o27 = 0; o27 < e19; o27++) {
  876. for (let e20 = 0; e20 < s22; e20++)
  877. i15[e20] = t21[o27 * s22 + e20];
  878. this._edt1d(i15, r22, h15, n26, s22);
  879. for (let e20 = 0; e20 < s22; e20++)
  880. t21[o27 * s22 + e20] = Math.sqrt(r22[e20]);
  881. }
  882. }
  883. _edt1d(t21, s22, e19, r22, h15) {
  884. e19[0] = 0, r22[0] = -i7, r22[1] = +i7;
  885. for (let n26 = 1, o27 = 0; n26 < h15; n26++) {
  886. let s23 = (t21[n26] + n26 * n26 - (t21[e19[o27]] + e19[o27] * e19[o27])) / (2 * n26 - 2 * e19[o27]);
  887. for (; s23 <= r22[o27]; )
  888. o27--, s23 = (t21[n26] + n26 * n26 - (t21[e19[o27]] + e19[o27] * e19[o27])) / (2 * n26 - 2 * e19[o27]);
  889. o27++, e19[o27] = n26, r22[o27] = s23, r22[o27 + 1] = +i7;
  890. }
  891. for (let i15 = 0, n26 = 0; i15 < h15; i15++) {
  892. for (; r22[n26 + 1] < i15; )
  893. n26++;
  894. s22[i15] = (i15 - e19[n26]) * (i15 - e19[n26]) + t21[e19[n26]];
  895. }
  896. }
  897. };
  898. // node_modules/@arcgis/core/views/2d/engine/webgl/SpriteMosaic.js
  899. function g5(t21) {
  900. return t21 && t21.type === "static";
  901. }
  902. var p2 = class {
  903. constructor(t21, e19, i15 = 0) {
  904. this._mosaicPages = [], this._maxItemSize = 0, this._currentPage = 0, this._pageWidth = 0, this._pageHeight = 0, this._mosaicRects = new Map(), this._spriteCopyQueue = [], this.pixelRatio = 1, (t21 <= 0 || e19 <= 0) && console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"), this._pageWidth = t21, this._pageHeight = e19, i15 > 0 && (this._maxItemSize = i15), this.pixelRatio = window.devicePixelRatio || 1, this._binPack = new t11(this._pageWidth, this._pageHeight);
  905. const s22 = Math.floor(this._pageWidth), r22 = Math.floor(this._pageHeight);
  906. this._mosaicPages.push({ mosaicsData: { type: "static", data: new Uint32Array(s22 * r22) }, size: [this._pageWidth, this._pageHeight], dirty: true, texture: void 0 });
  907. }
  908. getWidth(t21) {
  909. return t21 >= this._mosaicPages.length ? -1 : this._mosaicPages[t21].size[0];
  910. }
  911. getHeight(t21) {
  912. return t21 >= this._mosaicPages.length ? -1 : this._mosaicPages[t21].size[1];
  913. }
  914. getPageTexture(t21) {
  915. return t21 < this._mosaicPages.length ? this._mosaicPages[t21].texture : null;
  916. }
  917. has(t21) {
  918. return this._mosaicRects.has(t21);
  919. }
  920. get itemCount() {
  921. return this._mosaicRects.size;
  922. }
  923. getSpriteItem(t21) {
  924. return this._mosaicRects.get(t21);
  925. }
  926. addSpriteItem(t21, i15, a16, r22, o27, h15) {
  927. if (this._mosaicRects.has(t21))
  928. return this._mosaicRects.get(t21);
  929. let c18, n26, p9;
  930. if (g5(a16))
  931. [c18, n26, p9] = this._allocateImage(i15[0], i15[1]);
  932. else {
  933. c18 = new t4(0, 0, i15[0], i15[1]), n26 = this._mosaicPages.length;
  934. const t22 = void 0;
  935. this._mosaicPages.push({ mosaicsData: a16, size: [i15[0] + 2 * et, i15[1] + 2 * et], dirty: true, texture: t22 });
  936. }
  937. if (c18.width <= 0 || c18.height <= 0)
  938. return null;
  939. const m14 = { rect: c18, width: i15[0], height: i15[1], sdf: o27, simplePattern: h15, pixelRatio: 1, page: n26 };
  940. return this._mosaicRects.set(t21, m14), g5(a16) && this._copy({ rect: c18, spriteSize: i15, spriteData: a16.data, page: n26, pageSize: p9, repeat: r22, sdf: o27 }), m14;
  941. }
  942. hasItemsToProcess() {
  943. return this._spriteCopyQueue.length !== 0;
  944. }
  945. processNextItem() {
  946. const t21 = this._spriteCopyQueue.pop();
  947. t21 && this._copy(t21);
  948. }
  949. getSpriteItems(t21) {
  950. const e19 = {};
  951. for (const i15 of t21)
  952. e19[i15] = this.getSpriteItem(i15);
  953. return e19;
  954. }
  955. getMosaicItemPosition(t21) {
  956. const i15 = this.getSpriteItem(t21), s22 = i15 && i15.rect;
  957. if (!s22)
  958. return null;
  959. s22.width = i15.width, s22.height = i15.height;
  960. const a16 = i15.width, r22 = i15.height, o27 = et, h15 = this._mosaicPages[i15.page];
  961. return { size: [i15.width, i15.height], tl: [(s22.x + o27) / h15[0], (s22.y + o27) / h15[1]], br: [(s22.x + o27 + a16) / h15[0], (s22.y + o27 + r22) / h15[1]], page: i15.page };
  962. }
  963. bind(t21, e19, i15 = 0, s22 = 0) {
  964. const a16 = this._mosaicPages[i15], r22 = a16.mosaicsData;
  965. let o27 = a16.texture;
  966. if (o27 || (o27 = m7(t21, r22, a16.size), a16.texture = o27), o27.setSamplingMode(e19), g5(r22))
  967. t21.bindTexture(o27, s22), a16.dirty && (o27.setData(new Uint8Array(r22.data.buffer)), o27.generateMipmap());
  968. else {
  969. r22.data.bindFrame(t21, o27, s22);
  970. }
  971. a16.dirty = false;
  972. }
  973. static _copyBits(t21, e19, i15, s22, a16, r22, o27, h15, c18, n26, g10) {
  974. let p9 = s22 * e19 + i15, m14 = h15 * r22 + o27;
  975. if (g10) {
  976. m14 -= r22;
  977. for (let o28 = -1; o28 <= n26; o28++, p9 = ((o28 + n26) % n26 + s22) * e19 + i15, m14 += r22)
  978. for (let e20 = -1; e20 <= c18; e20++)
  979. a16[m14 + e20] = t21[p9 + (e20 + c18) % c18];
  980. } else
  981. for (let _13 = 0; _13 < n26; _13++) {
  982. for (let e20 = 0; e20 < c18; e20++)
  983. a16[m14 + e20] = t21[p9 + e20];
  984. p9 += e19, m14 += r22;
  985. }
  986. }
  987. _copy(i15) {
  988. if (i15.page >= this._mosaicPages.length)
  989. return;
  990. const s22 = this._mosaicPages[i15.page], a16 = s22.mosaicsData;
  991. if (!g5(s22.mosaicsData))
  992. throw new s3("mapview-invalid-resource", "unsuitable data type!");
  993. const r22 = i15.spriteData, o27 = a16.data;
  994. o27 && r22 || console.error("Source or target images are uninitialized!"), p2._copyBits(r22, i15.spriteSize[0], 0, 0, o27, i15.pageSize[0], i15.rect.x + et, i15.rect.y + et, i15.spriteSize[0], i15.spriteSize[1], i15.repeat), s22.dirty = true;
  995. }
  996. _allocateImage(t21, r22) {
  997. t21 += 2 * et, r22 += 2 * et;
  998. const o27 = Math.max(t21, r22);
  999. if (this._maxItemSize && this._maxItemSize < o27) {
  1000. const e19 = 2 ** Math.ceil(P2(t21)), a16 = 2 ** Math.ceil(P2(r22)), o28 = new t4(0, 0, t21, r22);
  1001. return this._mosaicPages.push({ mosaicsData: { type: "static", data: new Uint32Array(e19 * a16) }, size: [e19, a16], dirty: true, texture: void 0 }), [o28, this._mosaicPages.length - 1, [e19, a16]];
  1002. }
  1003. const h15 = this._binPack.allocate(t21, r22);
  1004. if (h15.width <= 0) {
  1005. const e19 = this._mosaicPages[this._currentPage];
  1006. return !e19.dirty && g5(e19.mosaicsData) && (e19.mosaicsData.data = null), this._currentPage = this._mosaicPages.length, this._mosaicPages.push({ mosaicsData: { type: "static", data: new Uint32Array(this._pageWidth * this._pageHeight) }, size: [this._pageWidth, this._pageHeight], dirty: true, texture: void 0 }), this._binPack = new t11(this._pageWidth, this._pageHeight), this._allocateImage(t21, r22);
  1007. }
  1008. return [h15, this._currentPage, [this._pageWidth, this._pageHeight]];
  1009. }
  1010. dispose() {
  1011. this._binPack = null;
  1012. for (const t21 of this._mosaicPages) {
  1013. const e19 = t21.texture;
  1014. e19 && e19.dispose();
  1015. const i15 = t21.mosaicsData;
  1016. if (!g5(i15)) {
  1017. i15.data.destroy();
  1018. }
  1019. }
  1020. this._mosaicPages = null, this._mosaicRects.clear();
  1021. }
  1022. };
  1023. function m7(t21, e19, i15) {
  1024. return g5(e19) ? new u4(t21, { pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, width: i15[0], height: i15[1] }, new Uint8Array(e19.data.buffer)) : new u4(t21, { pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.LINEAR, wrapMode: D.CLAMP_TO_EDGE, width: i15[0], height: i15[1] }, null);
  1025. }
  1026. // node_modules/@arcgis/core/views/2d/engine/webgl/animatedFormats/utils.js
  1027. function a10(t21) {
  1028. return n2(t21.frameDurations.reduce((e19, t22) => e19 + t22, 0));
  1029. }
  1030. function n18(e19) {
  1031. const { width: t21, height: r22 } = e19;
  1032. return { frameDurations: e19.frameDurations.reverse(), selectFrame: (t22) => {
  1033. const r23 = e19.frameDurations.length - 1 - t22;
  1034. e19.selectFrame(r23);
  1035. }, width: t21, height: r22 };
  1036. }
  1037. function s14(t21, r22) {
  1038. const { width: i15, height: n26, selectFrame: s22 } = t21, o27 = r22 / a10(t21);
  1039. return { frameDurations: t21.frameDurations.map((t22) => n2(t22 * o27)), selectFrame: s22, width: i15, height: n26 };
  1040. }
  1041. function o15(t21, r22) {
  1042. const { width: i15, height: a16, selectFrame: n26 } = t21, s22 = t21.frameDurations.slice(), o27 = s22.shift();
  1043. return s22.unshift(n2(o27 + r22)), { frameDurations: s22, selectFrame: n26, width: i15, height: a16 };
  1044. }
  1045. function m8(t21, r22) {
  1046. const { width: i15, height: a16, selectFrame: n26 } = t21, s22 = t21.frameDurations.slice(), o27 = s22.pop();
  1047. return s22.push(n2(o27 + r22)), { frameDurations: s22, selectFrame: n26, width: i15, height: a16 };
  1048. }
  1049. var c6 = class {
  1050. constructor(e19, t21, r22) {
  1051. this._animation = e19, this._repeatType = r22, this._direction = 1, this._currentFrame = 0, this.timeToFrame = this._animation.frameDurations[this._currentFrame];
  1052. let i15 = 0;
  1053. for (; t21 > i15; )
  1054. i15 += this.timeToFrame, this.nextFrame();
  1055. this._animation.selectFrame(this._currentFrame);
  1056. }
  1057. nextFrame() {
  1058. if (this._currentFrame += this._direction, this._direction > 0) {
  1059. if (this._currentFrame === this._animation.frameDurations.length)
  1060. switch (this._repeatType) {
  1061. case d2.None:
  1062. this._currentFrame -= this._direction;
  1063. break;
  1064. case d2.Loop:
  1065. this._currentFrame = 0;
  1066. break;
  1067. case d2.Oscillate:
  1068. this._currentFrame -= this._direction, this._direction = -1;
  1069. }
  1070. } else if (this._currentFrame === -1)
  1071. switch (this._repeatType) {
  1072. case d2.None:
  1073. this._currentFrame -= this._direction;
  1074. break;
  1075. case d2.Loop:
  1076. this._currentFrame = this._animation.frameDurations.length - 1;
  1077. break;
  1078. case d2.Oscillate:
  1079. this._currentFrame -= this._direction, this._direction = 1;
  1080. }
  1081. this.timeToFrame = this._animation.frameDurations[this._currentFrame], this._animation.selectFrame(this._currentFrame);
  1082. }
  1083. };
  1084. function h5(h15, u15, l17) {
  1085. let f14, { repeatType: _13 } = u15;
  1086. if (_13 == null && (_13 = d2.Loop), u15.reverseAnimation === true && (h15 = n18(h15)), u15.duration != null && (h15 = s14(h15, n2(1e3 * u15.duration))), u15.repeatDelay != null) {
  1087. const r22 = 1e3 * u15.repeatDelay;
  1088. _13 === d2.Loop ? h15 = m8(h15, n2(r22)) : _13 === d2.Oscillate && (h15 = o15(m8(h15, n2(r22 / 2)), n2(r22 / 2)));
  1089. }
  1090. if (u15.startTimeOffset != null)
  1091. f14 = n2(1e3 * u15.startTimeOffset);
  1092. else if (u15.randomizeStartTime != null) {
  1093. const t21 = o8(l17), n26 = 82749913, s22 = u15.randomizeStartSeed != null ? u15.randomizeStartSeed : n26, o27 = e2(t21, s22);
  1094. f14 = n2(o27 * a10(h15));
  1095. } else
  1096. f14 = n2(0);
  1097. return new c6(h15, f14, _13);
  1098. }
  1099. function u6(e19, t21, r22) {
  1100. const i15 = t21.playAnimation == null || t21.playAnimation, a16 = h5(e19, t21, r22);
  1101. let n26, s22 = a16.timeToFrame;
  1102. function o27() {
  1103. n26 = i15 && setTimeout(() => {
  1104. a16.nextFrame(), s22 = a16.timeToFrame, o27();
  1105. }, s22);
  1106. }
  1107. return o27(), { remove: () => {
  1108. i15 && clearTimeout(n26);
  1109. } };
  1110. }
  1111. // node_modules/@arcgis/core/views/2d/engine/webgl/animatedFormats/BaseAnimatableTextureResource.js
  1112. var s15 = class {
  1113. constructor(t21) {
  1114. this._requestRender = t21, this._frameData = null;
  1115. }
  1116. destroy() {
  1117. this._playHandle.remove();
  1118. }
  1119. bindFrame(t21, r22, i15) {
  1120. t21.bindTexture(r22, i15), t(this._frameData) || (r22.updateData(0, et, et, this._frameData.width, this._frameData.height, this._frameData), this._frameData = null);
  1121. }
  1122. async _load(e19, a16, s22, o27) {
  1123. try {
  1124. const t21 = (t22) => {
  1125. this._frameData = t22, this._requestRender.requestRender();
  1126. }, r22 = await this._loadAnimation(e19, t21, o27);
  1127. this.frameCount = r22.frameDurations.length, this.width = r22.width, this.height = r22.height, this._playHandle = u6(r22, a16, s22);
  1128. } catch (h15) {
  1129. if (!g(h15))
  1130. return new s3("invalid-resource", "Could not parse animated resource.");
  1131. }
  1132. }
  1133. };
  1134. // node_modules/@arcgis/core/views/2d/engine/webgl/animatedFormats/apng.js
  1135. var o16;
  1136. var u7 = { exports: {} };
  1137. o16 = function() {
  1138. return function(e19) {
  1139. var t21 = {};
  1140. function r22(n26) {
  1141. if (t21[n26])
  1142. return t21[n26].exports;
  1143. var i15 = t21[n26] = { exports: {}, id: n26, loaded: false };
  1144. return e19[n26].call(i15.exports, i15, i15.exports, r22), i15.loaded = true, i15.exports;
  1145. }
  1146. return r22.m = e19, r22.c = t21, r22.p = "", r22(0);
  1147. }([function(e19, t21, r22) {
  1148. Object.defineProperty(t21, "__esModule", { value: true }), t21.isNotPNG = u15, t21.isNotAPNG = h15, t21.default = c18;
  1149. var n26 = s22(r22(1)), i15 = r22(2);
  1150. function s22(e20) {
  1151. return e20 && e20.__esModule ? e20 : { default: e20 };
  1152. }
  1153. var a16 = new Error("Not a PNG"), o27 = new Error("Not an animated PNG");
  1154. function u15(e20) {
  1155. return e20 === a16;
  1156. }
  1157. function h15(e20) {
  1158. return e20 === o27;
  1159. }
  1160. var l17 = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
  1161. function c18(e20) {
  1162. var t22 = new Uint8Array(e20);
  1163. if (Array.prototype.some.call(l17, function(e21, r24) {
  1164. return e21 !== t22[r24];
  1165. }))
  1166. return a16;
  1167. var r23 = false;
  1168. if (f14(t22, function(e21) {
  1169. return !(r23 = e21 === "acTL");
  1170. }), !r23)
  1171. return o27;
  1172. var n27 = [], s23 = [], u16 = null, h16 = null, c19 = 0, p10 = new i15.APNG();
  1173. if (f14(t22, function(e21, t23, r24, a17) {
  1174. var o28 = new DataView(t23.buffer);
  1175. switch (e21) {
  1176. case "IHDR":
  1177. u16 = t23.subarray(r24 + 8, r24 + 8 + a17), p10.width = o28.getUint32(r24 + 8), p10.height = o28.getUint32(r24 + 12);
  1178. break;
  1179. case "acTL":
  1180. p10.numPlays = o28.getUint32(r24 + 8 + 4);
  1181. break;
  1182. case "fcTL":
  1183. h16 && (p10.frames.push(h16), c19++), (h16 = new i15.Frame()).width = o28.getUint32(r24 + 8 + 4), h16.height = o28.getUint32(r24 + 8 + 8), h16.left = o28.getUint32(r24 + 8 + 12), h16.top = o28.getUint32(r24 + 8 + 16);
  1184. var l18 = o28.getUint16(r24 + 8 + 20), f15 = o28.getUint16(r24 + 8 + 22);
  1185. f15 === 0 && (f15 = 100), h16.delay = 1e3 * l18 / f15, h16.delay <= 10 && (h16.delay = 100), p10.playTime += h16.delay, h16.disposeOp = o28.getUint8(r24 + 8 + 24), h16.blendOp = o28.getUint8(r24 + 8 + 25), h16.dataParts = [], c19 === 0 && h16.disposeOp === 2 && (h16.disposeOp = 1);
  1186. break;
  1187. case "fdAT":
  1188. h16 && h16.dataParts.push(t23.subarray(r24 + 8 + 4, r24 + 8 + a17));
  1189. break;
  1190. case "IDAT":
  1191. h16 && h16.dataParts.push(t23.subarray(r24 + 8, r24 + 8 + a17));
  1192. break;
  1193. case "IEND":
  1194. s23.push(d14(t23, r24, 12 + a17));
  1195. break;
  1196. default:
  1197. n27.push(d14(t23, r24, 12 + a17));
  1198. }
  1199. }), h16 && p10.frames.push(h16), p10.frames.length == 0)
  1200. return o27;
  1201. var m15 = new Blob(n27), y6 = new Blob(s23);
  1202. return p10.frames.forEach(function(e21) {
  1203. var t23 = [];
  1204. t23.push(l17), u16.set(_13(e21.width), 0), u16.set(_13(e21.height), 4), t23.push(v8("IHDR", u16)), t23.push(m15), e21.dataParts.forEach(function(e22) {
  1205. return t23.push(v8("IDAT", e22));
  1206. }), t23.push(y6), e21.imageData = new Blob(t23, { type: "image/png" }), delete e21.dataParts, t23 = null;
  1207. }), p10;
  1208. }
  1209. function f14(e20, t22) {
  1210. var r23 = new DataView(e20.buffer), n27 = 8, i16 = void 0, s23 = void 0, a17 = void 0;
  1211. do {
  1212. s23 = r23.getUint32(n27), a17 = t22(i16 = p9(e20, n27 + 4, 4), e20, n27, s23), n27 += 12 + s23;
  1213. } while (a17 !== false && i16 != "IEND" && n27 < e20.length);
  1214. }
  1215. function p9(e20, t22, r23) {
  1216. var n27 = Array.prototype.slice.call(e20.subarray(t22, t22 + r23));
  1217. return String.fromCharCode.apply(String, n27);
  1218. }
  1219. function m14(e20) {
  1220. for (var t22 = new Uint8Array(e20.length), r23 = 0; r23 < e20.length; r23++)
  1221. t22[r23] = e20.charCodeAt(r23);
  1222. return t22;
  1223. }
  1224. function d14(e20, t22, r23) {
  1225. var n27 = new Uint8Array(r23);
  1226. return n27.set(e20.subarray(t22, t22 + r23)), n27;
  1227. }
  1228. var v8 = function(e20, t22) {
  1229. var r23 = e20.length + t22.length, i16 = new Uint8Array(r23 + 8), s23 = new DataView(i16.buffer);
  1230. s23.setUint32(0, t22.length), i16.set(m14(e20), 4), i16.set(t22, 8);
  1231. var a17 = (0, n26.default)(i16, 4, r23);
  1232. return s23.setUint32(r23 + 4, a17), i16;
  1233. }, _13 = function(e20) {
  1234. return new Uint8Array([e20 >>> 24 & 255, e20 >>> 16 & 255, e20 >>> 8 & 255, 255 & e20]);
  1235. };
  1236. }, function(e19, t21) {
  1237. Object.defineProperty(t21, "__esModule", { value: true }), t21.default = function(e20) {
  1238. for (var t22 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n27 = -1, i16 = t22, s23 = t22 + (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e20.length - t22); i16 < s23; i16++)
  1239. n27 = n27 >>> 8 ^ r22[255 & (n27 ^ e20[i16])];
  1240. return -1 ^ n27;
  1241. };
  1242. for (var r22 = new Uint32Array(256), n26 = 0; n26 < 256; n26++) {
  1243. for (var i15 = n26, s22 = 0; s22 < 8; s22++)
  1244. i15 = (1 & i15) != 0 ? 3988292384 ^ i15 >>> 1 : i15 >>> 1;
  1245. r22[n26] = i15;
  1246. }
  1247. }, function(e19, t21, r22) {
  1248. Object.defineProperty(t21, "__esModule", { value: true }), t21.Frame = t21.APNG = void 0;
  1249. var n26 = function() {
  1250. function e20(e21, t22) {
  1251. for (var r23 = 0; r23 < t22.length; r23++) {
  1252. var n27 = t22[r23];
  1253. n27.enumerable = n27.enumerable || false, n27.configurable = true, "value" in n27 && (n27.writable = true), Object.defineProperty(e21, n27.key, n27);
  1254. }
  1255. }
  1256. return function(t22, r23, n27) {
  1257. return r23 && e20(t22.prototype, r23), n27 && e20(t22, n27), t22;
  1258. };
  1259. }(), i15 = s22(r22(3));
  1260. function s22(e20) {
  1261. return e20 && e20.__esModule ? e20 : { default: e20 };
  1262. }
  1263. function a16(e20, t22) {
  1264. if (!(e20 instanceof t22))
  1265. throw new TypeError("Cannot call a class as a function");
  1266. }
  1267. t21.APNG = function() {
  1268. function e20() {
  1269. a16(this, e20), this.width = 0, this.height = 0, this.numPlays = 0, this.playTime = 0, this.frames = [];
  1270. }
  1271. return n26(e20, [{ key: "createImages", value: function() {
  1272. return Promise.all(this.frames.map(function(e21) {
  1273. return e21.createImage();
  1274. }));
  1275. } }, { key: "getPlayer", value: function(e21) {
  1276. var t22 = this, r23 = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
  1277. return this.createImages().then(function() {
  1278. return new i15.default(t22, e21, r23);
  1279. });
  1280. } }]), e20;
  1281. }(), t21.Frame = function() {
  1282. function e20() {
  1283. a16(this, e20), this.left = 0, this.top = 0, this.width = 0, this.height = 0, this.delay = 0, this.disposeOp = 0, this.blendOp = 0, this.imageData = null, this.imageElement = null;
  1284. }
  1285. return n26(e20, [{ key: "createImage", value: function() {
  1286. var e21 = this;
  1287. return this.imageElement ? Promise.resolve() : new Promise(function(t22, r23) {
  1288. var n27 = URL.createObjectURL(e21.imageData);
  1289. e21.imageElement = document.createElement("img"), e21.imageElement.onload = function() {
  1290. URL.revokeObjectURL(n27), t22();
  1291. }, e21.imageElement.onerror = function() {
  1292. URL.revokeObjectURL(n27), e21.imageElement = null, r23(new Error("Image creation error"));
  1293. }, e21.imageElement.src = n27;
  1294. });
  1295. } }]), e20;
  1296. }();
  1297. }, function(e19, t21, r22) {
  1298. Object.defineProperty(t21, "__esModule", { value: true });
  1299. var n26 = function() {
  1300. function e20(e21, t22) {
  1301. for (var r23 = 0; r23 < t22.length; r23++) {
  1302. var n27 = t22[r23];
  1303. n27.enumerable = n27.enumerable || false, n27.configurable = true, "value" in n27 && (n27.writable = true), Object.defineProperty(e21, n27.key, n27);
  1304. }
  1305. }
  1306. return function(t22, r23, n27) {
  1307. return r23 && e20(t22.prototype, r23), n27 && e20(t22, n27), t22;
  1308. };
  1309. }();
  1310. function i15(e20) {
  1311. return e20 && e20.__esModule ? e20 : { default: e20 };
  1312. }
  1313. function s22(e20, t22) {
  1314. if (!(e20 instanceof t22))
  1315. throw new TypeError("Cannot call a class as a function");
  1316. }
  1317. function a16(e20, t22) {
  1318. if (!e20)
  1319. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1320. return !t22 || typeof t22 != "object" && typeof t22 != "function" ? e20 : t22;
  1321. }
  1322. function o27(e20, t22) {
  1323. if (typeof t22 != "function" && t22 !== null)
  1324. throw new TypeError("Super expression must either be null or a function, not " + typeof t22);
  1325. e20.prototype = Object.create(t22 && t22.prototype, { constructor: { value: e20, enumerable: false, writable: true, configurable: true } }), t22 && (Object.setPrototypeOf ? Object.setPrototypeOf(e20, t22) : e20.__proto__ = t22);
  1326. }
  1327. var u15 = function(e20) {
  1328. function t22(e21, r23, n27) {
  1329. s22(this, t22);
  1330. var i16 = a16(this, (t22.__proto__ || Object.getPrototypeOf(t22)).call(this));
  1331. return i16.playbackRate = 1, i16._currentFrameNumber = 0, i16._ended = false, i16._paused = true, i16._numPlays = 0, i16._apng = e21, i16.context = r23, i16.stop(), n27 && i16.play(), i16;
  1332. }
  1333. return o27(t22, e20), n26(t22, [{ key: "renderNextFrame", value: function() {
  1334. this._currentFrameNumber = (this._currentFrameNumber + 1) % this._apng.frames.length, this._currentFrameNumber === this._apng.frames.length - 1 && (this._numPlays++, this._apng.numPlays !== 0 && this._numPlays >= this._apng.numPlays && (this._ended = true, this._paused = true)), this._prevFrame && this._prevFrame.disposeOp == 1 ? this.context.clearRect(this._prevFrame.left, this._prevFrame.top, this._prevFrame.width, this._prevFrame.height) : this._prevFrame && this._prevFrame.disposeOp == 2 && this.context.putImageData(this._prevFrameData, this._prevFrame.left, this._prevFrame.top);
  1335. var e21 = this.currentFrame;
  1336. this._prevFrame = e21, this._prevFrameData = null, e21.disposeOp == 2 && (this._prevFrameData = this.context.getImageData(e21.left, e21.top, e21.width, e21.height)), e21.blendOp == 0 && this.context.clearRect(e21.left, e21.top, e21.width, e21.height), this.context.drawImage(e21.imageElement, e21.left, e21.top), this.emit("frame", this._currentFrameNumber), this._ended && this.emit("end");
  1337. } }, { key: "play", value: function() {
  1338. var e21 = this;
  1339. this.emit("play"), this._ended && this.stop(), this._paused = false;
  1340. var t23 = performance.now() + this.currentFrame.delay / this.playbackRate, r23 = function r24(n27) {
  1341. if (!e21._ended && !e21._paused) {
  1342. if (n27 >= t23) {
  1343. for (; n27 - t23 >= e21._apng.playTime / e21.playbackRate; )
  1344. t23 += e21._apng.playTime / e21.playbackRate, e21._numPlays++;
  1345. do {
  1346. e21.renderNextFrame(), t23 += e21.currentFrame.delay / e21.playbackRate;
  1347. } while (!e21._ended && n27 > t23);
  1348. }
  1349. requestAnimationFrame(r24);
  1350. }
  1351. };
  1352. requestAnimationFrame(r23);
  1353. } }, { key: "pause", value: function() {
  1354. this._paused || (this.emit("pause"), this._paused = true);
  1355. } }, { key: "stop", value: function() {
  1356. this.emit("stop"), this._numPlays = 0, this._ended = false, this._paused = true, this._currentFrameNumber = -1, this.context.clearRect(0, 0, this._apng.width, this._apng.height), this.renderNextFrame();
  1357. } }, { key: "currentFrameNumber", get: function() {
  1358. return this._currentFrameNumber;
  1359. } }, { key: "currentFrame", get: function() {
  1360. return this._apng.frames[this._currentFrameNumber];
  1361. } }, { key: "paused", get: function() {
  1362. return this._paused;
  1363. } }, { key: "ended", get: function() {
  1364. return this._ended;
  1365. } }]), t22;
  1366. }(i15(r22(4)).default);
  1367. t21.default = u15;
  1368. }, function(e19, t21) {
  1369. function r22() {
  1370. this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0;
  1371. }
  1372. function n26(e20) {
  1373. return typeof e20 == "function";
  1374. }
  1375. function i15(e20) {
  1376. return typeof e20 == "number";
  1377. }
  1378. function s22(e20) {
  1379. return typeof e20 == "object" && e20 !== null;
  1380. }
  1381. function a16(e20) {
  1382. return e20 === void 0;
  1383. }
  1384. e19.exports = r22, r22.EventEmitter = r22, r22.prototype._events = void 0, r22.prototype._maxListeners = void 0, r22.defaultMaxListeners = 10, r22.prototype.setMaxListeners = function(e20) {
  1385. if (!i15(e20) || e20 < 0 || isNaN(e20))
  1386. throw TypeError("n must be a positive number");
  1387. return this._maxListeners = e20, this;
  1388. }, r22.prototype.emit = function(e20) {
  1389. var t22, r23, i16, o27, u15, h15;
  1390. if (this._events || (this._events = {}), e20 === "error" && (!this._events.error || s22(this._events.error) && !this._events.error.length)) {
  1391. if ((t22 = arguments[1]) instanceof Error)
  1392. throw t22;
  1393. var l17 = new Error('Uncaught, unspecified "error" event. (' + t22 + ")");
  1394. throw l17.context = t22, l17;
  1395. }
  1396. if (a16(r23 = this._events[e20]))
  1397. return false;
  1398. if (n26(r23))
  1399. switch (arguments.length) {
  1400. case 1:
  1401. r23.call(this);
  1402. break;
  1403. case 2:
  1404. r23.call(this, arguments[1]);
  1405. break;
  1406. case 3:
  1407. r23.call(this, arguments[1], arguments[2]);
  1408. break;
  1409. default:
  1410. o27 = Array.prototype.slice.call(arguments, 1), r23.apply(this, o27);
  1411. }
  1412. else if (s22(r23))
  1413. for (o27 = Array.prototype.slice.call(arguments, 1), i16 = (h15 = r23.slice()).length, u15 = 0; u15 < i16; u15++)
  1414. h15[u15].apply(this, o27);
  1415. return true;
  1416. }, r22.prototype.addListener = function(e20, t22) {
  1417. var i16;
  1418. if (!n26(t22))
  1419. throw TypeError("listener must be a function");
  1420. return this._events || (this._events = {}), this._events.newListener && this.emit("newListener", e20, n26(t22.listener) ? t22.listener : t22), this._events[e20] ? s22(this._events[e20]) ? this._events[e20].push(t22) : this._events[e20] = [this._events[e20], t22] : this._events[e20] = t22, s22(this._events[e20]) && !this._events[e20].warned && (i16 = a16(this._maxListeners) ? r22.defaultMaxListeners : this._maxListeners) && i16 > 0 && this._events[e20].length > i16 && (this._events[e20].warned = true, console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e20].length), typeof console.trace == "function" && console.trace()), this;
  1421. }, r22.prototype.on = r22.prototype.addListener, r22.prototype.once = function(e20, t22) {
  1422. if (!n26(t22))
  1423. throw TypeError("listener must be a function");
  1424. var r23 = false;
  1425. function i16() {
  1426. this.removeListener(e20, i16), r23 || (r23 = true, t22.apply(this, arguments));
  1427. }
  1428. return i16.listener = t22, this.on(e20, i16), this;
  1429. }, r22.prototype.removeListener = function(e20, t22) {
  1430. var r23, i16, a17, o27;
  1431. if (!n26(t22))
  1432. throw TypeError("listener must be a function");
  1433. if (!this._events || !this._events[e20])
  1434. return this;
  1435. if (a17 = (r23 = this._events[e20]).length, i16 = -1, r23 === t22 || n26(r23.listener) && r23.listener === t22)
  1436. delete this._events[e20], this._events.removeListener && this.emit("removeListener", e20, t22);
  1437. else if (s22(r23)) {
  1438. for (o27 = a17; o27-- > 0; )
  1439. if (r23[o27] === t22 || r23[o27].listener && r23[o27].listener === t22) {
  1440. i16 = o27;
  1441. break;
  1442. }
  1443. if (i16 < 0)
  1444. return this;
  1445. r23.length === 1 ? (r23.length = 0, delete this._events[e20]) : r23.splice(i16, 1), this._events.removeListener && this.emit("removeListener", e20, t22);
  1446. }
  1447. return this;
  1448. }, r22.prototype.removeAllListeners = function(e20) {
  1449. var t22, r23;
  1450. if (!this._events)
  1451. return this;
  1452. if (!this._events.removeListener)
  1453. return arguments.length === 0 ? this._events = {} : this._events[e20] && delete this._events[e20], this;
  1454. if (arguments.length === 0) {
  1455. for (t22 in this._events)
  1456. t22 !== "removeListener" && this.removeAllListeners(t22);
  1457. return this.removeAllListeners("removeListener"), this._events = {}, this;
  1458. }
  1459. if (n26(r23 = this._events[e20]))
  1460. this.removeListener(e20, r23);
  1461. else if (r23)
  1462. for (; r23.length; )
  1463. this.removeListener(e20, r23[r23.length - 1]);
  1464. return delete this._events[e20], this;
  1465. }, r22.prototype.listeners = function(e20) {
  1466. return this._events && this._events[e20] ? n26(this._events[e20]) ? [this._events[e20]] : this._events[e20].slice() : [];
  1467. }, r22.prototype.listenerCount = function(e20) {
  1468. if (this._events) {
  1469. var t22 = this._events[e20];
  1470. if (n26(t22))
  1471. return 1;
  1472. if (t22)
  1473. return t22.length;
  1474. }
  1475. return 0;
  1476. }, r22.listenerCount = function(e20, t22) {
  1477. return e20.listenerCount(t22);
  1478. };
  1479. }]);
  1480. }, u7.exports = o16();
  1481. var h6 = o5(u7.exports);
  1482. var l6 = class extends s15 {
  1483. static async create(e19, t21, i15, s22, a16) {
  1484. const o27 = new l6(s22);
  1485. try {
  1486. await o27._load(e19, t21, i15, a16);
  1487. } catch (u15) {
  1488. if (!g(u15))
  1489. return new s3("invalid-resource", `Could not load PNG: ${u15.message}`);
  1490. }
  1491. return o27;
  1492. }
  1493. async _loadAnimation(e19, t21, r22) {
  1494. return c7(e19, t21, r22);
  1495. }
  1496. };
  1497. async function c7(e19, t21, r22) {
  1498. const n26 = h6(e19);
  1499. if (n26 instanceof Error)
  1500. throw n26;
  1501. await n26.createImages(), f(r22);
  1502. const { frames: a16, width: o27, height: u15 } = n26, l17 = document.createElement("canvas");
  1503. l17.width = o27, l17.height = u15;
  1504. const c18 = l17.getContext("2d"), f14 = [], p9 = [];
  1505. for (const i15 of a16) {
  1506. p9.push(n2(i15.delay));
  1507. const e20 = i15.imageElement;
  1508. i15.blendOp === 0 ? c18.globalCompositeOperation = "copy" : c18.globalCompositeOperation = "source-over";
  1509. const t22 = i15.disposeOp === 2 && c18.getImageData(i15.left, i15.top, i15.width, i15.height);
  1510. c18.drawImage(e20, i15.left, i15.top);
  1511. const r23 = c18.getImageData(0, 0, o27, u15);
  1512. f14.push(r23), i15.disposeOp === 0 || (i15.disposeOp === 1 ? c18.clearRect(i15.left, i15.top, i15.width, i15.height) : i15.disposeOp === 2 && c18.putImageData(t22, i15.left, i15.top));
  1513. }
  1514. return { frameDurations: p9, selectFrame: (e20) => {
  1515. const r23 = f14[e20];
  1516. t21(r23);
  1517. }, width: o27, height: u15 };
  1518. }
  1519. var f7 = [137, 80, 78, 71, 13, 10, 26, 10];
  1520. function p3(e19) {
  1521. const t21 = new Uint8Array(e19);
  1522. return !f7.some((e20, r22) => e20 !== t21[r22]);
  1523. }
  1524. function m9(e19) {
  1525. if (!p3(e19))
  1526. return false;
  1527. const t21 = new DataView(e19), r22 = new Uint8Array(e19);
  1528. let n26, i15 = 8;
  1529. do {
  1530. const e20 = t21.getUint32(i15);
  1531. if (n26 = String.fromCharCode.apply(String, Array.prototype.slice.call(r22.subarray(i15 + 4, i15 + 8))), n26 === "acTL")
  1532. return true;
  1533. i15 += 12 + e20;
  1534. } while (n26 !== "IEND" && i15 < r22.length);
  1535. return false;
  1536. }
  1537. // node_modules/@arcgis/core/views/2d/engine/webgl/animatedFormats/gif.js
  1538. var i8 = {};
  1539. var o17 = {};
  1540. var s16 = {};
  1541. Object.defineProperty(s16, "__esModule", { value: true }), s16.loop = s16.conditional = s16.parse = void 0;
  1542. var d4 = function e13(r22, t21) {
  1543. var n26 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a16 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : n26;
  1544. if (Array.isArray(t21))
  1545. t21.forEach(function(t22) {
  1546. return e13(r22, t22, n26, a16);
  1547. });
  1548. else if (typeof t21 == "function")
  1549. t21(r22, n26, a16, e13);
  1550. else {
  1551. var i15 = Object.keys(t21)[0];
  1552. Array.isArray(t21[i15]) ? (a16[i15] = {}, e13(r22, t21[i15], n26, a16[i15])) : a16[i15] = t21[i15](r22, n26, a16, e13);
  1553. }
  1554. return n26;
  1555. };
  1556. s16.parse = d4;
  1557. var c8 = function(e19, r22) {
  1558. return function(t21, n26, a16, i15) {
  1559. r22(t21, n26, a16) && i15(t21, e19, n26, a16);
  1560. };
  1561. };
  1562. s16.conditional = c8;
  1563. var u8 = function(e19, r22) {
  1564. return function(t21, n26, a16, i15) {
  1565. for (var o27 = [], s22 = t21.pos; r22(t21, n26, a16); ) {
  1566. var d14 = {};
  1567. if (i15(t21, e19, n26, d14), t21.pos === s22)
  1568. break;
  1569. s22 = t21.pos, o27.push(d14);
  1570. }
  1571. return o27;
  1572. };
  1573. };
  1574. s16.loop = u8;
  1575. var l7 = {};
  1576. Object.defineProperty(l7, "__esModule", { value: true }), l7.readBits = l7.readArray = l7.readUnsigned = l7.readString = l7.peekBytes = l7.readBytes = l7.peekByte = l7.readByte = l7.buildStream = void 0;
  1577. var f8 = function(e19) {
  1578. return { data: e19, pos: 0 };
  1579. };
  1580. l7.buildStream = f8;
  1581. var p4 = function() {
  1582. return function(e19) {
  1583. return e19.data[e19.pos++];
  1584. };
  1585. };
  1586. l7.readByte = p4;
  1587. var g6 = function() {
  1588. var e19 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  1589. return function(r22) {
  1590. return r22.data[r22.pos + e19];
  1591. };
  1592. };
  1593. l7.peekByte = g6;
  1594. var y3 = function(e19) {
  1595. return function(r22) {
  1596. return r22.data.subarray(r22.pos, r22.pos += e19);
  1597. };
  1598. };
  1599. l7.readBytes = y3;
  1600. var m10 = function(e19) {
  1601. return function(r22) {
  1602. return r22.data.subarray(r22.pos, r22.pos + e19);
  1603. };
  1604. };
  1605. l7.peekBytes = m10;
  1606. var v3 = function(e19) {
  1607. return function(r22) {
  1608. return Array.from(y3(e19)(r22)).map(function(e20) {
  1609. return String.fromCharCode(e20);
  1610. }).join("");
  1611. };
  1612. };
  1613. l7.readString = v3;
  1614. var h7 = function(e19) {
  1615. return function(r22) {
  1616. var t21 = y3(2)(r22);
  1617. return e19 ? (t21[1] << 8) + t21[0] : (t21[0] << 8) + t21[1];
  1618. };
  1619. };
  1620. l7.readUnsigned = h7;
  1621. var w = function(e19, r22) {
  1622. return function(t21, n26, a16) {
  1623. for (var i15 = typeof r22 == "function" ? r22(t21, n26, a16) : r22, o27 = y3(e19), s22 = new Array(i15), d14 = 0; d14 < i15; d14++)
  1624. s22[d14] = o27(t21);
  1625. return s22;
  1626. };
  1627. };
  1628. l7.readArray = w;
  1629. var x = function(e19, r22, t21) {
  1630. for (var n26 = 0, a16 = 0; a16 < t21; a16++)
  1631. n26 += e19[r22 + a16] && Math.pow(2, t21 - a16 - 1);
  1632. return n26;
  1633. };
  1634. var B3 = function(e19) {
  1635. return function(r22) {
  1636. for (var t21 = p4()(r22), n26 = new Array(8), a16 = 0; a16 < 8; a16++)
  1637. n26[7 - a16] = !!(t21 & 1 << a16);
  1638. return Object.keys(e19).reduce(function(r23, t22) {
  1639. var a17 = e19[t22];
  1640. return a17.length ? r23[t22] = x(n26, a17.index, a17.length) : r23[t22] = n26[a17.index], r23;
  1641. }, {});
  1642. };
  1643. };
  1644. l7.readBits = B3, function(e19) {
  1645. Object.defineProperty(e19, "__esModule", { value: true }), e19.default = void 0;
  1646. var r22 = s16, t21 = l7, n26 = { blocks: function(e20) {
  1647. for (var r23 = 0, n27 = [], a17 = e20.data.length, i16 = 0, o28 = (0, t21.readByte)()(e20); o28 !== r23 && o28; o28 = (0, t21.readByte)()(e20)) {
  1648. if (e20.pos + o28 >= a17) {
  1649. var s22 = a17 - e20.pos;
  1650. n27.push((0, t21.readBytes)(s22)(e20)), i16 += s22;
  1651. break;
  1652. }
  1653. n27.push((0, t21.readBytes)(o28)(e20)), i16 += o28;
  1654. }
  1655. for (var d15 = new Uint8Array(i16), c19 = 0, u16 = 0; u16 < n27.length; u16++)
  1656. d15.set(n27[u16], c19), c19 += n27[u16].length;
  1657. return d15;
  1658. } }, a16 = (0, r22.conditional)({ gce: [{ codes: (0, t21.readBytes)(2) }, { byteSize: (0, t21.readByte)() }, { extras: (0, t21.readBits)({ future: { index: 0, length: 3 }, disposal: { index: 3, length: 3 }, userInput: { index: 6 }, transparentColorGiven: { index: 7 } }) }, { delay: (0, t21.readUnsigned)(true) }, { transparentColorIndex: (0, t21.readByte)() }, { terminator: (0, t21.readByte)() }] }, function(e20) {
  1659. var r23 = (0, t21.peekBytes)(2)(e20);
  1660. return r23[0] === 33 && r23[1] === 249;
  1661. }), i15 = (0, r22.conditional)({ image: [{ code: (0, t21.readByte)() }, { descriptor: [{ left: (0, t21.readUnsigned)(true) }, { top: (0, t21.readUnsigned)(true) }, { width: (0, t21.readUnsigned)(true) }, { height: (0, t21.readUnsigned)(true) }, { lct: (0, t21.readBits)({ exists: { index: 0 }, interlaced: { index: 1 }, sort: { index: 2 }, future: { index: 3, length: 2 }, size: { index: 5, length: 3 } }) }] }, (0, r22.conditional)({ lct: (0, t21.readArray)(3, function(e20, r23, t22) {
  1662. return Math.pow(2, t22.descriptor.lct.size + 1);
  1663. }) }, function(e20, r23, t22) {
  1664. return t22.descriptor.lct.exists;
  1665. }), { data: [{ minCodeSize: (0, t21.readByte)() }, n26] }] }, function(e20) {
  1666. return (0, t21.peekByte)()(e20) === 44;
  1667. }), o27 = (0, r22.conditional)({ text: [{ codes: (0, t21.readBytes)(2) }, { blockSize: (0, t21.readByte)() }, { preData: function(e20, r23, n27) {
  1668. return (0, t21.readBytes)(n27.text.blockSize)(e20);
  1669. } }, n26] }, function(e20) {
  1670. var r23 = (0, t21.peekBytes)(2)(e20);
  1671. return r23[0] === 33 && r23[1] === 1;
  1672. }), d14 = (0, r22.conditional)({ application: [{ codes: (0, t21.readBytes)(2) }, { blockSize: (0, t21.readByte)() }, { id: function(e20, r23, n27) {
  1673. return (0, t21.readString)(n27.blockSize)(e20);
  1674. } }, n26] }, function(e20) {
  1675. var r23 = (0, t21.peekBytes)(2)(e20);
  1676. return r23[0] === 33 && r23[1] === 255;
  1677. }), c18 = (0, r22.conditional)({ comment: [{ codes: (0, t21.readBytes)(2) }, n26] }, function(e20) {
  1678. var r23 = (0, t21.peekBytes)(2)(e20);
  1679. return r23[0] === 33 && r23[1] === 254;
  1680. }), u15 = [{ header: [{ signature: (0, t21.readString)(3) }, { version: (0, t21.readString)(3) }] }, { lsd: [{ width: (0, t21.readUnsigned)(true) }, { height: (0, t21.readUnsigned)(true) }, { gct: (0, t21.readBits)({ exists: { index: 0 }, resolution: { index: 1, length: 3 }, sort: { index: 4 }, size: { index: 5, length: 3 } }) }, { backgroundColorIndex: (0, t21.readByte)() }, { pixelAspectRatio: (0, t21.readByte)() }] }, (0, r22.conditional)({ gct: (0, t21.readArray)(3, function(e20, r23) {
  1681. return Math.pow(2, r23.lsd.gct.size + 1);
  1682. }) }, function(e20, r23) {
  1683. return r23.lsd.gct.exists;
  1684. }), { frames: (0, r22.loop)([a16, d14, c18, i15, o27], function(e20) {
  1685. var r23 = (0, t21.peekByte)()(e20);
  1686. return r23 === 33 || r23 === 44;
  1687. }) }];
  1688. e19.default = u15;
  1689. }(o17);
  1690. var b2 = {};
  1691. Object.defineProperty(b2, "__esModule", { value: true }), b2.deinterlace = void 0;
  1692. var k = function(e19, r22) {
  1693. for (var t21 = new Array(e19.length), n26 = e19.length / r22, a16 = function(n27, a17) {
  1694. var i16 = e19.slice(a17 * r22, (a17 + 1) * r22);
  1695. t21.splice.apply(t21, [n27 * r22, r22].concat(i16));
  1696. }, i15 = [0, 4, 2, 1], o27 = [8, 8, 4, 2], s22 = 0, d14 = 0; d14 < 4; d14++)
  1697. for (var c18 = i15[d14]; c18 < n26; c18 += o27[d14])
  1698. a16(c18, s22), s22++;
  1699. return t21;
  1700. };
  1701. b2.deinterlace = k;
  1702. var A4 = {};
  1703. Object.defineProperty(A4, "__esModule", { value: true }), A4.lzw = void 0;
  1704. var U4 = function(e19, r22, t21) {
  1705. var n26, a16, i15, o27, s22, d14, c18, u15, l17, f14, p9, g10, y6, m14, v8, h15, w4 = 4096, x5 = -1, B4 = t21, b5 = new Array(t21), k2 = new Array(w4), A8 = new Array(w4), U5 = new Array(w4 + 1);
  1706. for (s22 = (a16 = 1 << (f14 = e19)) + 1, n26 = a16 + 2, c18 = x5, i15 = (1 << (o27 = f14 + 1)) - 1, u15 = 0; u15 < a16; u15++)
  1707. k2[u15] = 0, A8[u15] = u15;
  1708. for (p9 = g10 = y6 = m14 = v8 = h15 = 0, l17 = 0; l17 < B4; ) {
  1709. if (m14 === 0) {
  1710. if (g10 < o27) {
  1711. p9 += r22[h15] << g10, g10 += 8, h15++;
  1712. continue;
  1713. }
  1714. if (u15 = p9 & i15, p9 >>= o27, g10 -= o27, u15 > n26 || u15 == s22)
  1715. break;
  1716. if (u15 == a16) {
  1717. i15 = (1 << (o27 = f14 + 1)) - 1, n26 = a16 + 2, c18 = x5;
  1718. continue;
  1719. }
  1720. if (c18 == x5) {
  1721. U5[m14++] = A8[u15], c18 = u15, y6 = u15;
  1722. continue;
  1723. }
  1724. for (d14 = u15, u15 == n26 && (U5[m14++] = y6, u15 = c18); u15 > a16; )
  1725. U5[m14++] = A8[u15], u15 = k2[u15];
  1726. y6 = 255 & A8[u15], U5[m14++] = y6, n26 < w4 && (k2[n26] = c18, A8[n26] = y6, (++n26 & i15) == 0 && n26 < w4 && (o27++, i15 += n26)), c18 = d14;
  1727. }
  1728. m14--, b5[v8++] = U5[m14], l17++;
  1729. }
  1730. for (l17 = v8; l17 < B4; l17++)
  1731. b5[l17] = 0;
  1732. return b5;
  1733. };
  1734. A4.lzw = U4, Object.defineProperty(i8, "__esModule", { value: true });
  1735. var S4 = i8.decompressFrames = i8.decompressFrame = F2 = i8.parseGIF = void 0;
  1736. var _4 = M4(o17);
  1737. var j2 = s16;
  1738. var z2 = l7;
  1739. var I4 = b2;
  1740. var C3 = A4;
  1741. function M4(e19) {
  1742. return e19 && e19.__esModule ? e19 : { default: e19 };
  1743. }
  1744. var T3 = function(e19) {
  1745. var r22 = new Uint8Array(e19);
  1746. return (0, j2.parse)((0, z2.buildStream)(r22), _4.default);
  1747. };
  1748. var F2 = i8.parseGIF = T3;
  1749. var O5 = function(e19) {
  1750. for (var r22 = e19.pixels.length, t21 = new Uint8ClampedArray(4 * r22), n26 = 0; n26 < r22; n26++) {
  1751. var a16 = 4 * n26, i15 = e19.pixels[n26], o27 = e19.colorTable[i15] || [0, 0, 0];
  1752. t21[a16] = o27[0], t21[a16 + 1] = o27[1], t21[a16 + 2] = o27[2], t21[a16 + 3] = i15 !== e19.transparentIndex ? 255 : 0;
  1753. }
  1754. return t21;
  1755. };
  1756. var D3 = function(e19, r22, t21) {
  1757. if (e19.image) {
  1758. var n26 = e19.image, a16 = n26.descriptor.width * n26.descriptor.height, i15 = (0, C3.lzw)(n26.data.minCodeSize, n26.data.blocks, a16);
  1759. n26.descriptor.lct.interlaced && (i15 = (0, I4.deinterlace)(i15, n26.descriptor.width));
  1760. var o27 = { pixels: i15, dims: { top: e19.image.descriptor.top, left: e19.image.descriptor.left, width: e19.image.descriptor.width, height: e19.image.descriptor.height } };
  1761. return n26.descriptor.lct && n26.descriptor.lct.exists ? o27.colorTable = n26.lct : o27.colorTable = r22, e19.gce && (o27.delay = 10 * (e19.gce.delay || 10), o27.disposalType = e19.gce.extras.disposal, e19.gce.extras.transparentColorGiven && (o27.transparentIndex = e19.gce.transparentColorIndex)), t21 && (o27.patch = O5(o27)), o27;
  1762. }
  1763. console.warn("gif frame does not have associated image.");
  1764. };
  1765. i8.decompressFrame = D3;
  1766. var P3 = function(e19, r22) {
  1767. return e19.frames.filter(function(e20) {
  1768. return e20.image;
  1769. }).map(function(t21) {
  1770. return D3(t21, e19.gct, r22);
  1771. });
  1772. };
  1773. S4 = i8.decompressFrames = P3;
  1774. var G2 = class extends s15 {
  1775. static async create(t21, n26, a16, i15, o27) {
  1776. const s22 = new G2(i15);
  1777. try {
  1778. await s22._load(t21, n26, a16, o27);
  1779. } catch (d14) {
  1780. if (!g(d14))
  1781. return new s3("invalid-resource", `Could not load GIF: ${d14.message}`);
  1782. }
  1783. return s22;
  1784. }
  1785. async _loadAnimation(e19, r22, t21) {
  1786. return E3(e19, r22);
  1787. }
  1788. };
  1789. async function E3(e19, r22, a16) {
  1790. const i15 = F2(e19), o27 = S4(i15, true), { width: s22, height: d14 } = i15.lsd, c18 = document.createElement("canvas");
  1791. c18.width = s22, c18.height = d14;
  1792. const u15 = c18.getContext("2d"), l17 = [], f14 = [];
  1793. for (const p9 of o27) {
  1794. f14.push(n2(p9.delay));
  1795. const e20 = new ImageData(p9.patch, p9.dims.width, p9.dims.height), r23 = m4(e20), a17 = p9.disposalType === 3 && u15.getImageData(p9.dims.left, p9.dims.top, p9.dims.width, p9.dims.height);
  1796. u15.drawImage(r23, p9.dims.left, p9.dims.top);
  1797. const i16 = u15.getImageData(0, 0, s22, d14);
  1798. l17.push(i16), p9.disposalType === 1 || (p9.disposalType === 2 ? u15.clearRect(p9.dims.left, p9.dims.top, p9.dims.width, p9.dims.height) : p9.disposalType === 3 && u15.putImageData(a17, p9.dims.left, p9.dims.top));
  1799. }
  1800. return { frameDurations: f14, selectFrame: (e20) => {
  1801. const t21 = l17[e20];
  1802. r22(t21);
  1803. }, width: s22, height: d14 };
  1804. }
  1805. var R2 = [71, 73, 70];
  1806. function V3(e19) {
  1807. const r22 = new Uint8Array(e19);
  1808. return !R2.some((e20, t21) => e20 !== r22[t21]);
  1809. }
  1810. function $2(e19) {
  1811. if (!V3(e19))
  1812. return false;
  1813. const r22 = new DataView(e19), t21 = r22.getUint8(10);
  1814. let n26 = 13 + (128 & t21 ? 3 * 2 ** (1 + (7 & t21)) : 0), a16 = 0, i15 = false;
  1815. for (; !i15; ) {
  1816. switch (r22.getUint8(n26++)) {
  1817. case 33:
  1818. if (!o27())
  1819. return false;
  1820. break;
  1821. case 44:
  1822. s22();
  1823. break;
  1824. case 59:
  1825. i15 = true;
  1826. break;
  1827. default:
  1828. return false;
  1829. }
  1830. if (a16 > 1)
  1831. return true;
  1832. }
  1833. function o27() {
  1834. switch (r22.getUint8(n26++)) {
  1835. case 249:
  1836. d14();
  1837. break;
  1838. case 1:
  1839. c18();
  1840. break;
  1841. case 254:
  1842. u15();
  1843. break;
  1844. case 255:
  1845. l17();
  1846. break;
  1847. default:
  1848. return false;
  1849. }
  1850. return true;
  1851. }
  1852. function s22() {
  1853. a16++, n26 += 8;
  1854. const e20 = r22.getUint8(n26++);
  1855. n26 += 128 & e20 ? 3 * 2 ** (1 + (7 & e20)) : 0, n26++, f14();
  1856. }
  1857. function d14() {
  1858. n26++, n26 += 4, f14();
  1859. }
  1860. function c18() {
  1861. a16++, n26++, n26 += 12, f14();
  1862. }
  1863. function u15() {
  1864. f14();
  1865. }
  1866. function l17() {
  1867. n26++, n26 += 8, n26 += 3, f14();
  1868. }
  1869. function f14() {
  1870. let e20;
  1871. for (; e20 = r22.getUint8(n26++); )
  1872. n26 += e20;
  1873. }
  1874. return false;
  1875. }
  1876. // node_modules/@arcgis/core/views/2d/engine/webgl/util/symbolUtils.js
  1877. function e14(e19) {
  1878. switch (e19.type) {
  1879. case "esriSMS":
  1880. return `${e19.style}.${e19.path}`;
  1881. case "esriSLS":
  1882. return `${e19.style}.${e19.cap}`;
  1883. case "esriSFS":
  1884. return `${e19.style}`;
  1885. case "esriPFS":
  1886. case "esriPMS":
  1887. return e19.imageData ? `${e19.imageData}${e19.width}${e19.height}` : `${e19.url}${e19.width}${e19.height}`;
  1888. default:
  1889. return "mosaicHash" in e19 ? e19.mosaicHash : JSON.stringify(e19);
  1890. }
  1891. }
  1892. // node_modules/@arcgis/core/views/2d/engine/webgl/TextureManager.js
  1893. var O6 = n9();
  1894. var Q = "arial-unicode-ms-regular";
  1895. var H = 126;
  1896. var V4 = s2.getLogger("esri.views.2d.engine.webgl.TextureManager");
  1897. async function Y3(e19, i15) {
  1898. const r22 = Ee(e19);
  1899. let n26;
  1900. const o27 = ";base64,";
  1901. if (r22.includes(o27)) {
  1902. const e20 = r22.indexOf(o27) + o27.length, t21 = r22.substring(e20), i16 = atob(t21), s22 = new Uint8Array(i16.length);
  1903. for (let r23 = 0; r23 < i16.length; r23++)
  1904. s22[r23] = i16.charCodeAt(r23);
  1905. n26 = s22.buffer;
  1906. } else
  1907. try {
  1908. const { data: e20 } = await U(r22, { responseType: "array-buffer", ...i15 });
  1909. n26 = e20;
  1910. } catch (a16) {
  1911. if (!g(a16))
  1912. return new s3("mapview-invalid-resource", `Could not fetch requested resource at ${r22}`);
  1913. }
  1914. return n26;
  1915. }
  1916. function D4(e19, t21) {
  1917. const i15 = Math.round(u2(t21) * window.devicePixelRatio), s22 = i15 >= 128 ? 2 : 4;
  1918. return Math.min(e19, i15 * s22);
  1919. }
  1920. var J2 = (e19, t21, i15) => V4.error(new s3(e19, t21, i15));
  1921. var W4 = class {
  1922. constructor(e19, t21, i15) {
  1923. this.mosaicType = e19, this.page = t21, this.sdf = i15;
  1924. }
  1925. static fromMosaic(e19, t21) {
  1926. return new W4(e19, t21.page, t21.sdf);
  1927. }
  1928. };
  1929. var X2 = class {
  1930. constructor(i15, r22) {
  1931. this._requestRender = i15, this.resourceManager = r22, this._invalidFontsMap = new Map(), this._sdfConverter = new r11(H), this._bindingInfos = new Array(), this._hashToBindingIndex = new Map(), this._ongoingRasterizations = new Map(), this._imageRequestQueue = new l3({ concurrency: 10, process: async (e19, i16) => {
  1932. f(i16);
  1933. try {
  1934. return await U(e19, { responseType: "image", signal: i16 });
  1935. } catch (r23) {
  1936. if (!g(r23))
  1937. throw new s3("mapview-invalid-resource", `Could not fetch requested resource at ${e19}`, r23);
  1938. throw r23;
  1939. }
  1940. } }), this._spriteMosaic = new p2(2048, 2048, 500), this._glyphSource = new r10(`${r2.fontsUrl}/{fontstack}/{range}.pbf`), this._glyphMosaic = new _3(1024, 1024, this._glyphSource), this._rasterizer = new m5(r22);
  1941. }
  1942. dispose() {
  1943. this._spriteMosaic.dispose(), this._glyphMosaic.dispose(), this._rasterizer.dispose(), this._sdfConverter.dispose(), this._spriteMosaic = null, this._glyphMosaic = null, this._sdfConverter = null, this._hashToBindingIndex.clear(), this._hashToBindingIndex = null, this._bindingInfos = null, this._ongoingRasterizations.clear(), this._ongoingRasterizations = null, this._imageRequestQueue.clear(), this._imageRequestQueue = null;
  1944. }
  1945. get sprites() {
  1946. return this._spriteMosaic;
  1947. }
  1948. get glyphs() {
  1949. return this._glyphMosaic;
  1950. }
  1951. async rasterizeItem(e19, t21, i15, s22) {
  1952. if (t(e19))
  1953. return J2("mapview-null-resource", "Unable to rasterize null resource"), null;
  1954. switch (e19.type) {
  1955. case "text":
  1956. case "esriTS": {
  1957. const t22 = await this._rasterizeText(e19, i15, s22);
  1958. return t22.forEach((e20) => this._setTextureBinding(O4.GLYPH, e20)), { glyphMosaicItems: t22 };
  1959. }
  1960. default: {
  1961. if (Ne(e19))
  1962. return J2("mapview-invalid-type", `MapView does not support symbol type: ${e19.type}`, e19), null;
  1963. const i16 = await this._rasterizeSpriteSymbol(e19, t21, s22);
  1964. return e3(i16) && i16 && this._setTextureBinding(O4.SPRITE, i16), { spriteMosaicItem: i16 };
  1965. }
  1966. }
  1967. }
  1968. bindTextures(e19, t21, i15, s22 = false) {
  1969. if (i15.textureBinding === 0)
  1970. return;
  1971. const r22 = this._bindingInfos[i15.textureBinding - 1], n26 = r22.page, o27 = s22 ? L2.LINEAR_MIPMAP_LINEAR : L2.LINEAR;
  1972. switch (r22.mosaicType) {
  1973. case O4.SPRITE: {
  1974. const i16 = this.sprites.getWidth(n26), s23 = this.sprites.getHeight(n26), r23 = r5(O6, i16, s23);
  1975. return this._spriteMosaic.bind(e19, o27, n26, y2), t21.setUniform1i("u_texture", y2), void t21.setUniform2fv("u_mosaicSize", r23);
  1976. }
  1977. case O4.GLYPH: {
  1978. const i16 = this.glyphs.width, s23 = this.glyphs.height, r23 = r5(O6, i16, s23);
  1979. return this._glyphMosaic.bind(e19, o27, n26, z), t21.setUniform1i("u_texture", z), void t21.setUniform2fv("u_mosaicSize", r23);
  1980. }
  1981. default:
  1982. V4.error("mapview-texture-manager", `Cannot handle unknown type ${r22.mosaicType}`);
  1983. }
  1984. }
  1985. _hashMosaic(e19, t21) {
  1986. return 1 | e19 << 1 | (t21.sdf ? 1 : 0) << 2 | t21.page << 3;
  1987. }
  1988. _setTextureBinding(e19, t21) {
  1989. const i15 = this._hashMosaic(e19, t21);
  1990. if (!this._hashToBindingIndex.has(i15)) {
  1991. const s22 = W4.fromMosaic(e19, t21), r22 = this._bindingInfos.length + 1;
  1992. this._hashToBindingIndex.set(i15, r22), this._bindingInfos.push(s22);
  1993. }
  1994. t21.textureBinding = this._hashToBindingIndex.get(i15);
  1995. }
  1996. async _rasterizeText(e19, t21, s22) {
  1997. let r22, n26;
  1998. if ("cim" in e19) {
  1999. const t22 = e19;
  2000. r22 = t22.fontName, n26 = t22.text;
  2001. } else {
  2002. const t22 = e19;
  2003. r22 = n10(t22.font), n26 = t22.text;
  2004. }
  2005. const o27 = this._invalidFontsMap.has(r22), a16 = t21 || ve(n6(n26)[0]);
  2006. try {
  2007. return await this._glyphMosaic.getGlyphItems(o27 ? Q : r22, a16, s22);
  2008. } catch (h15) {
  2009. return J2("mapview-invalid-resource", `Couldn't find font ${r22}. Falling back to Arial Unicode MS Regular`), this._invalidFontsMap.set(r22, true), this._glyphMosaic.getGlyphItems(Q, a16, s22);
  2010. }
  2011. }
  2012. async _rasterizeSpriteSymbol(e19, t21, i15) {
  2013. if (Me(e19))
  2014. return null;
  2015. const r22 = e14(e19);
  2016. if (this._spriteMosaic.has(r22))
  2017. return this._spriteMosaic.getSpriteItem(r22);
  2018. if (Ie(e19) || Te(e19) && !Be(e19))
  2019. return this._handleAsyncResource(r22, e19, i15);
  2020. const n26 = 1, o27 = this._rasterizer.rasterizeJSONResource(e19, n26);
  2021. if (o27) {
  2022. const { size: t22, image: i16, sdf: s22, simplePattern: n27 } = o27;
  2023. return this._addItemToMosaic(r22, t22, { type: "static", data: i16 }, _e(e19), s22, n27);
  2024. }
  2025. return new s3("TextureManager", "unrecognized or null rasterized image");
  2026. }
  2027. async _handleAsyncResource(e19, t21, i15) {
  2028. if (this._ongoingRasterizations.has(e19))
  2029. return this._ongoingRasterizations.get(e19);
  2030. let s22;
  2031. s22 = Ie(t21) ? this._handleSVG(t21, e19, i15) : this._handleImage(t21, e19, i15), this._ongoingRasterizations.set(e19, s22);
  2032. try {
  2033. await s22, this._ongoingRasterizations.delete(e19);
  2034. } catch {
  2035. this._ongoingRasterizations.delete(e19);
  2036. }
  2037. return s22;
  2038. }
  2039. async _handleSVG(e19, t21, i15) {
  2040. const s22 = [H, H], r22 = await this._sdfConverter.draw(e19.path, i15);
  2041. return this._addItemToMosaic(t21, s22, { type: "static", data: new Uint32Array(r22.buffer) }, false, true, true);
  2042. }
  2043. async _handleGIFOrPNG(e19, t21, i15) {
  2044. const r22 = await Y3(e19, i15);
  2045. if (e3(r22)) {
  2046. const o27 = V3(r22), a16 = p3(r22);
  2047. if (!o27 && !a16)
  2048. return new s3("mapview-invalid-resource", "Image data is neither GIF nor PNG!");
  2049. let c18;
  2050. try {
  2051. const t22 = e19.animatedSymbolProperties || {}, s22 = e19.objectId;
  2052. o27 && $2(r22) ? c18 = await G2.create(r22, t22, s22, this._requestRender, i15) : a16 && m9(r22) && (c18 = await l6.create(r22, t22, s22, this._requestRender, i15));
  2053. } catch (n26) {
  2054. if (!g(n26))
  2055. return new s3("mapview-invalid-resource", "Could not fetch requested resource!");
  2056. }
  2057. if (c18 && e3(c18))
  2058. return this._addItemToMosaic(t21, [c18.width, c18.height], { type: "animated", data: c18 }, _e(e19), false, false);
  2059. const u15 = new Blob([r22], { type: o27 ? "image/gif" : "image/png" }), d14 = await this._imageFromBlob(u15);
  2060. if (d14 && d14 instanceof HTMLImageElement) {
  2061. let i16 = d14.width, s22 = d14.height;
  2062. e19.type === "esriPMS" && (i16 = Math.round(D4(d14.width, Ue(e19))), s22 = Math.round(d14.height * (i16 / d14.width)));
  2063. const r23 = "cim" in e19 ? e19.cim.colorSubstitutions : void 0, { size: n26, sdf: o28, image: a17 } = this._rasterizer.rasterizeImageResource(i16, s22, d14, r23);
  2064. return this._addItemToMosaic(t21, n26, { type: "static", data: a17 }, _e(e19), o28, false);
  2065. }
  2066. }
  2067. return new s3("mapview-invalid-resource", "Could not handle resource!");
  2068. }
  2069. async _handleImage(e19, t21, i15) {
  2070. if (we(e19) || Ae(e19))
  2071. return this._handleGIFOrPNG(e19, t21, i15);
  2072. const r22 = Ee(e19);
  2073. try {
  2074. let s22;
  2075. const n26 = this.resourceManager.getResource(r22);
  2076. if (r(n26))
  2077. s22 = n26;
  2078. else {
  2079. const { data: e20 } = await this._imageRequestQueue.push(r22, { ...i15 });
  2080. s22 = e20;
  2081. }
  2082. if (De(r22)) {
  2083. if ("width" in e19 && "height" in e19)
  2084. s22.width = u2(e19.width), s22.height = u2(e19.height);
  2085. else if ("cim" in e19) {
  2086. const t22 = e19.cim;
  2087. s22.width = u2(t22.width ?? t22.scaleX * t22.size), s22.height = u2(t22.size);
  2088. }
  2089. }
  2090. if (!s22.width || !s22.height)
  2091. return null;
  2092. let a16 = s22.width, h15 = s22.height;
  2093. e19.type === "esriPMS" && (a16 = Math.round(D4(s22.width, Ue(e19))), h15 = Math.round(s22.height * (a16 / s22.width)));
  2094. const u15 = "cim" in e19 ? e19.cim.colorSubstitutions : void 0, { size: d14, sdf: m14, image: l17 } = this._rasterizer.rasterizeImageResource(a16, h15, s22, u15);
  2095. return this._addItemToMosaic(t21, d14, { type: "static", data: l17 }, _e(e19), m14, false);
  2096. } catch (n26) {
  2097. if (!g(n26))
  2098. return new s3("mapview-invalid-resource", `Could not fetch requested resource at ${r22}. ${n26.message}`);
  2099. }
  2100. }
  2101. async _imageFromBlob(e19) {
  2102. const t21 = window.URL.createObjectURL(e19);
  2103. try {
  2104. const { data: e20 } = await this._imageRequestQueue.push(t21);
  2105. return window.URL.revokeObjectURL(t21), e20;
  2106. } catch (i15) {
  2107. if (window.URL.revokeObjectURL(t21), !g(i15))
  2108. return new s3("mapview-invalid-resource", `Could not fetch requested resource at ${t21}`);
  2109. throw i15;
  2110. }
  2111. }
  2112. _addItemToMosaic(e19, t21, i15, s22, r22, n26) {
  2113. return this._spriteMosaic.addSpriteItem(e19, t21, i15, s22, r22, n26);
  2114. }
  2115. };
  2116. // node_modules/@arcgis/core/views/2d/engine/webgl/shaders/StencilPrograms.js
  2117. var r12 = { shaders: { vertexShader: n14("stencil/stencil.vert"), fragmentShader: n14("stencil/stencil.frag") }, attributes: new Map([["a_pos", 0]]) };
  2118. // node_modules/@arcgis/core/views/2d/engine/webgl/WorldExtentClipRenderer.js
  2119. var u9 = r8(-0.5, -0.5);
  2120. var f9 = class {
  2121. constructor() {
  2122. this._centerNdc = n4(), this._pxToNdc = n4(), this._worldDimensionsPx = n4(), this._mat3 = e7(), this._initialized = false;
  2123. }
  2124. dispose() {
  2125. this._program = s(this._program), this._quad = s(this._quad);
  2126. }
  2127. render(t21, s22) {
  2128. const { context: i15 } = t21;
  2129. return !!this._updateGeometry(t21, s22) && (this._initialized || this._initialize(i15), i15.setDepthWriteEnabled(false), i15.setDepthTestEnabled(false), i15.setColorMask(false, false, false, false), i15.setBlendingEnabled(false), i15.setStencilOp(O2.KEEP, O2.KEEP, O2.REPLACE), i15.setStencilFunction(I.ALWAYS, 1, 255), i15.setStencilTestEnabled(true), i15.useProgram(this._program), this._program.setUniformMatrix3fv("u_worldExtent", this._mat3), this._quad.draw(), this._quad.unbind(), true);
  2130. }
  2131. _initialize(t21) {
  2132. if (this._initialized)
  2133. return;
  2134. const s22 = e6(t21, r12);
  2135. s22 && (this._program = s22, this._quad = new n13(t21, [0, 0, 1, 0, 0, 1, 1, 1]), this._initialized = true);
  2136. }
  2137. _updateGeometry(t21, a16) {
  2138. const { state: n26, pixelRatio: m14 } = t21, { size: c18, rotation: d14 } = n26, p9 = Math.round(c18[0] * m14), _13 = Math.round(c18[1] * m14);
  2139. if (!n26.spatialReference.isWrappable)
  2140. return false;
  2141. const l17 = o2(d14), f14 = Math.abs(Math.cos(l17)), b5 = Math.abs(Math.sin(l17)), g10 = Math.round(p9 * f14 + _13 * b5), x5 = Math.round(n26.worldScreenWidth);
  2142. if (g10 <= x5)
  2143. return false;
  2144. const j5 = p9 * b5 + _13 * f14, E6 = x5 * m14, M6 = (a16.left - a16.right) * m14 / p9, w4 = (a16.bottom - a16.top) * m14 / _13;
  2145. o3(this._worldDimensionsPx, E6, j5, 1), o3(this._pxToNdc, 2 / p9, -2 / _13, 1), o3(this._centerNdc, M6, w4, 1);
  2146. const P4 = this._mat3;
  2147. return l2(P4, this._centerNdc), f4(P4, P4, this._pxToNdc), d14 !== 0 && h2(P4, P4, l17), f4(P4, P4, this._worldDimensionsPx), M2(P4, P4, u9), true;
  2148. }
  2149. };
  2150. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/Effect.js
  2151. var t12 = class {
  2152. constructor() {
  2153. this.name = this.constructor.name;
  2154. }
  2155. createOptions(t21, r22) {
  2156. return null;
  2157. }
  2158. };
  2159. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/AnimationEffect.js
  2160. var o18 = class extends t12 {
  2161. constructor() {
  2162. super(...arguments), this.defines = [], this._desc = { vsPath: "fx/integrate", fsPath: "fx/integrate", attributes: new Map([["a_position", 0]]) };
  2163. }
  2164. dispose() {
  2165. this._quad && this._quad.dispose();
  2166. }
  2167. bind() {
  2168. }
  2169. unbind() {
  2170. }
  2171. draw(r22, i15) {
  2172. if (!i15.size)
  2173. return;
  2174. const { context: a16, renderingOptions: o27 } = r22;
  2175. this._quad || (this._quad = new n13(a16, [0, 0, 1, 0, 0, 1, 1, 1]));
  2176. const n26 = a16.getBoundFramebufferObject(), { x: u15, y: m14, width: d14, height: f14 } = a16.getViewport();
  2177. i15.bindTextures(a16);
  2178. const c18 = i15.getBlock(N2);
  2179. if (t(c18))
  2180. return;
  2181. const _13 = c18.getFBO(a16), l17 = c18.getFBO(a16, 1);
  2182. a16.setViewport(0, 0, i15.size, i15.size), this._computeDelta(r22, l17, o27.labelsAnimationTime), this._updateAnimationState(r22, l17, _13), a16.bindFramebuffer(n26), a16.setViewport(u15, m14, d14, f14);
  2183. }
  2184. _computeDelta(e19, t21, s22) {
  2185. const { context: a16, painter: o27, displayLevel: n26 } = e19, u15 = o27.materialManager.getProgram(this._desc, ["delta"]);
  2186. a16.bindFramebuffer(t21), a16.setClearColor(0, 0, 0, 0), a16.clear(a16.gl.COLOR_BUFFER_BIT), a16.useProgram(u15), u15.setUniform1i("u_maskTexture", B2), u15.setUniform1i("u_sourceTexture", C2), u15.setUniform1f("u_timeDelta", e19.deltaTime), u15.setUniform1f("u_animationTime", s22), u15.setUniform1f("u_zoomLevel", Math.round(10 * n26)), this._quad.draw();
  2187. }
  2188. _updateAnimationState(e19, t21, r22) {
  2189. const { context: i15, painter: s22 } = e19, a16 = s22.materialManager.getProgram(this._desc, ["update"]);
  2190. i15.bindTexture(t21.colorTexture, 1), i15.useProgram(a16), a16.setUniform1i("u_sourceTexture", 1), i15.bindFramebuffer(r22), i15.setClearColor(0, 0, 0, 0), i15.clear(i15.gl.COLOR_BUFFER_BIT), this._quad.draw();
  2191. }
  2192. };
  2193. // node_modules/@arcgis/core/views/2d/engine/webgl/shaders/BlendPrograms.js
  2194. var r13 = (e19) => e19.replace("-", "_").toUpperCase();
  2195. var t13 = (e19) => `#define ${r13(e19)}
  2196. `;
  2197. function n19(r22) {
  2198. return { attributes: new Map([["a_pos", 0], ["a_tex", 1]]), shaders: { vertexShader: t13(r22) + n14("blend/blend.vert"), fragmentShader: t13(r22) + n14("blend/blend.frag") } };
  2199. }
  2200. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/BlendEffect.js
  2201. var l8 = s2.getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");
  2202. var _5 = class {
  2203. constructor() {
  2204. this._size = [0, 0];
  2205. }
  2206. dispose(e19) {
  2207. this._backBufferTexture = s(this._backBufferTexture), this._quad = s(this._quad);
  2208. }
  2209. draw(r22, t21, s22, a16, d14) {
  2210. const { context: u15, drawPhase: f14 } = r22;
  2211. if (this._setupShader(u15), a16 && a16 !== "normal" && f14 !== I3.LABEL)
  2212. return void this._drawBlended(r22, t21, s22, a16, d14);
  2213. const c18 = n19("normal"), m14 = u15.programCache.acquire(c18.shaders.vertexShader, c18.shaders.fragmentShader, c18.attributes);
  2214. if (!m14)
  2215. return void l8.error(new s3("mapview-BlendEffect", 'Error creating shader program for blend mode "normal"'));
  2216. u15.useProgram(m14), t21.setSamplingMode(s22), u15.bindTexture(t21, 0), m14.setUniform1i("u_layerTexture", 0), m14.setUniform1f("u_opacity", d14), u15.setBlendingEnabled(true), u15.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA);
  2217. const h15 = this._quad;
  2218. h15.draw(), h15.unbind(), m14.dispose();
  2219. }
  2220. _drawBlended(r22, t21, i15, a16, d14) {
  2221. const { context: u15, state: f14, pixelRatio: c18, inFadeTransition: m14 } = r22, { size: h15 } = f14, _13 = u15.getBoundFramebufferObject();
  2222. let p9, b5;
  2223. if (r(_13)) {
  2224. const e19 = _13.descriptor;
  2225. p9 = e19.width, b5 = e19.height;
  2226. } else
  2227. p9 = Math.round(c18 * h15[0]), b5 = Math.round(c18 * h15[1]);
  2228. this._createOrResizeTexture(r22, p9, b5);
  2229. const g10 = this._backBufferTexture;
  2230. _13.copyToTexture(0, 0, p9, b5, 0, 0, g10), u15.setStencilTestEnabled(false), u15.setStencilWriteMask(0), u15.setBlendingEnabled(true), u15.setDepthTestEnabled(false), u15.setDepthWriteEnabled(false);
  2231. const x5 = n19(a16), E6 = u15.programCache.acquire(x5.shaders.vertexShader, x5.shaders.fragmentShader, x5.attributes);
  2232. if (!E6)
  2233. return void l8.error(new s3("mapview-BlendEffect", `Error creating shader program for blend mode ${a16}`));
  2234. u15.useProgram(E6), g10.setSamplingMode(i15), u15.bindTexture(g10, 0), E6.setUniform1i("u_backbufferTexture", 0), t21.setSamplingMode(i15), u15.bindTexture(t21, 1), E6.setUniform1i("u_layerTexture", 1), E6.setUniform1f("u_opacity", d14), E6.setUniform1f("u_inFadeOpacity", m14 ? 1 : 0), u15.setBlendFunction(R.ONE, R.ZERO);
  2235. const T6 = this._quad;
  2236. T6.draw(), T6.unbind(), E6.dispose(), u15.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA);
  2237. }
  2238. _setupShader(e19) {
  2239. this._quad || (this._quad = new n13(e19, [-1, -1, 1, -1, -1, 1, 1, 1]));
  2240. }
  2241. _createOrResizeTexture(e19, r22, t21) {
  2242. const { context: s22 } = e19;
  2243. this._backBufferTexture !== null && r22 === this._size[0] && t21 === this._size[1] || (this._backBufferTexture ? this._backBufferTexture.resize(r22, t21) : this._backBufferTexture = new u4(s22, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: r22, height: t21 }), this._size[0] = r22, this._size[1] = t21);
  2244. }
  2245. };
  2246. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/FeatureEffect.js
  2247. var r14 = class extends t12 {
  2248. constructor(e19) {
  2249. super(), this.name = this.constructor.name, this.defines = [e19];
  2250. }
  2251. dispose() {
  2252. }
  2253. bind({ context: e19, painter: t21 }) {
  2254. this._prev = e19.getBoundFramebufferObject();
  2255. const { width: r22, height: s22 } = e19.getViewport(), o27 = t21.getFbos(r22, s22).effect0;
  2256. e19.bindFramebuffer(o27), e19.setColorMask(true, true, true, true), e19.setClearColor(0, 0, 0, 0), e19.clear(e19.gl.COLOR_BUFFER_BIT);
  2257. }
  2258. unbind() {
  2259. }
  2260. draw(e19, r22) {
  2261. const { context: s22, painter: o27 } = e19, n26 = o27.getPostProcessingEffects(r22), c18 = s22.getBoundFramebufferObject();
  2262. for (const { postProcessingEffect: t21, effect: f14 } of n26)
  2263. t21.draw(e19, c18, f14);
  2264. s22.bindFramebuffer(this._prev), s22.setStencilTestEnabled(false), o27.blitTexture(s22, c18.colorTexture, L2.NEAREST), s22.setStencilTestEnabled(true);
  2265. }
  2266. };
  2267. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/parameters.js
  2268. var o19 = 1;
  2269. var t14 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1];
  2270. var i9 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
  2271. var n20 = 256;
  2272. var e15 = { outlineWidth: 1.3, outerHaloWidth: 0.4, innerHaloWidth: 0.4, outlinePosition: 0 };
  2273. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/HighlightGradient.js
  2274. var u10 = s2.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");
  2275. function C4(o27, i15) {
  2276. i15.fillColor[0] = o27.color.r / 255, i15.fillColor[1] = o27.color.g / 255, i15.fillColor[2] = o27.color.b / 255, i15.fillColor[3] = o27.color.a, o27.haloColor ? (i15.outlineColor[0] = o27.haloColor.r / 255, i15.outlineColor[1] = o27.haloColor.g / 255, i15.outlineColor[2] = o27.haloColor.b / 255, i15.outlineColor[3] = o27.haloColor.a) : (i15.outlineColor[0] = i15.fillColor[0], i15.outlineColor[1] = i15.fillColor[1], i15.outlineColor[2] = i15.fillColor[2], i15.outlineColor[3] = i15.fillColor[3]), i15.fillColor[3] *= o27.fillOpacity, i15.outlineColor[3] *= o27.haloOpacity, i15.fillColor[0] *= i15.fillColor[3], i15.fillColor[1] *= i15.fillColor[3], i15.fillColor[2] *= i15.fillColor[3], i15.outlineColor[0] *= i15.outlineColor[3], i15.outlineColor[1] *= i15.outlineColor[3], i15.outlineColor[2] *= i15.outlineColor[3], i15.outlineWidth = e15.outlineWidth, i15.outerHaloWidth = e15.outerHaloWidth, i15.innerHaloWidth = e15.innerHaloWidth, i15.outlinePosition = e15.outlinePosition;
  2277. }
  2278. var g7 = [0, 0, 0, 0];
  2279. var f10 = class {
  2280. constructor() {
  2281. this._convertedHighlightOptions = { fillColor: [0.2 * 0.75, 0.6 * 0.75, 0.675, 0.75], outlineColor: [0.2 * 0.9, 0.54, 0.81, 0.9], outlinePosition: e15.outlinePosition, outlineWidth: e15.outlineWidth, innerHaloWidth: e15.innerHaloWidth, outerHaloWidth: e15.outerHaloWidth }, this.shadeTexChanged = true, this.texelData = new Uint8Array(4 * n20), this.minMaxDistance = [0, 0];
  2282. }
  2283. setHighlightOptions(o27) {
  2284. const i15 = this._convertedHighlightOptions;
  2285. C4(o27, i15);
  2286. const t21 = i15.outlinePosition - i15.outlineWidth / 2 - i15.outerHaloWidth, r22 = i15.outlinePosition - i15.outlineWidth / 2, n26 = i15.outlinePosition + i15.outlineWidth / 2, h15 = i15.outlinePosition + i15.outlineWidth / 2 + i15.innerHaloWidth, a16 = Math.sqrt(Math.PI / 2) * o19, s22 = Math.abs(t21) > a16 ? Math.round(10 * (Math.abs(t21) - a16)) / 10 : 0, d14 = Math.abs(h15) > a16 ? Math.round(10 * (Math.abs(h15) - a16)) / 10 : 0;
  2287. let f14;
  2288. s22 && !d14 ? u10.error("The outer rim of the highlight is " + s22 + "px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards).") : !s22 && d14 ? u10.error("The inner rim of the highlight is " + d14 + "px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards).") : s22 && d14 && u10.error("The highlight is " + Math.max(s22, d14) + "px away from the edge of the feature; consider reducing some width values.");
  2289. const c18 = [void 0, void 0, void 0, void 0];
  2290. function m14(o28, i16, t22) {
  2291. c18[0] = (1 - t22) * o28[0] + t22 * i16[0], c18[1] = (1 - t22) * o28[1] + t22 * i16[1], c18[2] = (1 - t22) * o28[2] + t22 * i16[2], c18[3] = (1 - t22) * o28[3] + t22 * i16[3];
  2292. }
  2293. const { texelData: p9 } = this;
  2294. for (let l17 = 0; l17 < n20; ++l17)
  2295. f14 = t21 + l17 / (n20 - 1) * (h15 - t21), f14 < t21 ? (c18[4 * l17 + 0] = 0, c18[4 * l17 + 1] = 0, c18[4 * l17 + 2] = 0, c18[4 * l17 + 3] = 0) : f14 < r22 ? m14(g7, i15.outlineColor, (f14 - t21) / (r22 - t21)) : f14 < n26 ? [c18[0], c18[1], c18[2], c18[3]] = i15.outlineColor : f14 < h15 ? m14(i15.outlineColor, i15.fillColor, (f14 - n26) / (h15 - n26)) : [c18[4 * l17 + 0], c18[4 * l17 + 1], c18[4 * l17 + 2], c18[4 * l17 + 3]] = i15.fillColor, p9[4 * l17 + 0] = 255 * c18[0], p9[4 * l17 + 1] = 255 * c18[1], p9[4 * l17 + 2] = 255 * c18[2], p9[4 * l17 + 3] = 255 * c18[3];
  2296. this.minMaxDistance[0] = t21, this.minMaxDistance[1] = h15, this.shadeTexChanged = true;
  2297. }
  2298. applyHighlightOptions(o27, t21) {
  2299. this.shadeTex || (this.shadeTex = new u4(o27, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, width: n20, height: 1, samplingMode: L2.LINEAR })), this.shadeTexChanged && (this.shadeTex.updateData(0, 0, 0, n20, 1, this.texelData), this.shadeTexChanged = false), o27.bindTexture(this.shadeTex, J), t21.setUniform2fv("u_minMaxDistance", this.minMaxDistance);
  2300. }
  2301. destroy() {
  2302. this.shadeTex && (this.shadeTex.dispose(), this.shadeTex = null);
  2303. }
  2304. };
  2305. // node_modules/@arcgis/core/views/2d/engine/webgl/shaders/HighlightPrograms.js
  2306. var t15 = { shaders: { vertexShader: n14("highlight/textured.vert"), fragmentShader: n14("highlight/highlight.frag") }, attributes: new Map([["a_position", 0], ["a_texcoord", 1]]) };
  2307. var r15 = { shaders: { vertexShader: n14("highlight/textured.vert"), fragmentShader: n14("highlight/blur.frag") }, attributes: new Map([["a_position", 0], ["a_texcoord", 1]]) };
  2308. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js
  2309. var c9 = class {
  2310. constructor() {
  2311. this._width = void 0, this._height = void 0, this._resources = null;
  2312. }
  2313. dispose() {
  2314. this._resources && (this._resources.quadGeometry.dispose(), this._resources.quadVAO.dispose(), this._resources.highlightProgram.dispose(), this._resources.blurProgram.dispose(), this._resources = null);
  2315. }
  2316. preBlur(e19, i15) {
  2317. e19.bindTexture(i15, I2), e19.useProgram(this._resources.blurProgram), this._resources.blurProgram.setUniform4fv("u_direction", [1, 0, 1 / this._width, 0]), this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector", t14), e19.bindVAO(this._resources.quadVAO), e19.drawArrays(E.TRIANGLE_STRIP, 0, 4), e19.bindVAO();
  2318. }
  2319. finalBlur(e19, s22) {
  2320. e19.bindTexture(s22, I2), e19.useProgram(this._resources.blurProgram), this._resources.blurProgram.setUniform4fv("u_direction", [0, 1, 0, 1 / this._height]), this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector", i9), e19.bindVAO(this._resources.quadVAO), e19.drawArrays(E.TRIANGLE_STRIP, 0, 4), e19.bindVAO();
  2321. }
  2322. renderHighlight(e19, s22, i15) {
  2323. e19.bindTexture(s22, I2), e19.useProgram(this._resources.highlightProgram), i15.applyHighlightOptions(e19, this._resources.highlightProgram), e19.bindVAO(this._resources.quadVAO), e19.setBlendingEnabled(true), e19.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), e19.drawArrays(E.TRIANGLE_STRIP, 0, 4), e19.bindVAO();
  2324. }
  2325. _initialize(s22, i15, a16) {
  2326. this._width = i15, this._height = a16;
  2327. const m14 = c3.createVertex(s22, F.STATIC_DRAW, new Int8Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]).buffer), c18 = new f5(s22, new Map([["a_position", 0], ["a_texcoord", 1]]), { geometry: [new t3("a_position", 2, C.BYTE, 0, 4), new t3("a_texcoord", 2, C.UNSIGNED_BYTE, 2, 4)] }, { geometry: m14 }), f14 = e6(s22, t15), b5 = e6(s22, r15);
  2328. s22.useProgram(f14), f14.setUniform1i("u_texture", I2), f14.setUniform1i("u_shade", J), f14.setUniform1f("u_sigma", o19), s22.useProgram(b5), b5.setUniform1i("u_texture", I2), b5.setUniform1f("u_sigma", o19), this._resources = { quadGeometry: m14, quadVAO: c18, highlightProgram: f14, blurProgram: b5 };
  2329. }
  2330. setup(r22, e19, s22) {
  2331. this._resources ? (this._width = e19, this._height = s22) : this._initialize(r22, e19, s22);
  2332. }
  2333. };
  2334. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js
  2335. function l9(l17, a16, _13) {
  2336. const c18 = new u4(l17, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, width: a16, height: _13, samplingMode: L2.LINEAR });
  2337. return [c18, new D2(l17, { colorTarget: Y.TEXTURE, depthStencilTarget: V.STENCIL_RENDER_BUFFER }, c18)];
  2338. }
  2339. var a11 = class {
  2340. constructor() {
  2341. this._width = void 0, this._height = void 0, this._resources = null;
  2342. }
  2343. dispose() {
  2344. this._resources && (this._resources.sharedBlur1Tex.dispose(), this._resources.sharedBlur1Fbo.dispose(), this._resources.sharedBlur2Tex.dispose(), this._resources.sharedBlur2Fbo.dispose(), this._resources = null);
  2345. }
  2346. _initialize(e19, s22, r22) {
  2347. this._width = s22, this._height = r22;
  2348. const [t21, i15] = l9(e19, s22, r22), [h15, o27] = l9(e19, s22, r22);
  2349. this._resources = { sharedBlur1Tex: t21, sharedBlur1Fbo: i15, sharedBlur2Tex: h15, sharedBlur2Fbo: o27 };
  2350. }
  2351. setup(e19, s22, r22) {
  2352. !this._resources || this._width === s22 && this._height === r22 || this.dispose(), this._resources || this._initialize(e19, s22, r22);
  2353. }
  2354. get sharedBlur1Tex() {
  2355. return this._resources.sharedBlur1Tex;
  2356. }
  2357. get sharedBlur1Fbo() {
  2358. return this._resources.sharedBlur1Fbo;
  2359. }
  2360. get sharedBlur2Tex() {
  2361. return this._resources.sharedBlur2Tex;
  2362. }
  2363. get sharedBlur2Fbo() {
  2364. return this._resources.sharedBlur2Fbo;
  2365. }
  2366. };
  2367. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/HighlightEffect.js
  2368. var l10 = 4;
  2369. var d5 = 4 / l10;
  2370. var n21 = class extends t12 {
  2371. constructor() {
  2372. super(...arguments), this.defines = ["highlight"], this._hlRenderer = new c9(), this._hlGradient = new f10(), this._width = void 0, this._height = void 0, this._hlSurfaces = new a11(), this._adjustedWidth = void 0, this._adjustedHeight = void 0, this._blitRenderer = new _2();
  2373. }
  2374. dispose() {
  2375. this._hlSurfaces && this._hlSurfaces.dispose(), this._hlRenderer && this._hlRenderer.dispose(), this._hlGradient && this._hlGradient.destroy(), this._boundFBO = null;
  2376. }
  2377. bind(e19) {
  2378. const { context: t21, painter: s22 } = e19, { width: i15, height: h15 } = t21.getViewport(), r22 = s22.getFbos(i15, h15).effect0;
  2379. this.setup(e19, i15, h15), t21.bindFramebuffer(r22), t21.setColorMask(true, true, true, true), t21.setClearColor(0, 0, 0, 0), t21.clear(t21.gl.COLOR_BUFFER_BIT);
  2380. }
  2381. unbind() {
  2382. }
  2383. setup({ context: e19 }, t21, s22) {
  2384. this._width = t21, this._height = s22;
  2385. const i15 = t21 % l10, h15 = s22 % l10;
  2386. t21 += i15 < l10 / 2 ? -i15 : l10 - i15, s22 += h15 < l10 / 2 ? -h15 : l10 - h15, this._adjustedWidth = t21, this._adjustedHeight = s22, this._boundFBO = e19.getBoundFramebufferObject();
  2387. const r22 = Math.round(t21 * d5), n26 = Math.round(s22 * d5);
  2388. this._hlRenderer.setup(e19, r22, n26), this._hlSurfaces.setup(e19, r22, n26);
  2389. }
  2390. draw({ context: e19 }) {
  2391. const t21 = e19.getBoundFramebufferObject();
  2392. e19.setViewport(0, 0, this._adjustedWidth * d5, this._adjustedHeight * d5), e19.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo), e19.setStencilTestEnabled(false), e19.setClearColor(0, 0, 0, 0), e19.clear(e19.gl.COLOR_BUFFER_BIT), this._blitRenderer.render(e19, t21.colorTexture, L2.NEAREST, 1), e19.setStencilTestEnabled(false), e19.setBlendingEnabled(false), e19.setColorMask(false, false, false, true), e19.bindFramebuffer(this._hlSurfaces.sharedBlur2Fbo), e19.setClearColor(0, 0, 0, 0), e19.clear(e19.gl.COLOR_BUFFER_BIT), this._hlRenderer.preBlur(e19, this._hlSurfaces.sharedBlur1Tex), e19.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo), e19.setClearColor(0, 0, 0, 0), e19.clear(e19.gl.COLOR_BUFFER_BIT), this._hlRenderer.finalBlur(e19, this._hlSurfaces.sharedBlur2Tex), e19.bindFramebuffer(this._boundFBO), e19.setBlendingEnabled(true), e19.setColorMask(true, true, true, true), e19.setViewport(0, 0, this._width, this._height), this._hlRenderer.renderHighlight(e19, this._hlSurfaces.sharedBlur1Tex, this._hlGradient), this._boundFBO = null;
  2393. }
  2394. setHighlightOptions(e19) {
  2395. this._hlGradient.setHighlightOptions(e19);
  2396. }
  2397. };
  2398. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/HittestEffect.js
  2399. var c10 = class extends t12 {
  2400. constructor() {
  2401. super(...arguments), this.name = this.constructor.name, this.defines = ["hittest"];
  2402. }
  2403. dispose() {
  2404. r(this._fbo) && this._fbo.dispose();
  2405. }
  2406. createOptions({ pixelRatio: t21 }, i15, s22 = Y2) {
  2407. if (!i15.length)
  2408. return null;
  2409. const o27 = i15.shift(), n26 = o27.point.x, r22 = o27.point.y;
  2410. return this._outstanding = o27, { type: "hittest", distance: s22 * t21, position: [n26, r22] };
  2411. }
  2412. bind(t21) {
  2413. const { context: e19, attributeView: o27 } = t21;
  2414. if (!o27.size)
  2415. return;
  2416. const n26 = o27.getBlock(O3);
  2417. if (t(n26))
  2418. return;
  2419. const r22 = n26.getFBO(e19);
  2420. e19.setViewport(0, 0, o27.size, o27.size), e19.bindFramebuffer(r22), e19.setColorMask(true, true, true, true), e19.setClearColor(0, 0, 0, 0), e19.clear(e19.gl.COLOR_BUFFER_BIT | e19.gl.DEPTH_BUFFER_BIT);
  2421. }
  2422. unbind(t21) {
  2423. }
  2424. draw(t21) {
  2425. const { context: e19, attributeView: o27 } = t21, c18 = o27.getBlock(O3);
  2426. if (t(this._outstanding))
  2427. return;
  2428. const d14 = this._outstanding.resolver;
  2429. if (t(c18))
  2430. return d14.resolve([]), void (this._outstanding = null);
  2431. const l17 = c18.getFBO(e19), u15 = new Uint8Array(l17.width * l17.height * 4);
  2432. l17.readPixels(0, 0, l17.width, l17.height, P.RGBA, G.UNSIGNED_BYTE, u15);
  2433. const a16 = [];
  2434. for (let i15 = 0; i15 < u15.length; i15 += 4) {
  2435. const t22 = u15[i15], e20 = u15[i15 + 3];
  2436. t22 && a16.push({ id: i15 / 4, directHits: e20 });
  2437. }
  2438. this._outstanding = null, a16.sort((t22, i15) => i15.directHits === t22.directHits ? i15.id - t22.id : i15.directHits - t22.directHits), d14.resolve(a16.map((t22) => t22.id));
  2439. }
  2440. };
  2441. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/HittestEffectVTL.js
  2442. var i10 = class extends t12 {
  2443. constructor() {
  2444. super(...arguments), this.name = this.constructor.name, this.defines = ["id"], this._lastSize = 0;
  2445. }
  2446. dispose() {
  2447. r(this._fbo) && this._fbo.dispose();
  2448. }
  2449. bind({ context: t21, painter: e19 }) {
  2450. const { width: s22, height: o27 } = t21.getViewport();
  2451. this._boundFBO = t21.getBoundFramebufferObject();
  2452. const r22 = e19.getFbos(s22, o27).effect0;
  2453. t21.bindFramebuffer(r22), t21.setColorMask(true, true, true, true), t21.setClearColor(0, 0, 0, 0), t21.clear(t21.gl.COLOR_BUFFER_BIT);
  2454. }
  2455. unbind({ context: t21 }) {
  2456. t21.bindFramebuffer(this._boundFBO), this._boundFBO = null;
  2457. }
  2458. draw({ context: t21, state: s22, pixelRatio: i15 }, n26, f14 = 2 * Y2) {
  2459. const a16 = t21.getBoundFramebufferObject(), h15 = s22.size[1] * i15, u15 = Math.round(f14 * i15), b5 = u15 / 2, c18 = u15 / 2;
  2460. this._ensureBuffer(u15), n26.forEach((t22, e19) => {
  2461. const s23 = new Map(), f15 = Math.floor(e19.x * i15 - u15 / 2), l17 = Math.floor(h15 - e19.y * i15 - u15 / 2);
  2462. a16.readPixels(f15, l17, u15, u15, P.RGBA, G.UNSIGNED_BYTE, this._buf);
  2463. for (let o27 = 0; o27 < this._buf32.length; o27++) {
  2464. const t23 = this._buf32[o27];
  2465. if (t23 !== 4294967295 && t23 !== 0) {
  2466. const e20 = o27 % u15, r22 = u15 - Math.floor(o27 / u15), i16 = (b5 - e20) * (b5 - e20) + (c18 - r22) * (c18 - r22), n27 = s23.has(t23) ? s23.get(t23) : 4294967295;
  2467. s23.set(t23, Math.min(i16, n27));
  2468. }
  2469. }
  2470. const d14 = Array.from(s23).sort((t23, e20) => t23[1] - e20[1]).map((t23) => t23[0]);
  2471. t22.resolve(d14), n26.delete(e19);
  2472. });
  2473. }
  2474. _ensureBuffer(t21) {
  2475. this._lastSize !== t21 && (this._lastSize = t21, this._buf = new Uint8Array(4 * t21 * t21), this._buf32 = new Uint32Array(this._buf.buffer));
  2476. }
  2477. };
  2478. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Bloom.js
  2479. var u11 = 5;
  2480. var p5 = [1, 0];
  2481. var _6 = [0, 1];
  2482. var m11 = [1, 0.8, 0.6, 0.4, 0.2];
  2483. var d6 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  2484. var c11 = class {
  2485. constructor() {
  2486. this._intensityFBO = null, this._compositeFBO = null, this._mipsFBOs = new Array(u11), this._nMips = u11, this._kernelSizeArray = [3, 5, 7, 9, 11], this._size = [0, 0], this._programDesc = { luminosityHighPass: { vsPath: "post-processing/pp", fsPath: "post-processing/bloom/luminosityHighPass", attributes: new Map([["a_position", 0]]) }, gaussianBlur: { vsPath: "post-processing/pp", fsPath: "post-processing/bloom/gaussianBlur", attributes: new Map([["a_position", 0]]) }, composite: { vsPath: "post-processing/pp", fsPath: "post-processing/bloom/composite", attributes: new Map([["a_position", 0]]) }, blit: { vsPath: "post-processing/pp", fsPath: "post-processing/blit", attributes: new Map([["a_position", 0]]) } };
  2487. }
  2488. dispose() {
  2489. if (this._quad && (this._quad.dispose(), this._quad = null), this._intensityFBO && (this._intensityFBO.dispose(), this._intensityFBO = null), this._compositeFBO && (this._compositeFBO.dispose(), this._compositeFBO = null), this._mipsFBOs) {
  2490. for (let t21 = 0; t21 < this._nMips; t21++)
  2491. this._mipsFBOs[t21] && (this._mipsFBOs[t21].horizontal.dispose(), this._mipsFBOs[t21].vertical.dispose());
  2492. this._mipsFBOs = null;
  2493. }
  2494. }
  2495. draw(i15, s22, r22) {
  2496. const { width: o27, height: n26 } = s22, { context: a16, painter: l17 } = i15, { materialManager: h15 } = l17, c18 = a16.gl, T6 = this._programDesc, { strength: f14, radius: g10, threshold: B4 } = r22;
  2497. this._quad || (this._quad = new n13(a16, [-1, -1, 1, -1, -1, 1, 1, 1])), this._createOrResizeResources(i15, o27, n26), a16.setStencilTestEnabled(false), a16.setBlendingEnabled(true), a16.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), a16.setStencilWriteMask(0);
  2498. const O7 = this._quad;
  2499. O7.bind(), a16.bindFramebuffer(this._intensityFBO);
  2500. const F4 = h15.getProgram(T6.luminosityHighPass);
  2501. a16.useProgram(F4), a16.bindTexture(s22.colorTexture, 0), F4.setUniform1i("u_texture", 0), F4.setUniform3fv("u_defaultColor", [0, 0, 0]), F4.setUniform1f("u_defaultOpacity", 0), F4.setUniform1f("u_luminosityThreshold", B4), F4.setUniform1f("u_smoothWidth", 0.01);
  2502. const b5 = [Math.round(o27 / 2), Math.round(n26 / 2)];
  2503. a16.setViewport(0, 0, b5[0], b5[1]), a16.setClearColor(0, 0, 0, 0), a16.clear(c18.COLOR_BUFFER_BIT), O7.draw(), a16.setBlendingEnabled(false);
  2504. let E6 = this._intensityFBO.colorTexture;
  2505. for (let t21 = 0; t21 < this._nMips; t21++) {
  2506. const e19 = h15.getProgram(T6.gaussianBlur, [{ name: "radius", value: this._kernelSizeArray[t21] }]);
  2507. a16.useProgram(e19), a16.bindTexture(E6, t21 + 1), e19.setUniform1i("u_colorTexture", t21 + 1), e19.setUniform2fv("u_texSize", b5), e19.setUniform2fv("u_direction", p5), a16.setViewport(0, 0, b5[0], b5[1]);
  2508. const i16 = this._mipsFBOs[t21];
  2509. a16.bindFramebuffer(i16.horizontal), O7.draw(), E6 = i16.horizontal.colorTexture, a16.bindFramebuffer(i16.vertical), a16.bindTexture(E6, t21 + 1), e19.setUniform2fv("u_direction", _6), O7.draw(), E6 = i16.vertical.colorTexture, b5[0] = Math.round(b5[0] / 2), b5[1] = Math.round(b5[1] / 2);
  2510. }
  2511. a16.setViewport(0, 0, o27, n26);
  2512. const x5 = h15.getProgram(T6.composite, [{ name: "nummips", value: u11 }]);
  2513. a16.bindFramebuffer(this._compositeFBO), a16.useProgram(x5), x5.setUniform1f("u_bloomStrength", f14), x5.setUniform1f("u_bloomRadius", g10), x5.setUniform1fv("u_bloomFactors", m11), x5.setUniform3fv("u_bloomTintColors", d6), a16.bindTexture(this._mipsFBOs[0].vertical.colorTexture, 1), x5.setUniform1i("u_blurTexture1", 1), a16.bindTexture(this._mipsFBOs[1].vertical.colorTexture, 2), x5.setUniform1i("u_blurTexture2", 2), a16.bindTexture(this._mipsFBOs[2].vertical.colorTexture, 3), x5.setUniform1i("u_blurTexture3", 3), a16.bindTexture(this._mipsFBOs[3].vertical.colorTexture, 4), x5.setUniform1i("u_blurTexture4", 4), a16.bindTexture(this._mipsFBOs[4].vertical.colorTexture, 5), x5.setUniform1i("u_blurTexture5", 5), O7.draw(), a16.bindFramebuffer(s22), a16.setBlendingEnabled(true);
  2514. const w4 = h15.getProgram(T6.blit);
  2515. a16.useProgram(w4), a16.bindTexture(this._compositeFBO.colorTexture, 6), w4.setUniform1i("u_texture", 6), a16.setBlendFunction(R.ONE, R.ONE), O7.draw(), O7.unbind(), a16.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), a16.setStencilTestEnabled(true);
  2516. }
  2517. _createOrResizeResources(t21, e19, u15) {
  2518. const { context: p9 } = t21;
  2519. if (this._compositeFBO && this._size[0] === e19 && this._size[1] === u15)
  2520. return;
  2521. this._size[0] = e19, this._size[1] = u15;
  2522. const _13 = [Math.round(e19 / 2), Math.round(u15 / 2)];
  2523. this._compositeFBO ? this._compositeFBO.resize(e19, u15) : this._compositeFBO = new D2(p9, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: e19, height: u15 }), this._intensityFBO ? this._intensityFBO.resize(_13[0], _13[1]) : this._intensityFBO = new D2(p9, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: _13[0], height: _13[1] }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: _13[0], height: _13[1] });
  2524. for (let m14 = 0; m14 < this._nMips; m14++)
  2525. this._mipsFBOs[m14] ? (this._mipsFBOs[m14].horizontal.resize(_13[0], _13[1]), this._mipsFBOs[m14].vertical.resize(_13[0], _13[1])) : this._mipsFBOs[m14] = { horizontal: new D2(p9, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: _13[0], height: _13[1] }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: _13[0], height: _13[1] }), vertical: new D2(p9, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: _13[0], height: _13[1] }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: _13[0], height: _13[1] }) }, _13[0] = Math.round(_13[0] / 2), _13[1] = Math.round(_13[1] / 2);
  2526. }
  2527. };
  2528. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Blur.js
  2529. var d7 = [1, 0];
  2530. var _7 = [0, 1];
  2531. var b3 = class {
  2532. constructor() {
  2533. this._blurFBO = null, this._size = [0, 0], this._programDesc = { gaussianBlur: { vsPath: "post-processing/pp", fsPath: "post-processing/blur/gaussianBlur", attributes: new Map([["a_position", 0]]) }, radialBlur: { vsPath: "post-processing/pp", fsPath: "post-processing/blur/radial-blur", attributes: new Map([["a_position", 0]]) }, blit: { vsPath: "post-processing/pp", fsPath: "post-processing/blit", attributes: new Map([["a_position", 0]]) } };
  2534. }
  2535. dispose() {
  2536. this._blurFBO && (this._blurFBO.dispose(), this._blurFBO = null);
  2537. }
  2538. draw(t21, r22, s22) {
  2539. const { context: i15 } = t21, { type: a16, radius: n26 } = s22;
  2540. if (n26 === 0)
  2541. return;
  2542. this._createOrResizeResources(t21), this._quad || (this._quad = new n13(i15, [-1, -1, 1, -1, -1, 1, 1, 1]));
  2543. const o27 = this._quad;
  2544. o27.bind(), a16 === "blur" ? this._gaussianBlur(t21, r22, n26) : this._radialBlur(t21, r22), o27.unbind();
  2545. }
  2546. _gaussianBlur(e19, r22, s22) {
  2547. const { context: i15, state: a16, painter: n26, pixelRatio: o27 } = e19, { size: u15 } = a16, { materialManager: l17 } = n26, b5 = this._programDesc, p9 = this._quad, c18 = [Math.round(o27 * u15[0]), Math.round(o27 * u15[1])], h15 = this._blurFBO, g10 = l17.getProgram(b5.gaussianBlur, [{ name: "radius", value: Math.ceil(s22) }]);
  2548. i15.useProgram(g10), i15.setBlendingEnabled(false), i15.bindFramebuffer(h15), i15.bindTexture(r22.colorTexture, 4), g10.setUniform1i("u_colorTexture", 4), g10.setUniform2fv("u_texSize", c18), g10.setUniform2fv("u_direction", d7), g10.setUniform1f("u_sigma", s22), p9.draw(), i15.bindFramebuffer(r22), i15.setStencilWriteMask(0), i15.setStencilTestEnabled(false), i15.setDepthWriteEnabled(false), i15.setDepthTestEnabled(false), i15.bindTexture(h15.colorTexture, 5), g10.setUniform1i("u_colorTexture", 5), g10.setUniform2fv("u_direction", _7), p9.draw(), i15.setBlendingEnabled(true), i15.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), i15.setStencilTestEnabled(true);
  2549. }
  2550. _radialBlur(e19, r22) {
  2551. const { context: s22, painter: i15 } = e19, { materialManager: a16 } = i15, n26 = this._programDesc, o27 = this._quad, u15 = this._blurFBO;
  2552. s22.bindFramebuffer(u15);
  2553. const l17 = a16.getProgram(n26.radialBlur);
  2554. s22.useProgram(l17), s22.setBlendingEnabled(false), s22.bindTexture(r22.colorTexture, 4), l17.setUniform1i("u_colorTexture", 4), o27.draw(), s22.bindFramebuffer(r22), s22.setStencilWriteMask(0), s22.setStencilTestEnabled(false), s22.setDepthWriteEnabled(false), s22.setDepthTestEnabled(false), s22.setBlendingEnabled(true);
  2555. const d14 = a16.getProgram(n26.blit);
  2556. s22.useProgram(d14), s22.bindTexture(u15.colorTexture, 5), d14.setUniform1i("u_texture", 5), s22.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), o27.draw();
  2557. }
  2558. _createOrResizeResources(e19) {
  2559. const { context: t21, state: d14, pixelRatio: _13 } = e19, { size: b5 } = d14, p9 = Math.round(_13 * b5[0]), c18 = Math.round(_13 * b5[1]);
  2560. this._blurFBO && this._size[0] === p9 && this._size[1] === c18 || (this._size[0] = p9, this._size[1] = c18, this._blurFBO ? this._blurFBO.resize(p9, c18) : this._blurFBO = new D2(t21, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: p9, height: c18 }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: p9, height: c18 }));
  2561. }
  2562. };
  2563. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Colorize.js
  2564. var l11 = class {
  2565. constructor() {
  2566. this._size = [0, 0], this._programDesc = { vsPath: "post-processing/pp", fsPath: "post-processing/filterEffect", attributes: new Map([["a_position", 0]]) };
  2567. }
  2568. dispose() {
  2569. this._layerFBOTexture && (this._layerFBOTexture.dispose(), this._layerFBOTexture = null);
  2570. }
  2571. draw(e19, s22, r22) {
  2572. const { width: i15, height: a16 } = s22;
  2573. this._createOrResizeResources(e19, i15, a16);
  2574. const { context: o27, painter: n26 } = e19, { materialManager: l17 } = n26, _13 = this._programDesc, c18 = this._quad, h15 = r22.colorMatrix;
  2575. c18.bind();
  2576. const u15 = this._layerFBOTexture;
  2577. o27.bindFramebuffer(s22), s22.copyToTexture(0, 0, i15, a16, 0, 0, u15), o27.setBlendingEnabled(false), o27.setStencilTestEnabled(false);
  2578. const d14 = l17.getProgram(_13);
  2579. o27.useProgram(d14), o27.bindTexture(u15, 2), d14.setUniformMatrix4fv("u_coefficients", h15), d14.setUniform1i("u_colorTexture", 2), c18.draw(), o27.setBlendingEnabled(true), o27.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), o27.setStencilTestEnabled(true), c18.unbind();
  2580. }
  2581. _createOrResizeResources(t21, l17, _13) {
  2582. const { context: c18 } = t21;
  2583. this._layerFBOTexture && this._size[0] === l17 && this._size[1] === _13 || (this._size[0] = l17, this._size[1] = _13, this._layerFBOTexture ? this._layerFBOTexture.resize(l17, _13) : this._layerFBOTexture = new u4(c18, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: l17, height: _13 }), this._quad || (this._quad = new n13(c18, [-1, -1, 1, -1, -1, 1, 1, 1])));
  2584. }
  2585. };
  2586. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/DropShadow.js
  2587. var _8 = [1, 0];
  2588. var d8 = [0, 1];
  2589. var c12 = class {
  2590. constructor() {
  2591. this._horizontalBlurFBO = null, this._verticalBlurFBO = null, this._size = [0, 0], this._programDesc = { blur: { vsPath: "post-processing/pp", fsPath: "post-processing/blur/gaussianBlur", attributes: new Map([["a_position", 0]]) }, composite: { vsPath: "post-processing/pp", fsPath: "post-processing/drop-shadow/composite", attributes: new Map([["a_position", 0]]) }, blit: { vsPath: "post-processing/pp", fsPath: "post-processing/blit", attributes: new Map([["a_position", 0]]) } };
  2592. }
  2593. dispose() {
  2594. this._layerFBOTexture && (this._layerFBOTexture.dispose(), this._layerFBOTexture = null), this._horizontalBlurFBO && (this._horizontalBlurFBO.dispose(), this._horizontalBlurFBO = null), this._verticalBlurFBO && (this._verticalBlurFBO.dispose(), this._verticalBlurFBO = null);
  2595. }
  2596. draw(i15, s22, o27) {
  2597. const { context: a16, state: l17, painter: n26 } = i15, { materialManager: u15 } = n26, h15 = this._programDesc, p9 = s22.width, c18 = s22.height, B4 = [Math.round(p9 / 2), Math.round(c18 / 2)], { blurRadius: m14, offsetX: T6, offsetY: f14, color: g10 } = o27, F4 = [u2(T6 / 2), u2(f14 / 2)];
  2598. this._createOrResizeResources(i15, p9, c18, B4);
  2599. const O7 = this._horizontalBlurFBO, E6 = this._verticalBlurFBO;
  2600. a16.setStencilWriteMask(0), a16.setStencilTestEnabled(false), a16.setDepthWriteEnabled(false), a16.setDepthTestEnabled(false);
  2601. const b5 = this._layerFBOTexture;
  2602. s22.copyToTexture(0, 0, p9, c18, 0, 0, b5), this._quad || (this._quad = new n13(a16, [-1, -1, 1, -1, -1, 1, 1, 1])), a16.setViewport(0, 0, B4[0], B4[1]);
  2603. const w4 = this._quad;
  2604. w4.bind(), a16.setBlendingEnabled(false);
  2605. const x5 = u15.getProgram(h15.blur, [{ name: "radius", value: Math.ceil(m14) }]);
  2606. a16.useProgram(x5), a16.bindFramebuffer(O7), a16.bindTexture(s22.colorTexture, 4), x5.setUniform1i("u_colorTexture", 4), x5.setUniform2fv("u_texSize", B4), x5.setUniform2fv("u_direction", _8), x5.setUniform1f("u_sigma", m14), w4.draw(), a16.bindFramebuffer(E6), a16.bindTexture(O7.colorTexture, 5), x5.setUniform1i("u_colorTexture", 5), x5.setUniform2fv("u_direction", d8), w4.draw(), a16.bindFramebuffer(s22), a16.setViewport(0, 0, p9, c18);
  2607. const M6 = u15.getProgram(h15.composite);
  2608. a16.useProgram(M6), a16.bindTexture(E6.colorTexture, 2), M6.setUniform1i("u_blurTexture", 2), a16.bindTexture(b5, 3), M6.setUniform1i("u_layerFBOTexture", 3), M6.setUniform4fv("u_shadowColor", [g10[3] * (g10[0] / 255), g10[3] * (g10[1] / 255), g10[3] * (g10[2] / 255), g10[3]]), M6.setUniformMatrix3fv("u_displayViewMat3", l17.displayMat3), M6.setUniform2fv("u_shadowOffset", F4), w4.draw(), a16.setBlendingEnabled(true), a16.setStencilTestEnabled(true), a16.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), w4.unbind();
  2609. }
  2610. _createOrResizeResources(e19, t21, r22, _13) {
  2611. const { context: d14 } = e19;
  2612. this._horizontalBlurFBO && this._size[0] === t21 && this._size[1] === r22 || (this._size[0] = t21, this._size[1] = r22, this._horizontalBlurFBO ? this._horizontalBlurFBO.resize(_13[0], _13[1]) : this._horizontalBlurFBO = new D2(d14, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: _13[0], height: _13[1] }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: _13[0], height: _13[1] }), this._verticalBlurFBO ? this._verticalBlurFBO.resize(_13[0], _13[1]) : this._verticalBlurFBO = new D2(d14, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: _13[0], height: _13[1] }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: _13[0], height: _13[1] }), this._layerFBOTexture ? this._layerFBOTexture.resize(t21, r22) : this._layerFBOTexture = new u4(d14, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: t21, height: r22 }));
  2613. }
  2614. };
  2615. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Opacity.js
  2616. var l12 = class {
  2617. constructor() {
  2618. this._size = [0, 0];
  2619. }
  2620. dispose() {
  2621. this._layerFBOTexture && (this._layerFBOTexture.dispose(), this._layerFBOTexture = null);
  2622. }
  2623. draw(t21, s22, r22) {
  2624. const { width: i15, height: a16 } = s22;
  2625. this._createOrResizeResources(t21, i15, a16);
  2626. const { context: l17, painter: o27 } = t21, { amount: T6 } = r22, h15 = l17.gl, n26 = this._layerFBOTexture;
  2627. l17.bindFramebuffer(s22), s22.copyToTexture(0, 0, i15, a16, 0, 0, n26), l17.setBlendingEnabled(true), l17.setStencilTestEnabled(false), l17.setDepthTestEnabled(false), l17.setClearColor(0, 0, 0, 0), l17.clear(h15.COLOR_BUFFER_BIT), o27.blitTexture(l17, n26, L2.NEAREST, T6);
  2628. }
  2629. _createOrResizeResources(l17, o27, T6) {
  2630. const { context: h15 } = l17;
  2631. this._layerFBOTexture && this._size[0] === o27 && this._size[1] === T6 || (this._size[0] = o27, this._size[1] = T6, this._layerFBOTexture ? this._layerFBOTexture.resize(o27, T6) : this._layerFBOTexture = new u4(h15, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.NEAREST, flipped: false, width: o27, height: T6 }));
  2632. }
  2633. };
  2634. // node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/EffectManager.js
  2635. function c13(o27) {
  2636. switch (o27) {
  2637. case "bloom":
  2638. case "blur":
  2639. case "opacity":
  2640. case "drop-shadow":
  2641. return o27;
  2642. default:
  2643. return "colorize";
  2644. }
  2645. }
  2646. var f11 = { colorize: () => new l11(), blur: () => new b3(), bloom: () => new c11(), opacity: () => new l12(), "drop-shadow": () => new c12() };
  2647. var i11 = class {
  2648. constructor() {
  2649. this._effectMap = new Map();
  2650. }
  2651. dispose() {
  2652. this._effectMap.forEach((o27) => o27.dispose()), this._effectMap.clear();
  2653. }
  2654. getPostProcessingEffects(o27) {
  2655. if (!o27 || o27.length === 0)
  2656. return [];
  2657. const e19 = [];
  2658. for (const t21 of o27) {
  2659. const o28 = c13(t21.type);
  2660. let s22 = this._effectMap.get(o28);
  2661. s22 || (s22 = f11[o28](), this._effectMap.set(o28, s22)), e19.push({ postProcessingEffect: s22, effect: t21 });
  2662. }
  2663. return e19;
  2664. }
  2665. };
  2666. // node_modules/@arcgis/core/views/2d/engine/webgl/painter/RenderPass.js
  2667. var t16 = class {
  2668. constructor(r22, e19) {
  2669. this.brushes = r22, this.name = e19.name, this.drawPhase = e19.drawPhase || I3.MAP, this._targetFn = e19.target, this.effects = e19.effects || [], this.enableDefaultDraw = e19.enableDefaultDraw ?? (() => true);
  2670. }
  2671. render(r22) {
  2672. const { context: e19, profiler: s22 } = r22, t21 = this._targetFn(), a16 = this.drawPhase & r22.drawPhase;
  2673. if (s22.recordPassStart(this.name), a16) {
  2674. this.enableDefaultDraw() && this._doRender(r22, t21), s22.recordPassEnd();
  2675. for (const a17 of this.effects) {
  2676. if (!a17.enable())
  2677. continue;
  2678. const o27 = a17.apply;
  2679. s22.recordPassStart(this.name + "." + o27.name), s22.recordBrushStart(o27.name);
  2680. const n26 = a17.args && a17.args(), { x: i15, y: d14, width: f14, height: h15 } = e19.getViewport(), c18 = e19.getBoundFramebufferObject();
  2681. o27.bind(r22, n26);
  2682. const p9 = o27.createOptions(r22, n26), u15 = r22.passOptions;
  2683. r22.passOptions = p9, this._doRender(r22, t21, o27.defines), r22.passOptions = u15, o27.draw(r22, n26), o27.unbind(r22, n26), e19.bindFramebuffer(c18), e19.setViewport(i15, d14, f14, h15), s22.recordBrushEnd(), s22.recordPassEnd();
  2684. }
  2685. }
  2686. }
  2687. _doRender(s22, t21, a16) {
  2688. if (!t(t21))
  2689. if (a2(t21)) {
  2690. for (const r22 of t21)
  2691. if (r22.visible)
  2692. for (const e19 of this.brushes)
  2693. s22.profiler.recordBrushStart(e19.name), e19.prepareState(s22, r22, a16), e19.draw(s22, r22, a16), s22.profiler.recordBrushEnd();
  2694. } else
  2695. for (const r22 of this.brushes)
  2696. s22.profiler.recordBrushStart(r22.name), r22.prepareState(s22, t21, a16), r22.draw(s22, t21, a16), s22.profiler.recordBrushEnd();
  2697. }
  2698. };
  2699. // node_modules/@arcgis/core/views/2d/engine/webgl/Painter.js
  2700. function N3(e19, t21) {
  2701. switch (e19) {
  2702. case E2.LINE:
  2703. return W3.line;
  2704. case E2.TEXT:
  2705. return W3.text;
  2706. case E2.LABEL:
  2707. return W3.label;
  2708. case E2.FILL:
  2709. return t21 === S2.DOT_DENSITY ? W3.dotDensity : W3.fill;
  2710. case E2.MARKER:
  2711. switch (t21) {
  2712. case S2.HEATMAP:
  2713. return W3.heatmap;
  2714. case S2.PIE_CHART:
  2715. return W3.pieChart;
  2716. default:
  2717. return W3.marker;
  2718. }
  2719. }
  2720. }
  2721. var D5 = class {
  2722. constructor(e19, t21, s22) {
  2723. this.context = e19, this._blitRenderer = new _2(), this._worldExtentClipRenderer = new f9(), this._isClippedToWorldExtent = false, this._brushCache = new Map(), this._vtlMaterialManager = new o11(), this._blendEffect = new _5(), this._fboPool = [], this.effects = { highlight: new n21(), hittest: new c10(), hittestVTL: new i10(), integrate: new o18(), insideEffect: new r14("inside"), outsideEffect: new r14("outside") }, this.materialManager = new h4(e19), this.textureManager = new X2(t21, s22), this._effectsManager = new i11();
  2724. }
  2725. get vectorTilesMaterialManager() {
  2726. return this._vtlMaterialManager;
  2727. }
  2728. getRenderTarget() {
  2729. return this._renderTarget;
  2730. }
  2731. setRenderTarget(e19) {
  2732. this._renderTarget = e19;
  2733. }
  2734. getFbos(e19, t21) {
  2735. if (e19 !== this._lastWidth || t21 !== this._lastHeight) {
  2736. if (this._lastWidth = e19, this._lastHeight = t21, this._fbos) {
  2737. for (const s23 in this._fbos)
  2738. this._fbos[s23].resize(e19, t21);
  2739. return this._fbos;
  2740. }
  2741. const s22 = { target: M.TEXTURE_2D, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.NEAREST, wrapMode: D.CLAMP_TO_EDGE, width: e19, height: t21 }, r22 = { colorTarget: Y.TEXTURE, depthStencilTarget: V.DEPTH_STENCIL_RENDER_BUFFER }, i15 = new r9(this.context, { width: e19, height: t21, internalFormat: B.DEPTH_STENCIL });
  2742. this._stencilBuf = i15, this._fbos = { output: new D2(this.context, r22, s22, i15), blend: new D2(this.context, r22, s22, i15), effect0: new D2(this.context, r22, s22, i15) };
  2743. }
  2744. return this._fbos;
  2745. }
  2746. acquireFbo(e19, t21) {
  2747. let s22;
  2748. s22 = this._fboPool.length > 0 ? this._fboPool.pop() : new D2(this.context, { colorTarget: Y.TEXTURE, depthStencilTarget: V.DEPTH_STENCIL_RENDER_BUFFER }, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.NEAREST, wrapMode: D.CLAMP_TO_EDGE, width: e19, height: t21 }, this._stencilBuf);
  2749. const r22 = s22.descriptor;
  2750. return r22.width === e19 && r22.height === t21 || s22.resize(e19, t21), s22;
  2751. }
  2752. releaseFbo(e19) {
  2753. this._fboPool.push(e19);
  2754. }
  2755. getSharedStencilBuffer() {
  2756. return this._stencilBuf;
  2757. }
  2758. beforeRenderLayers(t21, s22 = null) {
  2759. const { width: r22, height: i15 } = t21.getViewport();
  2760. this._prevFBO = t21.getBoundFramebufferObject();
  2761. const n26 = this.getFbos(r22, i15);
  2762. if (t21.bindFramebuffer(n26.output), t21.setColorMask(true, true, true, true), r(s22)) {
  2763. const { r: e19, g: r23, b: i16, a: n27 } = s22.color;
  2764. t21.setClearColor(n27 * e19 / 255, n27 * r23 / 255, n27 * i16 / 255, n27);
  2765. } else
  2766. t21.setClearColor(0, 0, 0, 0);
  2767. t21.setDepthWriteEnabled(true), t21.setClearDepth(1), t21.clear(t21.gl.COLOR_BUFFER_BIT | t21.gl.DEPTH_BUFFER_BIT), t21.setDepthWriteEnabled(false);
  2768. }
  2769. beforeRenderLayer(e19, t21, s22) {
  2770. const { context: r22, blendMode: i15, effects: n26, requireFBO: o27, drawPhase: a16 } = e19;
  2771. if (o27 || I5(a16, i15, n26, s22))
  2772. r22.bindFramebuffer(this._fbos.blend), r22.setColorMask(true, true, true, true), r22.setClearColor(0, 0, 0, 0), r22.setDepthWriteEnabled(true), r22.setClearDepth(1), r22.clear(r22.gl.COLOR_BUFFER_BIT | r22.gl.DEPTH_BUFFER_BIT), r22.setDepthWriteEnabled(false);
  2773. else {
  2774. const e20 = this._getOutputFBO();
  2775. r22.bindFramebuffer(e20);
  2776. }
  2777. r22.setDepthWriteEnabled(false), r22.setDepthTestEnabled(false), r22.setStencilTestEnabled(true), r22.setClearStencil(t21), r22.setStencilWriteMask(255), r22.clear(r22.gl.STENCIL_BUFFER_BIT);
  2778. }
  2779. compositeLayer(s22, r22) {
  2780. const { context: i15, blendMode: n26, effects: a16, requireFBO: h15, drawPhase: l17 } = s22;
  2781. if (h15 || I5(l17, n26, a16, r22)) {
  2782. r(a16) && a16.length > 0 && l17 === I3.MAP && this._applyEffects(s22, a16);
  2783. const h16 = this._getOutputFBO();
  2784. i15.bindFramebuffer(h16), i15.setStencilTestEnabled(false), i15.setStencilWriteMask(0), i15.setBlendingEnabled(true), i15.setBlendFunctionSeparate(R.ONE, R.ONE_MINUS_SRC_ALPHA, R.ONE, R.ONE_MINUS_SRC_ALPHA), i15.setColorMask(true, true, true, true);
  2785. const f14 = t(n26) || l17 === I3.HIGHLIGHT ? "normal" : n26;
  2786. this._blendEffect.draw(s22, this._fbos.blend.colorTexture, L2.NEAREST, f14, r22);
  2787. }
  2788. }
  2789. renderLayers(e19) {
  2790. if (e19.bindFramebuffer(this._prevFBO), !this._fbos)
  2791. return;
  2792. const t21 = this._getOutputFBO();
  2793. e19.setDepthTestEnabled(false), e19.setStencilWriteMask(0), this._isClippedToWorldExtent ? (e19.setStencilTestEnabled(true), e19.setStencilFunction(I.EQUAL, 1, 255)) : e19.setStencilTestEnabled(false), this.blitTexture(e19, t21.colorTexture, L2.NEAREST);
  2794. }
  2795. prepareDisplay(t21, s22, r22) {
  2796. const { context: i15 } = t21;
  2797. if (i15.bindFramebuffer(this._prevFBO), i15.setColorMask(true, true, true, true), r(s22)) {
  2798. const { r: e19, g: t22, b: r23, a: n26 } = s22.color;
  2799. i15.setClearColor(n26 * e19 / 255, n26 * t22 / 255, n26 * r23 / 255, n26);
  2800. } else
  2801. i15.setClearColor(0, 0, 0, 0);
  2802. i15.setStencilWriteMask(255), i15.setClearStencil(0), i15.clear(i15.gl.COLOR_BUFFER_BIT | i15.gl.STENCIL_BUFFER_BIT), this._isClippedToWorldExtent = this._worldExtentClipRenderer.render(t21, r22);
  2803. }
  2804. dispose() {
  2805. if (this.materialManager.dispose(), this.textureManager.dispose(), this._blitRenderer = s(this._blitRenderer), this._worldExtentClipRenderer = s(this._worldExtentClipRenderer), this._brushCache && (this._brushCache.forEach((e19) => e19.dispose()), this._brushCache.clear(), this._brushCache = null), this._fbos)
  2806. for (const e19 in this._fbos)
  2807. this._fbos[e19] && this._fbos[e19].dispose();
  2808. for (const e19 of this._fboPool)
  2809. e19.dispose();
  2810. if (this._fboPool.length = 0, this.effects)
  2811. for (const e19 in this.effects)
  2812. this.effects[e19] && this.effects[e19].dispose();
  2813. this._effectsManager.dispose(), this._vtlMaterialManager = s(this._vtlMaterialManager), this._prevFBO = null;
  2814. }
  2815. getBrush(e19, t21) {
  2816. const s22 = N3(e19, t21);
  2817. let r22 = this._brushCache.get(s22);
  2818. return r22 === void 0 && (r22 = new s22(), this._brushCache.set(s22, r22)), this._brushCache.get(s22);
  2819. }
  2820. renderObject(e19, t21, s22, i15) {
  2821. const n26 = W3[s22];
  2822. if (!n26)
  2823. return null;
  2824. let o27 = this._brushCache.get(n26);
  2825. o27 === void 0 && (o27 = new n26(), this._brushCache.set(n26, o27)), o27.prepareState(e19, t21, i15), o27.draw(e19, t21, i15);
  2826. }
  2827. renderObjects(e19, t21, s22, i15) {
  2828. const n26 = W3[s22];
  2829. if (!n26)
  2830. return null;
  2831. let o27 = this._brushCache.get(n26);
  2832. o27 === void 0 && (o27 = new n26(), this._brushCache.set(n26, o27)), o27.drawMany(e19, t21, i15);
  2833. }
  2834. registerRenderPass(e19) {
  2835. const t21 = e19.brushes.map((e20) => (this._brushCache.has(e20) || this._brushCache.set(e20, new e20()), this._brushCache.get(e20)));
  2836. return new t16(t21, e19);
  2837. }
  2838. setHighlightOptions(e19) {
  2839. this.effects.highlight.setHighlightOptions(e19);
  2840. }
  2841. blitTexture(e19, t21, s22, r22 = 1) {
  2842. e19.setBlendingEnabled(true), e19.setBlendFunctionSeparate(R.ONE, R.ONE_MINUS_SRC_ALPHA, R.ONE, R.ONE_MINUS_SRC_ALPHA), e19.setColorMask(true, true, true, true), this._blitRenderer.render(e19, t21, s22, r22);
  2843. }
  2844. getPostProcessingEffects(e19) {
  2845. return this._effectsManager.getPostProcessingEffects(e19);
  2846. }
  2847. _getOutputFBO() {
  2848. return this._renderTarget != null ? this._renderTarget : this._fbos.output;
  2849. }
  2850. _applyEffects(e19, t21) {
  2851. const { context: s22 } = e19, r22 = this._effectsManager.getPostProcessingEffects(t21);
  2852. for (const { postProcessingEffect: i15, effect: n26 } of r22)
  2853. s22.bindFramebuffer(this._fbos.blend), i15.draw(e19, this._fbos.blend, n26);
  2854. }
  2855. };
  2856. function I5(t21, s22, r22, i15) {
  2857. return t21 !== I3.HIGHLIGHT && (i15 !== 1 || r(s22) && s22 !== "normal" || r(r22) && r22.length > 0);
  2858. }
  2859. // node_modules/@arcgis/core/views/webgl/capabilities/DisjointTimerQuery.js
  2860. var E4 = class {
  2861. constructor(e19, E6, t21, T6, r22, _13, i15, u15) {
  2862. this.createQuery = e19, this.resultAvailable = E6, this.getResult = t21, this.disjoint = T6, this.beginTimeElapsed = r22, this.endTimeElapsed = _13, this.createTimestamp = i15, this.timestampBits = u15;
  2863. }
  2864. };
  2865. function t17(t21, T6) {
  2866. if (T6.disjointTimerQuery)
  2867. return null;
  2868. let r22 = t21.getExtension("EXT_disjoint_timer_query_webgl2");
  2869. return r22 && n8(t21) ? new E4(() => t21.createQuery(), (e19) => t21.getQueryParameter(e19, t21.QUERY_RESULT_AVAILABLE), (e19) => t21.getQueryParameter(e19, t21.QUERY_RESULT), () => t21.getParameter(r22.GPU_DISJOINT_EXT), (e19) => t21.beginQuery(r22.TIME_ELAPSED_EXT, e19), () => t21.endQuery(r22.TIME_ELAPSED_EXT), (e19) => r22.queryCounterEXT(e19, r22.TIMESTAMP_EXT), () => t21.getQuery(r22.TIMESTAMP_EXT, r22.QUERY_COUNTER_BITS_EXT)) : (r22 = t21.getExtension("EXT_disjoint_timer_query"), r22 ? new E4(() => r22.createQueryEXT(), (e19) => r22.getQueryObjectEXT(e19, r22.QUERY_RESULT_AVAILABLE_EXT), (e19) => r22.getQueryObjectEXT(e19, r22.QUERY_RESULT_EXT), () => t21.getParameter(r22.GPU_DISJOINT_EXT), (e19) => r22.beginQueryEXT(r22.TIME_ELAPSED_EXT, e19), () => r22.endQueryEXT(r22.TIME_ELAPSED_EXT), (e19) => r22.queryCounterEXT(e19, r22.TIMESTAMP_EXT), () => r22.getQueryEXT(r22.TIMESTAMP_EXT, r22.QUERY_COUNTER_BITS_EXT)) : null);
  2870. }
  2871. // node_modules/@arcgis/core/views/2d/engine/webgl/Profiler.js
  2872. var i12 = a("esri-2d-profiler");
  2873. var o20 = class {
  2874. constructor(t21, r22) {
  2875. if (this._events = new n3(), this._entries = new Map(), this._timings = new s7(10), !i12)
  2876. return;
  2877. this._ext = t17(t21.gl, {}), this._debugOutput = r22;
  2878. const o27 = t21.gl;
  2879. if (this.enableCommandLogging) {
  2880. for (const e19 in o27)
  2881. if (typeof o27[e19] == "function") {
  2882. const s22 = o27[e19], t22 = e19.includes("draw");
  2883. o27[e19] = (...r23) => (this._events.emit("command", { container: this._currentContainer, pass: this._currentPass, brush: this._currentBrush, method: e19, args: r23, isDrawCommand: t22 }), this._currentSummary && (this._currentSummary.commands++, t22 && this._currentSummary.drawCommands++), s22.apply(o27, r23));
  2884. }
  2885. }
  2886. }
  2887. get enableCommandLogging() {
  2888. return !(typeof i12 == "object" && i12.disableCommands);
  2889. }
  2890. recordContainerStart(e19) {
  2891. i12 && (this._currentContainer = e19);
  2892. }
  2893. recordContainerEnd() {
  2894. i12 && (this._currentContainer = null);
  2895. }
  2896. recordPassStart(e19) {
  2897. i12 && (this._currentPass = e19, this._initSummary());
  2898. }
  2899. recordPassEnd() {
  2900. i12 && (this._currentPass = null, this._emitSummary());
  2901. }
  2902. recordBrushStart(e19) {
  2903. i12 && (this._currentBrush = e19);
  2904. }
  2905. recordBrushEnd() {
  2906. i12 && (this._currentBrush = null);
  2907. }
  2908. recordStart(e19) {
  2909. if (i12 && r(this._ext)) {
  2910. if (this._entries.has(e19)) {
  2911. const s23 = this._entries.get(e19), t21 = this._ext.resultAvailable(s23.query), n26 = this._ext.disjoint();
  2912. if (t21 && !n26) {
  2913. const t22 = this._ext.getResult(s23.query) / 1e6;
  2914. let n27 = 0;
  2915. if (r(this._timings.enqueue(t22))) {
  2916. const e20 = this._timings.entries, s24 = e20.length;
  2917. let t23 = 0;
  2918. for (const r22 of e20)
  2919. t23 += r22;
  2920. n27 = t23 / s24;
  2921. }
  2922. const i15 = t22.toFixed(2), o27 = n27 ? n27.toFixed(2) : "--";
  2923. this.enableCommandLogging ? (console.groupCollapsed(`Frame report for ${e19}, ${i15} ms (${o27} last 10 avg)
  2924. ${s23.commandsLen} Commands (${s23.drawCommands} draw)`), console.log("RenderPass breakdown: "), console.table(s23.summaries), console.log("Commands: ", s23.commands), console.groupEnd()) : console.log(`Frame report for ${e19}, ${i15} ms (${o27} last 10 avg)`), this._debugOutput.innerHTML = `${i15} (${o27})`;
  2925. }
  2926. for (const e20 of s23.handles)
  2927. e20.remove();
  2928. this._entries.delete(e19);
  2929. }
  2930. const s22 = { name: e19, query: this._ext.createQuery(), commands: [], commandsLen: 0, drawCommands: 0, summaries: [], handles: [] };
  2931. this.enableCommandLogging && (s22.handles.push(this._events.on("command", (e20) => {
  2932. s22.commandsLen++, s22.commands.push(e20), e20.isDrawCommand && s22.drawCommands++;
  2933. })), s22.handles.push(this._events.on("summary", (e20) => {
  2934. s22.summaries.push(e20);
  2935. }))), this._ext.beginTimeElapsed(s22.query), this._entries.set(e19, s22);
  2936. }
  2937. }
  2938. recordEnd(e19) {
  2939. i12 && r(this._ext) && this._entries.has(e19) && this._ext.endTimeElapsed();
  2940. }
  2941. _initSummary() {
  2942. this.enableCommandLogging && (this._currentSummary = { container: this._currentContainer, pass: this._currentPass, drawCommands: 0, commands: 0 });
  2943. }
  2944. _emitSummary() {
  2945. this.enableCommandLogging && this._events.emit("summary", this._currentSummary);
  2946. }
  2947. };
  2948. // node_modules/@arcgis/core/views/webgl/ContextState.js
  2949. var h8 = class {
  2950. constructor() {
  2951. this.blend = false, this.blendColor = { r: 0, g: 0, b: 0, a: 0 }, this.blendFunction = { srcRGB: R.ONE, dstRGB: R.ZERO, srcAlpha: R.ONE, dstAlpha: R.ZERO }, this.blendEquation = { mode: T.ADD, modeAlpha: T.ADD }, this.colorMask = { r: true, g: true, b: true, a: true }, this.faceCulling = false, this.cullFace = N.BACK, this.frontFace = S.CCW, this.scissorTest = false, this.scissorRect = { x: 0, y: 0, width: 0, height: 0 }, this.depthTest = false, this.depthFunction = I.LESS, this.clearDepth = 1, this.depthWrite = true, this.depthRange = { zNear: 0, zFar: 1 }, this.viewport = null, this.stencilTest = false, this.polygonOffsetFill = false, this.polygonOffset = [0, 0], this.stencilFunction = { face: N.FRONT_AND_BACK, func: I.ALWAYS, ref: 0, mask: 1 }, this.clearStencil = 0, this.stencilWriteMask = 1, this.stencilOperation = { face: N.FRONT_AND_BACK, fail: O2.KEEP, zFail: O2.KEEP, zPass: O2.KEEP }, this.clearColor = { r: 0, g: 0, b: 0, a: 0 }, this.program = null, this.vertexBuffer = null, this.indexBuffer = null, this.uniformBuffer = null, this.pixelPackBuffer = null, this.pixelUnpackBuffer = null, this.copyReadBuffer = null, this.copyWriteBuffer = null, this.uniformBufferBindingPoints = new Array(), this.readFramebuffer = null, this.drawFramebuffer = null, this.renderbuffer = null, this.activeTexture = 0, this.textureUnitMap = new Array();
  2952. }
  2953. };
  2954. // node_modules/@arcgis/core/views/support/AllocationTracer.js
  2955. var o21 = class {
  2956. constructor(o27) {
  2957. this._allocations = new Map(), o27 ? Error.stackTraceLimit = 1 / 0 : (this.add = () => {
  2958. }, this.remove = () => {
  2959. });
  2960. }
  2961. add(o27) {
  2962. this._allocations.set(o27, new Error().stack);
  2963. }
  2964. remove(o27) {
  2965. this._allocations.delete(o27);
  2966. }
  2967. print() {
  2968. if (this._allocations.size > 0) {
  2969. console.log(`${this._allocations.size} live object allocations:`);
  2970. const o27 = new Map();
  2971. this._allocations.forEach((s22) => {
  2972. o27.set(s22, (o27.get(s22) ?? 0) + 1);
  2973. }), o27.forEach((o28, s22) => {
  2974. const t21 = s22.split("\n");
  2975. t21.shift(), t21.shift(), console.log(`${o28}: ${t21.shift()}`), t21.forEach((o29) => console.log(" ", o29));
  2976. });
  2977. }
  2978. }
  2979. };
  2980. // node_modules/@arcgis/core/views/webgl/InstanceCounter.js
  2981. var e16 = { RECORD_ALLOCATIONS: false };
  2982. var s17 = class {
  2983. constructor() {
  2984. for (this._current = new Array(), this._max = new Array(), this._allocations = new o21(e16.RECORD_ALLOCATIONS); this._current.length < t2.COUNT; )
  2985. this._current.push(0), this._max.push(0);
  2986. }
  2987. resetMax() {
  2988. for (this._max.length = 0; this._max.length < this._current.length; )
  2989. this._max.push(0);
  2990. }
  2991. increment(t21, r22) {
  2992. const e19 = ++this._current[t21];
  2993. this._max[t21] = Math.max(e19, this._max[t21]), this._allocations.add(r22);
  2994. }
  2995. decrement(t21, r22) {
  2996. --this._current[t21], this._allocations.remove(r22);
  2997. }
  2998. get max() {
  2999. return this._max;
  3000. }
  3001. get current() {
  3002. return this._current;
  3003. }
  3004. get total() {
  3005. return this.current.reduce((t21, r22) => t21 + r22, 0);
  3006. }
  3007. printResourceCount() {
  3008. if (this.total > 0) {
  3009. console.log("Live objects:");
  3010. for (let t21 = 0; t21 < t2.COUNT; ++t21) {
  3011. const e19 = this._current[t21];
  3012. e19 > 0 && console.log(`${t2[t21]}: ${e19}`);
  3013. }
  3014. }
  3015. this._allocations.print();
  3016. }
  3017. };
  3018. // node_modules/@arcgis/core/views/webgl/testDoublePrecisionArithmetic.js
  3019. function A5(A8, _13) {
  3020. const g10 = new D2(A8, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE }, { target: M.TEXTURE_2D, wrapMode: D.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.NEAREST, width: 1, height: 1 });
  3021. function B4(n26, e19) {
  3022. const o27 = `
  3023. precision highp float;
  3024. attribute vec2 position;
  3025. uniform vec3 u_highA;
  3026. uniform vec3 u_lowA;
  3027. uniform vec3 u_highB;
  3028. uniform vec3 u_lowB;
  3029. varying vec4 v_color;
  3030. ${_13 ? "#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION" : ""}
  3031. #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION
  3032. vec3 dpPlusFrc(vec3 a, vec3 b) {
  3033. return mix(a, a + b, vec3(notEqual(b, vec3(0))));
  3034. }
  3035. vec3 dpMinusFrc(vec3 a, vec3 b) {
  3036. return mix(vec3(0), a - b, vec3(notEqual(a, b)));
  3037. }
  3038. vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
  3039. vec3 t1 = dpPlusFrc(hiA, hiB);
  3040. vec3 e = dpMinusFrc(t1, hiA);
  3041. vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
  3042. return t1 + t2;
  3043. }
  3044. #else
  3045. vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
  3046. vec3 t1 = hiA + hiB;
  3047. vec3 e = t1 - hiA;
  3048. vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
  3049. return t1 + t2;
  3050. }
  3051. #endif
  3052. const float MAX_RGBA_FLOAT =
  3053. 255.0 / 256.0 +
  3054. 255.0 / 256.0 / 256.0 +
  3055. 255.0 / 256.0 / 256.0 / 256.0 +
  3056. 255.0 / 256.0 / 256.0 / 256.0 / 256.0;
  3057. const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
  3058. vec4 float2rgba(const float value) {
  3059. // Make sure value is in the domain we can represent
  3060. float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
  3061. // Decompose value in 32bit fixed point parts represented as
  3062. // uint8 rgba components. Decomposition uses the fractional part after multiplying
  3063. // by a power of 256 (this removes the bits that are represented in the previous
  3064. // component) and then converts the fractional part to 8bits.
  3065. vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
  3066. // Convert uint8 values (from 0 to 255) to floating point representation for
  3067. // the shader
  3068. const float toU8AsFloat = 1.0 / 255.0;
  3069. return fixedPointU8 * toU8AsFloat;
  3070. }
  3071. void main() {
  3072. vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB);
  3073. v_color = float2rgba(val.z / 25.0);
  3074. gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);
  3075. }
  3076. `, r22 = "\n precision highp float;\n\n varying vec4 v_color;\n\n void main() {\n gl_FragColor = v_color;\n }\n ", i15 = A8.programCache.acquire(o27, r22, new Map([["position", 0]])), a16 = new Float32Array(6);
  3077. t6(n26, a16, 3);
  3078. const c18 = new Float32Array(6);
  3079. return t6(e19, c18, 3), A8.useProgram(i15), i15.setUniform3f("u_highA", a16[0], a16[2], a16[4]), i15.setUniform3f("u_lowA", a16[1], a16[3], a16[5]), i15.setUniform3f("u_highB", c18[0], c18[2], c18[4]), i15.setUniform3f("u_lowB", c18[1], c18[3], c18[5]), i15;
  3080. }
  3081. const E6 = c3.createVertex(A8, F.STATIC_DRAW, new Uint16Array([0, 0, 1, 0, 0, 1, 1, 1])), b5 = new f5(A8, new Map([["position", 0]]), { geometry: [new t3("position", 2, C.UNSIGNED_SHORT, 0, 4)] }, { geometry: E6 }), F4 = r4(5633261287538229e-9, 2626832878767164e-9, 1.4349880495278358e6), w4 = r4(563327146742708e-8, 2.6268736381334523e6, 1434963231608387e-9), T6 = B4(F4, w4), O7 = A8.getBoundFramebufferObject(), { x: U5, y: I7, width: R4, height: N4 } = A8.getViewport();
  3082. A8.bindFramebuffer(g10), A8.setViewport(0, 0, 1, 1), A8.bindVAO(b5), A8.drawArrays(E.TRIANGLE_STRIP, 0, 4);
  3083. const S5 = new Uint8Array(4);
  3084. g10.readPixels(0, 0, 1, 1, P.RGBA, G.UNSIGNED_BYTE, S5), T6.dispose(), b5.dispose(false), E6.dispose(), g10.dispose(), A8.setViewport(U5, I7, R4, N4), A8.bindFramebuffer(O7);
  3085. const D6 = (F4[2] - w4[2]) / 25, y6 = r7(S5);
  3086. return Math.abs(D6 - y6);
  3087. }
  3088. // node_modules/@arcgis/core/views/webgl/testFloatBufferBlend.js
  3089. var T4;
  3090. var _9;
  3091. var F3;
  3092. var x2 = { exports: {} };
  3093. function A6(T6) {
  3094. if (!T6.gl)
  3095. return false;
  3096. if (T6.type === o6.WEBGL1)
  3097. return !(!T6.capabilities.textureFloat?.textureFloat || !T6.capabilities.colorBufferFloat?.textureFloat);
  3098. if (!(T6.capabilities.textureFloat?.textureFloat && T6.capabilities.colorBufferFloat?.textureFloat && T6.capabilities.colorBufferFloat?.floatBlend))
  3099. return false;
  3100. const _13 = new D2(T6, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE }, { target: M.TEXTURE_2D, wrapMode: D.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: G.FLOAT, internalFormat: U2.RGBA32F, samplingMode: L2.NEAREST, width: 1, height: 1 }), F4 = c3.createVertex(T6, F.STATIC_DRAW, new Uint16Array([0, 0, 1, 0, 0, 1, 1, 1])), A8 = new f5(T6, new Map([["a_pos", 0]]), { geometry: [new t3("a_pos", 2, C.UNSIGNED_SHORT, 0, 4)] }, { geometry: F4 }), R4 = "\n precision highp float;\n attribute vec2 a_pos;\n\n void main() {\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ", v8 = "\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ", S5 = T6.programCache.acquire(R4, v8, new Map([["a_pos", 0]]));
  3101. T6.useProgram(S5);
  3102. const h15 = T6.getBoundFramebufferObject(), { x: P4, y: L3, width: B4, height: C5 } = T6.getViewport();
  3103. T6.bindFramebuffer(_13), T6.setViewport(0, 0, 1, 1), T6.bindVAO(A8), T6.drawArrays(E.TRIANGLE_STRIP, 0, 4);
  3104. const w4 = W2({ blending: A3 });
  3105. T6.setPipelineState(w4), T6.drawArrays(E.TRIANGLE_STRIP, 0, 4), x2.exports.init(T6);
  3106. const O7 = T6.gl.getError();
  3107. return T6.setViewport(P4, L3, B4, C5), T6.bindFramebuffer(h15), S5.dispose(), A8.dispose(false), F4.dispose(), _13.dispose(), O7 !== 1282 || (console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."), false);
  3108. }
  3109. T4 = x2, _9 = function() {
  3110. var e19 = function(e20) {
  3111. window.console && window.console.log && window.console.log(e20);
  3112. }, t21 = function(t22) {
  3113. window.console && window.console.error ? window.console.error(t22) : e19(t22);
  3114. }, r22 = { enable: { 1: { 0: true } }, disable: { 1: { 0: true } }, getParameter: { 1: { 0: true } }, drawArrays: { 3: { 0: true } }, drawElements: { 4: { 0: true, 2: true } }, createShader: { 1: { 0: true } }, getShaderParameter: { 2: { 1: true } }, getProgramParameter: { 2: { 1: true } }, getShaderPrecisionFormat: { 2: { 0: true, 1: true } }, getVertexAttrib: { 2: { 1: true } }, vertexAttribPointer: { 6: { 2: true } }, bindTexture: { 2: { 0: true } }, activeTexture: { 1: { 0: true } }, getTexParameter: { 2: { 0: true, 1: true } }, texParameterf: { 3: { 0: true, 1: true } }, texParameteri: { 3: { 0: true, 1: true, 2: true } }, texImage2D: { 9: { 0: true, 2: true, 6: true, 7: true }, 6: { 0: true, 2: true, 3: true, 4: true } }, texSubImage2D: { 9: { 0: true, 6: true, 7: true }, 7: { 0: true, 4: true, 5: true } }, copyTexImage2D: { 8: { 0: true, 2: true } }, copyTexSubImage2D: { 8: { 0: true } }, generateMipmap: { 1: { 0: true } }, compressedTexImage2D: { 7: { 0: true, 2: true } }, compressedTexSubImage2D: { 8: { 0: true, 6: true } }, bindBuffer: { 2: { 0: true } }, bufferData: { 3: { 0: true, 2: true } }, bufferSubData: { 3: { 0: true } }, getBufferParameter: { 2: { 0: true, 1: true } }, pixelStorei: { 2: { 0: true, 1: true } }, readPixels: { 7: { 4: true, 5: true } }, bindRenderbuffer: { 2: { 0: true } }, bindFramebuffer: { 2: { 0: true } }, checkFramebufferStatus: { 1: { 0: true } }, framebufferRenderbuffer: { 4: { 0: true, 1: true, 2: true } }, framebufferTexture2D: { 5: { 0: true, 1: true, 2: true } }, getFramebufferAttachmentParameter: { 3: { 0: true, 1: true, 2: true } }, getRenderbufferParameter: { 2: { 0: true, 1: true } }, renderbufferStorage: { 4: { 0: true, 1: true } }, clear: { 1: { 0: { enumBitwiseOr: ["COLOR_BUFFER_BIT", "DEPTH_BUFFER_BIT", "STENCIL_BUFFER_BIT"] } } }, depthFunc: { 1: { 0: true } }, blendFunc: { 2: { 0: true, 1: true } }, blendFuncSeparate: { 4: { 0: true, 1: true, 2: true, 3: true } }, blendEquation: { 1: { 0: true } }, blendEquationSeparate: { 2: { 0: true, 1: true } }, stencilFunc: { 3: { 0: true } }, stencilFuncSeparate: { 4: { 0: true, 1: true } }, stencilMaskSeparate: { 2: { 0: true } }, stencilOp: { 3: { 0: true, 1: true, 2: true } }, stencilOpSeparate: { 4: { 0: true, 1: true, 2: true, 3: true } }, cullFace: { 1: { 0: true } }, frontFace: { 1: { 0: true } }, drawArraysInstancedANGLE: { 4: { 0: true } }, drawElementsInstancedANGLE: { 5: { 0: true, 2: true } }, blendEquationEXT: { 1: { 0: true } } }, n26 = null, o27 = null;
  3115. function a16(e20) {
  3116. if (n26 == null)
  3117. for (var t22 in n26 = {}, o27 = {}, e20)
  3118. typeof e20[t22] == "number" && (n26[e20[t22]] = t22, o27[t22] = e20[t22]);
  3119. }
  3120. function i15() {
  3121. if (n26 == null)
  3122. throw "WebGLDebugUtils.init(ctx) not called";
  3123. }
  3124. function f14(e20) {
  3125. return i15(), n26[e20] !== void 0;
  3126. }
  3127. function u15(e20) {
  3128. i15();
  3129. var t22 = n26[e20];
  3130. return t22 !== void 0 ? "gl." + t22 : "/*UNKNOWN WebGL ENUM*/ 0x" + e20.toString(16);
  3131. }
  3132. function l17(e20, t22, n27, a17) {
  3133. var i16;
  3134. if ((i16 = r22[e20]) !== void 0 && (i16 = i16[t22]) !== void 0 && i16[n27]) {
  3135. if (typeof i16[n27] == "object" && i16[n27].enumBitwiseOr !== void 0) {
  3136. for (var f15 = i16[n27].enumBitwiseOr, l18 = 0, c19 = [], s23 = 0; s23 < f15.length; ++s23) {
  3137. var d15 = o27[f15[s23]];
  3138. (a17 & d15) != 0 && (l18 |= d15, c19.push(u15(d15)));
  3139. }
  3140. return l18 === a17 ? c19.join(" | ") : u15(a17);
  3141. }
  3142. return u15(a17);
  3143. }
  3144. return a17 === null ? "null" : a17 === void 0 ? "undefined" : a17.toString();
  3145. }
  3146. function c18(e20, t22) {
  3147. for (var r23 = "", n27 = t22.length, o28 = 0; o28 < n27; ++o28)
  3148. r23 += (o28 == 0 ? "" : ", ") + l17(e20, n27, o28, t22[o28]);
  3149. return r23;
  3150. }
  3151. function s22(e20, t22, r23) {
  3152. e20.__defineGetter__(r23, function() {
  3153. return t22[r23];
  3154. }), e20.__defineSetter__(r23, function(e21) {
  3155. t22[r23] = e21;
  3156. });
  3157. }
  3158. function d14(e20, r23, n27, o28) {
  3159. o28 = o28 || e20, a16(e20), r23 = r23 || function(e21, r24, n28) {
  3160. for (var o29 = "", a17 = n28.length, i17 = 0; i17 < a17; ++i17)
  3161. o29 += (i17 == 0 ? "" : ", ") + l17(r24, a17, i17, n28[i17]);
  3162. t21("WebGL error " + u15(e21) + " in " + r24 + "(" + o29 + ")");
  3163. };
  3164. var i16 = {};
  3165. function f15(e21, t22) {
  3166. return function() {
  3167. n27 && n27(t22, arguments);
  3168. var a17 = e21[t22].apply(e21, arguments), f16 = o28.getError();
  3169. return f16 != 0 && (i16[f16] = true, r23(f16, t22, arguments)), a17;
  3170. };
  3171. }
  3172. var c19 = {};
  3173. for (var g11 in e20)
  3174. if (typeof e20[g11] == "function")
  3175. if (g11 != "getExtension")
  3176. c19[g11] = f15(e20, g11);
  3177. else {
  3178. var b6 = f15(e20, g11);
  3179. c19[g11] = function() {
  3180. return d14(b6.apply(e20, arguments), r23, n27, o28);
  3181. };
  3182. }
  3183. else
  3184. s22(c19, e20, g11);
  3185. return c19.getError = function() {
  3186. for (var t22 in i16)
  3187. if (i16.hasOwnProperty(t22) && i16[t22])
  3188. return i16[t22] = false, t22;
  3189. return e20.NO_ERROR;
  3190. }, c19;
  3191. }
  3192. function g10(e20) {
  3193. var t22 = e20.getParameter(e20.MAX_VERTEX_ATTRIBS), r23 = e20.createBuffer();
  3194. e20.bindBuffer(e20.ARRAY_BUFFER, r23);
  3195. for (var n27 = 0; n27 < t22; ++n27)
  3196. e20.disableVertexAttribArray(n27), e20.vertexAttribPointer(n27, 4, e20.FLOAT, false, 0, 0), e20.vertexAttrib1f(n27, 0);
  3197. e20.deleteBuffer(r23);
  3198. var o28 = e20.getParameter(e20.MAX_TEXTURE_IMAGE_UNITS);
  3199. for (n27 = 0; n27 < o28; ++n27)
  3200. e20.activeTexture(e20.TEXTURE0 + n27), e20.bindTexture(e20.TEXTURE_CUBE_MAP, null), e20.bindTexture(e20.TEXTURE_2D, null);
  3201. for (e20.activeTexture(e20.TEXTURE0), e20.useProgram(null), e20.bindBuffer(e20.ARRAY_BUFFER, null), e20.bindBuffer(e20.ELEMENT_ARRAY_BUFFER, null), e20.bindFramebuffer(e20.FRAMEBUFFER, null), e20.bindRenderbuffer(e20.RENDERBUFFER, null), e20.disable(e20.BLEND), e20.disable(e20.CULL_FACE), e20.disable(e20.DEPTH_TEST), e20.disable(e20.DITHER), e20.disable(e20.SCISSOR_TEST), e20.blendColor(0, 0, 0, 0), e20.blendEquation(e20.FUNC_ADD), e20.blendFunc(e20.ONE, e20.ZERO), e20.clearColor(0, 0, 0, 0), e20.clearDepth(1), e20.clearStencil(-1), e20.colorMask(true, true, true, true), e20.cullFace(e20.BACK), e20.depthFunc(e20.LESS), e20.depthMask(true), e20.depthRange(0, 1), e20.frontFace(e20.CCW), e20.hint(e20.GENERATE_MIPMAP_HINT, e20.DONT_CARE), e20.lineWidth(1), e20.pixelStorei(e20.PACK_ALIGNMENT, 4), e20.pixelStorei(e20.UNPACK_ALIGNMENT, 4), e20.pixelStorei(e20.UNPACK_FLIP_Y_WEBGL, false), e20.pixelStorei(e20.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false), e20.UNPACK_COLORSPACE_CONVERSION_WEBGL && e20.pixelStorei(e20.UNPACK_COLORSPACE_CONVERSION_WEBGL, e20.BROWSER_DEFAULT_WEBGL), e20.polygonOffset(0, 0), e20.sampleCoverage(1, false), e20.scissor(0, 0, e20.canvas.width, e20.canvas.height), e20.stencilFunc(e20.ALWAYS, 0, 4294967295), e20.stencilMask(4294967295), e20.stencilOp(e20.KEEP, e20.KEEP, e20.KEEP), e20.viewport(0, 0, e20.canvas.width, e20.canvas.height), e20.clear(e20.COLOR_BUFFER_BIT | e20.DEPTH_BUFFER_BIT | e20.STENCIL_BUFFER_BIT); e20.getError(); )
  3202. ;
  3203. }
  3204. function b5(e20) {
  3205. var t22, r23, n27 = [], o28 = [], a17 = {}, i16 = 1, f15 = false, u16 = [], l18 = 0, c19 = 0, d15 = false, b6 = 0, E6 = {};
  3206. function p9(e21) {
  3207. return typeof e21 == "function" ? e21 : function(t23) {
  3208. e21.handleEvent(t23);
  3209. };
  3210. }
  3211. e20.getContext = (r23 = e20.getContext, function() {
  3212. var n28 = r23.apply(e20, arguments);
  3213. if (n28 instanceof WebGLRenderingContext) {
  3214. if (n28 != t22) {
  3215. if (t22)
  3216. throw "got different context";
  3217. a17 = S5(t22 = n28);
  3218. }
  3219. return a17;
  3220. }
  3221. return n28;
  3222. });
  3223. var m14 = function(e21) {
  3224. n27.push(p9(e21));
  3225. }, T6 = function(e21) {
  3226. o28.push(p9(e21));
  3227. };
  3228. function _13(e21) {
  3229. var t23 = e21.addEventListener;
  3230. e21.addEventListener = function(r24, n28, o29) {
  3231. switch (r24) {
  3232. case "webglcontextlost":
  3233. m14(n28);
  3234. break;
  3235. case "webglcontextrestored":
  3236. T6(n28);
  3237. break;
  3238. default:
  3239. t23.apply(e21, arguments);
  3240. }
  3241. };
  3242. }
  3243. function F4() {
  3244. for (var e21 = Object.keys(E6), t23 = 0; t23 < e21.length; ++t23)
  3245. delete E6[e21];
  3246. }
  3247. function x5() {
  3248. ++c19, f15 || l18 == c19 && e20.loseContext();
  3249. }
  3250. function A8(e21, t23) {
  3251. var r24 = e21[t23];
  3252. return function() {
  3253. if (x5(), !f15)
  3254. return r24.apply(e21, arguments);
  3255. };
  3256. }
  3257. function R4() {
  3258. for (var e21 = 0; e21 < u16.length; ++e21) {
  3259. var r24 = u16[e21];
  3260. r24 instanceof WebGLBuffer ? t22.deleteBuffer(r24) : r24 instanceof WebGLFramebuffer ? t22.deleteFramebuffer(r24) : r24 instanceof WebGLProgram ? t22.deleteProgram(r24) : r24 instanceof WebGLRenderbuffer ? t22.deleteRenderbuffer(r24) : r24 instanceof WebGLShader ? t22.deleteShader(r24) : r24 instanceof WebGLTexture && t22.deleteTexture(r24);
  3261. }
  3262. }
  3263. function v8(e21) {
  3264. return { statusMessage: e21, preventDefault: function() {
  3265. d15 = true;
  3266. } };
  3267. }
  3268. return _13(e20), e20.loseContext = function() {
  3269. if (!f15) {
  3270. for (f15 = true, l18 = 0, ++i16; t22.getError(); )
  3271. ;
  3272. F4(), E6[t22.CONTEXT_LOST_WEBGL] = true;
  3273. var r24 = v8("context lost"), o29 = n27.slice();
  3274. setTimeout(function() {
  3275. for (var t23 = 0; t23 < o29.length; ++t23)
  3276. o29[t23](r24);
  3277. b6 >= 0 && setTimeout(function() {
  3278. e20.restoreContext();
  3279. }, b6);
  3280. }, 0);
  3281. }
  3282. }, e20.restoreContext = function() {
  3283. f15 && o28.length && setTimeout(function() {
  3284. if (!d15)
  3285. throw "can not restore. webglcontestlost listener did not call event.preventDefault";
  3286. R4(), g10(t22), f15 = false, c19 = 0, d15 = false;
  3287. for (var e21 = o28.slice(), r24 = v8("context restored"), n28 = 0; n28 < e21.length; ++n28)
  3288. e21[n28](r24);
  3289. }, 0);
  3290. }, e20.loseContextInNCalls = function(e21) {
  3291. if (f15)
  3292. throw "You can not ask a lost contet to be lost";
  3293. l18 = c19 + e21;
  3294. }, e20.getNumCalls = function() {
  3295. return c19;
  3296. }, e20.setRestoreTimeout = function(e21) {
  3297. b6 = e21;
  3298. }, e20;
  3299. function S5(e21) {
  3300. for (var r24 in e21)
  3301. typeof e21[r24] == "function" ? a17[r24] = A8(e21, r24) : s22(a17, e21, r24);
  3302. a17.getError = function() {
  3303. if (x5(), !f15)
  3304. for (; e22 = t22.getError(); )
  3305. E6[e22] = true;
  3306. for (var e22 in E6)
  3307. if (E6[e22])
  3308. return delete E6[e22], e22;
  3309. return a17.NO_ERROR;
  3310. };
  3311. for (var n28 = ["createBuffer", "createFramebuffer", "createProgram", "createRenderbuffer", "createShader", "createTexture"], o29 = 0; o29 < n28.length; ++o29) {
  3312. var l19 = n28[o29];
  3313. a17[l19] = function(t23) {
  3314. return function() {
  3315. if (x5(), f15)
  3316. return null;
  3317. var r25 = t23.apply(e21, arguments);
  3318. return r25.__webglDebugContextLostId__ = i16, u16.push(r25), r25;
  3319. };
  3320. }(e21[l19]);
  3321. }
  3322. var c20 = ["getActiveAttrib", "getActiveUniform", "getBufferParameter", "getContextAttributes", "getAttachedShaders", "getFramebufferAttachmentParameter", "getParameter", "getProgramParameter", "getProgramInfoLog", "getRenderbufferParameter", "getShaderParameter", "getShaderInfoLog", "getShaderSource", "getTexParameter", "getUniform", "getUniformLocation", "getVertexAttrib"];
  3323. for (o29 = 0; o29 < c20.length; ++o29)
  3324. l19 = c20[o29], a17[l19] = function(t23) {
  3325. return function() {
  3326. return x5(), f15 ? null : t23.apply(e21, arguments);
  3327. };
  3328. }(a17[l19]);
  3329. var d16 = ["isBuffer", "isEnabled", "isFramebuffer", "isProgram", "isRenderbuffer", "isShader", "isTexture"];
  3330. for (o29 = 0; o29 < d16.length; ++o29)
  3331. l19 = d16[o29], a17[l19] = function(t23) {
  3332. return function() {
  3333. return x5(), !f15 && t23.apply(e21, arguments);
  3334. };
  3335. }(a17[l19]);
  3336. return a17.checkFramebufferStatus = function(t23) {
  3337. return function() {
  3338. return x5(), f15 ? a17.FRAMEBUFFER_UNSUPPORTED : t23.apply(e21, arguments);
  3339. };
  3340. }(a17.checkFramebufferStatus), a17.getAttribLocation = function(t23) {
  3341. return function() {
  3342. return x5(), f15 ? -1 : t23.apply(e21, arguments);
  3343. };
  3344. }(a17.getAttribLocation), a17.getVertexAttribOffset = function(t23) {
  3345. return function() {
  3346. return x5(), f15 ? 0 : t23.apply(e21, arguments);
  3347. };
  3348. }(a17.getVertexAttribOffset), a17.isContextLost = function() {
  3349. return f15;
  3350. }, a17;
  3351. }
  3352. }
  3353. return { init: a16, mightBeEnum: f14, glEnumToString: u15, glFunctionArgToString: l17, glFunctionArgsToString: c18, makeDebugContext: d14, makeLostContextSimulatingCanvas: b5, resetToInitialState: g10 };
  3354. }, (F3 = _9()) !== void 0 && (T4.exports = F3);
  3355. // node_modules/@arcgis/core/views/webgl/testSamplerPrecision.js
  3356. var w2 = s2.getLogger("esri.views.WebGLDriverTest");
  3357. function h9(e19) {
  3358. const h15 = new D2(e19, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE }, { target: M.TEXTURE_2D, wrapMode: D.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.NEAREST, width: 1, height: 1 }), T6 = "\nprecision highp float;\nattribute vec2 a_pos;\nuniform highp sampler2D u_texture;\nvarying vec4 v_color;\n\nfloat getBit(in float bitset, in int bitIndex) {\n float offset = pow(2.0, float(bitIndex));\n return mod(floor(bitset / offset), 2.0);\n}\n\nvoid main() {\n vec4 value = texture2D(u_texture, vec2(0.0));\n float bit = getBit(value.x * 255.0, 1);\n\n v_color = bit * vec4(1.0);\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n}\n", _13 = "\nprecision highp float;\nvarying vec4 v_color;\n\nvoid main() {\n gl_FragColor = v_color;\n}\n", v8 = new Uint8Array(4), b5 = c3.createVertex(e19, F.STATIC_DRAW, new Uint16Array([0, 0, 1, 0, 0, 1, 1, 1])), E6 = new f5(e19, new Map([["a_position", 0]]), { geometry: [new t3("a_position", 2, C.SHORT, 0, 4)] }, { geometry: b5 }), A8 = e19.programCache.acquire(T6, _13, new Map([["a_pos", 0]]));
  3359. e19.useProgram(A8);
  3360. const x5 = new u4(e19, { target: M.TEXTURE_2D, wrapMode: D.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.NEAREST, width: 1, height: 1 }, new Uint8Array([2, 255, 0, 0]));
  3361. A8.setUniform1i("u_texture", 0), e19.bindTexture(x5, 0);
  3362. const y6 = e19.getBoundFramebufferObject();
  3363. e19.bindFramebuffer(h15), e19.useProgram(A8);
  3364. const { x: D6, y: R4, width: j5, height: N4 } = e19.getViewport();
  3365. e19.setViewport(0, 0, 1, 1), e19.bindVAO(E6), e19.drawArrays(E.TRIANGLE_STRIP, 0, 4), e19.setViewport(D6, R4, j5, N4), h15.readPixels(0, 0, 1, 1, P.RGBA, G.UNSIGNED_BYTE, v8), A8.dispose(), E6.dispose(false), b5.dispose(), h15.dispose();
  3366. const B4 = v8[0] !== 255 || v8[1] !== 255 || v8[2] !== 255 || v8[3] !== 255;
  3367. return B4 && w2.warn(`A problem was detected with your graphics driver. Your driver does not appear to honor sampler precision specifiers, which may result in rendering issues due to numerical instability. We recommend ensuring that your drivers have been updated to the latest version. Applying lowp sampler workaround. [${v8[0]}.${v8[1]}.${v8[2]}.${v8[3]}]`), e19.bindFramebuffer(y6), B4;
  3368. }
  3369. // node_modules/@arcgis/core/views/webgl/testSVGPremultipliedAlpha.js
  3370. async function f12(f14) {
  3371. const w4 = new Image();
  3372. if (w4.src = "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A", w4.width = 5, w4.height = 5, await w4.decode(), !f14.gl)
  3373. return true;
  3374. const _13 = new D2(f14, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE }, { target: M.TEXTURE_2D, wrapMode: D.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L2.NEAREST, width: 1, height: 1 }), E6 = c3.createVertex(f14, F.STATIC_DRAW, new Uint16Array([0, 0, 1, 0, 0, 1, 1, 1])), h15 = new f5(f14, new Map([["a_pos", 0]]), m6, { geometry: E6 }), v8 = "\n precision highp float;\n\n attribute vec2 a_pos;\n varying vec2 v_uv;\n\n void main() {\n v_uv = a_pos;\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ", T6 = "\n precision highp float;\n\n varying vec2 v_uv;\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor = texture2D(u_texture, v_uv);\n }\n ", x5 = f14.programCache.acquire(v8, T6, new Map([["a_pos", 0]]));
  3375. f14.useProgram(x5);
  3376. const A8 = new u4(f14, { dataType: G.UNSIGNED_BYTE, pixelFormat: P.RGBA, preMultiplyAlpha: false, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR }, w4);
  3377. f14.bindTexture(A8, 0), x5.setUniform1i("u_texture", 0);
  3378. const b5 = f14.getBoundFramebufferObject(), { x: y6, y: B4, width: C5, height: F4 } = f14.getViewport();
  3379. f14.bindFramebuffer(_13), f14.setViewport(0, 0, 1, 1), f14.setClearColor(0, 0, 0, 0), f14.setBlendingEnabled(false), f14.clearSafe(_.COLOR_BUFFER_BIT), f14.bindVAO(h15), f14.drawArrays(E.TRIANGLE_STRIP, 0, 4);
  3380. const R4 = new Uint8Array(4);
  3381. return _13.readPixels(0, 0, 1, 1, P.RGBA, G.UNSIGNED_BYTE, R4), x5.dispose(), h15.dispose(false), E6.dispose(), _13.dispose(), A8.dispose(), f14.setViewport(y6, B4, C5, F4), f14.bindFramebuffer(b5), w4.src = "", R4[0] === 255;
  3382. }
  3383. // node_modules/@arcgis/core/views/webgl/WebGLDriverTest.js
  3384. var o22 = class {
  3385. constructor(e19) {
  3386. this.context = e19, this._floatBufferBlendWorking = A6(e19), f12(e19).then((e20) => this._svgAlwaysPremultipliesAlpha = !e20);
  3387. }
  3388. get floatBufferBlendWorking() {
  3389. if (t(this._floatBufferBlendWorking))
  3390. throw new Error("floatBufferBlendWorking test not yet available");
  3391. return this._floatBufferBlendWorking;
  3392. }
  3393. get svgAlwaysPremultipliesAlpha() {
  3394. if (t(this._svgAlwaysPremultipliesAlpha))
  3395. throw new Error("svgAlwaysPremultipliesAlpha test not yet available");
  3396. return this._svgAlwaysPremultipliesAlpha;
  3397. }
  3398. get doublePrecisionRequiresObfuscation() {
  3399. if (t(this._doublePrecisionRequiresObfuscation)) {
  3400. const e19 = A5(this.context, false), i15 = A5(this.context, true);
  3401. this._doublePrecisionRequiresObfuscation = e19 !== 0 && (i15 === 0 || e19 / i15 > 5);
  3402. }
  3403. return this._doublePrecisionRequiresObfuscation;
  3404. }
  3405. get ignoresSamplerPrecision() {
  3406. return t(this._ignoresSamplerPrecision) && (this._ignoresSamplerPrecision = h9(this.context)), this._ignoresSamplerPrecision;
  3407. }
  3408. };
  3409. // node_modules/@arcgis/core/views/webgl/capabilities/DrawBuffers.js
  3410. function A7(A8, _13) {
  3411. if (_13.disjointTimerQuery)
  3412. return null;
  3413. if (n8(A8))
  3414. return { drawBuffers: A8.drawBuffers.bind(A8), MAX_DRAW_BUFFERS: A8.MAX_DRAW_BUFFERS, MAX_COLOR_ATTACHMENTS: A8.MAX_COLOR_ATTACHMENTS };
  3415. if (_13.drawBuffers)
  3416. return null;
  3417. const e19 = A8.getExtension("WEBGL_draw_buffers");
  3418. return e19 ? { drawBuffers: e19.drawBuffersWEBGL.bind(e19), MAX_DRAW_BUFFERS: e19.MAX_DRAW_BUFFERS_WEBGL, MAX_COLOR_ATTACHMENTS: e19.MAX_COLOR_ATTACHMENTS_WEBGL } : null;
  3419. }
  3420. // node_modules/@arcgis/core/views/webgl/capabilities/Instancing.js
  3421. function r16(r22) {
  3422. if (n8(r22))
  3423. return { drawArraysInstanced: r22.drawArraysInstanced.bind(r22), drawElementsInstanced: r22.drawElementsInstanced.bind(r22), vertexAttribDivisor: r22.vertexAttribDivisor.bind(r22) };
  3424. const t21 = r22.getExtension("ANGLE_instanced_arrays");
  3425. return t21 ? { drawArraysInstanced: t21.drawArraysInstancedANGLE.bind(t21), drawElementsInstanced: t21.drawElementsInstancedANGLE.bind(t21), vertexAttribDivisor: t21.vertexAttribDivisorANGLE.bind(t21) } : null;
  3426. }
  3427. // node_modules/@arcgis/core/views/webgl/capabilities/load.js
  3428. function _10(t21, _13) {
  3429. if (_13.compressedTextureETC)
  3430. return null;
  3431. const e19 = t21.getExtension("WEBGL_compressed_texture_etc");
  3432. return e19 ? { COMPRESSED_R11_EAC: e19.COMPRESSED_R11_EAC, COMPRESSED_SIGNED_R11_EAC: e19.COMPRESSED_SIGNED_R11_EAC, COMPRESSED_RG11_EAC: e19.COMPRESSED_RG11_EAC, COMPRESSED_SIGNED_RG11_EAC: e19.COMPRESSED_SIGNED_RG11_EAC, COMPRESSED_RGB8_ETC2: e19.COMPRESSED_RGB8_ETC2, COMPRESSED_SRGB8_ETC2: e19.COMPRESSED_SRGB8_ETC2, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: e19.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: e19.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, COMPRESSED_RGBA8_ETC2_EAC: e19.COMPRESSED_RGBA8_ETC2_EAC, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: e19.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC } : null;
  3433. }
  3434. function e17(t21, _13) {
  3435. if (_13.compressedTextureS3TC)
  3436. return null;
  3437. const e19 = t21.getExtension("WEBGL_compressed_texture_s3tc");
  3438. return e19 ? { COMPRESSED_RGB_S3TC_DXT1: e19.COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1: e19.COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3: e19.COMPRESSED_RGBA_S3TC_DXT3_EXT, COMPRESSED_RGBA_S3TC_DXT5: e19.COMPRESSED_RGBA_S3TC_DXT5_EXT } : null;
  3439. }
  3440. function E5(_13, e19) {
  3441. if (n8(_13))
  3442. return { MIN: _13.MIN, MAX: _13.MAX };
  3443. if (e19.blendMinMax)
  3444. return null;
  3445. {
  3446. const t21 = _13.getExtension("EXT_blend_minmax");
  3447. return t21 ? { MIN: t21.MIN_EXT, MAX: t21.MAX_EXT } : null;
  3448. }
  3449. }
  3450. function n22(t21, _13) {
  3451. if (_13.textureFilterAnisotropic)
  3452. return null;
  3453. const e19 = t21.getExtension("EXT_texture_filter_anisotropic") || t21.getExtension("MOZ_EXT_texture_filter_anisotropic") || t21.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  3454. return e19 ? { MAX_TEXTURE_MAX_ANISOTROPY: e19.MAX_TEXTURE_MAX_ANISOTROPY_EXT, TEXTURE_MAX_ANISOTROPY: e19.TEXTURE_MAX_ANISOTROPY_EXT } : null;
  3455. }
  3456. function R3(_13, e19) {
  3457. if (n8(_13))
  3458. return { textureFloat: true, textureFloatLinear: !e19.textureFloatLinear && !!_13.getExtension("OES_texture_float_linear"), textureHalfFloat: true, textureHalfFloatLinear: true, HALF_FLOAT: _13.HALF_FLOAT, R16F: _13.R16F, RG16F: _13.RG16F, RGBA16F: _13.RGBA16F, R32F: _13.R32F, RG32F: _13.RG32F, RGBA32F: _13.RGBA32F, R11F_G11F_B10F: _13.R11F_G11F_B10F, RGB16F: _13.RGB16F };
  3459. if (_13 instanceof WebGLRenderingContext) {
  3460. const t21 = !e19.textureHalfFloat && _13.getExtension("OES_texture_half_float");
  3461. return { textureFloat: !e19.textureFloat && !!_13.getExtension("OES_texture_float"), textureFloatLinear: !e19.textureFloatLinear && !!_13.getExtension("OES_texture_float_linear"), textureHalfFloat: !!t21, textureHalfFloatLinear: !e19.textureHalfFloatLinear && !!_13.getExtension("OES_texture_half_float_linear"), HALF_FLOAT: t21 ? t21.HALF_FLOAT_OES : void 0 };
  3462. }
  3463. return null;
  3464. }
  3465. function r17(_13, e19) {
  3466. if (n8(_13)) {
  3467. const t21 = !e19.colorBufferHalfFloat && _13.getExtension("EXT_color_buffer_half_float") || !e19.colorBufferFloat && _13.getExtension("EXT_color_buffer_float"), E6 = !e19.colorBufferFloat && _13.getExtension("EXT_color_buffer_float"), n26 = !e19.floatBlend && !e19.colorBufferFloat && _13.getExtension("EXT_float_blend");
  3468. return t21 || E6 || n26 ? { textureFloat: !!E6, textureHalfFloat: !!t21, floatBlend: !!n26, R16F: _13.R16F, RG16F: _13.RG16F, RGBA16F: _13.RGBA16F, R32F: _13.R32F, RG32F: _13.RG32F, RGBA32F: _13.RGBA32F, R11F_G11F_B10F: _13.R11F_G11F_B10F, RGB16F: _13.RGB16F } : null;
  3469. }
  3470. if (_13 instanceof WebGLRenderingContext) {
  3471. const t21 = !e19.colorBufferHalfFloat && _13.getExtension("EXT_color_buffer_half_float"), E6 = !e19.colorBufferFloat && _13.getExtension("WEBGL_color_buffer_float"), n26 = !e19.floatBlend && !e19.colorBufferFloat && _13.getExtension("EXT_float_blend");
  3472. return t21 || E6 || n26 ? { textureFloat: !!E6, textureHalfFloat: !!t21, floatBlend: !!n26, RGBA16F: t21 ? t21.RGBA16F_EXT : void 0, RGB16F: t21 ? t21.RGB16F_EXT : void 0, RGBA32F: E6 ? E6.RGBA32F_EXT : void 0 } : null;
  3473. }
  3474. return null;
  3475. }
  3476. function o23(_13, e19, E6, n26, R4) {
  3477. if (n26 && n8(_13))
  3478. return true;
  3479. if (e19[E6])
  3480. return false;
  3481. for (const t21 of R4)
  3482. if (_13.getExtension(t21))
  3483. return true;
  3484. return false;
  3485. }
  3486. function l13(_13, e19) {
  3487. if (!n8(_13))
  3488. return null;
  3489. if (e19.textureNorm16)
  3490. return null;
  3491. const E6 = _13.getExtension("EXT_texture_norm16");
  3492. return E6 ? { R16: E6.R16_EXT, RG16: E6.RG16_EXT, RGB16: E6.RGB16_EXT, RGBA16: E6.RGBA16_EXT, R16_SNORM: E6.R16_SNORM_EXT, RG16_SNORM: E6.RG16_SNORM_EXT, RGB16_SNORM: E6.RGB16_SNORM_EXT, RGBA16_SNORM: E6.RGBA16_SNORM_EXT } : null;
  3493. }
  3494. // node_modules/@arcgis/core/views/webgl/capabilities/LoseContext.js
  3495. function e18(e19, t21) {
  3496. const n26 = t21.loseContext && e19.getExtension("WEBGL_lose_context");
  3497. return n26 ? { loseRenderingContext: () => n26.loseContext() } : null;
  3498. }
  3499. // node_modules/@arcgis/core/views/webgl/capabilities/VertexArrayObjects.js
  3500. function r18(r22, t21) {
  3501. if (n8(r22))
  3502. return { createVertexArray: r22.createVertexArray.bind(r22), deleteVertexArray: r22.deleteVertexArray.bind(r22), bindVertexArray: r22.bindVertexArray.bind(r22) };
  3503. if (t21.vao)
  3504. return null;
  3505. const n26 = r22.getExtension("OES_vertex_array_object") || r22.getExtension("MOZ_OES_vertex_array_object") || r22.getExtension("WEBKIT_OES_vertex_array_object");
  3506. return n26 ? { createVertexArray: n26.createVertexArrayOES.bind(n26), deleteVertexArray: n26.deleteVertexArrayOES.bind(n26), bindVertexArray: n26.bindVertexArrayOES.bind(n26) } : null;
  3507. }
  3508. // node_modules/@arcgis/core/views/webgl/capabilities/Capabilities.js
  3509. var x3 = class {
  3510. constructor(t21, e19) {
  3511. this.gl = t21, this._depthTexture = null, this._standardDerivatives = null, this._shaderTextureLOD = null, this._fragDepth = null, this._textureFloatLinear = null, this._disabledExtensions = e19.disabledExtensions || {}, this._debugWebGLExtensions = e19.debugWebGLExtensions || {};
  3512. }
  3513. get drawBuffers() {
  3514. return this._drawBuffers || (this._drawBuffers = A7(this.gl, this._disabledExtensions)), this._drawBuffers;
  3515. }
  3516. get instancing() {
  3517. return this._instancing || (this._instancing = r16(this.gl)), this._instancing;
  3518. }
  3519. get vao() {
  3520. return this._vertexArrayObject || (this._vertexArrayObject = r18(this.gl, this._disabledExtensions)), this._vertexArrayObject;
  3521. }
  3522. get compressedTextureETC() {
  3523. return this._compressedTextureETC || (this._compressedTextureETC = _10(this.gl, this._disabledExtensions)), this._compressedTextureETC;
  3524. }
  3525. get compressedTextureS3TC() {
  3526. return this._compressedTextureS3TC || (this._compressedTextureS3TC = e17(this.gl, this._disabledExtensions)), this._compressedTextureS3TC;
  3527. }
  3528. get textureFilterAnisotropic() {
  3529. return this._textureFilterAnisotropic || (this._textureFilterAnisotropic = n22(this.gl, this._disabledExtensions)), this._textureFilterAnisotropic;
  3530. }
  3531. get disjointTimerQuery() {
  3532. return this._disjointTimerQuery || (this._disjointTimerQuery = t17(this.gl, this._disabledExtensions)), this._disjointTimerQuery;
  3533. }
  3534. get textureFloat() {
  3535. return this._textureFloat || (this._textureFloat = R3(this.gl, this._disabledExtensions)), this._textureFloat;
  3536. }
  3537. get colorBufferFloat() {
  3538. return this._colorBufferFloat || (this._colorBufferFloat = r17(this.gl, this._disabledExtensions)), this._colorBufferFloat;
  3539. }
  3540. get blendMinMax() {
  3541. return this._minMaxBlending || (this._minMaxBlending = E5(this.gl, this._disabledExtensions)), this._minMaxBlending;
  3542. }
  3543. get depthTexture() {
  3544. return this._depthTexture === null && (this._depthTexture = o23(this.gl, this._disabledExtensions, "depthTexture", true, ["WEBGL_depth_texture", "MOZ_WEBGL_depth_texture", "WEBKIT_WEBGL_depth_texture"])), this._depthTexture;
  3545. }
  3546. get standardDerivatives() {
  3547. return this._standardDerivatives === null && (this._standardDerivatives = o23(this.gl, this._disabledExtensions, "standardDerivatives", true, ["OES_standard_derivatives"])), this._standardDerivatives;
  3548. }
  3549. get shaderTextureLOD() {
  3550. return this._shaderTextureLOD === null && (this._shaderTextureLOD = o23(this.gl, this._disabledExtensions, "shaderTextureLOD", true, ["EXT_shader_texture_lod"])), this._shaderTextureLOD;
  3551. }
  3552. get fragDepth() {
  3553. return this._fragDepth === null && (this._fragDepth = o23(this.gl, this._disabledExtensions, "fragDepth", true, ["EXT_frag_depth"])), this._fragDepth;
  3554. }
  3555. get loseContext() {
  3556. return this._loseContext || (this._loseContext = e18(this.gl, this._debugWebGLExtensions)), this._loseContext;
  3557. }
  3558. get textureNorm16() {
  3559. return this._textureNorm16 || (this._textureNorm16 = l13(this.gl, this._disabledExtensions)), this._textureNorm16;
  3560. }
  3561. get textureFloatLinear() {
  3562. return this._textureFloatLinear === null && (this._textureFloatLinear = o23(this.gl, this._disabledExtensions, "textureFloatLinear", false, ["OES_texture_float_linear"])), this._textureFloatLinear;
  3563. }
  3564. enable(t21) {
  3565. return this[t21];
  3566. }
  3567. };
  3568. // node_modules/@arcgis/core/views/webgl/RenderingContext.js
  3569. var y4 = class {
  3570. constructor(t21, e19) {
  3571. this.gl = t21, this.instanceCounter = new s17(), this.programCache = new s8(this), this._state = new h8(), this._numOfDrawCalls = 0, this._numOfTriangles = 0, this.type = n8(t21) ? o6.WEBGL2 : o6.WEBGL1, this._loadExtensions(), this.configure(e19);
  3572. }
  3573. configure(t21) {
  3574. this._capabilities = new x3(this.gl, t21), this._parameters = this._loadParameters(t21);
  3575. const e19 = this.gl.getParameter(this.gl.VIEWPORT);
  3576. this._state = new h8(), this._state.viewport = { x: e19[0], y: e19[1], width: e19[2], height: e19[3] }, this._stateTracker = new M3({ setBlending: (t22) => {
  3577. if (t22) {
  3578. this.setBlendingEnabled(true), this.setBlendEquationSeparate(t22.opRgb, t22.opAlpha), this.setBlendFunctionSeparate(t22.srcRgb, t22.dstRgb, t22.srcAlpha, t22.dstAlpha);
  3579. const e20 = t22.color;
  3580. this.setBlendColor(e20.r, e20.g, e20.b, e20.a);
  3581. } else
  3582. this.setBlendingEnabled(false);
  3583. }, setCulling: (t22) => {
  3584. t22 ? (this.setFaceCullingEnabled(true), this.setCullFace(t22.face), this.setFrontFace(t22.mode)) : this.setFaceCullingEnabled(false);
  3585. }, setPolygonOffset: (t22) => {
  3586. t22 ? (this.setPolygonOffsetFillEnabled(true), this.setPolygonOffset(t22.factor, t22.units)) : this.setPolygonOffsetFillEnabled(false);
  3587. }, setDepthTest: (t22) => {
  3588. t22 ? (this.setDepthTestEnabled(true), this.setDepthFunction(t22.func)) : this.setDepthTestEnabled(false);
  3589. }, setStencilTest: (t22) => {
  3590. if (t22) {
  3591. this.setStencilTestEnabled(true);
  3592. const e20 = t22.function;
  3593. this.setStencilFunction(e20.func, e20.ref, e20.mask);
  3594. const s22 = t22.operation;
  3595. this.setStencilOp(s22.fail, s22.zFail, s22.zPass);
  3596. } else
  3597. this.setStencilTestEnabled(false);
  3598. }, setDepthWrite: (t22) => {
  3599. t22 ? (this.setDepthWriteEnabled(true), this.setDepthRange(t22.zNear, t22.zFar)) : this.setDepthWriteEnabled(false);
  3600. }, setColorWrite: (t22) => {
  3601. t22 ? this.setColorMask(t22.r, t22.g, t22.b, t22.a) : this.setColorMask(false, false, false, false);
  3602. }, setStencilWrite: (t22) => {
  3603. t22 ? this.setStencilWriteMask(t22.mask) : this.setStencilWriteMask(0);
  3604. } }), this.enforceState(), this._driverTest = new o22(this);
  3605. }
  3606. get driverTest() {
  3607. return this._driverTest;
  3608. }
  3609. get contextAttributes() {
  3610. return this.gl.getContextAttributes();
  3611. }
  3612. get parameters() {
  3613. return this._parameters;
  3614. }
  3615. dispose() {
  3616. this.programCache.dispose(), this.bindVAO(null), this.unbindBuffer(A2.ARRAY_BUFFER), this.unbindBuffer(A2.ELEMENT_ARRAY_BUFFER), n8(this.gl) && (this.unbindBuffer(A2.UNIFORM_BUFFER), this._state.uniformBufferBindingPoints.length = 0, this.unbindBuffer(A2.PIXEL_PACK_BUFFER), this.unbindBuffer(A2.PIXEL_UNPACK_BUFFER), this.unbindBuffer(A2.COPY_READ_BUFFER), this.unbindBuffer(A2.COPY_WRITE_BUFFER)), this._state.textureUnitMap.length = 0, u3() && this.instanceCounter.printResourceCount();
  3617. }
  3618. setPipelineState(t21) {
  3619. this._stateTracker.setPipeline(t21);
  3620. }
  3621. setBlendingEnabled(t21) {
  3622. this._state.blend !== t21 && (t21 === true ? this.gl.enable(this.gl.BLEND) : this.gl.disable(this.gl.BLEND), this._state.blend = t21, this._stateTracker.invalidateBlending());
  3623. }
  3624. externalProgramUpdate() {
  3625. this._state.program?.stop(), this._state.program = null;
  3626. }
  3627. externalTextureUnitUpdate(t21, e19) {
  3628. for (let s22 = 0; s22 < t21.length; ++s22)
  3629. this._state.textureUnitMap[t21[s22]] = null;
  3630. e19 >= 0 && (this._state.activeTexture = e19);
  3631. }
  3632. externalVertexArrayObjectUpdate() {
  3633. const t21 = this.capabilities.vao;
  3634. t21 && (t21.bindVertexArray(null), this._state.vertexArrayObject = null), this._state.vertexBuffer = null, this._state.indexBuffer = null;
  3635. }
  3636. externalVertexBufferUpdate() {
  3637. this._state.vertexBuffer = null;
  3638. }
  3639. externalIndexBufferUpdate() {
  3640. this._state.indexBuffer = null;
  3641. }
  3642. setBlendColor(t21, e19, s22, i15) {
  3643. t21 === this._state.blendColor.r && e19 === this._state.blendColor.g && s22 === this._state.blendColor.b && i15 === this._state.blendColor.a || (this.gl.blendColor(t21, e19, s22, i15), this._state.blendColor.r = t21, this._state.blendColor.g = e19, this._state.blendColor.b = s22, this._state.blendColor.a = i15, this._stateTracker.invalidateBlending());
  3644. }
  3645. setBlendFunction(t21, e19) {
  3646. t21 === this._state.blendFunction.srcRGB && e19 === this._state.blendFunction.dstRGB || (this.gl.blendFunc(t21, e19), this._state.blendFunction.srcRGB = t21, this._state.blendFunction.srcAlpha = t21, this._state.blendFunction.dstRGB = e19, this._state.blendFunction.dstAlpha = e19, this._stateTracker.invalidateBlending());
  3647. }
  3648. setBlendFunctionSeparate(t21, e19, s22, i15) {
  3649. this._state.blendFunction.srcRGB === t21 && this._state.blendFunction.srcAlpha === s22 && this._state.blendFunction.dstRGB === e19 && this._state.blendFunction.dstAlpha === i15 || (this.gl.blendFuncSeparate(t21, e19, s22, i15), this._state.blendFunction.srcRGB = t21, this._state.blendFunction.srcAlpha = s22, this._state.blendFunction.dstRGB = e19, this._state.blendFunction.dstAlpha = i15, this._stateTracker.invalidateBlending());
  3650. }
  3651. setBlendEquation(t21) {
  3652. this._state.blendEquation.mode !== t21 && (this.gl.blendEquation(t21), this._state.blendEquation.mode = t21, this._state.blendEquation.modeAlpha = t21, this._stateTracker.invalidateBlending());
  3653. }
  3654. setBlendEquationSeparate(t21, e19) {
  3655. this._state.blendEquation.mode === t21 && this._state.blendEquation.modeAlpha === e19 || (this.gl.blendEquationSeparate(t21, e19), this._state.blendEquation.mode = t21, this._state.blendEquation.modeAlpha = e19, this._stateTracker.invalidateBlending());
  3656. }
  3657. setColorMask(t21, e19, s22, i15) {
  3658. this._state.colorMask.r === t21 && this._state.colorMask.g === e19 && this._state.colorMask.b === s22 && this._state.colorMask.a === i15 || (this.gl.colorMask(t21, e19, s22, i15), this._state.colorMask.r = t21, this._state.colorMask.g = e19, this._state.colorMask.b = s22, this._state.colorMask.a = i15, this._stateTracker.invalidateColorWrite());
  3659. }
  3660. setClearColor(t21, e19, s22, i15) {
  3661. this._state.clearColor.r === t21 && this._state.clearColor.g === e19 && this._state.clearColor.b === s22 && this._state.clearColor.a === i15 || (this.gl.clearColor(t21, e19, s22, i15), this._state.clearColor.r = t21, this._state.clearColor.g = e19, this._state.clearColor.b = s22, this._state.clearColor.a = i15);
  3662. }
  3663. setFaceCullingEnabled(t21) {
  3664. this._state.faceCulling !== t21 && (t21 === true ? this.gl.enable(this.gl.CULL_FACE) : this.gl.disable(this.gl.CULL_FACE), this._state.faceCulling = t21, this._stateTracker.invalidateCulling());
  3665. }
  3666. setPolygonOffsetFillEnabled(t21) {
  3667. this._state.polygonOffsetFill !== t21 && (t21 === true ? this.gl.enable(this.gl.POLYGON_OFFSET_FILL) : this.gl.disable(this.gl.POLYGON_OFFSET_FILL), this._state.polygonOffsetFill = t21, this._stateTracker.invalidatePolygonOffset());
  3668. }
  3669. setPolygonOffset(t21, e19) {
  3670. this._state.polygonOffset[0] === t21 && this._state.polygonOffset[1] === e19 || (this._state.polygonOffset[0] = t21, this._state.polygonOffset[1] = e19, this.gl.polygonOffset(t21, e19), this._stateTracker.invalidatePolygonOffset());
  3671. }
  3672. setCullFace(t21) {
  3673. this._state.cullFace !== t21 && (this.gl.cullFace(t21), this._state.cullFace = t21, this._stateTracker.invalidateCulling());
  3674. }
  3675. setFrontFace(t21) {
  3676. this._state.frontFace !== t21 && (this.gl.frontFace(t21), this._state.frontFace = t21, this._stateTracker.invalidateCulling());
  3677. }
  3678. setScissorTestEnabled(t21) {
  3679. this._state.scissorTest !== t21 && (t21 === true ? this.gl.enable(this.gl.SCISSOR_TEST) : this.gl.disable(this.gl.SCISSOR_TEST), this._state.scissorTest = t21);
  3680. }
  3681. setScissorRect(t21, e19, s22, i15) {
  3682. this._state.scissorRect.x === t21 && this._state.scissorRect.y === e19 && this._state.scissorRect.width === s22 && this._state.scissorRect.height === i15 || (this.gl.scissor(t21, e19, s22, i15), this._state.scissorRect.x = t21, this._state.scissorRect.y = e19, this._state.scissorRect.width = s22, this._state.scissorRect.height = i15);
  3683. }
  3684. setDepthTestEnabled(t21) {
  3685. this._state.depthTest !== t21 && (t21 === true ? this.gl.enable(this.gl.DEPTH_TEST) : this.gl.disable(this.gl.DEPTH_TEST), this._state.depthTest = t21, this._stateTracker.invalidateDepthTest());
  3686. }
  3687. setClearDepth(t21) {
  3688. this._state.clearDepth !== t21 && (this.gl.clearDepth(t21), this._state.clearDepth = t21);
  3689. }
  3690. setDepthFunction(t21) {
  3691. this._state.depthFunction !== t21 && (this.gl.depthFunc(t21), this._state.depthFunction = t21, this._stateTracker.invalidateDepthTest());
  3692. }
  3693. setDepthWriteEnabled(t21) {
  3694. this._state.depthWrite !== t21 && (this.gl.depthMask(t21), this._state.depthWrite = t21, this._stateTracker.invalidateDepthWrite());
  3695. }
  3696. setDepthRange(t21, e19) {
  3697. this._state.depthRange.zNear === t21 && this._state.depthRange.zFar === e19 || (this.gl.depthRange(t21, e19), this._state.depthRange.zNear = t21, this._state.depthRange.zFar = e19, this._stateTracker.invalidateDepthWrite());
  3698. }
  3699. setStencilTestEnabled(t21) {
  3700. this._state.stencilTest !== t21 && (t21 === true ? this.gl.enable(this.gl.STENCIL_TEST) : this.gl.disable(this.gl.STENCIL_TEST), this._state.stencilTest = t21, this._stateTracker.invalidateStencilTest());
  3701. }
  3702. setClearStencil(t21) {
  3703. t21 !== this._state.clearStencil && (this.gl.clearStencil(t21), this._state.clearStencil = t21);
  3704. }
  3705. setStencilFunction(t21, e19, s22) {
  3706. this._state.stencilFunction.func === t21 && this._state.stencilFunction.ref === e19 && this._state.stencilFunction.mask === s22 || (this.gl.stencilFunc(t21, e19, s22), this._state.stencilFunction.face = N.FRONT_AND_BACK, this._state.stencilFunction.func = t21, this._state.stencilFunction.ref = e19, this._state.stencilFunction.mask = s22, this._stateTracker.invalidateStencilTest());
  3707. }
  3708. setStencilFunctionSeparate(t21, e19, s22, i15) {
  3709. this._state.stencilFunction.face === t21 && this._state.stencilFunction.func === e19 && this._state.stencilFunction.ref === s22 && this._state.stencilFunction.mask === i15 || (this.gl.stencilFuncSeparate(t21, e19, s22, i15), this._state.stencilFunction.face = t21, this._state.stencilFunction.func = e19, this._state.stencilFunction.ref = s22, this._state.stencilFunction.mask = i15, this._stateTracker.invalidateStencilTest());
  3710. }
  3711. setStencilWriteMask(t21) {
  3712. this._state.stencilWriteMask !== t21 && (this.gl.stencilMask(t21), this._state.stencilWriteMask = t21, this._stateTracker.invalidateStencilWrite());
  3713. }
  3714. setStencilOp(t21, e19, s22) {
  3715. this._state.stencilOperation.face === N.FRONT_AND_BACK && this._state.stencilOperation.fail === t21 && this._state.stencilOperation.zFail === e19 && this._state.stencilOperation.zPass === s22 || (this.gl.stencilOp(t21, e19, s22), this._state.stencilOperation.face = N.FRONT_AND_BACK, this._state.stencilOperation.fail = t21, this._state.stencilOperation.zFail = e19, this._state.stencilOperation.zPass = s22, this._stateTracker.invalidateStencilTest());
  3716. }
  3717. setStencilOpSeparate(t21, e19, s22, i15) {
  3718. this._state.stencilOperation.face === t21 && this._state.stencilOperation.fail === e19 && this._state.stencilOperation.zFail === s22 && this._state.stencilOperation.zPass === i15 || (this.gl.stencilOpSeparate(t21, e19, s22, i15), this._state.stencilOperation.face = t21, this._state.stencilOperation.fail = e19, this._state.stencilOperation.zFail = s22, this._state.stencilOperation.zPass = i15, this._stateTracker.invalidateStencilTest());
  3719. }
  3720. setActiveTexture(t21, e19 = false) {
  3721. const s22 = this._state.activeTexture;
  3722. return t21 >= 0 && (e19 || t21 !== this._state.activeTexture) && (this.gl.activeTexture(X + t21), this._state.activeTexture = t21), s22;
  3723. }
  3724. clear(t21) {
  3725. t21 && this.gl.clear(t21);
  3726. }
  3727. clearSafe(t21, e19 = 255) {
  3728. t21 && (t21 & _.COLOR_BUFFER_BIT && this.setColorMask(true, true, true, true), t21 & _.DEPTH_BUFFER_BIT && this.setDepthWriteEnabled(true), t21 & _.STENCIL_BUFFER_BIT && this.setStencilWriteMask(e19), this.gl.clear(t21));
  3729. }
  3730. drawArrays(t21, e19, s22) {
  3731. if (u3() && (this._numOfDrawCalls++, this._numOfTriangles += I6(t21, s22)), this.gl.drawArrays(t21, e19, s22), u3()) {
  3732. const t22 = i3(this);
  3733. t22 && console.error("drawArrays:", t22);
  3734. }
  3735. }
  3736. drawElements(e19, s22, i15, a16) {
  3737. if (u3() && (this._numOfDrawCalls++, this._numOfTriangles += I6(e19, s22)), this.gl.drawElements(e19, s22, i15, a16), u3()) {
  3738. const r22 = i3(this);
  3739. if (r22) {
  3740. const n26 = this.getBoundVAO(), l17 = n26?.indexBuffer, h15 = n26?.vertexBuffers, f14 = { indexBuffer: l17, vertexBuffers: h15 }, o27 = { mode: e19, count: s22, type: i15, offset: a16 }, _13 = o(l17, (t21) => t21.size) ?? 0, u15 = a16 + s22, c18 = _13 < u15 ? `. Buffer is too small. Attempted to draw index ${u15} of ${_13}` : "";
  3741. console.error(`drawElements: ${r22}${c18}`, { args: o27, vao: f14 });
  3742. }
  3743. }
  3744. }
  3745. logInfo() {
  3746. u3() && console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`);
  3747. }
  3748. resetInfo() {
  3749. u3() && (this._numOfDrawCalls = 0, this._numOfTriangles = 0);
  3750. }
  3751. get capabilities() {
  3752. return this._capabilities;
  3753. }
  3754. setViewport(t21, e19, s22, i15) {
  3755. s22 = Math.max(Math.round(s22), 1), i15 = Math.max(Math.round(i15), 1);
  3756. const a16 = this._state.viewport;
  3757. a16.x === t21 && a16.y === e19 && a16.width === s22 && a16.height === i15 || (a16.x = t21, a16.y = e19, a16.width = s22, a16.height = i15, this.gl.viewport(t21, e19, s22, i15));
  3758. }
  3759. getViewport() {
  3760. return { x: this._state.viewport.x, y: this._state.viewport.y, width: this._state.viewport.width, height: this._state.viewport.height };
  3761. }
  3762. useProgram(t21) {
  3763. this._state.program !== t21 && (this._state.program?.stop(), this._state.program = t21, this.gl.useProgram(t21?.glName ?? null));
  3764. }
  3765. bindTexture(t21, i15, a16 = false) {
  3766. (i15 >= this.parameters.maxTextureImageUnits || i15 < 0) && console.error("Input texture unit is out of range of available units!");
  3767. const r22 = this._state.textureUnitMap[i15];
  3768. return t(t21) || t21.glName == null ? (r(r22) && (this.setActiveTexture(i15, a16), this.gl.bindTexture(r22.descriptor.target, null)), this._state.textureUnitMap[i15] = null, r22) : a16 || r22 !== t21 ? (this.setActiveTexture(i15, a16), this.gl.bindTexture(t21.descriptor.target, t21.glName), t21.applyChanges(), this._state.textureUnitMap[i15] = t21, r22) : (t21.isDirty && (this.setActiveTexture(i15, a16), t21.applyChanges()), r22);
  3769. }
  3770. unbindTexture(t21) {
  3771. if (!t(t21))
  3772. for (let e19 = 0; e19 < this.parameters.maxTextureImageUnits; e19++)
  3773. this._state.textureUnitMap[e19] === t21 && (this.bindTexture(null, e19), this._state.textureUnitMap[e19] = null);
  3774. }
  3775. bindFramebuffer(t21, s22 = false) {
  3776. if (s22 || this._state.readFramebuffer !== t21 || this._state.drawFramebuffer !== t21) {
  3777. if (t(t21))
  3778. return this.gl.bindFramebuffer(n5.FRAMEBUFFER, null), this._state.readFramebuffer = null, void (this._state.drawFramebuffer = null);
  3779. t21.initializeAndBind(n5.FRAMEBUFFER), this._state.readFramebuffer = t21, this._state.drawFramebuffer = t21;
  3780. }
  3781. }
  3782. bindFramebufferSeparate(t21, s22, a16 = false) {
  3783. const r22 = s22 === n5.READ_FRAMEBUFFER, n26 = r22 ? this._state.readFramebuffer : this._state.drawFramebuffer;
  3784. (a16 || n26 !== t21) && (t(t21) ? this.gl.bindFramebuffer(s22, null) : t21.initializeAndBind(s22), r22 ? this._state.readFramebuffer = c(t21, null) : this._state.drawFramebuffer = c(t21, null));
  3785. }
  3786. blitFramebuffer(t21, e19, s22 = 0, i15 = 0, a16 = t21.width, r22 = t21.height, n26 = 0, l17 = 0, h15 = e19.width, f14 = e19.height, o27 = _.COLOR_BUFFER_BIT, _13 = L2.NEAREST) {
  3787. this.bindFramebufferSeparate(t21, n5.READ_FRAMEBUFFER), this.bindFramebufferSeparate(e19, n5.DRAW_FRAMEBUFFER);
  3788. this.gl.blitFramebuffer(s22, i15, a16, r22, n26, l17, h15, f14, o27, _13);
  3789. }
  3790. bindBuffer(t21, e19) {
  3791. if (t21)
  3792. switch (e19 ?? (e19 = t21.bufferType), e19) {
  3793. case A2.ARRAY_BUFFER:
  3794. this._state.vertexBuffer = v4(this.gl, t21, e19, this._state.vertexBuffer);
  3795. break;
  3796. case A2.ELEMENT_ARRAY_BUFFER:
  3797. this._state.indexBuffer = v4(this.gl, t21, e19, this._state.indexBuffer);
  3798. break;
  3799. case A2.UNIFORM_BUFFER:
  3800. this._state.uniformBuffer = v4(this.gl, t21, e19, this._state.uniformBuffer);
  3801. break;
  3802. case A2.PIXEL_PACK_BUFFER:
  3803. this._state.pixelPackBuffer = v4(this.gl, t21, e19, this._state.pixelPackBuffer);
  3804. break;
  3805. case A2.PIXEL_UNPACK_BUFFER:
  3806. this._state.pixelUnpackBuffer = v4(this.gl, t21, e19, this._state.pixelUnpackBuffer);
  3807. break;
  3808. case A2.COPY_READ_BUFFER:
  3809. this._state.copyReadBuffer = v4(this.gl, t21, e19, this._state.copyReadBuffer);
  3810. break;
  3811. case A2.COPY_WRITE_BUFFER:
  3812. this._state.copyWriteBuffer = v4(this.gl, t21, e19, this._state.copyWriteBuffer);
  3813. }
  3814. }
  3815. bindRenderbuffer(t21) {
  3816. const e19 = this.gl;
  3817. t21 || (e19.bindRenderbuffer(e19.RENDERBUFFER, null), this._state.renderbuffer = null), this._state.renderbuffer !== t21 && (e19.bindRenderbuffer(e19.RENDERBUFFER, t21.glName), this._state.renderbuffer = t21);
  3818. }
  3819. _getBufferBinding(t21, s22) {
  3820. if (s22 >= this.parameters.maxUniformBufferBindings || s22 < 0)
  3821. return console.error("Uniform buffer binding point is out of range!"), null;
  3822. const i15 = this._state.uniformBufferBindingPoints;
  3823. let a16 = i15[s22];
  3824. return t(a16) && (a16 = { buffer: null, offset: 0, size: 0 }, i15[s22] = a16), a16;
  3825. }
  3826. bindBufferBase(t21, s22, i15) {
  3827. const a16 = this._getBufferBinding(t21, s22);
  3828. if (t(a16))
  3829. return;
  3830. if (a16.buffer === i15 && a16.offset === 0 && a16.size === 0)
  3831. return;
  3832. this.gl.bindBufferBase(t21, s22, i15 ? i15.glName : null), a16.buffer = i15, a16.offset = 0, a16.size = 0;
  3833. }
  3834. bindBufferRange(t21, s22, i15, a16, r22) {
  3835. const n26 = this._getBufferBinding(t21, s22);
  3836. if (t(n26))
  3837. return;
  3838. if (n26.buffer === i15 && n26.offset === a16 && n26.size === r22)
  3839. return;
  3840. if (a16 % this._parameters.uniformBufferOffsetAlignment != 0)
  3841. return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");
  3842. this.gl.bindBufferRange(t21, s22, i15.glName, a16, r22), n26.buffer = i15, n26.offset = a16, n26.size = r22;
  3843. }
  3844. bindUBO(t21, s22, i15, a16) {
  3845. t(s22) ? this.bindBufferBase(A2.UNIFORM_BUFFER, t21, null) : (u3() && (a16 ?? s22.byteLength) > this._parameters.maxUniformBlockSize && console.error("Attempting to bind more data than the maximum uniform block size"), s22.initialize(), i15 !== void 0 && a16 !== void 0 ? this.bindBufferRange(A2.UNIFORM_BUFFER, t21, s22.buffer, i15, a16) : this.bindBufferBase(A2.UNIFORM_BUFFER, t21, s22.buffer));
  3846. }
  3847. unbindUBO(t21) {
  3848. for (let e19 = 0, i15 = this._state.uniformBufferBindingPoints.length; e19 < i15; e19++) {
  3849. const i16 = this._state.uniformBufferBindingPoints[e19];
  3850. r(i16) && i16.buffer === t21.buffer && this.bindBufferBase(A2.UNIFORM_BUFFER, e19, null);
  3851. }
  3852. }
  3853. unbindBuffer(t21) {
  3854. switch (t21) {
  3855. case A2.ARRAY_BUFFER:
  3856. this._state.vertexBuffer = v4(this.gl, null, t21, this._state.vertexBuffer);
  3857. break;
  3858. case A2.ELEMENT_ARRAY_BUFFER:
  3859. this._state.indexBuffer = v4(this.gl, null, t21, this._state.indexBuffer);
  3860. break;
  3861. case A2.UNIFORM_BUFFER:
  3862. this._state.uniformBuffer = v4(this.gl, null, t21, this._state.uniformBuffer);
  3863. break;
  3864. case A2.PIXEL_PACK_BUFFER:
  3865. this._state.pixelPackBuffer = v4(this.gl, null, t21, this._state.pixelPackBuffer);
  3866. break;
  3867. case A2.PIXEL_UNPACK_BUFFER:
  3868. this._state.pixelUnpackBuffer = v4(this.gl, null, t21, this._state.pixelUnpackBuffer);
  3869. break;
  3870. case A2.COPY_READ_BUFFER:
  3871. this._state.copyReadBuffer = v4(this.gl, null, t21, this._state.copyReadBuffer);
  3872. break;
  3873. case A2.COPY_WRITE_BUFFER:
  3874. this._state.copyWriteBuffer = v4(this.gl, null, t21, this._state.copyWriteBuffer);
  3875. }
  3876. }
  3877. bindVAO(t21 = null) {
  3878. t(t21) ? this._state.vertexArrayObject && (this._state.vertexArrayObject.unbind(), this._state.vertexArrayObject = null) : this._state.vertexArrayObject !== t21 && (t21.bind(), this._state.vertexArrayObject = t21);
  3879. }
  3880. async clientWaitAsync(t21 = n2(10)) {
  3881. const e19 = this.gl, s22 = e19.fenceSync(W.SYNC_GPU_COMMANDS_COMPLETE, 0);
  3882. let i15;
  3883. this.instanceCounter.increment(t2.Sync, s22), e19.flush();
  3884. do {
  3885. await L(t21), i15 = e19.clientWaitSync(s22, 0, 0);
  3886. } while (i15 === r6.TIMEOUT_EXPIRED);
  3887. if (this.instanceCounter.decrement(t2.Sync, s22), e19.deleteSync(s22), i15 === r6.WAIT_FAILED)
  3888. throw new Error("Client wait failed");
  3889. }
  3890. getBoundFramebufferObject(t21 = n5.FRAMEBUFFER) {
  3891. return t21 === n5.READ_FRAMEBUFFER ? this._state.readFramebuffer : this._state.drawFramebuffer;
  3892. }
  3893. getBoundVAO() {
  3894. return this._state.vertexArrayObject;
  3895. }
  3896. resetState() {
  3897. this.useProgram(null), this.bindVAO(null), this.bindFramebuffer(null, true), this.unbindBuffer(A2.ARRAY_BUFFER), this.unbindBuffer(A2.ELEMENT_ARRAY_BUFFER), n8(this.gl) && (this.unbindBuffer(A2.UNIFORM_BUFFER), this._state.uniformBufferBindingPoints.length = 0, this.unbindBuffer(A2.PIXEL_PACK_BUFFER), this.unbindBuffer(A2.PIXEL_UNPACK_BUFFER), this.unbindBuffer(A2.COPY_READ_BUFFER), this.unbindBuffer(A2.COPY_WRITE_BUFFER));
  3898. for (let t21 = 0; t21 < this.parameters.maxTextureImageUnits; ++t21)
  3899. this.bindTexture(null, t21);
  3900. this.setBlendingEnabled(false), this.setBlendFunction(R.ONE, R.ZERO), this.setBlendEquation(T.ADD), this.setBlendColor(0, 0, 0, 0), this.setFaceCullingEnabled(false), this.setCullFace(N.BACK), this.setFrontFace(S.CCW), this.setPolygonOffsetFillEnabled(false), this.setPolygonOffset(0, 0), this.setScissorTestEnabled(false), this.setScissorRect(0, 0, this.gl.canvas.width, this.gl.canvas.height), this.setDepthTestEnabled(false), this.setDepthFunction(I.LESS), this.setDepthRange(0, 1), this.setStencilTestEnabled(false), this.setStencilFunction(I.ALWAYS, 0, 0), this.setStencilOp(O2.KEEP, O2.KEEP, O2.KEEP), this.setClearColor(0, 0, 0, 0), this.setClearDepth(1), this.setClearStencil(0), this.setColorMask(true, true, true, true), this.setStencilWriteMask(4294967295), this.setDepthWriteEnabled(true), this.setViewport(0, 0, this.gl.canvas.width, this.gl.canvas.height);
  3901. }
  3902. enforceState() {
  3903. const t21 = this.gl, e19 = this.capabilities.vao;
  3904. e19 && e19.bindVertexArray(null);
  3905. for (let s22 = 0; s22 < this.parameters.maxVertexAttributes; s22++)
  3906. t21.disableVertexAttribArray(s22);
  3907. if (this._state.vertexBuffer ? t21.bindBuffer(this._state.vertexBuffer.bufferType, this._state.vertexBuffer.glName) : t21.bindBuffer(A2.ARRAY_BUFFER, null), this._state.indexBuffer ? t21.bindBuffer(this._state.indexBuffer.bufferType, this._state.indexBuffer.glName) : t21.bindBuffer(A2.ELEMENT_ARRAY_BUFFER, null), n8(t21)) {
  3908. this._state.uniformBuffer ? t21.bindBuffer(this._state.uniformBuffer.bufferType, this._state.uniformBuffer.glName) : t21.bindBuffer(A2.UNIFORM_BUFFER, null);
  3909. for (let e20 = 0; e20 < this._parameters.maxUniformBufferBindings; e20++) {
  3910. const i15 = this._state.uniformBufferBindingPoints[e20];
  3911. if (r(i15)) {
  3912. const { buffer: s22, offset: a16, size: r22 } = i15;
  3913. s22 !== null ? a16 === 0 && r22 === 0 ? t21.bindBufferBase(A2.UNIFORM_BUFFER, e20, s22.glName) : t21.bindBufferRange(A2.UNIFORM_BUFFER, e20, s22.glName, a16, r22) : t21.bindBufferBase(A2.UNIFORM_BUFFER, e20, null);
  3914. }
  3915. }
  3916. this._state.pixelPackBuffer ? t21.bindBuffer(this._state.pixelPackBuffer.bufferType, this._state.pixelPackBuffer.glName) : t21.bindBuffer(A2.PIXEL_PACK_BUFFER, null), this._state.pixelUnpackBuffer ? t21.bindBuffer(this._state.pixelUnpackBuffer.bufferType, this._state.pixelUnpackBuffer.glName) : t21.bindBuffer(A2.PIXEL_UNPACK_BUFFER, null), this._state.copyReadBuffer ? t21.bindBuffer(this._state.copyReadBuffer.bufferType, this._state.copyReadBuffer.glName) : t21.bindBuffer(A2.COPY_READ_BUFFER, null), this._state.copyWriteBuffer ? t21.bindBuffer(this._state.copyWriteBuffer.bufferType, this._state.copyWriteBuffer.glName) : t21.bindBuffer(A2.COPY_WRITE_BUFFER, null), t21.bindFramebuffer(n5.READ_FRAMEBUFFER, null), t21.readBuffer(t21.BACK), this._state.readFramebuffer && (t21.bindFramebuffer(n5.READ_FRAMEBUFFER, this._state.readFramebuffer.glName), t21.readBuffer(f3.COLOR_ATTACHMENT0)), t21.bindFramebuffer(n5.DRAW_FRAMEBUFFER, this._state.drawFramebuffer?.glName ?? null);
  3917. } else
  3918. this._state.readFramebuffer = this._state.drawFramebuffer, t21.bindFramebuffer(n5.FRAMEBUFFER, this._state.drawFramebuffer?.glName ?? null);
  3919. if (e19 && this._state.vertexArrayObject) {
  3920. const t22 = this._state.vertexArrayObject;
  3921. this._state.vertexArrayObject && (this._state.vertexArrayObject.unbind(), this._state.vertexArrayObject = null), this.bindVAO(t22);
  3922. }
  3923. t21.useProgram(this._state.program?.glName ?? null), t21.blendColor(this._state.blendColor.r, this._state.blendColor.g, this._state.blendColor.b, this._state.blendColor.a), t21.bindRenderbuffer(t21.RENDERBUFFER, this._state.renderbuffer ? this._state.renderbuffer.glName : null), this._state.blend === true ? t21.enable(this.gl.BLEND) : t21.disable(this.gl.BLEND), t21.blendEquationSeparate(this._state.blendEquation.mode, this._state.blendEquation.modeAlpha), t21.blendFuncSeparate(this._state.blendFunction.srcRGB, this._state.blendFunction.dstRGB, this._state.blendFunction.srcAlpha, this._state.blendFunction.dstAlpha), t21.clearColor(this._state.clearColor.r, this._state.clearColor.g, this._state.clearColor.b, this._state.clearColor.a), t21.clearDepth(this._state.clearDepth), t21.clearStencil(this._state.clearStencil), t21.colorMask(this._state.colorMask.r, this._state.colorMask.g, this._state.colorMask.b, this._state.colorMask.a), t21.cullFace(this._state.cullFace), t21.depthFunc(this._state.depthFunction), t21.depthRange(this._state.depthRange.zNear, this._state.depthRange.zFar), this._state.depthTest === true ? t21.enable(t21.DEPTH_TEST) : t21.disable(t21.DEPTH_TEST), t21.depthMask(this._state.depthWrite), t21.frontFace(this._state.frontFace), t21.lineWidth(1), this._state.faceCulling === true ? t21.enable(t21.CULL_FACE) : t21.disable(t21.CULL_FACE), t21.polygonOffset(this._state.polygonOffset[0], this._state.polygonOffset[1]), this._state.polygonOffsetFill === true ? t21.enable(t21.POLYGON_OFFSET_FILL) : t21.disable(t21.POLYGON_OFFSET_FILL), t21.scissor(this._state.scissorRect.x, this._state.scissorRect.y, this._state.scissorRect.width, this._state.scissorRect.height), this._state.scissorTest === true ? t21.enable(t21.SCISSOR_TEST) : t21.disable(t21.SCISSOR_TEST), t21.stencilFunc(this._state.stencilFunction.func, this._state.stencilFunction.ref, this._state.stencilFunction.mask), t21.stencilOpSeparate(this._state.stencilOperation.face, this._state.stencilOperation.fail, this._state.stencilOperation.zFail, this._state.stencilOperation.zPass), this._state.stencilTest === true ? t21.enable(t21.STENCIL_TEST) : t21.disable(t21.STENCIL_TEST), t21.stencilMask(this._state.stencilWriteMask);
  3924. for (let i15 = 0; i15 < this.parameters.maxTextureImageUnits; i15++) {
  3925. t21.activeTexture(X + i15), t21.bindTexture(M.TEXTURE_2D, null), t21.bindTexture(M.TEXTURE_CUBE_MAP, null), n8(t21) && (t21.bindTexture(M.TEXTURE_3D, null), t21.bindTexture(M.TEXTURE_2D_ARRAY, null));
  3926. const e20 = this._state.textureUnitMap[i15];
  3927. r(e20) && t21.bindTexture(e20.descriptor.target, e20.glName);
  3928. }
  3929. t21.activeTexture(X + this._state.activeTexture), t21.viewport(this._state.viewport.x, this._state.viewport.y, this._state.viewport.width, this._state.viewport.height), this.resetInfo();
  3930. }
  3931. _loadExtensions() {
  3932. this.type === o6.WEBGL1 && this.gl.getExtension("OES_element_index_uint"), this.gl.getExtension("KHR_parallel_shader_compile");
  3933. }
  3934. _loadParameters(t21) {
  3935. const e19 = this.capabilities.textureFilterAnisotropic, s22 = t21.maxAnisotropy ?? 1 / 0, i15 = n8(this.gl), a16 = this.gl, r22 = { versionString: this.gl.getParameter(this.gl.VERSION), maxVertexTextureImageUnits: this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), maxVertexAttributes: this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS), maxMaxAnisotropy: e19 ? Math.min(this.gl.getParameter(e19.MAX_TEXTURE_MAX_ANISOTROPY), s22) : 1, maxTextureImageUnits: this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS), maxTextureSize: this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE), maxUniformBufferBindings: i15 ? a16.getParameter(a16.MAX_UNIFORM_BUFFER_BINDINGS) : 0, maxVertexUniformBlocks: i15 ? a16.getParameter(a16.MAX_VERTEX_UNIFORM_BLOCKS) : 0, maxFragmentUniformBlocks: i15 ? a16.getParameter(a16.MAX_FRAGMENT_UNIFORM_BLOCKS) : 0, maxUniformBlockSize: i15 ? a16.getParameter(a16.MAX_UNIFORM_BLOCK_SIZE) : 0, uniformBufferOffsetAlignment: i15 ? a16.getParameter(a16.UNIFORM_BUFFER_OFFSET_ALIGNMENT) : 1, maxArrayTextureLayers: i15 ? a16.getParameter(a16.MAX_ARRAY_TEXTURE_LAYERS) : 1, maxSamples: i15 ? a16.getParameter(a16.MAX_SAMPLES) : 1 };
  3936. return u4.TEXTURE_UNIT_FOR_UPDATES = r22.maxTextureImageUnits - 1, r22;
  3937. }
  3938. };
  3939. function v4(t21, e19, s22, i15) {
  3940. return e19 ? i15 !== e19 && t21.bindBuffer(s22, e19.glName) : t21.bindBuffer(s22, null), e19;
  3941. }
  3942. function I6(t21, e19) {
  3943. switch (t21) {
  3944. case E.POINTS:
  3945. return 2 * e19;
  3946. case E.TRIANGLES:
  3947. return e19 / 3;
  3948. case E.TRIANGLE_STRIP:
  3949. case E.TRIANGLE_FAN:
  3950. return e19 - 2;
  3951. default:
  3952. return 0;
  3953. }
  3954. }
  3955. // node_modules/@arcgis/core/views/2d/engine/Stage.js
  3956. var x4 = 2e3;
  3957. var v5 = class extends s9 {
  3958. constructor(i15, n26) {
  3959. super(), this._trash = new Set(), this._renderRemainingTime = 0, this._lastFrameRenderTime = 0, this.renderRequested = false, this.stage = this, this._stationary = true;
  3960. const { canvas: o27 = document.createElement("canvas"), alpha: d14 = true, stencil: l17 = true, contextOptions: m14 = {} } = n26;
  3961. this._canvas = o27;
  3962. const g10 = n7("2d", o27, { alpha: d14, antialias: false, depth: true, stencil: l17 });
  3963. this.context = new y4(r(g10) ? g10 : null, m14), this.resourceManager = new s6(), this.painter = new D5(this.context, this, this.resourceManager), a("esri-2d-profiler") && (this._debugOutput = document.createElement("div"), this._debugOutput.setAttribute("style", "margin: 24px 64px; position: absolute; color: red;"), i15.appendChild(this._debugOutput)), this._renderParameters = { drawPhase: 0, state: this.state, pixelRatio: window.devicePixelRatio, stationary: false, globalOpacity: 1, blendMode: null, deltaTime: -1, time: 0, inFadeTransition: false, effects: null, context: this.context, painter: this.painter, timeline: n26.timeline || new e8(), renderingOptions: n26.renderingOptions, requestRender: () => this.requestRender(), requireFBO: false, profiler: new o20(this.context, this._debugOutput), dataUploadCounter: 0 }, this._taskHandle = A({ render: (e19) => this.renderFrame(e19) }), this._taskHandle.pause(), this._lostWebGLContextHandle = r3(o27, "webglcontextlost", () => {
  3964. this.emit("webgl-error", { error: new s3("webgl-context-lost") });
  3965. }), o27.setAttribute("style", "width: 100%; height:100%; display:block;"), i15.appendChild(o27);
  3966. }
  3967. destroy() {
  3968. this.removeAllChildren(), this._emptyTrash(), this._taskHandle.remove(), this._taskHandle = null, this._lostWebGLContextHandle && (this._lostWebGLContextHandle.remove(), this._lostWebGLContextHandle = null), this._canvas.parentNode && this._canvas.parentNode.removeChild(this._canvas), this._debugOutput && this._debugOutput.parentNode && this._debugOutput.parentNode.removeChild(this._debugOutput), this.highlightOptions = null, this.resourceManager.destroy(), this.painter.dispose(), this.context.dispose(), this._canvas = null;
  3969. }
  3970. get background() {
  3971. return this._background;
  3972. }
  3973. set background(e19) {
  3974. this._background = e19, this.requestRender();
  3975. }
  3976. get highlightOptions() {
  3977. return this._highlightOptions;
  3978. }
  3979. set highlightOptions(e19) {
  3980. this._highlightOptionsHandle && (this._highlightOptionsHandle.remove(), this._highlightOptionsHandle = null), this._highlightOptions = e19, this._highlightOptions && (this._highlightOptionsHandle = l(() => this._highlightOptions?.version, () => {
  3981. this.painter.setHighlightOptions(e19), this.requestRender();
  3982. }, h));
  3983. }
  3984. get renderingOptions() {
  3985. return this._renderingOptions;
  3986. }
  3987. set renderingOptions(e19) {
  3988. this._renderingOptions = e19, this.requestRender();
  3989. }
  3990. get state() {
  3991. return this._state;
  3992. }
  3993. set state(e19) {
  3994. this._state = e19, this.requestRender();
  3995. }
  3996. get stationary() {
  3997. return this._stationary;
  3998. }
  3999. set stationary(e19) {
  4000. this._stationary !== e19 && (this._stationary = e19, this.requestRender());
  4001. }
  4002. trashDisplayObject(e19) {
  4003. this._trash.add(e19), this.requestRender();
  4004. }
  4005. untrashDisplayObject(e19) {
  4006. return this._trash.delete(e19);
  4007. }
  4008. requestRender() {
  4009. this._renderRemainingTime = x4, this.renderRequested || (this.renderRequested = true, this.emit("will-render"), this._taskHandle.resume());
  4010. }
  4011. renderFrame(e19) {
  4012. const t21 = this._lastFrameRenderTime ? e19.time - this._lastFrameRenderTime : 0;
  4013. this._renderRemainingTime -= t21, this._renderRemainingTime <= 0 && this._taskHandle.pause(), this._lastFrameRenderTime = e19.time, this.renderRequested = false, this._renderParameters.state = this._state, this._renderParameters.stationary = this.stationary, this._renderParameters.pixelRatio = window.devicePixelRatio, this._renderParameters.globalOpacity = 1, this._renderParameters.time = e19.time, this._renderParameters.deltaTime = e19.deltaTime, this._renderParameters.effects = null, this.processRender(this._renderParameters), this._emptyTrash(), this.emit("post-render");
  4014. }
  4015. _createTransforms() {
  4016. return { dvs: e7() };
  4017. }
  4018. renderChildren(e19) {
  4019. for (const t21 of this.children)
  4020. t21.beforeRender(e19);
  4021. this._renderChildren(this.children, e19);
  4022. for (const t21 of this.children)
  4023. t21.afterRender(e19);
  4024. }
  4025. _renderChildren(e19, t21) {
  4026. const s22 = this.context;
  4027. s22.resetInfo(), t21.profiler.recordStart("drawLayers"), t21.dataUploadCounter = 0, t21.drawPhase = I3.MAP, this.painter.beforeRenderLayers(s22, this.background);
  4028. for (const r22 of e19)
  4029. r22.processRender(t21);
  4030. this.painter.prepareDisplay(t21, this.background, this.state.padding), this.painter.renderLayers(s22), t21.drawPhase = I3.HIGHLIGHT, this.painter.beforeRenderLayers(s22);
  4031. for (const r22 of e19)
  4032. r22.processRender(t21);
  4033. this.painter.renderLayers(s22);
  4034. if (this._isLabelDrawPhaseRequired(e19)) {
  4035. t21.drawPhase = I3.LABEL, this.painter.beforeRenderLayers(s22);
  4036. for (const r22 of e19)
  4037. r22.processRender(t21);
  4038. this.painter.renderLayers(s22);
  4039. }
  4040. if (a("esri-tiles-debug")) {
  4041. t21.drawPhase = I3.DEBUG, this.painter.beforeRenderLayers(s22);
  4042. for (const r22 of e19)
  4043. r22.processRender(t21);
  4044. this.painter.renderLayers(s22);
  4045. }
  4046. t21.profiler.recordEnd("drawLayers"), s22.logInfo();
  4047. }
  4048. doRender(e19) {
  4049. const t21 = this.context, { state: r22, pixelRatio: s22 } = e19;
  4050. this._resizeCanvas(e19), t21.setViewport(0, 0, s22 * r22.size[0], s22 * r22.size[1]), t21.setDepthWriteEnabled(true), t21.setStencilWriteMask(255), super.doRender(e19);
  4051. }
  4052. async takeScreenshot(e19) {
  4053. const { framebufferWidth: t21, framebufferHeight: r22 } = { framebufferWidth: Math.round(this.state.size[0] * e19.resolutionScale), framebufferHeight: Math.round(this.state.size[1] * e19.resolutionScale) }, s22 = 1, i15 = this.context, n26 = this._state.clone();
  4054. if (e19.rotation != null) {
  4055. const t22 = n26.viewpoint;
  4056. n26.viewpoint.rotation = e19.rotation, n26.viewpoint = t22;
  4057. }
  4058. const a16 = { ...this._renderParameters, drawPhase: null, globalOpacity: 1, stationary: true, state: n26, pixelRatio: s22, time: performance.now(), deltaTime: 0, blendMode: null, effects: null, inFadeTransition: false }, o27 = new D2(i15, { colorTarget: Y.TEXTURE, depthStencilTarget: V.DEPTH_STENCIL_RENDER_BUFFER, width: t21, height: r22 }), h15 = i15.getBoundFramebufferObject(), d14 = i15.getViewport();
  4059. i15.bindFramebuffer(o27), i15.setViewport(0, 0, t21, r22), this._renderChildren(e19.children, a16);
  4060. const l17 = this._readbackScreenshot(o27, { ...e19.cropArea, y: r22 - (e19.cropArea.y + e19.cropArea.height) });
  4061. i15.bindFramebuffer(h15), i15.setViewport(d14.x, d14.y, d14.width, d14.height), this.requestRender();
  4062. const p9 = await l17;
  4063. let c18;
  4064. return e19.outputScale === 1 ? c18 = p9 : (c18 = new ImageData(Math.round(p9.width * e19.outputScale), Math.round(p9.height * e19.outputScale)), p(p9, c18, true)), c18;
  4065. }
  4066. async _readbackScreenshot(e19, t21) {
  4067. const r22 = m3(t21.width, t21.height, document.createElement("canvas"));
  4068. return await e19.readPixelsAsync(t21.x, t21.y, t21.width, t21.height, P.RGBA, G.UNSIGNED_BYTE, new Uint8Array(r22.data.buffer)), r22;
  4069. }
  4070. _resizeCanvas(e19) {
  4071. const t21 = this._canvas, r22 = t21.style, { state: { size: s22 }, pixelRatio: i15 } = e19, n26 = s22[0], a16 = s22[1], o27 = Math.round(n26 * i15), h15 = Math.round(a16 * i15);
  4072. t21.width === o27 && t21.height === h15 || (t21.width = o27, t21.height = h15), r22.width = n26 + "px", r22.height = a16 + "px";
  4073. }
  4074. _emptyTrash() {
  4075. for (; this._trash.size > 0; ) {
  4076. const e19 = Array.from(this._trash);
  4077. this._trash.clear();
  4078. for (const t21 of e19)
  4079. t21.processDetach();
  4080. }
  4081. }
  4082. _isLabelDrawPhaseRequired(e19) {
  4083. let t21 = false;
  4084. for (const r22 of e19) {
  4085. if (!(r22 instanceof s9)) {
  4086. t21 = t21 || false;
  4087. break;
  4088. }
  4089. if (r22.hasLabels)
  4090. return true;
  4091. t21 = t21 || this._isLabelDrawPhaseRequired(r22.children);
  4092. }
  4093. return t21;
  4094. }
  4095. };
  4096. // node_modules/@arcgis/core/views/2d/engine/webgl/collisions/CollisionGrid.js
  4097. var i13 = 2;
  4098. var o25 = 1;
  4099. var h10 = 0;
  4100. var r19 = 1;
  4101. var n23 = 2;
  4102. var c14 = class {
  4103. constructor(t21, s22) {
  4104. this.width = t21, this.height = s22;
  4105. const i15 = Math.ceil(t21 / o25), h15 = Math.ceil(s22 / o25);
  4106. this._cols = i15, this._rows = h15, this._cells = t7.create(i15 * h15);
  4107. }
  4108. insertMetrics(t21) {
  4109. const s22 = this._hasCollision(t21);
  4110. return s22 === h10 && this._markMetrics(t21), s22;
  4111. }
  4112. getCellId(t21, s22) {
  4113. return t21 + s22 * this._cols;
  4114. }
  4115. has(t21) {
  4116. return this._cells.has(t21);
  4117. }
  4118. hasRange(t21, s22) {
  4119. return this._cells.hasRange(t21, s22);
  4120. }
  4121. set(t21) {
  4122. this._cells.set(t21);
  4123. }
  4124. setRange(t21, s22) {
  4125. this._cells.setRange(t21, s22);
  4126. }
  4127. _hasCollision(t21) {
  4128. const s22 = t21.id;
  4129. let e19 = 0, o27 = 0;
  4130. t21.save();
  4131. do {
  4132. const s23 = t21.boundsCount;
  4133. e19 += s23;
  4134. for (let e20 = 0; e20 < s23; e20++) {
  4135. const s24 = t21.boundsComputedAnchorX(e20), h15 = t21.boundsComputedAnchorY(e20), c18 = t21.boundsWidth(e20) + i13, l17 = t21.boundsHeight(e20) + i13;
  4136. switch (this._collide(s24, h15, c18, l17)) {
  4137. case n23:
  4138. return n23;
  4139. case r19:
  4140. o27++;
  4141. }
  4142. }
  4143. } while (t21.peekId() === s22 && t21.next());
  4144. return t21.restore(), e19 === o27 ? r19 : h10;
  4145. }
  4146. _collide(s22, e19, i15, c18) {
  4147. const l17 = s22 - i15 / 2, _13 = e19 - c18 / 2, a16 = l17 + i15, u15 = _13 + c18;
  4148. if (a16 < 0 || u15 < 0 || l17 > this.width || _13 > this.height)
  4149. return r19;
  4150. const d14 = o4(Math.floor(l17 / o25), 0, this._cols), g10 = o4(Math.floor(_13 / o25), 0, this._rows), f14 = o4(Math.ceil(a16 / o25), 0, this._cols), m14 = o4(Math.ceil(u15 / o25), 0, this._rows);
  4151. for (let t21 = g10; t21 <= m14; t21++)
  4152. for (let s23 = d14; s23 <= f14; s23++) {
  4153. const e20 = this.getCellId(s23, t21);
  4154. if (this.has(e20))
  4155. return n23;
  4156. }
  4157. return h10;
  4158. }
  4159. _mark(s22, e19, i15, h15) {
  4160. const r22 = s22 - i15 / 2, n26 = e19 - h15 / 2, c18 = r22 + i15, l17 = n26 + h15, _13 = o4(Math.floor(r22 / o25), 0, this._cols), a16 = o4(Math.floor(n26 / o25), 0, this._rows), u15 = o4(Math.ceil(c18 / o25), 0, this._cols), d14 = o4(Math.ceil(l17 / o25), 0, this._rows);
  4161. for (let t21 = a16; t21 <= d14; t21++)
  4162. for (let s23 = _13; s23 <= u15; s23++) {
  4163. const e20 = this.getCellId(s23, t21);
  4164. this.set(e20);
  4165. }
  4166. return false;
  4167. }
  4168. _markMetrics(t21) {
  4169. const s22 = t21.id;
  4170. do {
  4171. const s23 = t21.boundsCount;
  4172. for (let e19 = 0; e19 < s23; e19++) {
  4173. const s24 = t21.boundsComputedAnchorX(e19), o27 = t21.boundsComputedAnchorY(e19), h15 = t21.boundsWidth(e19) + i13, r22 = t21.boundsHeight(e19) + i13;
  4174. this._mark(s24, o27, h15, r22);
  4175. }
  4176. } while (t21.peekId() === s22 && t21.next());
  4177. }
  4178. };
  4179. // node_modules/@arcgis/core/views/2d/engine/webgl/collisions/visualVariableSimpleUtils.js
  4180. var r20 = Math.PI;
  4181. function a12(e19, t21) {
  4182. switch (t21.transformationType) {
  4183. case i2.Additive:
  4184. return s18(e19, t21);
  4185. case i2.Constant:
  4186. return u12(t21, e19);
  4187. case i2.ClampedLinear:
  4188. return o26(e19, t21);
  4189. case i2.Proportional:
  4190. return l14(e19, t21);
  4191. case i2.Stops:
  4192. return c15(e19, t21);
  4193. case i2.RealWorldSize:
  4194. return m12(e19, t21);
  4195. case i2.Identity:
  4196. return e19;
  4197. case i2.Unknown:
  4198. return null;
  4199. }
  4200. }
  4201. function i14(e19, t21) {
  4202. return typeof e19 == "number" ? e19 : a12(t21, e19);
  4203. }
  4204. function s18(e19, t21) {
  4205. return e19 + (i14(t21.minSize, e19) || t21.minDataValue);
  4206. }
  4207. function u12(e19, t21) {
  4208. const n26 = e19.stops;
  4209. let r22 = n26 && n26.length && n26[0].size;
  4210. return r22 == null && (r22 = e19.minSize), i14(r22, t21);
  4211. }
  4212. function o26(e19, t21) {
  4213. const n26 = (e19 - t21.minDataValue) / (t21.maxDataValue - t21.minDataValue), r22 = i14(t21.minSize, e19), a16 = i14(t21.maxSize, e19);
  4214. return e19 <= t21.minDataValue ? r22 : e19 >= t21.maxDataValue ? a16 : r22 + n26 * (a16 - r22);
  4215. }
  4216. function l14(t21, n26) {
  4217. const r22 = t21 / n26.minDataValue, a16 = i14(n26.minSize, t21), s22 = i14(n26.maxSize, t21);
  4218. let u15 = null;
  4219. return u15 = r22 * a16, o4(u15, a16, s22);
  4220. }
  4221. function c15(e19, t21) {
  4222. const [n26, r22, a16] = p6(e19, t21.cache.ipData);
  4223. if (n26 === r22)
  4224. return i14(t21.stops[n26].size, e19);
  4225. {
  4226. const s22 = i14(t21.stops[n26].size, e19);
  4227. return s22 + (i14(t21.stops[r22].size, e19) - s22) * a16;
  4228. }
  4229. }
  4230. function m12(n26, a16) {
  4231. const s22 = m2[a16.valueUnit], u15 = i14(a16.minSize, n26), o27 = i14(a16.maxSize, n26), { valueRepresentation: l17 } = a16;
  4232. let c18 = null;
  4233. return c18 = l17 === "area" ? 2 * Math.sqrt(n26 / r20) / s22 : l17 === "radius" || l17 === "distance" ? 2 * n26 / s22 : n26 / s22, o4(c18, u15, o27);
  4234. }
  4235. function p6(e19, t21) {
  4236. if (!t21)
  4237. return;
  4238. let n26 = 0, r22 = t21.length - 1;
  4239. return t21.some((t22, a16) => e19 < t22 ? (r22 = a16, true) : (n26 = a16, false)), [n26, r22, (e19 - t21[n26]) / (t21[r22] - t21[n26])];
  4240. }
  4241. // node_modules/@arcgis/core/views/2d/engine/webgl/collisions/CollisionEngine.js
  4242. var c16 = 254;
  4243. var u13 = 255;
  4244. var f13 = 0;
  4245. function b4(e19, i15) {
  4246. const o27 = [];
  4247. e19.forEachTile((e20) => o27.push(e20)), o27.sort((e20, t21) => e20.instanceId - t21.instanceId), o27.forEach((e20) => {
  4248. r(e20.labelMetrics) && e20.isReady && i15(e20, e20.labelMetrics.getCursor());
  4249. });
  4250. }
  4251. function p7(e19) {
  4252. return e19.layer && (e19.layer.type === "feature" || e19.layer.type === "csv" || e19.layer.type === "geojson" || e19.layer.type === "ogc-feature" || e19.layer.type === "stream" || e19.layer.type === "subtype-group" || e19.layer.type === "wfs");
  4253. }
  4254. function y5(e19) {
  4255. return (t21) => u2(a12(t21, e19));
  4256. }
  4257. function m13(e19) {
  4258. const t21 = "visualVariables" in e19 && e19.visualVariables;
  4259. if (!t21)
  4260. return null;
  4261. for (const i15 of t21)
  4262. if (i15.type === "size")
  4263. return y5(i15);
  4264. return null;
  4265. }
  4266. function h11(e19) {
  4267. for (const t21 of e19) {
  4268. const e20 = "featureReduction" in t21 && t21.featureReduction && "labelingInfo" in t21.featureReduction && t21.featureReduction, i15 = [...t21.labelingInfo || [], ...e20?.labelingInfo || []];
  4269. if (!t21.labelsVisible || !i15.length)
  4270. continue;
  4271. if (i15.some((e21) => e21.deconflictionStrategy === "none"))
  4272. return true;
  4273. }
  4274. return false;
  4275. }
  4276. function M5(t21, i15) {
  4277. if (!p7(i15))
  4278. return;
  4279. const o27 = i15.layer.type === "subtype-group" ? i15.layer.sublayers.items : [i15.layer], r22 = i15.layer.geometryType, n26 = !h11(o27), s22 = {};
  4280. if (i15.layer.type !== "subtype-group") {
  4281. if (i15.tileRenderer?.type === "heatmap")
  4282. return;
  4283. const e19 = m13(i15.layer.renderer);
  4284. s22[0] = e19;
  4285. }
  4286. const a16 = i15.tileRenderer;
  4287. if (t(a16))
  4288. return;
  4289. const l17 = i15.layer.visible && !i15.suspended;
  4290. t21.push({ tileRenderer: a16, vvEvaluators: s22, deconflictionEnabled: n26, geometryType: r22, visible: l17 });
  4291. }
  4292. var g8 = class {
  4293. run(e19, t21, i15) {
  4294. const o27 = [];
  4295. for (let r22 = e19.length - 1; r22 >= 0; r22--) {
  4296. M5(o27, e19[r22]);
  4297. }
  4298. this._transformMetrics(o27, t21), this._runCollision(o27, t21, i15);
  4299. }
  4300. _runCollision(e19, t21, i15) {
  4301. const [o27, r22] = t21.state.size, s22 = new c14(o27 * t21.pixelRatio, r22 * t21.pixelRatio);
  4302. for (const { tileRenderer: n26, deconflictionEnabled: a16, visible: l17 } of e19) {
  4303. const e20 = n26.featuresView.attributeView;
  4304. a16 ? l17 ? (this._prepare(n26), this._collideVisible(s22, n26, i15), this._collideInvisible(s22, n26)) : b4(n26, (t22, i16) => {
  4305. for (; i16.nextId(); )
  4306. e20.setLabelMinZoom(i16.id, u13);
  4307. }) : b4(n26, (t22, i16) => {
  4308. for (; i16.nextId(); )
  4309. e20.setLabelMinZoom(i16.id, f13);
  4310. });
  4311. }
  4312. }
  4313. _isFiltered(t21, i15, n26) {
  4314. const s22 = i15.getFilterFlags(t21), a16 = !n26.hasFilter || !!(s22 & U3), l17 = t(n26.featureEffect) || n26.featureEffect.excludedLabelsVisible || !!(s22 & V2);
  4315. return !(a16 && l17);
  4316. }
  4317. _prepare(e19) {
  4318. const t21 = e19.featuresView.attributeView, i15 = new Set();
  4319. b4(e19, (o27, r22) => {
  4320. for (; r22.nextId(); ) {
  4321. if (i15.has(r22.id))
  4322. continue;
  4323. if (i15.add(r22.id), this._isFiltered(r22.id, t21, e19.layerView)) {
  4324. t21.setLabelMinZoom(r22.id, c16);
  4325. continue;
  4326. }
  4327. t21.getLabelMinZoom(r22.id) !== f13 ? t21.setLabelMinZoom(r22.id, u13) : t21.setLabelMinZoom(r22.id, f13);
  4328. }
  4329. });
  4330. }
  4331. _collideVisible(e19, t21, i15) {
  4332. const o27 = t21.featuresView.attributeView, r22 = new Set();
  4333. b4(t21, (t22, n26) => {
  4334. for (; n26.nextId(); )
  4335. if (!r22.has(n26.id))
  4336. if (t22.key.level === i15) {
  4337. if (o27.getLabelMinZoom(n26.id) === 0) {
  4338. switch (e19.insertMetrics(n26)) {
  4339. case r19:
  4340. break;
  4341. case n23:
  4342. o27.setLabelMinZoom(n26.id, c16), r22.add(n26.id);
  4343. break;
  4344. case h10:
  4345. o27.setLabelMinZoom(n26.id, f13), r22.add(n26.id);
  4346. }
  4347. }
  4348. } else
  4349. o27.setLabelMinZoom(n26.id, c16);
  4350. });
  4351. }
  4352. _collideInvisible(e19, t21) {
  4353. const i15 = t21.featuresView.attributeView, o27 = new Set();
  4354. b4(t21, (t22, r22) => {
  4355. for (; r22.nextId(); )
  4356. if (!o27.has(r22.id) && i15.getLabelMinZoom(r22.id) === u13) {
  4357. switch (e19.insertMetrics(r22)) {
  4358. case r19:
  4359. break;
  4360. case n23:
  4361. i15.setLabelMinZoom(r22.id, u13), o27.add(r22.id);
  4362. break;
  4363. case h10:
  4364. i15.setLabelMinZoom(r22.id, f13), o27.add(r22.id);
  4365. }
  4366. }
  4367. });
  4368. }
  4369. _transformMetrics(e19, i15) {
  4370. for (const { tileRenderer: o27, geometryType: r22, vvEvaluators: n26 } of e19)
  4371. b4(o27, (e20, s22) => {
  4372. const a16 = o27.featuresView.attributeView, l17 = e20.transforms.labelMat2d;
  4373. l17[4] = Math.round(l17[4]), l17[5] = Math.round(l17[5]);
  4374. const d14 = l17[4], c18 = l17[5], u15 = r22 === "polyline";
  4375. for (; s22.next(); ) {
  4376. const e21 = s22.boundsCount, o28 = s22.anchorX, r23 = s22.anchorY;
  4377. let f14 = s22.size;
  4378. const b5 = n26[0];
  4379. if (r(b5)) {
  4380. const e22 = b5(a16.getVVSize(s22.id));
  4381. f14 = isNaN(e22) || e22 == null || e22 === 1 / 0 ? f14 : e22;
  4382. }
  4383. const p9 = s22.directionX * (f14 / 2), y6 = s22.directionY * (f14 / 2);
  4384. for (let t21 = 0; t21 < e21; t21++) {
  4385. let e22 = o28, n27 = s22.anchorY;
  4386. if (u15) {
  4387. let o29 = e22 + s22.boundsX(t21) + p9, r24 = n27 + s22.boundsY(t21) + y6;
  4388. i15.state.rotation ? (o29 = l17[0] * o29 + l17[2] * r24 + l17[4], r24 = l17[1] * o29 + l17[3] * r24 + l17[5]) : (o29 += d14, r24 += c18), s22.setBoundsComputedAnchorX(t21, Math.floor(o29)), s22.setBoundsComputedAnchorY(t21, Math.floor(r24));
  4389. } else {
  4390. i15.state.rotation ? (e22 = l17[0] * o28 + l17[2] * r23 + l17[4], n27 = l17[1] * o28 + l17[3] * r23 + l17[5]) : (e22 += d14, n27 += c18);
  4391. const a17 = e22 + s22.boundsX(t21) + p9, u16 = n27 + s22.boundsY(t21) + y6;
  4392. s22.setBoundsComputedAnchorX(t21, a17), s22.setBoundsComputedAnchorY(t21, u16);
  4393. }
  4394. }
  4395. }
  4396. });
  4397. }
  4398. };
  4399. // node_modules/@arcgis/core/views/2d/LabelManager.js
  4400. var p8 = 32;
  4401. s2.getLogger("esri.views.2d.layers.labels.LabelManager");
  4402. var d9 = class extends a4(y) {
  4403. constructor(e19) {
  4404. super(e19), this._applyVisibilityPassThrottled = e4(this._applyVisibilityPass, p8, this), this.lastUpdateId = -1, this.updateRequested = false, this.view = null;
  4405. }
  4406. initialize() {
  4407. this.collisionEngine = new g8();
  4408. }
  4409. destroy() {
  4410. this.collisionEngine = null, this._applyVisibilityPassThrottled.remove(), this._applyVisibilityPassThrottled = null;
  4411. }
  4412. get updating() {
  4413. return this.updateRequested;
  4414. }
  4415. update(e19) {
  4416. this._applyVisibilityPassThrottled(e19);
  4417. }
  4418. viewChange() {
  4419. this.requestUpdate();
  4420. }
  4421. requestUpdate() {
  4422. this.updateRequested || (this.updateRequested = true, this.view.requestUpdate());
  4423. }
  4424. processUpdate(e19) {
  4425. this._set("updateParameters", e19), this.updateRequested && (this.updateRequested = false, this.update(e19));
  4426. }
  4427. _applyVisibilityPass(e19) {
  4428. try {
  4429. const t21 = this.view.featuresTilingScheme.getClosestInfoForScale(e19.state.scale).level;
  4430. this.collisionEngine.run(this.view.allLayerViews.items, e19, t21);
  4431. } catch (t21) {
  4432. }
  4433. }
  4434. };
  4435. e([d()], d9.prototype, "updateRequested", void 0), e([d({ readOnly: true })], d9.prototype, "updateParameters", void 0), e([d()], d9.prototype, "updating", null), e([d()], d9.prototype, "view", void 0), d9 = e([n("esri.views.2d.layers.labels.LabelManager")], d9);
  4436. var n24 = d9;
  4437. // node_modules/@arcgis/core/views/2d/navigation/ZoomBox.js
  4438. var a13 = { container: "esri-zoom-box__container", overlay: "esri-zoom-box__overlay", background: "esri-zoom-box__overlay-background", box: "esri-zoom-box__outline" };
  4439. var n25 = { zoom: "Shift", counter: "Ctrl" };
  4440. var h12 = class extends y {
  4441. constructor(t21) {
  4442. super(t21), this._container = null, this._overlay = null, this._backgroundShape = null, this._boxShape = null, this._box = { x: 0, y: 0, width: 0, height: 0 }, this._redraw = this._redraw.bind(this);
  4443. }
  4444. destroy() {
  4445. this.view = null;
  4446. }
  4447. set view(t21) {
  4448. this._handles && this._handles.forEach((t22) => {
  4449. t22.remove();
  4450. }), this._handles = null, this._destroyOverlay(), this._set("view", t21), t21 && (t21.on("drag", [n25.zoom], (t22) => this._handleDrag(t22, 1), g2.INTERNAL), t21.on("drag", [n25.zoom, n25.counter], (t22) => this._handleDrag(t22, -1), g2.INTERNAL));
  4451. }
  4452. _start() {
  4453. this._createContainer(), this._createOverlay(), this.navigation.begin();
  4454. }
  4455. _update(t21, e19, r22, i15) {
  4456. this._box.x = t21, this._box.y = e19, this._box.width = r22, this._box.height = i15, this._rafId || (this._rafId = requestAnimationFrame(this._redraw));
  4457. }
  4458. _end(t21, e19, i15, o27, s22) {
  4459. const a16 = this.view, n26 = a16.toMap(c2(t21 + 0.5 * i15, e19 + 0.5 * o27));
  4460. let h15 = Math.max(i15 / a16.width, o27 / a16.height);
  4461. s22 === -1 && (h15 = 1 / h15), this._destroyOverlay(), this.navigation.end(), a16.goTo({ center: n26, scale: a16.scale * h15 });
  4462. }
  4463. _updateBox(t21, e19, r22, i15) {
  4464. const o27 = this._boxShape;
  4465. o27.setAttributeNS(null, "x", "" + t21), o27.setAttributeNS(null, "y", "" + e19), o27.setAttributeNS(null, "width", "" + r22), o27.setAttributeNS(null, "height", "" + i15), o27.setAttributeNS(null, "class", a13.box);
  4466. }
  4467. _updateBackground(t21, e19, r22, i15) {
  4468. this._backgroundShape.setAttributeNS(null, "d", this._toSVGPath(t21, e19, r22, i15, this.view.width, this.view.height));
  4469. }
  4470. _createContainer() {
  4471. const t21 = document.createElement("div");
  4472. t21.className = a13.container, this.view.root.appendChild(t21), this._container = t21;
  4473. }
  4474. _createOverlay() {
  4475. const t21 = this.view.width, e19 = this.view.height, r22 = document.createElementNS("http://www.w3.org/2000/svg", "path");
  4476. r22.setAttributeNS(null, "d", "M 0 0 L " + t21 + " 0 L " + t21 + " " + e19 + " L 0 " + e19 + " Z"), r22.setAttributeNS(null, "class", a13.background);
  4477. const i15 = document.createElementNS("http://www.w3.org/2000/svg", "rect"), o27 = document.createElementNS("http://www.w3.org/2000/svg", "svg");
  4478. o27.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"), o27.setAttributeNS(null, "class", a13.overlay), o27.appendChild(r22), o27.appendChild(i15), this._container.appendChild(o27), this._backgroundShape = r22, this._boxShape = i15, this._overlay = o27;
  4479. }
  4480. _destroyOverlay() {
  4481. this._container && this._container.parentNode && this._container.parentNode.removeChild(this._container), this._container = this._backgroundShape = this._boxShape = this._overlay = null;
  4482. }
  4483. _toSVGPath(t21, e19, r22, i15, o27, s22) {
  4484. const a16 = t21 + r22, n26 = e19 + i15;
  4485. return "M 0 0 L " + o27 + " 0 L " + o27 + " " + s22 + " L 0 " + s22 + " ZM " + t21 + " " + e19 + " L " + t21 + " " + n26 + " L " + a16 + " " + n26 + " L " + a16 + " " + e19 + " Z";
  4486. }
  4487. _handleDrag(t21, e19) {
  4488. const r22 = t21.x, i15 = t21.y, o27 = t21.origin.x, s22 = t21.origin.y;
  4489. let a16, n26, h15, l17;
  4490. switch (r22 > o27 ? (a16 = o27, h15 = r22 - o27) : (a16 = r22, h15 = o27 - r22), i15 > s22 ? (n26 = s22, l17 = i15 - s22) : (n26 = i15, l17 = s22 - i15), t21.action) {
  4491. case "start":
  4492. this._start();
  4493. break;
  4494. case "update":
  4495. this._update(a16, n26, h15, l17);
  4496. break;
  4497. case "end":
  4498. this._end(a16, n26, h15, l17, e19);
  4499. }
  4500. t21.stopPropagation();
  4501. }
  4502. _redraw() {
  4503. if (!this._rafId)
  4504. return;
  4505. if (this._rafId = null, !this._overlay)
  4506. return;
  4507. const { x: t21, y: e19, width: r22, height: i15 } = this._box;
  4508. this._updateBox(t21, e19, r22, i15), this._updateBackground(t21, e19, r22, i15), this._rafId = requestAnimationFrame(this._redraw);
  4509. }
  4510. };
  4511. e([d()], h12.prototype, "navigation", void 0), e([d()], h12.prototype, "view", null), h12 = e([n("esri.views.2d.navigation.ZoomBox")], h12);
  4512. var l15 = h12;
  4513. // node_modules/@arcgis/core/views/navigation/FilteredFiniteDifference.js
  4514. var t18 = class {
  4515. constructor(t21) {
  4516. this.gain = t21;
  4517. }
  4518. update(t21) {
  4519. if (this.hasLastValue) {
  4520. const e19 = this.computeDelta(t21);
  4521. this._updateDelta(e19);
  4522. }
  4523. this.lastValue = t21;
  4524. }
  4525. reset() {
  4526. this.lastValue = void 0, this.filteredDelta = void 0;
  4527. }
  4528. get hasLastValue() {
  4529. return this.lastValue !== void 0;
  4530. }
  4531. get hasFilteredDelta() {
  4532. return this.filteredDelta !== void 0;
  4533. }
  4534. computeDelta(t21) {
  4535. return t21 - this.lastValue;
  4536. }
  4537. _updateDelta(t21) {
  4538. this.hasFilteredDelta ? this.filteredDelta = (1 - this.gain) * this.filteredDelta + this.gain * t21 : this.filteredDelta = t21;
  4539. }
  4540. };
  4541. // node_modules/@arcgis/core/views/navigation/Momentum.js
  4542. var t19 = class {
  4543. constructor(t21, i15, o27) {
  4544. this._initialVelocity = t21, this._stopVelocity = i15, this._friction = o27, this._duration = Math.abs(Math.log(Math.abs(this._initialVelocity) / this._stopVelocity) / Math.log(1 - this._friction));
  4545. }
  4546. get duration() {
  4547. return this._duration;
  4548. }
  4549. isFinished(t21) {
  4550. return t21 > this.duration;
  4551. }
  4552. get friction() {
  4553. return this._friction;
  4554. }
  4555. value(t21) {
  4556. return this.valueFromInitialVelocity(this._initialVelocity, t21);
  4557. }
  4558. valueDelta(t21, i15) {
  4559. const o27 = this.value(t21);
  4560. return this.value(t21 + i15) - o27;
  4561. }
  4562. valueFromInitialVelocity(t21, i15) {
  4563. i15 = Math.min(i15, this.duration);
  4564. const o27 = 1 - this.friction;
  4565. return t21 * (o27 ** i15 - 1) / Math.log(o27);
  4566. }
  4567. };
  4568. // node_modules/@arcgis/core/views/navigation/PanPlanarMomentumEstimator.js
  4569. var c17 = class extends t19 {
  4570. constructor(e19, t21, i15, s22, n26) {
  4571. super(e19, t21, i15), this.sceneVelocity = s22, this.direction = n26;
  4572. }
  4573. value(e19) {
  4574. return super.valueFromInitialVelocity(this.sceneVelocity, e19);
  4575. }
  4576. };
  4577. var h13 = class {
  4578. constructor(e19 = 300, t21 = 12, i15 = 0.84) {
  4579. this.minimumInitialVelocity = e19, this.stopVelocity = t21, this.friction = i15, this.enabled = true, this.time = new t18(0.6), this.screen = [new t18(0.4), new t18(0.4)], this.scene = [new t18(0.6), new t18(0.6), new t18(0.6)], this.tmpDirection = n4();
  4580. }
  4581. add(e19, t21, i15) {
  4582. if (this.enabled) {
  4583. if (this.time.hasLastValue) {
  4584. if (this.time.computeDelta(i15) < 0.015)
  4585. return;
  4586. }
  4587. this.screen[0].update(e19[0]), this.screen[1].update(e19[1]), this.scene[0].update(t21[0]), this.scene[1].update(t21[1]), this.scene[2].update(t21[2]), this.time.update(i15);
  4588. }
  4589. }
  4590. reset() {
  4591. this.screen[0].reset(), this.screen[1].reset(), this.scene[0].reset(), this.scene[1].reset(), this.scene[2].reset(), this.time.reset();
  4592. }
  4593. evaluateMomentum() {
  4594. if (!this.enabled || !this.screen[0].hasFilteredDelta)
  4595. return null;
  4596. const e19 = this.screen[0].filteredDelta, t21 = this.screen[1].filteredDelta, i15 = Math.sqrt(e19 * e19 + t21 * t21) / this.time.filteredDelta;
  4597. return Math.abs(i15) < this.minimumInitialVelocity ? null : this.createMomentum(i15, this.stopVelocity, this.friction);
  4598. }
  4599. createMomentum(s22, n26, r22) {
  4600. o3(this.tmpDirection, this.scene[0].filteredDelta, this.scene[1].filteredDelta, this.scene[2].filteredDelta);
  4601. const h15 = s4(this.tmpDirection);
  4602. h15 > 0 && q(this.tmpDirection, this.tmpDirection, 1 / h15);
  4603. const l17 = h15 / this.time.filteredDelta;
  4604. return new c17(s22, n26, r22, l17, this.tmpDirection);
  4605. }
  4606. };
  4607. // node_modules/@arcgis/core/views/2d/navigation/actions/Pan.js
  4608. var d10 = class extends y {
  4609. constructor(t21) {
  4610. super(t21), this.animationTime = 0, this.momentumEstimator = new h13(500, 6, 0.92), this.momentum = null, this.tmpMomentum = n4(), this.momentumFinished = false, this.viewpoint = new u5({ targetGeometry: new j(), scale: 0, rotation: 0 }), f2(() => this.momentumFinished, () => this.navigation.stop());
  4611. }
  4612. begin(t21, i15) {
  4613. this.navigation.begin(), this.momentumEstimator.reset(), this.addToEstimator(i15), this.previousDrag = i15;
  4614. }
  4615. update(t21, i15) {
  4616. this.addToEstimator(i15);
  4617. let o27 = i15.center.x, m14 = i15.center.y;
  4618. const s22 = this.previousDrag;
  4619. o27 = s22 ? s22.center.x - o27 : -o27, m14 = s22 ? m14 - s22.center.y : m14, t21.viewpoint = St(this.viewpoint, t21.viewpoint, [o27 || 0, m14 || 0]), this.previousDrag = i15;
  4620. }
  4621. end(t21, i15) {
  4622. this.addToEstimator(i15);
  4623. const o27 = t21.navigation.momentumEnabled;
  4624. this.momentum = o27 ? this.momentumEstimator.evaluateMomentum() : null, this.animationTime = 0, this.momentum && this.onAnimationUpdate(t21), this.previousDrag = null, this.navigation.end();
  4625. }
  4626. addToEstimator(t21) {
  4627. const i15 = t21.center.x, o27 = t21.center.y, m14 = i(-i15, o27), e19 = r4(-i15, o27, 0);
  4628. this.momentumEstimator.add(m14, e19, 1e-3 * t21.timestamp);
  4629. }
  4630. onAnimationUpdate(t21) {
  4631. this.navigation.animationManager.animateContinous(t21.viewpoint, (i15, o27) => {
  4632. this.momentumFinished = !this.momentum || this.momentum.isFinished(this.animationTime);
  4633. const m14 = 1e-3 * o27;
  4634. if (!this.momentumFinished) {
  4635. const o28 = this.momentum.valueDelta(this.animationTime, m14);
  4636. q(this.tmpMomentum, this.momentum.direction, o28), St(i15, i15, this.tmpMomentum), t21.constraints.constrainByGeometry(i15);
  4637. }
  4638. this.animationTime += m14;
  4639. });
  4640. }
  4641. stopMomentumNavigation() {
  4642. this.momentum && (this.momentumEstimator.reset(), this.momentum = null, this.navigation.stop());
  4643. }
  4644. };
  4645. e([d()], d10.prototype, "momentumFinished", void 0), e([d()], d10.prototype, "viewpoint", void 0), e([d()], d10.prototype, "navigation", void 0), d10 = e([n("esri.views.2d.navigation.actions.Pan")], d10);
  4646. var v6 = d10;
  4647. // node_modules/@arcgis/core/views/navigation/MomentumEstimator.js
  4648. var s19 = class {
  4649. constructor(t21 = 2.5, i15 = 0.01, s22 = 0.95, l17 = 12) {
  4650. this.minimumInitialVelocity = t21, this.stopVelocity = i15, this.friction = s22, this.maxVelocity = l17, this.enabled = true, this.value = new t18(0.8), this.time = new t18(0.3);
  4651. }
  4652. add(t21, e19) {
  4653. if (this.enabled) {
  4654. if (this.time.hasLastValue) {
  4655. if (this.time.computeDelta(e19) < 0.01)
  4656. return;
  4657. if (this.value.hasFilteredDelta) {
  4658. const e20 = this.value.computeDelta(t21);
  4659. this.value.filteredDelta * e20 < 0 && this.value.reset();
  4660. }
  4661. }
  4662. this.time.update(e19), this.value.update(t21);
  4663. }
  4664. }
  4665. reset() {
  4666. this.value.reset(), this.time.reset();
  4667. }
  4668. evaluateMomentum() {
  4669. if (!this.enabled || !this.value.hasFilteredDelta)
  4670. return null;
  4671. let e19 = this.value.filteredDelta / this.time.filteredDelta;
  4672. return e19 = o4(e19, -this.maxVelocity, this.maxVelocity), Math.abs(e19) < this.minimumInitialVelocity ? null : this.createMomentum(e19, this.stopVelocity, this.friction);
  4673. }
  4674. createMomentum(t21, e19, s22) {
  4675. return new t19(t21, e19, s22);
  4676. }
  4677. };
  4678. // node_modules/@arcgis/core/views/navigation/RotationMomentumEstimator.js
  4679. var a14 = class extends s19 {
  4680. constructor(t21 = 3, a16 = 0.01, s22 = 0.95, e19 = 12) {
  4681. super(t21, a16, s22, e19);
  4682. }
  4683. add(t21, a16) {
  4684. if (this.value.hasLastValue) {
  4685. const a17 = this.value.lastValue;
  4686. let s22 = t21 - a17;
  4687. for (; s22 > Math.PI; )
  4688. s22 -= 2 * Math.PI;
  4689. for (; s22 < -Math.PI; )
  4690. s22 += 2 * Math.PI;
  4691. t21 = a17 + s22;
  4692. }
  4693. super.add(t21, a16);
  4694. }
  4695. };
  4696. // node_modules/@arcgis/core/views/navigation/ZoomMomentumEstimator.js
  4697. var r21 = class extends t19 {
  4698. constructor(e19, t21, r22) {
  4699. super(e19, t21, r22);
  4700. }
  4701. value(e19) {
  4702. const t21 = super.value(e19);
  4703. return Math.exp(t21);
  4704. }
  4705. valueDelta(e19, t21) {
  4706. const r22 = super.value(e19), s22 = super.value(e19 + t21) - r22;
  4707. return Math.exp(s22);
  4708. }
  4709. };
  4710. var s20 = class extends s19 {
  4711. constructor(e19 = 2.5, t21 = 0.01, r22 = 0.95, s22 = 12) {
  4712. super(e19, t21, r22, s22);
  4713. }
  4714. add(e19, t21) {
  4715. super.add(Math.log(e19), t21);
  4716. }
  4717. createMomentum(e19, t21, s22) {
  4718. return new r21(e19, t21, s22);
  4719. }
  4720. };
  4721. // node_modules/@arcgis/core/views/2d/navigation/actions/Pinch.js
  4722. var _11 = class extends y {
  4723. constructor(t21) {
  4724. super(t21), this._animationTime = 0, this._momentumFinished = false, this._rotationMomentumEstimator = new a14(0.6, 0.15, 0.95), this._rotationDirection = 1, this._zoomDirection = 1, this._zoomMomentumEstimator = new s20(), this._zoomOnly = null, this.zoomMomentum = null, this.rotateMomentum = null, this.viewpoint = new u5({ targetGeometry: new j(), scale: 0, rotation: 0 }), this.own(f2(() => this._momentumFinished, () => this.navigation.stop()));
  4725. }
  4726. begin(t21, o27) {
  4727. this.navigation.begin(), this._rotationMomentumEstimator.reset(), this._zoomMomentumEstimator.reset(), this._zoomOnly = null, this._previousAngle = this._startAngle = o27.angle, this._previousRadius = this._startRadius = o27.radius, this._previousCenter = o27.center, this._updateTimestamp = null, t21.constraints.rotationEnabled && this.addToRotateEstimator(0, o27.timestamp), this.addToZoomEstimator(o27, 1);
  4728. }
  4729. update(t21, o27) {
  4730. this._updateTimestamp === null && (this._updateTimestamp = o27.timestamp);
  4731. const i15 = o27.angle, s22 = o27.radius, e19 = o27.center, n26 = Math.abs(180 * (i15 - this._startAngle) / Math.PI), m14 = Math.abs(s22 - this._startRadius), a16 = this._startRadius / s22;
  4732. if (this._previousRadius) {
  4733. const r22 = s22 / this._previousRadius;
  4734. let h15 = 180 * (i15 - this._previousAngle) / Math.PI;
  4735. this._rotationDirection = h15 >= 0 ? 1 : -1, this._zoomDirection = r22 >= 1 ? 1 : -1, t21.constraints.rotationEnabled ? (this._zoomOnly === null && o27.timestamp - this._updateTimestamp > 200 && (this._zoomOnly = m14 - n26 > 0), this._zoomOnly === null || this._zoomOnly ? h15 = 0 : this.addToRotateEstimator(i15 - this._startAngle, o27.timestamp)) : h15 = 0, this.addToZoomEstimator(o27, a16), this.navigation.setViewpoint([e19.x, e19.y], 1 / r22, h15, [this._previousCenter.x - e19.x, e19.y - this._previousCenter.y]);
  4736. }
  4737. this._previousAngle = i15, this._previousRadius = s22, this._previousCenter = e19;
  4738. }
  4739. end(t21) {
  4740. this.rotateMomentum = this._rotationMomentumEstimator.evaluateMomentum(), this.zoomMomentum = this._zoomMomentumEstimator.evaluateMomentum(), this._animationTime = 0, (this.rotateMomentum || this.zoomMomentum) && this.onAnimationUpdate(t21), this.navigation.end();
  4741. }
  4742. addToRotateEstimator(t21, o27) {
  4743. this._rotationMomentumEstimator.add(t21, 1e-3 * o27);
  4744. }
  4745. addToZoomEstimator(t21, o27) {
  4746. this._zoomMomentumEstimator.add(o27, 1e-3 * t21.timestamp);
  4747. }
  4748. canZoomIn(t21) {
  4749. const o27 = t21.scale, i15 = t21.constraints.effectiveMaxScale;
  4750. return i15 === 0 || o27 > i15;
  4751. }
  4752. canZoomOut(t21) {
  4753. const o27 = t21.scale, i15 = t21.constraints.effectiveMinScale;
  4754. return i15 === 0 || o27 < i15;
  4755. }
  4756. onAnimationUpdate(t21) {
  4757. this.navigation.animationManager.animateContinous(t21.viewpoint, (o27, i15) => {
  4758. const s22 = !this.canZoomIn(t21) && this._zoomDirection > 1 || !this.canZoomOut(t21) && this._zoomDirection < 1, e19 = !this.rotateMomentum || this.rotateMomentum.isFinished(this._animationTime), n26 = s22 || !this.zoomMomentum || this.zoomMomentum.isFinished(this._animationTime), p9 = 1e-3 * i15;
  4759. if (this._momentumFinished = e19 && n26, !this._momentumFinished) {
  4760. const i16 = this.rotateMomentum ? Math.abs(this.rotateMomentum.valueDelta(this._animationTime, p9)) * this._rotationDirection * 180 / Math.PI : 0;
  4761. let s23 = this.zoomMomentum ? Math.abs(this.zoomMomentum.valueDelta(this._animationTime, p9)) : 1;
  4762. const e20 = n11(), n27 = n11();
  4763. if (this._previousCenter) {
  4764. r5(e20, this._previousCenter.x, this._previousCenter.y), nt(n27, t21.size, t21.padding), s5(e20, e20, n27);
  4765. const { constraints: r22, scale: p10 } = t21, c18 = p10 * s23;
  4766. s23 < 1 && !r22.canZoomInTo(c18) ? (s23 = p10 / r22.effectiveMaxScale, this.zoomMomentum = null, this.rotateMomentum = null) : s23 > 1 && !r22.canZoomOutTo(c18) && (s23 = p10 / r22.effectiveMinScale, this.zoomMomentum = null, this.rotateMomentum = null), Gt(o27, t21.viewpoint, s23, i16, e20, t21.size), t21.constraints.constrainByGeometry(o27);
  4767. }
  4768. }
  4769. this._animationTime += p9;
  4770. });
  4771. }
  4772. stopMomentumNavigation() {
  4773. (this.rotateMomentum || this.zoomMomentum) && (this.rotateMomentum && (this._rotationMomentumEstimator.reset(), this.rotateMomentum = null), this.zoomMomentum && (this._zoomMomentumEstimator.reset(), this.zoomMomentum = null), this.navigation.stop());
  4774. }
  4775. };
  4776. e([d()], _11.prototype, "_momentumFinished", void 0), e([d()], _11.prototype, "viewpoint", void 0), e([d()], _11.prototype, "navigation", void 0), _11 = e([n("esri.views.2d.navigation.actions.Pinch")], _11);
  4777. var d11 = _11;
  4778. // node_modules/@arcgis/core/views/2d/navigation/actions/Rotate.js
  4779. var u14 = n11();
  4780. var d12 = n11();
  4781. var j3 = class extends y {
  4782. constructor(t21) {
  4783. super(t21), this._previousCenter = n11(), this.viewpoint = new u5({ targetGeometry: new j(), scale: 0, rotation: 0 });
  4784. }
  4785. begin(t21, e19) {
  4786. this.navigation.begin(), r5(this._previousCenter, e19.center.x, e19.center.y);
  4787. }
  4788. update(t21, e19) {
  4789. const { state: { size: o27, padding: r22 } } = t21;
  4790. r5(u14, e19.center.x, e19.center.y), $(d12, o27, r22), t21.viewpoint = bt(this.viewpoint, t21.state.paddedViewState.viewpoint, pt(d12, this._previousCenter, u14)), a3(this._previousCenter, u14);
  4791. }
  4792. end() {
  4793. this.navigation.end();
  4794. }
  4795. };
  4796. e([d()], j3.prototype, "viewpoint", void 0), e([d()], j3.prototype, "navigation", void 0), j3 = e([n("esri.views.2d.actions.Rotate")], j3);
  4797. var h14 = j3;
  4798. // node_modules/@arcgis/core/views/2d/navigation/MapViewNavigation.js
  4799. var l16 = 10;
  4800. var w3 = 1;
  4801. var v7 = new u5({ targetGeometry: new j() });
  4802. var d13 = [0, 0];
  4803. var g9 = 250;
  4804. var _12 = class extends y {
  4805. constructor(t21) {
  4806. super(t21), this._endTimer = null, this.animationManager = null;
  4807. }
  4808. initialize() {
  4809. this.pan = new v6({ navigation: this }), this.rotate = new h14({ navigation: this }), this.pinch = new d11({ navigation: this }), this.zoomBox = new l15({ view: this.view, navigation: this });
  4810. }
  4811. destroy() {
  4812. this.pan.destroy(), this.rotate.destroy(), this.pinch.destroy(), this.zoomBox.destroy(), this.pan = this.rotate = this.pinch = this.zoomBox = this.animationManager = null;
  4813. }
  4814. begin() {
  4815. this._set("interacting", true);
  4816. }
  4817. end() {
  4818. this._lastEventTimestamp = performance.now(), this._startTimer(g9);
  4819. }
  4820. async zoom(t21, i15 = this._getDefaultAnchor()) {
  4821. if (this.stop(), this.begin(), this.view.constraints.snapToZoom && this.view.constraints.effectiveLODs)
  4822. return t21 < 1 ? this.zoomIn(i15) : this.zoomOut(i15);
  4823. this.setViewpoint(i15, t21, 0, [0, 0]);
  4824. }
  4825. async zoomIn(t21) {
  4826. const i15 = this.view, o27 = i15.constraints.snapToNextScale(i15.scale);
  4827. return this._zoomToScale(o27, t21);
  4828. }
  4829. async zoomOut(t21) {
  4830. const i15 = this.view, o27 = i15.constraints.snapToPreviousScale(i15.scale);
  4831. return this._zoomToScale(o27, t21);
  4832. }
  4833. setViewpoint(t21, i15, o27, n26) {
  4834. this.begin(), this.view.state.viewpoint = this._scaleRotateTranslateViewpoint(this.view.viewpoint, t21, i15, o27, n26), this.end();
  4835. }
  4836. setViewpointImmediate(t21, i15 = 0, o27 = [0, 0], n26 = this._getDefaultAnchor()) {
  4837. this.view.state.viewpoint = this._scaleRotateTranslateViewpoint(this.view.viewpoint, n26, t21, i15, o27);
  4838. }
  4839. continousRotateClockwise() {
  4840. const t21 = this.get("view.viewpoint");
  4841. this.animationManager.animateContinous(t21, (t22) => {
  4842. bt(t22, t22, -w3);
  4843. });
  4844. }
  4845. continousRotateCounterclockwise() {
  4846. const t21 = this.get("view.viewpoint");
  4847. this.animationManager.animateContinous(t21, (t22) => {
  4848. bt(t22, t22, w3);
  4849. });
  4850. }
  4851. resetRotation() {
  4852. this.view.rotation = 0;
  4853. }
  4854. continousPanLeft() {
  4855. this._continuousPan([-l16, 0]);
  4856. }
  4857. continousPanRight() {
  4858. this._continuousPan([l16, 0]);
  4859. }
  4860. continousPanUp() {
  4861. this._continuousPan([0, l16]);
  4862. }
  4863. continousPanDown() {
  4864. this._continuousPan([0, -l16]);
  4865. }
  4866. stop() {
  4867. this.pan.stopMomentumNavigation(), this.animationManager.stop(), this.end(), this._endTimer !== null && (clearTimeout(this._endTimer), this._endTimer = null, this._set("interacting", false));
  4868. }
  4869. _continuousPan(t21) {
  4870. const i15 = this.view.viewpoint;
  4871. this.animationManager.animateContinous(i15, (i16) => {
  4872. St(i16, i16, t21), this.view.constraints.constrainByGeometry(i16);
  4873. });
  4874. }
  4875. _startTimer(t21) {
  4876. return this._endTimer !== null || (this._endTimer = setTimeout(() => {
  4877. this._endTimer = null;
  4878. const t22 = performance.now() - this._lastEventTimestamp;
  4879. t22 < g9 ? this._endTimer = this._startTimer(t22) : this._set("interacting", false);
  4880. }, t21)), this._endTimer;
  4881. }
  4882. _getDefaultAnchor() {
  4883. const { size: t21, padding: { left: i15, right: o27, top: n26, bottom: e19 } } = this.view;
  4884. return d13[0] = 0.5 * (t21[0] - o27 + i15), d13[1] = 0.5 * (t21[1] - e19 + n26), d13;
  4885. }
  4886. async _zoomToScale(t21, i15 = this._getDefaultAnchor()) {
  4887. const { view: o27 } = this, { constraints: n26, scale: e19, viewpoint: s22, size: a16, padding: r22 } = o27, h15 = n26.canZoomInTo(t21), m14 = n26.canZoomOutTo(t21);
  4888. if (!(t21 < e19 && !h15 || t21 > e19 && !m14))
  4889. return Rt(v7, s22, t21 / e19, 0, i15, a16, r22), n26.constrainByGeometry(v7), o27.goTo(v7, { animate: true });
  4890. }
  4891. _scaleRotateTranslateViewpoint(t21, i15, o27, n26, e19) {
  4892. const { view: s22 } = this, { size: a16, padding: h15, constraints: m14, scale: p9, viewpoint: u15 } = s22, l17 = p9 * o27, w4 = m14.canZoomInTo(l17), v8 = m14.canZoomOutTo(l17);
  4893. return (o27 < 1 && !w4 || o27 > 1 && !v8) && (o27 = 1), St(u15, u15, e19), Rt(t21, u15, o27, n26, i15, a16, h15), m14.constrainByGeometry(t21);
  4894. }
  4895. };
  4896. e([d()], _12.prototype, "animationManager", void 0), e([d({ type: Boolean, readOnly: true })], _12.prototype, "interacting", void 0), e([d()], _12.prototype, "pan", void 0), e([d()], _12.prototype, "pinch", void 0), e([d()], _12.prototype, "rotate", void 0), e([d()], _12.prototype, "view", void 0), e([d()], _12.prototype, "zoomBox", void 0), _12 = e([n("esri.views.2d.navigation.MapViewNavigation")], _12);
  4897. var T5 = _12;
  4898. // node_modules/@arcgis/core/views/2d/engine/webgl/shaders/MagnifierPrograms.js
  4899. var a15 = { shaders: { vertexShader: n14("magnifier/magnifier.vert"), fragmentShader: n14("magnifier/magnifier.frag") }, attributes: new Map([["a_pos", 0]]) };
  4900. function t20(r22) {
  4901. return e6(r22, a15);
  4902. }
  4903. // node_modules/@arcgis/core/views/magnifier/resources.js
  4904. async function s21(s22) {
  4905. const r22 = import("./mask-svg-IG7CBNQI.js"), i15 = import("./overlay-svg-5UCUJ2PW.js"), o27 = t5((await r22).default, { signal: s22 }), e19 = t5((await i15).default, { signal: s22 }), m14 = { mask: await o27, overlay: await e19 };
  4906. return f(s22), m14;
  4907. }
  4908. // node_modules/@arcgis/core/views/2d/magnifier/MagnifierView2D.js
  4909. var j4 = class extends a6 {
  4910. constructor() {
  4911. super(), this._handles = new u(), this._resourcePixelRatio = 1, this.visible = false;
  4912. }
  4913. destroy() {
  4914. this._handles.destroy(), this._handles = null, this._disposeRenderResources(), this._resourcesTask && (this._resourcesTask.abort(), this._resourcesTask = null);
  4915. }
  4916. get background() {
  4917. return this._background;
  4918. }
  4919. set background(e19) {
  4920. this._background = e19, this.requestRender();
  4921. }
  4922. get magnifier() {
  4923. return this._magnifier;
  4924. }
  4925. set magnifier(e19) {
  4926. this._magnifier = e19, this._handles.removeAll(), this._handles.add([l(() => e19.version, () => {
  4927. this.visible = e19.visible && r(e19.position) && e19.size > 0, this.requestRender();
  4928. }, h), l(() => [e19.maskUrl, e19.overlayUrl], () => this._reloadResources()), l(() => e19.size, () => {
  4929. this._disposeRenderResources(), this.requestRender();
  4930. })]);
  4931. }
  4932. _createTransforms() {
  4933. return { dvs: e7() };
  4934. }
  4935. doRender(e19) {
  4936. const r22 = e19.context;
  4937. if (!this._resourcesTask)
  4938. return void this._reloadResources();
  4939. if (e19.drawPhase !== I3.MAP || !this._canRender())
  4940. return;
  4941. this._updateResources(e19);
  4942. const i15 = this._magnifier;
  4943. if (t(i15.position))
  4944. return;
  4945. const a16 = e19.pixelRatio, o27 = i15.size * a16, n26 = 1 / i15.factor, l17 = Math.ceil(n26 * o27);
  4946. this._readbackTexture.resize(l17, l17);
  4947. const { size: h15 } = e19.state, m14 = a16 * h15[0], u15 = a16 * h15[1], d14 = 0.5 * l17, _13 = 0.5 * l17, p9 = o4(a16 * i15.position.x, d14, m14 - d14 - 1), f14 = o4(u15 - a16 * i15.position.y, _13, u15 - _13 - 1);
  4948. r22.setBlendingEnabled(true);
  4949. const g10 = p9 - d14, b5 = f14 - _13, x5 = this._readbackTexture;
  4950. r22.bindTexture(x5, 0), r22.gl.copyTexImage2D(x5.descriptor.target, 0, x5.descriptor.pixelFormat, g10, b5, l17, l17, 0);
  4951. const R4 = this.background?.color, y6 = R4 ? [R4.a * R4.r / 255, R4.a * R4.g / 255, R4.a * R4.b / 255, R4.a] : [1, 1, 1, 1], k2 = (p9 + i15.offset.x * a16) / m14 * 2 - 1, A8 = (f14 - i15.offset.y * a16) / u15 * 2 - 1, v8 = o27 / m14 * 2, E6 = o27 / u15 * 2, j5 = this._program;
  4952. r22.bindVAO(this._vertexArrayObject), r22.bindTexture(this._overlayTexture, 6), r22.bindTexture(this._maskTexture, 7), r22.useProgram(j5), j5.setUniform4fv("u_background", y6), j5.setUniform1i("u_readbackTexture", 0), j5.setUniform1i("u_overlayTexture", 6), j5.setUniform1i("u_maskTexture", 7), j5.setUniform4f("u_drawPos", k2, A8, v8, E6), j5.setUniform1i("u_maskEnabled", i15.maskEnabled ? 1 : 0), j5.setUniform1i("u_overlayEnabled", i15.overlayEnabled ? 1 : 0), r22.setStencilTestEnabled(false), r22.setColorMask(true, true, true, true), r22.drawArrays(E.TRIANGLE_STRIP, 0, 4), r22.bindVAO();
  4953. }
  4954. _canRender() {
  4955. return this.mask && this.overlay && this._magnifier != null;
  4956. }
  4957. _reloadResources() {
  4958. this._resourcesTask && this._resourcesTask.abort();
  4959. const r22 = r(this._magnifier) ? this._magnifier.maskUrl : null, s22 = r(this._magnifier) ? this._magnifier.overlayUrl : null;
  4960. this._resourcesTask = O(async (a16) => {
  4961. const o27 = t(r22) || t(s22) ? s21(a16) : null, n26 = r(r22) ? U(r22, { responseType: "image", signal: a16 }).then((e19) => e19.data) : o27.then((e19) => e19.mask), l17 = r(s22) ? U(s22, { responseType: "image", signal: a16 }).then((e19) => e19.data) : o27.then((e19) => e19.overlay), [h15, m14] = await Promise.all([n26, l17]);
  4962. this.mask = h15, this.overlay = m14, this._disposeRenderResources(), this.requestRender();
  4963. });
  4964. }
  4965. _disposeRenderResources() {
  4966. this._readbackTexture = s(this._readbackTexture), this._overlayTexture = s(this._overlayTexture), this._maskTexture = s(this._maskTexture), this._vertexArrayObject = s(this._vertexArrayObject), this._program = s(this._program);
  4967. }
  4968. _updateResources(e19) {
  4969. if (e19.pixelRatio !== this._resourcePixelRatio && this._disposeRenderResources(), this._readbackTexture)
  4970. return;
  4971. const r22 = e19.context;
  4972. this._resourcePixelRatio = e19.pixelRatio;
  4973. const s22 = Math.ceil(this._magnifier.size * e19.pixelRatio);
  4974. this._program = t20(r22);
  4975. const t21 = new Uint16Array([0, 1, 0, 0, 1, 1, 1, 0]), i15 = a15.attributes;
  4976. this._vertexArrayObject = new f5(r22, i15, m6, { geometry: c3.createVertex(r22, F.STATIC_DRAW, t21) }), this.overlay.width = s22, this.overlay.height = s22, this._overlayTexture = new u4(r22, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.NEAREST, flipped: true, preMultiplyAlpha: !It(this.overlay.src) || !e19.context.driverTest.svgAlwaysPremultipliesAlpha }, this.overlay), this.mask.width = s22, this.mask.height = s22, this._maskTexture = new u4(r22, { target: M.TEXTURE_2D, pixelFormat: P.ALPHA, internalFormat: P.ALPHA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.NEAREST, flipped: true }, this.mask);
  4977. const a16 = 1 / this._magnifier.factor;
  4978. this._readbackTexture = new u4(r22, { target: M.TEXTURE_2D, pixelFormat: P.RGBA, internalFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: false, width: Math.ceil(a16 * s22), height: Math.ceil(a16 * s22) });
  4979. }
  4980. };
  4981. export {
  4982. i4 as GraphicContainer,
  4983. ae as GraphicsView2D,
  4984. n24 as LabelManager,
  4985. j4 as MagnifierView2D,
  4986. T5 as MapViewNavigation,
  4987. v5 as Stage
  4988. };
  4989. //# sourceMappingURL=mapViewDeps-J6NKGEYU.js.map