| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389 |
- // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- // See https://js.arcgis.com/4.7/esri/copyright.txt for details.
- //>>built
- require({cache:{"esri/views/BreakpointsOwner":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/assignHelper dojo/dom-class ../core/Accessor ../core/ArrayPool ../core/Handles ../core/watchUtils ../core/accessorSupport/decorators ./DOMContainer".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p){var n={widthBreakpoint:{getValue:function(a){var c=a.viewSize[0];a=a.breakpoints;var b=this.values;return c<=a.xsmall?b.xsmall:c<=a.small?
- b.small:c<=a.medium?b.medium:c<=a.large?b.large:b.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",
- large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue:function(a){var c=a.viewSize[1];a=a.breakpoints;var b=this.values;return c<=a.xsmall?b.xsmall:c<=a.small?b.small:c<=a.medium?b.medium:
- c<=a.large?b.large:b.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",
- large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue:function(a){a=a.viewSize;var c=this.values;return a[1]>=a[0]?c.portrait:c.landscape},values:{portrait:"portrait",landscape:"landscape"},
- valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},t={xsmall:544,small:768,medium:992,large:1200};return function(g){function q(){var a=null!==g&&g.apply(this,arguments)||this;a._breakpointsHandles=new b;a.breakpoints=t;a.orientation=null;a.widthBreakpoint=null;a.heightBreakpoint=null;return a}f(q,g);q.prototype.initialize=function(){this._breakpointsHandles.add([k.init(this,["breakpoints","size"],this._updateClassNames)])};q.prototype.destroy=
- function(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles.destroy(),this._breakpointsHandles=null)};q.prototype._updateClassNames=function(){if(this.container){var a=d.acquire(),c=d.acquire(),m=!1,b,g,e;for(b in n)g=this[b],e=n[b].getValue({viewSize:this.size,breakpoints:this.breakpoints}),g!==e&&(m=!0,this[b]=e,c.push(n[b].valueToClassName[g]),a.push(n[b].valueToClassName[e]));m&&(this._applyClassNameChanges(a,c),d.release(a),d.release(c))}};q.prototype._applyClassNameChanges=
- function(a,b){var m=this.container;m&&(c.remove(m,b),c.add(m,a))};q.prototype._removeActiveClassNames=function(){var a=this.container;if(a)for(var b in n)c.remove(a,n[b].valueToClassName[this[b]])};a([l.property({set:function(a){var b=this._get("breakpoints");if(a!==b){b=(b=a)&&b.xsmall<b.small&&b.small<b.medium&&b.medium<b.large;if(!b){var m=JSON.stringify(t,null,2);console.warn("provided breakpoints are not valid, using defaults:"+m)}a=b?a:t;this._set("breakpoints",e({},a))}}})],q.prototype,"breakpoints",
- void 0);a([l.property()],q.prototype,"orientation",void 0);a([l.property()],q.prototype,"widthBreakpoint",void 0);a([l.property()],q.prototype,"heightBreakpoint",void 0);return q=a([l.subclass("esri.views.BreakpointsOwner")],q)}(l.declared(g,p))})},"esri/views/DOMContainer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/dom dojo/dom-construct dojo/on ../core/Accessor ../core/Evented ../core/Handles ../core/scheduling ../core/watchUtils ../core/accessorSupport/decorators ./PopupManager ./overlay/ViewOverlay ../widgets/Popup".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){var v=[0,0];return function(b){function m(){var a=b.call(this)||this;a._domHandles=new k;a._freqInfo={freq:16,time:750};a._overlayRenderTaskHandle=null;a.height=0;a.popup=new q({view:a});a.position=null;a.resizing=!1;a.root=null;a.surface=null;a.suspended=!0;a.ui=null;a.userContent=null;a.width=0;a.watch("cursor",function(m){var b=a.surface;b&&b.setAttribute("data-cursor",m)});a.watch("interacting",function(m){var b=a.surface;b&&b.setAttribute("data-interacting",
- m.toString())});a._focusEvent=a._focusEvent.bind(a);a._blurEvent=a._blurEvent.bind(a);return a}f(m,b);m.prototype.initialize=function(){this.watch("ui",this._handleUIChange);this._wireUI(this.ui)};m.prototype.destroy=function(){this.ui.destroy();this.popup&&!this.popup.destroyed&&this.popup.destroy();this.container=null;this._domHandles.destroy()};Object.defineProperty(m.prototype,"container",{set:function(a){var m=this,b=this._get("container");if(b!==a){this._domHandles.remove("dom-size");this._stopMeasuring();
- if(b){var d=this.surface;d&&(d.removeEventListener("focus",this._focusEvent),d.removeEventListener("blur",this._blurEvent));b.classList.remove("esri-view");this.popupManager.destroy();this._set("popupManager",null);this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null);this.overlay.destroy();this._set("overlay",null);c.destroy(this.root);this._set("root",null);c.destroy(this.userContent);this._set("userContent",null)}if(a){a.classList.add("esri-view");
- b=document.createElement("div");for(b.className="esri-view-user-storage";a.hasChildNodes();)b.appendChild(a.firstChild);a.appendChild(b);b=document.createElement("div");b.className="esri-view-root";a.insertBefore(b,a.firstChild);this._set("root",b);var g=document.createElement("div");g.className="esri-view-surface";g.setAttribute("role","application");g.tabIndex=0;g.addEventListener("focus",this._focusEvent);g.addEventListener("blur",this._blurEvent);e.setSelectable(g,!1);b.appendChild(g);this._set("surface",
- g);d=new u;b.appendChild(d.surface);this._set("overlay",d);d.watch("needsRender",function(a){a&&!m._overlayRenderTaskHandle?m._overlayRenderTaskHandle=l.addFrameTask({render:function(){m.overlay.render()}}):m._overlayRenderTaskHandle&&(m._overlayRenderTaskHandle.remove(),m._overlayRenderTaskHandle=null)});this._forceReadyCycle();this._domHandles.add(p.init(this,"size",function(a){var m=a[1];g.classList.toggle("esri-view-surface--inset-outline",a[0]>=document.body.clientWidth||m>=document.body.clientHeight)}),
- "dom-size");this._set("container",a);this._startMeasuring();a=new t({enabled:!0,view:this});this._set("popupManager",a)}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"focused",{get:function(){return document.activeElement===this.surface},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"size",{get:function(){return[this.width,
- this.height]},enumerable:!0,configurable:!0});m.prototype.blur=function(){this.surface&&this.surface.blur()};m.prototype.focus=function(){this.surface&&this.surface.focus()};m.prototype.pageToContainer=function(a,m,b){var c=this.position;a-=c[0];m-=c[1];b?(b[0]=a,b[1]=m):b=[a,m];return b};m.prototype.containerToPage=function(a,m,b){var c=this.position;a+=c[0];m+=c[1];b?(b[0]=a,b[1]=m):b=[a,m];return b};m.prototype._handleUIChange=function(a,m){m&&(this._domHandles.remove("ui"),m.destroy());a&&this._wireUI(a);
- this._set("ui",a)};m.prototype._wireUI=function(a){this._domHandles.remove("ui");a&&(a.view=this,this._domHandles.add([p.init(this,"root",function(m){a.container=m?c.create("div",null,m):null}),p.init(this,"popup",function(m,b){b&&(a.remove(b,"popup"),b!==m&&b.destroy());m&&(m.view=a.view,a.add(m,{key:"popup",position:"manual"}))})],"ui"))};m.prototype._focusEvent=function(a){this.notifyChange("focused");this.emit("focus",{native:a})};m.prototype._blurEvent=function(a){this.notifyChange("focused");
- this.emit("blur",{native:a})};m.prototype._stopMeasuring=function(){this._domHandles.remove("measuring");this._get("resizing")&&this._set("resizing",!1)};m.prototype._startMeasuring=function(){var a=this,m=this._freqInfo;m.freq=16;m.time=750;this._domHandles.add([g(window,"resize",function(){m.freq=16;m.time=750}),l.addFrameTask({prepare:function(m){var b=a._measure(),c=a._freqInfo;c.time+=m.deltaTime;b&&(c.freq=16,a._get("resizing")||a._set("resizing",!0));c.time<c.freq||(c.time=0,a._position()||
- b?c.freq=16:c.freq=Math.min(750,2*c.freq),!b&&512<=c.freq&&a._get("resizing")&&a._set("resizing",!1))}})],"measuring");this._measure();this._position()};m.prototype._measure=function(){var a=this.container,m=a?a.clientWidth:0,b=a?a.clientHeight:0;if(0===m||0===b||"hidden"===window.getComputedStyle(a).visibility)return this.suspended||this._set("suspended",!0),!1;var a=this.width,c=this.height;if(m===a&&b===c)return this.suspended&&this._set("suspended",!1),!1;this._set("width",m);this._set("height",
- b);this.suspended&&this._set("suspended",!1);this.emit("resize",{oldWidth:a,oldHeight:c,width:m,height:b});return!0};m.prototype._position=function(){var a=this.container,m=this.position,b=(a.ownerDocument||window.document).defaultView,a=a.getBoundingClientRect();v[0]=a.left+b.pageXOffset;v[1]=a.top+b.pageYOffset;return m&&v[0]===m[0]&&v[1]===m[1]?!1:(this._set("position",v.slice()),!0)};a([n.property({value:null,cast:function(a){return e.byId(a)}})],m.prototype,"container",null);a([n.property({readOnly:!0,
- dependsOn:["surface"]})],m.prototype,"focused",null);a([n.property({readOnly:!0})],m.prototype,"height",void 0);a([n.property({type:q})],m.prototype,"popup",void 0);a([n.property({type:t})],m.prototype,"popupManager",void 0);a([n.property({type:u})],m.prototype,"overlay",void 0);a([n.property({readOnly:!0})],m.prototype,"position",void 0);a([n.property({readOnly:!0})],m.prototype,"resizing",void 0);a([n.property({readOnly:!0})],m.prototype,"root",void 0);a([n.property({value:null,dependsOn:["width",
- "height"],readOnly:!0})],m.prototype,"size",null);a([n.property({readOnly:!0})],m.prototype,"surface",void 0);a([n.property({readOnly:!0})],m.prototype,"suspended",void 0);a([n.property()],m.prototype,"ui",void 0);a([n.property({readOnly:!0})],m.prototype,"userContent",void 0);a([n.property({readOnly:!0})],m.prototype,"width",void 0);return m=a([n.subclass("esri.views.DOMContainer")],m)}(n.declared(d,b))})},"esri/views/overlay/ViewOverlay":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper dojo/dom ../../core/Accessor ../../core/Collection ../../core/accessorSupport/decorators maquette".split(" "),
- function(r,h,f,a,e,c,g,d,b){return function(c){function k(){var a=null!==c&&c.apply(this,arguments)||this;a.items=new g;a._callbacks=new Map;a._projector=b.createProjector();a._hiddenProjector=b.createProjector();return a}f(k,c);Object.defineProperty(k.prototype,"needsRender",{get:function(){return 0<this.items.length},enumerable:!0,configurable:!0});k.prototype.initialize=function(){var a=this,b=document.createElement("div");b.className="esri-overlay-surface";e.setSelectable(b,!1);this._set("surface",
- b);this._hiddenSurface=document.createElement("div");this._hiddenSurface.setAttribute("style","visibility: hidden;");b.appendChild(this._hiddenSurface);this._itemsChangeHandle=this.items.on("change",function(b){b.added.map(function(b){var c=function(){return b.render()};a._callbacks.set(b,c);a._projector.append(a.surface,c)});b.removed.map(function(b){var c=a._projector.detach(a._callbacks.get(b));a.surface.removeChild(c.domNode);a._callbacks.delete(b)})})};k.prototype.addItem=function(a){this.items.add(a)};
- k.prototype.removeItem=function(a){this.items.remove(a)};k.prototype.destroy=function(){this.items.removeAll();this._itemsChangeHandle.remove();this._projector=this._callbacks=null};k.prototype.render=function(){this._projector.renderNow()};k.prototype.computeBoundingRect=function(a){var b=this._hiddenSurface,c=this._hiddenProjector,d=null,g=function(){return d=a.render()};c.append(b,g);c.renderNow();var e={left:0,top:0,right:0,bottom:0};if(d&&d.domNode){var k=d.domNode.getBoundingClientRect();e.left=
- k.left;e.top=k.top;e.right=k.right;e.bottom=k.bottom}for(c.detach(g);b.firstChild;)b.removeChild(b.firstChild);return e};k.prototype.overlaps=function(a,b){a=this.computeBoundingRect(a);b=this.computeBoundingRect(b);return Math.max(a.left,b.left)<=Math.min(a.right,b.right)&&Math.max(a.top,b.top)<=Math.min(a.bottom,b.bottom)};a([d.property({readOnly:!0})],k.prototype,"surface",void 0);a([d.property({readOnly:!0})],k.prototype,"items",void 0);a([d.property({readOnly:!0,dependsOn:["items.length"]})],
- k.prototype,"needsRender",null);return k=a([d.subclass("esri.views.overlay.ViewOverlay")],k)}(d.declared(c))})},"esri/widgets/Popup":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/assignHelper dojo/dom-geometry dojo/i18n!./Popup/nls/Popup dojo/keys ../core/Handles ../core/lang ../core/Logger ../core/watchUtils ../core/accessorSupport/decorators ./Feature ./Spinner ./Widget ./Popup/PopupViewModel ../widgets/support/widgetUtils ./support/widget".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m){function B(a,m){return void 0===m?"esri-popup__"+a:"esri-popup__"+a+"-"+m}var z=r.toUrl("./Popup/images/default-action.svg"),C={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},A=l.getLogger("esri.widgets.Popup");return function(l){function q(a){a=l.call(this)||this;a._blurContainer=!1;a._containerNode=null;a._mainContainerNode=null;a._featureMenuNode=null;a._focusContainer=!1;a._focusDockButton=!1;a._focusFeatureMenuButton=!1;a._focusFirstFeature=
- !1;a._handles=new b;a._displayActionTextLimit=2;a._pointerOffsetInPx=16;a._spinner=null;a.actions=null;a.alignment="auto";a.autoCloseEnabled=null;a.content=null;a.collapsed=!1;a.collapseEnabled=!0;a.dockEnabled=!1;a.featureCount=null;a.features=null;a.featureNavigationEnabled=!0;a.highlightEnabled=null;a.location=null;a.featureWidgets=[];a.promises=null;a.selectedFeature=null;a.selectedFeatureIndex=null;a.selectedFeatureWidget=null;a.spinnerEnabled=!0;a.title=null;a.updateLocationEnabled=null;a.view=
- null;a.viewModel=new v;a.visible=null;return a}f(q,l);q.prototype.postInitialize=function(){var a=this;this._addSelectedFeatureIndexHandle();this.own(p.watch(this,"viewModel.screenLocation",function(){return a._positionContainer()}),p.watch(this,["viewModel.visible","dockEnabled"],function(){return a._toggleScreenLocationEnabled()}),p.watch(this,"viewModel.screenLocation",function(m,b){!!m!==!!b&&a.reposition()}),p.watch(this,"viewModel.features",function(m){return a._createFeatureWidgets(m)}),p.watch(this,
- "viewModel.view.padding viewModel.view.size viewModel.visible viewModel.waitingForResult viewModel.location alignment".split(" "),function(){return a.reposition()}),p.watch(this,"spinnerEnabled",function(m){return a._spinnerEnabledChange(m)}),p.watch(this,"viewModel.view.size",function(m,b){return a._updateDockEnabledForViewSize(m,b)}),p.watch(this,"viewModel.view",function(m,b){return a._viewChange(m,b)}),p.watch(this,"viewModel.view.ready",function(m,b){return a._viewReadyChange(m,b)}),p.watch(this,
- ["viewModel.waitingForResult","viewModel.location"],function(){return a._displaySpinner()}),p.watch(this,["featureWidgets","viewModel.selectedFeatureIndex"],function(){return a._updateFeatureWidget()}),p.watch(this,"selectedFeatureWidget.viewModel.title",function(m){return a._setTitleFromFeatureWidget(m)}),p.watch(this,["selectedFeatureWidget.viewModel.content","selectedFeatureWidget.viewModel.waitingForContent"],function(){return a._setContentFromFeatureWidget()}),p.on(this,"viewModel","trigger-action",
- function(m){return a._zoomToAction(m)}))};q.prototype.destroy=function(){this._destroyFeatureWidgets();this._destroySpinner();this._handles&&this._handles.destroy();this._handles=null};Object.defineProperty(q.prototype,"currentAlignment",{get:function(){return this._getCurrentAlignment()},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"currentDockPosition",{get:function(){return this._getCurrentDockPosition()},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"dockOptions",
- {get:function(){return this._get("dockOptions")||C},set:function(a){var m=e({},C),b=this.get("viewModel.view.breakpoints"),c={};b&&(c.width=b.xsmall,c.height=b.xsmall);a=e({},m,a);m=e({},m.breakpoint,c);c=a.breakpoint;!0===c?a.breakpoint=m:"object"===typeof c&&(a.breakpoint=e({},m,c));this._set("dockOptions",a);this._setCurrentDockPosition();this.reposition()},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"featureMenuOpen",{get:function(){return this.viewModel.visible?this._get("featureMenuOpen"):
- !1},set:function(a){this._set("featureMenuOpen",!!a)},enumerable:!0,configurable:!0});q.prototype.blur=function(){this.visible||A.warn("Popup cannot be blurred while visible is false");this._blurContainer=!0;this.scheduleRender()};q.prototype.clear=function(){};q.prototype.close=function(){this.visible=!1};q.prototype.focus=function(){this.visible||A.warn("Popup cannot be focused while visible is false");this._focusContainer=!0;this.scheduleRender()};q.prototype.next=function(){return null};q.prototype.open=
- function(a){this._handles.remove("selected-index");this.set({featureMenuOpen:a?!!a.featureMenuOpen:!1});this.viewModel.open(a);this._addSelectedFeatureIndexHandle()};q.prototype.previous=function(){return null};q.prototype.reposition=function(){this.renderNow();this._positionContainer();this._setCurrentAlignment()};q.prototype.triggerAction=function(a){return null};q.prototype.render=function(){var a=this.collapsed,b=this.collapseEnabled,c=this.dockEnabled,d=this.actions,e=this.featureMenuOpen,l=
- this.featureNavigationEnabled,f=this.featureWidgets,q=this.visible,t=this.viewModel,v=t.content,n=t.featureCount,p=t.pendingPromisesCount,u=t.selectedFeatureIndex,z=t.title,t=1<n&&l,l=1<n&&e,C=b&&!l&&a,a=d&&d.length,A=t&&this._getPageText(n,u),h=this._renderContent(),D=x.isRtl(),E=this.get("selectedFeatureWidget")?this.get("selectedFeatureWidget.viewModel.waitingForContent")||this.get("selectedFeatureWidget.viewModel.content"):h,ga=c?g.undock:g.dock,n=this.currentAlignment,d=this.currentDockPosition,
- p=p?m.tsx("div",{key:B("loading-container"),role:"presentation",class:"esri-popup__loading-container","aria-label":g.loading,title:g.loading},m.tsx("span",{"aria-hidden":"true",class:m.join("esri-popup__icon","esri-icon-loading-indicator","esri-rotating")})):null,da=(r={},r["esri-icon-layer-list"]=!l,r["esri-icon-close"]=l,r),r=m.tsx("span",{"aria-hidden":"true",class:"esri-popup__icon",classes:da}),da=(Z={},Z["esri-icon-right-triangle-arrow"]=D,Z["esri-popup__pagination-previous-icon--rtl"]=D,Z["esri-icon-left-triangle-arrow"]=
- !D,Z["esri-popup__pagination-previous-icon"]=!D,Z),Z=m.tsx("span",{"aria-hidden":"true",class:"esri-popup__icon",classes:da}),da=m.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:m.join("esri-popup__button","esri-popup__pagination-previous"),"aria-label":g.previous,title:g.previous},Z),Z=(ea={},ea["esri-icon-left-triangle-arrow"]=D,ea["esri-popup__pagination-next-icon--rtl"]=D,ea["esri-icon-right-triangle-arrow"]=!D,ea["esri-popup__pagination-next-icon"]=
- !D,ea),ea=m.tsx("span",{"aria-hidden":"true",class:"esri-popup__icon",classes:Z}),D=m.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:m.join("esri-popup__button","esri-popup__pagination-next"),"aria-label":g.next,title:g.next},ea),Z=x.cssTransition("enter","esri-popup--feature-updated"),ea=this.id+"-feature-menu",e=m.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,
- afterUpdate:this._focusFeatureMenuButtonNode,class:m.join("esri-popup__button","esri-popup__feature-menu-button"),"aria-haspopup":"true","aria-controls":ea,"aria-expanded":e,"aria-label":g.menu,title:g.menu},r),A=m.tsx("div",{class:"esri-popup__pagination-page-text"},A),e=t?m.tsx("div",{class:"esri-popup__navigation-buttons",enterAnimation:Z},da,A,D,p||e):null,A=this._wouldDockTo(),A=(ja={},ja["esri-icon-minimize"]=c,ja["esri-popup__icon--dock-icon"]=!c,ja["esri-icon-dock-right"]=!c&&("top-right"===
- A||"bottom-right"===A),ja["esri-icon-dock-left"]=!c&&("top-left"===A||"bottom-left"===A),ja["esri-icon-maximize"]=!c&&"top-center"===A,ja["esri-icon-dock-bottom"]=!c&&"bottom-center"===A,ja),ja=m.tsx("span",{"aria-hidden":"true",classes:A,class:"esri-popup__icon"}),ja=this.get("dockOptions.buttonEnabled")?m.tsx("div",{role:"button","aria-label":ga,title:ga,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,
- class:m.join("esri-popup__button","esri-popup__button--dock")},ja):null,b=b&&z&&(E||a||t),ga=(aa={},aa["esri-popup__header-title--button"]=b,aa),A=b?C?g.expand:g.collapse:"",aa=this.id+"-popup-title",z=z?m.tsx("h2",{class:"esri-popup__header-title",key:z,enterAnimation:Z,id:aa,role:b?"button":"heading","aria-label":A,title:A,classes:ga,bind:this,tabIndex:b?0:-1,onclick:this._toggleCollapsed,onkeydown:this._toggleCollapsed,innerHTML:z}):null,b=m.tsx("span",{"aria-hidden":"true",class:m.join("esri-popup__icon",
- "esri-icon-close")}),b=m.tsx("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:"esri-popup__button","aria-label":g.close,title:g.close},b),b=m.tsx("header",{class:"esri-popup__header"},z,m.tsx("div",{class:"esri-popup__header-buttons"},ja,b)),ja=this.id+"-popup-content",v=E&&!C?m.tsx("article",{key:v,enterAnimation:Z,id:ja,class:"esri-popup__content"},h):null,h=!C&&("bottom-left"===n||"bottom-center"===n||"bottom-right"===n||"top-left"===d||"top-center"===d||
- "top-right"===d),C=!C&&("top-left"===n||"top-center"===n||"top-right"===n||"bottom-left"===d||"bottom-center"===d||"bottom-right"===d),E=l?null:m.tsx("div",{key:B("actions"),class:"esri-popup__actions"},this._renderActions()),ga=m.tsx("section",{key:B("navigation"),class:"esri-popup__navigation"},e),t=t||a?m.tsx("div",{key:B("feature-buttons"),class:"esri-popup__feature-buttons"},E,ga):null,u=this._renderFeatureMenuNode(f,u,l,ea),f=k.substitute({total:f.length},g.selectedFeatures),ea=m.tsx("section",
- {key:B("menu"),class:"esri-popup__feature-menu"},m.tsx("h2",{class:"esri-popup__feature-menu-header"},f),m.tsx("nav",{class:"esri-popup__feature-menu-viewport",afterCreate:this._featureMenuViewportNodeUpdated,afterUpdate:this._featureMenuViewportNodeUpdated},u)),f=c?null:m.tsx("div",{key:B("pointer"),class:"esri-popup__pointer",role:"presentation"},m.tsx("div",{class:m.join("esri-popup__pointer-direction","esri-popup--shadow")})),u=this.get("selectedFeature.layer.title"),a=this.get("selectedFeature.layer.id"),
- E=(qa={},qa["esri-popup--shadow"]=c,qa),c=(fa={},fa["esri-popup--aligned-top-center"]=q&&"top-center"===n,fa["esri-popup--aligned-bottom-center"]=q&&"bottom-center"===n,fa["esri-popup--aligned-top-left"]=q&&"top-left"===n,fa["esri-popup--aligned-bottom-left"]=q&&"bottom-left"===n,fa["esri-popup--aligned-top-right"]=q&&"top-right"===n,fa["esri-popup--aligned-bottom-right"]="bottom-right"===n,fa["esri-popup--is-docked"]=q&&c,fa["esri-popup--shadow"]=q&&!c,fa["esri-popup--is-docked-top-left"]=q&&"top-left"===
- d,fa["esri-popup--is-docked-top-center"]=q&&"top-center"===d,fa["esri-popup--is-docked-top-right"]=q&&"top-right"===d,fa["esri-popup--is-docked-bottom-left"]=q&&"bottom-left"===d,fa["esri-popup--is-docked-bottom-center"]=q&&"bottom-center"===d,fa["esri-popup--is-docked-bottom-right"]=q&&"bottom-right"===d,fa["esri-popup--feature-menu-open"]=q&&l,fa),fa=h?ea:null,qa=C?ea:null,l=h?t:null,n=C?t:null,fa=m.tsx("div",{class:m.join("esri-popup__main-container","esri-widget"),classes:E,tabIndex:-1,role:"dialog",
- "aria-labelledby":z?aa:"","aria-describedby":v?ja:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},l,fa,b,v,n,qa);return m.tsx("div",{key:B("base"),class:"esri-popup",role:"presentation",classes:c,"data-layer-title":u,"data-layer-id":a,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},q?[fa,f]:null);var r,Z,ea,ja,aa,qa,fa};q.prototype._featureMenuOpenChanged=function(a){a?this._focusFirstFeature=
- !0:this._focusFeatureMenuButton=!0};q.prototype._setTitleFromFeatureWidget=function(a){this.selectedFeatureWidget&&(this.viewModel.title=a||"")};q.prototype._setContentFromFeatureWidget=function(){var a=this.selectedFeatureWidget;a&&(this.viewModel.content=a)};q.prototype._handleFeatureMenuKeyup=function(a){a.keyCode===d.ESCAPE&&(a.stopPropagation(),this.featureMenuOpen=!1)};q.prototype._handleFeatureMenuItemKeyup=function(a){var m=a.keyCode,b=this._featureMenuNode,c=this.get("features.length"),g=
- a.currentTarget["data-feature-index"];b&&(b=b.querySelectorAll("li"),m===d.UP_ARROW?(a.stopPropagation(),b[(g-1+c)%c].focus()):m===d.DOWN_ARROW?(a.stopPropagation(),b[(g+1+c)%c].focus()):m===d.HOME?(a.stopPropagation(),b[0].focus()):m===d.END&&(a.stopPropagation(),b[b.length-1].focus()))};q.prototype._handleMainKeyup=function(a){var m=a.keyCode;m===d.LEFT_ARROW&&(a.stopPropagation(),this.previous());m===d.RIGHT_ARROW&&(a.stopPropagation(),this.next())};q.prototype._zoomToAction=function(a){a.action&&
- "zoom-to"===a.action.id&&this.viewModel.zoomToLocation()};q.prototype._spinnerEnabledChange=function(a){this._destroySpinner();a&&(a=this.get("viewModel.view"),this._createSpinner(a))};q.prototype._displaySpinner=function(){var a=this._spinner;if(a){var m=this.viewModel,b=m.location;m.waitingForResult?a.show({location:b}):a.hide()}};q.prototype._getIconStyles=function(a){return{"background-image":a?"url("+a+")":""}};q.prototype._renderAction=function(a,b,c,d){var e=this,l=p.watch(a,["id","className",
- "title","image","visible"],function(){return e.scheduleRender()});this._handles.add(l,d);l=this.get("selectedFeature.attributes");"zoom-to"===a.id&&(a.title=g.zoom,this._handles.add(p.init(this,"view.animation.state",function(b){a.className="waiting-for-target"===b?m.join("esri-popup__icon","esri-icon-loading-indicator","esri-rotating"):m.join("esri-popup__icon","esri-icon-zoom-in-magnifying-glass")}),d));d=a.title;var f=a.className,q=a.image||f?a.image:z;d=d&&l?k.substitute(l,d):d;f=f&&l?k.substitute(l,
- f):f;l=q&&l?k.substitute(l,q):q;q=f||"esri-popup__icon";f=(t={},t["esri-popup__action-image"]=!!l,t);t=(n={},n["esri-disabled"]=-1!==q.indexOf("esri-icon-loading-indicator"),n);c=c<=this._displayActionTextLimit?m.tsx("span",{key:B("action-text-"+b+"-"+a.uid),class:"esri-popup__action-text"},d):null;return a.visible?m.tsx("div",{key:B("action-"+b+"-"+a.uid),role:"button",tabIndex:0,title:d,"aria-label":d,classes:t,class:m.join("esri-popup__button","esri-popup__action"),bind:this,"data-action-index":b,
- onclick:this._triggerAction,onkeydown:this._triggerAction},m.tsx("span",{key:B("action-icon-"+b+"-"+a.uid+"-"+q),"aria-hidden":"true",class:q,classes:f,styles:this._getIconStyles(l)}),c):null;var t,n};q.prototype._renderActions=function(){var a=this;this._handles.remove("actions");var m=this.actions;if(m){var b=m.length;return m.toArray().map(function(m,c){return a._renderAction(m,c,b,"actions")})}};q.prototype._addSelectedFeatureIndexHandle=function(){var a=this,m=p.watch(this,"viewModel.selectedFeatureIndex",
- function(m,b){return a._selectedFeatureIndexUpdated(m,b)});this._handles.add(m,"selected-index")};q.prototype._selectedFeatureIndexUpdated=function(a,m){var b=this.featureMenuOpen;this.featureCount&&b&&a!==m&&-1!==a&&(this.featureMenuOpen=!1)};q.prototype._updateFeatureWidget=function(){var a=this.featureWidgets[this.viewModel.selectedFeatureIndex]||null;a&&!a.contentEnabled&&(a.contentEnabled=!0);this._set("selectedFeatureWidget",a)};q.prototype._destroyFeatureWidgets=function(){this.featureWidgets.forEach(function(a){return a.destroy()});
- this._set("featureWidgets",[])};q.prototype._createFeatureWidgets=function(a){var m=this.featureWidgets.slice(0),b=this.get("viewModel.view"),c=[];a.forEach(function(a,d){if(a){var g=null;m.some(function(b,c){b&&b.graphic===a&&(g=b,m.splice(c,1));return!!g});c[d]=g||new t({contentEnabled:!1,graphic:a,view:b})}});m.forEach(function(a){return a&&a.destroy()});this._set("featureWidgets",c)};q.prototype._isScreenLocationWithinView=function(a,m){return-1<a.x&&-1<a.y&&a.x<=m.width&&a.y<=m.height};q.prototype._isOutsideView=
- function(a){var m=a.popupHeight,b=a.popupWidth,c=a.screenLocation,d=a.side;a=a.view;if(isNaN(b)||isNaN(m)||!a||!c)return!1;var g=a.padding;return"right"===d&&c.x+b/2>a.width-g.right||"left"===d&&c.x-b/2<g.left||"top"===d&&c.y-m<g.top||"bottom"===d&&c.y+m>a.height-g.bottom?!0:!1};q.prototype._determineCurrentAlignment=function(){var a=this._pointerOffsetInPx,m=this._containerNode,b=this._mainContainerNode,d=this.viewModel,g=d.screenLocation,d=d.view;if(!g||!d||!m)return"top-center";if(!this._isScreenLocationWithinView(g,
- d))return this._get("currentAlignment")||"top-center";var e=b?window.getComputedStyle(b,null):null,b=e?parseInt(e.getPropertyValue("max-height").replace(/[^-\d\.]/g,""),10):0,e=e?parseInt(e.getPropertyValue("height").replace(/[^-\d\.]/g,""),10):0,k=c.getContentBox(m),m=k.w+a,k=Math.max(k.h,b,e)+a,a=this._isOutsideView({popupHeight:k,popupWidth:m,screenLocation:g,side:"right",view:d}),b=this._isOutsideView({popupHeight:k,popupWidth:m,screenLocation:g,side:"left",view:d}),e=this._isOutsideView({popupHeight:k,
- popupWidth:m,screenLocation:g,side:"top",view:d}),g=this._isOutsideView({popupHeight:k,popupWidth:m,screenLocation:g,side:"bottom",view:d});return b?e?"bottom-right":"top-right":a?e?"bottom-left":"top-left":e?g?"top-center":"bottom-center":"top-center"};q.prototype._getCurrentAlignment=function(){var a=this.alignment;return this.dockEnabled?null:"auto"===a?this._determineCurrentAlignment():"function"===typeof a?a.call(this):a};q.prototype._setCurrentAlignment=function(){this._set("currentAlignment",
- this._getCurrentAlignment())};q.prototype._setCurrentDockPosition=function(){this._set("currentDockPosition",this._getCurrentDockPosition())};q.prototype._getDockPosition=function(){var a=this.get("dockOptions.position");return"auto"===a?this._determineCurrentDockPosition():"function"===typeof a?a.call(this):a};q.prototype._getCurrentDockPosition=function(){return this.dockEnabled?this._getDockPosition():null};q.prototype._wouldDockTo=function(){return this.dockEnabled?null:this._getDockPosition()};
- q.prototype._renderFeatureMenuItemNode=function(a,b,c,d){var e=b===c;d=(k={},k["esri-popup__feature-menu-item--selected"]=e,k);k=e?m.tsx("span",{key:B("feature-menu-selected-feature-"+c),title:g.selectedFeature,"aria-label":g.selectedFeature,class:"esri-icon-check-mark"}):null;a=m.tsx("span",{innerHTML:a.title||g.untitled});return m.tsx("li",{role:"menuitem",tabIndex:-1,key:B("feature-menu-feature-"+c),classes:d,class:"esri-popup__feature-menu-item",bind:this,"data-feature-index":b,onkeyup:this._handleFeatureMenuItemKeyup,
- onclick:this._selectFeature,onkeydown:this._selectFeature},m.tsx("span",{class:"esri-popup__feature-menu-title"},a,k));var k};q.prototype._renderFeatureMenuNode=function(a,b,c,d){var g=this;return 1<a.length?m.tsx("ol",{class:"esri-popup__feature-menu-list",id:d,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},a.map(function(a,m){return g._renderFeatureMenuItemNode(a,m,b,c)})):null};q.prototype._determineCurrentDockPosition=
- function(){var a=this.get("viewModel.view"),m=x.isRtl()?"top-left":"top-right";if(!a)return m;var b=a.padding||{left:0,right:0,top:0,bottom:0},b=a.width-b.left-b.right;return(a=a.get("breakpoints"))&&b<=a.xsmall?"bottom-center":m};q.prototype._renderContent=function(){var a=this.get("viewModel.content");if("string"===typeof a)return m.tsx("div",{key:a,innerHTML:a});if(m.isWidget(a))return m.tsx("div",{key:a},a.render());if(a instanceof HTMLElement)return m.tsx("div",{key:a,bind:a,afterCreate:this._attachToNode});
- if(m.isWidgetBase(a))return m.tsx("div",{key:a,bind:a.domNode,afterCreate:this._attachToNode})};q.prototype._attachToNode=function(a){a.appendChild(this)};q.prototype._positionContainer=function(a){void 0===a&&(a=this._containerNode);a&&(this._containerNode=a);if(a){var m=this.viewModel.screenLocation,b=c.getContentBox(a);if(m=this._calculatePositionStyle(m,b))a.style.top=m.top,a.style.left=m.left,a.style.bottom=m.bottom,a.style.right=m.right}};q.prototype._calculateFullWidth=function(a){var m=this.currentAlignment,
- b=this._pointerOffsetInPx;return"top-left"===m||"bottom-left"===m||"top-right"===m||"bottom-right"===m?a+b:a};q.prototype._calculateAlignmentPosition=function(a,m,b,c){var d=this.currentAlignment,g=this._pointerOffsetInPx;c/=2;var e=b.height-m;b=b.width-a;var k=this.view.padding;if("bottom-center"===d)return{top:m+g-k.top,left:a-c-k.left};if("top-left"===d)return{bottom:e+g-k.bottom,right:b+g-k.right};if("bottom-left"===d)return{top:m+g-k.top,right:b+g-k.right};if("top-right"===d)return{bottom:e+
- g-k.bottom,left:a+g-k.left};if("bottom-right"===d)return{top:m+g-k.top,left:a+g-k.left};if("top-center"===d)return{bottom:e+g-k.bottom,left:a-c-k.left}};q.prototype._calculatePositionStyle=function(a,m){var b=this.view;if(b){if(this.dockEnabled)return{left:"",top:"",right:"",bottom:""};if(a&&m&&(m=this._calculateFullWidth(m.w),a=this._calculateAlignmentPosition(a.x,a.y,b,m)))return{top:void 0!==a.top?a.top+"px":"auto",left:void 0!==a.left?a.left+"px":"auto",bottom:void 0!==a.bottom?a.bottom+"px":
- "auto",right:void 0!==a.right?a.right+"px":"auto"}}};q.prototype._viewChange=function(a,m){a&&m&&(this.close(),this.clear())};q.prototype._viewReadyChange=function(a,m){a?(a=this.get("viewModel.view"),this._wireUpView(a)):m&&(this.close(),this.clear())};q.prototype._wireUpView=function(a){this._destroySpinner();a&&(this.spinnerEnabled&&this._createSpinner(a),this._setDockEnabledForViewSize(this.dockOptions))};q.prototype._dockingThresholdCrossed=function(a,m,b){var c=a[0];a=a[1];var d=m[0];m=m[1];
- var g=b.width;b=b.height;return c<=g&&d>g||c>g&&d<=g||a<=b&&m>b||a>b&&m<=b};q.prototype._updateDockEnabledForViewSize=function(a,m){if(a&&m){var b=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},c=b.left+b.right,d=b.top+b.bottom,b=[],g=[];b[0]=a[0]-c;b[1]=a[1]-d;g[0]=m[0]-c;g[1]=m[1]-d;a=this.dockOptions;this._dockingThresholdCrossed(b,g,a.breakpoint)&&this._setDockEnabledForViewSize(a);this._setCurrentDockPosition()}};q.prototype._focusDockButtonNode=function(a){this._focusDockButton&&
- (this._focusDockButton=!1,a.focus())};q.prototype._mainContainerNodeUpdated=function(a){this._mainContainerNode=a;this._focusContainer?(this._focusContainer=!1,a.focus()):this._blurContainer&&(this._blurContainer=!1,a.blur())};q.prototype._featureMenuNodeUpdated=function(a){(this._featureMenuNode=a)&&this._focusFirstFeature&&(this._focusFirstFeature=!1,a=a.querySelectorAll("li"),a.length&&a[0].focus())};q.prototype._focusFeatureMenuButtonNode=function(a){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=
- !1,a.focus())};q.prototype._featureMenuViewportNodeUpdated=function(a){a&&(a.scrollTop=0)};q.prototype._toggleScreenLocationEnabled=function(){var a=this.dockEnabled,m=this.viewModel;m&&(m.screenLocationEnabled=this.visible&&!a)};q.prototype._shouldDockAtCurrentViewSize=function(a){a=a.breakpoint;var m=this.get("viewModel.view.ui"),b=m.width,m=m.height;if(isNaN(b)||isNaN(m))return!1;b=a.hasOwnProperty("width")&&b<=a.width;a=a.hasOwnProperty("height")&&m<=a.height;return b||a};q.prototype._setDockEnabledForViewSize=
- function(a){a.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(a))};q.prototype._getPageText=function(a,m){return k.substitute({index:m+1,total:a},g.pageText)};q.prototype._destroySpinner=function(){var a=this._spinner,m=this.view;a&&(m&&m.ui.remove(this._spinner,"popup-spinner"),a.destroy(),this._spinner=null)};q.prototype._createSpinner=function(a){a&&(this._spinner=new u({view:a}),a.ui.add(this._spinner,{key:"popup-spinner",position:"manual"}))};q.prototype._toggleCollapsed=function(){this.collapsed=
- !this.collapsed};q.prototype._close=function(){this.close();this.view&&this.view.focus()};q.prototype._toggleDockEnabled=function(){this.dockEnabled=!this.dockEnabled;this._focusDockButton=!0;this.scheduleRender()};q.prototype._toggleFeatureMenu=function(){var a=!this.featureMenuOpen;this._featureMenuOpenChanged(a);this.featureMenuOpen=a};q.prototype._triggerAction=function(a){this.viewModel.triggerAction(a.currentTarget["data-action-index"])};q.prototype._selectFeature=function(a){a=a.currentTarget["data-feature-index"];
- isNaN(a)||(this.viewModel.selectedFeatureIndex=a)};q.prototype._next=function(){this.next()};q.prototype._previous=function(){this.previous()};a([n.aliasOf("viewModel.actions"),m.renderable()],q.prototype,"actions",void 0);a([n.property()],q.prototype,"alignment",void 0);a([n.aliasOf("viewModel.autoCloseEnabled")],q.prototype,"autoCloseEnabled",void 0);a([n.aliasOf("viewModel.content"),m.renderable()],q.prototype,"content",void 0);a([n.property(),m.renderable()],q.prototype,"collapsed",void 0);a([n.property(),
- m.renderable()],q.prototype,"collapseEnabled",void 0);a([n.property({readOnly:!0,dependsOn:["dockEnabled","alignment"]}),m.renderable()],q.prototype,"currentAlignment",null);a([n.property({readOnly:!0,dependsOn:["viewModel.view.ready","dockEnabled","dockOptions"]}),m.renderable()],q.prototype,"currentDockPosition",null);a([n.property(),m.renderable()],q.prototype,"dockOptions",null);a([n.property(),m.renderable()],q.prototype,"dockEnabled",void 0);a([n.aliasOf("viewModel.featureCount"),m.renderable()],
- q.prototype,"featureCount",void 0);a([n.property({dependsOn:["viewModel.visible"]}),m.renderable()],q.prototype,"featureMenuOpen",null);a([n.aliasOf("viewModel.features"),m.renderable()],q.prototype,"features",void 0);a([n.property(),m.renderable()],q.prototype,"featureNavigationEnabled",void 0);a([n.aliasOf("viewModel.highlightEnabled")],q.prototype,"highlightEnabled",void 0);a([n.aliasOf("viewModel.location"),m.renderable()],q.prototype,"location",void 0);a([n.property({readOnly:!0}),m.renderable()],
- q.prototype,"featureWidgets",void 0);a([n.aliasOf("viewModel.promises")],q.prototype,"promises",void 0);a([n.aliasOf("viewModel.selectedFeature"),m.renderable()],q.prototype,"selectedFeature",void 0);a([n.aliasOf("viewModel.selectedFeatureIndex"),m.renderable()],q.prototype,"selectedFeatureIndex",void 0);a([n.property({readOnly:!0}),m.renderable()],q.prototype,"selectedFeatureWidget",void 0);a([n.property()],q.prototype,"spinnerEnabled",void 0);a([n.aliasOf("viewModel.title"),m.renderable()],q.prototype,
- "title",void 0);a([n.aliasOf("viewModel.updateLocationEnabled")],q.prototype,"updateLocationEnabled",void 0);a([n.aliasOf("viewModel.view")],q.prototype,"view",void 0);a([n.property({type:v}),m.renderable("viewModel.screenLocation viewModel.screenLocationEnabled viewModel.state viewModel.pendingPromisesCount viewModel.promiseCount viewModel.waitingForResult".split(" ")),m.vmEvent(["triggerAction","trigger-action"])],q.prototype,"viewModel",void 0);a([n.aliasOf("viewModel.visible"),m.renderable()],
- q.prototype,"visible",void 0);a([n.aliasOf("viewModel.clear")],q.prototype,"clear",null);a([n.aliasOf("viewModel.next")],q.prototype,"next",null);a([n.aliasOf("viewModel.previous")],q.prototype,"previous",null);a([n.aliasOf("viewModel.triggerAction")],q.prototype,"triggerAction",null);a([m.accessibleHandler()],q.prototype,"_toggleCollapsed",null);a([m.accessibleHandler()],q.prototype,"_close",null);a([m.accessibleHandler()],q.prototype,"_toggleDockEnabled",null);a([m.accessibleHandler()],q.prototype,
- "_toggleFeatureMenu",null);a([m.accessibleHandler()],q.prototype,"_triggerAction",null);a([m.accessibleHandler()],q.prototype,"_selectFeature",null);a([m.accessibleHandler()],q.prototype,"_next",null);a([m.accessibleHandler()],q.prototype,"_previous",null);return q=a([n.subclass("esri.widgets.Popup")],q)}(n.declared(q))})},"esri/widgets/Feature":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Feature/nls/Feature dojo/keys ../core/promiseUtils ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Feature/FeatureViewModel ./Feature/support/attachmentUtils ./support/uriUtils ./support/widget".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){function u(a,b){return void 0===b?"esri-feature__"+a:"esri-feature__"+a+"-"+b}return function(k){function q(a){a=k.call(this)||this;a._chartMap=new Map;a._activeMediaMap=new Map;a._chartRequirePromise=null;a._refreshTimers=new Map;a._mediaInfo=new Map;a.contentEnabled=null;a.graphic=null;a.title=null;a.view=null;a.viewModel=new l;return a}f(q,k);q.prototype.postInitialize=function(){var a=this;this.own(d.init(this,"viewModel.content",function(){return a._setupMediaRefreshTimers()}))};
- q.prototype.destroy=function(){this._clearMediaRefreshTimers();this._activeMediaMap.clear();this._activeMediaMap=null;this._cancelChartModules();this._destroyCharts()};q.prototype.render=function(){var a=t.tsx("div",{key:u("loading-container"),class:"esri-feature__loading-container"},t.tsx("span",{class:t.join("esri-icon-loading-indicator esri-rotating","esri-feature__loading-spinner")})),a=this.viewModel.waitingForContent?a:this._renderContent();return t.tsx("div",{class:"esri-feature"},t.tsx("div",
- {class:"esri-feature__size-container"},t.tsx("div",{class:"esri-feature__main-container"},a)))};q.prototype.goToMedia=function(a,m){this._setContentElementMedia(a,m)};q.prototype.nextMedia=function(a){this._pageContentElementMedia(a,"next")};q.prototype.previousMedia=function(a){this._pageContentElementMedia(a,"previous")};q.prototype._cancelChartModules=function(){this._chartRequirePromise&&this._chartRequirePromise.cancel()};q.prototype._destroyChart=function(a){var m=this._chartMap.get(a);m&&(m.chart.destroy(),
- m.tooltip.destroy());this._chartMap.delete(a)};q.prototype._destroyCharts=function(){this._chartMap.forEach(function(a){a.chart.destroy();a.tooltip.destroy()});this._chartMap.clear()};q.prototype._renderContent=function(){this._destroyCharts();var a=this.viewModel.content;if("string"===typeof a)return t.tsx("div",{key:u("content-string"),innerHTML:a});if(t.isWidget(a))return t.tsx("div",{key:u("content-widget")},a.render());if(a instanceof HTMLElement)return t.tsx("div",{key:u("content-html-element"),
- bind:a,afterCreate:this._attachToNode});if(t.isWidgetBase(a))return t.tsx("div",{key:u("content-dijit"),bind:a.domNode,afterCreate:this._attachToNode});if(Array.isArray(a))return a.length?t.tsx("div",{key:u("content-content-elements")},a.map(this._renderContentElement,this)):null};q.prototype._renderContentElement=function(a,m){switch(a.type){case "attachments":return this._renderAttachments(a,m);case "fields":return this._renderFields(a,m);case "media":return this._renderMedia(a,m);case "text":return this._renderText(a,
- m);default:return null}};q.prototype._renderAttachmentInfo=function(a){var m=a.attachmentInfo,b=a.supportsResizeAttachments,c=m.contentType;a=m.name;var d=m.url,g=b&&p.isSupportedImage(c),k=-1===d.indexOf("?")?"?":"\x26",c=g?""+d+k+"w\x3d48":p.getIconPath(c),g=(l={},l["esri-feature__attachment-item-mask--icon"]=!g,l),l=(f={},f["esri-feature__attachments-image--resizable"]=b,f);return t.tsx("li",{class:"esri-feature__attachments-item",key:m},t.tsx("a",{class:"esri-feature__attachments-item-link",href:d,
- target:"_blank"},t.tsx("div",{classes:g,class:"esri-feature__attachment-item-mask"},t.tsx("img",{alt:a,classes:l,class:"esri-feature__attachments-image",title:a,src:c}),t.tsx("span",{class:"esri-feature__attachments-image-overlay"},t.tsx("span",{"aria-hidden":"true",class:"esri-feature__attachments-link-icon esri-icon-link-external"}))),t.tsx("span",{class:"esri-feature__attachments-filename"},a||e.noTitle)));var l,f};q.prototype._renderAttachments=function(a,m){var b=this,c=a.displayType,d=(m=a.attachmentInfos)&&
- m.length,g=this.get("graphic.layer.capabilities.operations.supportsResizeAttachments"),c=(k={},k["esri-feature__attachments--list"]="preview"!==c,k["esri-feature__attachments--preview"]="preview"===c,k);return d?t.tsx("div",{key:u("attachments-element"),class:t.join("esri-feature__attachments","esri-feature__content-element"),classes:c},t.tsx("div",{class:"esri-feature__attachments-title"},e.attach),t.tsx("ul",{class:"esri-feature__attachments-items"},m.map(function(m,c){return b._renderAttachmentInfo({attachmentInfo:m,
- attachmentInfoIndex:c,supportsResizeAttachments:g,contentElement:a})}))):null;var k};q.prototype._forceLTR=function(a){return"\x26lrm;"+a};q.prototype._renderFieldInfo=function(a,m){var b=this.viewModel.formattedAttributes,c=b?b.content[m]||b.global:null,d=a.fieldName,b=a.label||d,c=c?null==c[d]?"":c[d]:"";a=!(!a.format||!a.format.dateFormat);c="number"!==typeof c||a?n.autoLink(c):this._forceLTR(c);a=(g={},g["esri-feature__field-data--date"]=a,g);return t.tsx("tr",{key:u("fields-element-info-row",
- m)},t.tsx("th",{key:u("fields-element-info-row-header",m),class:"esri-feature__field-header",innerHTML:b}),t.tsx("td",{key:u("fields-element-info-row-data",m),class:"esri-feature__field-data",classes:a,innerHTML:c}));var g};q.prototype._renderFields=function(a,m){var b=this;return(a=a.fieldInfos)?t.tsx("div",{key:u("fields-element",m),class:t.join("esri-feature__fields","esri-feature__content-element")},t.tsx("table",{class:"esri-table",summary:e.fieldsSummary,key:u("fields-element-table",m)},t.tsx("tbody",
- {key:u("fields-element-table-body",m)},a.map(function(a){return b._renderFieldInfo(a,m)})))):null};q.prototype._shouldOpenInNewTab=function(a){void 0===a&&(a="");return!/^(?:mailto:|tel:)/.test(a.trim().toLowerCase())};q.prototype._clearMediaRefreshTimers=function(){this._refreshTimers.forEach(function(a){return clearTimeout(a)});this._refreshTimers.clear()};q.prototype._clearMediaRefreshTimer=function(a){var m=this._refreshTimers.get(a);m&&(clearTimeout(m),this._refreshTimers.delete(a))};q.prototype._getImageSource=
- function(a,m){var b=-1!==a.indexOf("?")?"\x26":"?";a=a.split("#");var c=a[1],c=void 0===c?"":c;return""+a[0]+b+"timestamp\x3d"+m+(c?"#":"")+c};q.prototype._setupMediaRefreshTimer=function(a){var m=this.get("viewModel.content");if(Array.isArray(m)&&(m=m[a])&&"media"===m.type){var b=this._activeMediaMap.get(a);isNaN(b)&&(b=0);(m=m.mediaInfos[b])&&"image"===m.type&&m.refreshInterval&&this._setRefreshTimeout(a,m)}};q.prototype._setupMediaRefreshTimers=function(){var a=this;this._clearMediaRefreshTimers();
- var m=this.get("viewModel.content");Array.isArray(m)&&m.forEach(function(m,b){return a._setupMediaRefreshTimer(b)})};q.prototype._updateMediaInfoTimestamp=function(a,m){var b=Date.now();this._mediaInfo.set(m,{timestamp:b,sourceURL:this._getImageSource(a,b)});this.scheduleRender()};q.prototype._setRefreshTimeout=function(a,m){var b=this,c=m.refreshInterval,d=m.value;c&&(m=6E4*c,this._updateMediaInfoTimestamp(d.sourceURL,a),m=setInterval(function(){b._updateMediaInfoTimestamp(d.sourceURL,a)},m),this._refreshTimers.set(a,
- m))};q.prototype._renderMediaInfoType=function(a,m){var b=a.value,c=a.title,c=void 0===c?"":c,d=a.type,g=a.refreshInterval,e=b.sourceURL,b=b.linkURL;if("image"===d)return a=this._shouldOpenInNewTab(b)?"_self":"_blank",e=(g=g?this._mediaInfo.get(m):null)?g.sourceURL:e,m=t.tsx("img",{alt:c,key:u("media-image-"+(g?g.timestamp:0),m),src:e}),(c=b?t.tsx("a",{title:c,href:b,target:a},m):null)?c:m;if(-1!==d.indexOf("chart"))return t.tsx("div",{key:u("chart",m),bind:this,"data-media-info":a,"data-content-element-index":m,
- class:"esri-feature__media-chart",afterCreate:this._getChartDependencies,afterUpdate:this._getChartDependencies})};q.prototype._getChartDependencies=function(a){var m=this,b=a["data-media-info"],c=a["data-content-element-index"],d=b.value,e=d.theme||"Claro",k=b.type,l=e;"string"===typeof e&&(l=e.replace(/\./g,"/"));this._cancelChartModules();this._chartRequirePromise=g.create(function(a){return r(["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip","dojox/charting/themes/"+l],function(){for(var b=
- [],m=0;m<arguments.length;m++)b[m]=arguments[m];return a(b)})}).then(function(b){m._renderChart(a,c,k,d,b[0],b[1],b[2]);m._chartRequirePromise=null})};q.prototype._renderChart=function(a,b,c,d,g,e,k){a=new g(a,{margins:{l:4,t:4,r:4,b:4}});k&&a.setTheme(k);switch(c){case "pie-chart":a.addPlot("default",{type:"Pie",labels:!1});a.addSeries("Series A",d.chartOptions);break;case "line-chart":a.addPlot("default",{type:"Markers"});a.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});
- a.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});d.chartOptions.forEach(function(a,b){a.x=b+1});a.addSeries("Series A",d.chartOptions);break;case "column-chart":a.addPlot("default",{type:"Columns",gap:3});a.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});a.addSeries("Series A",d.chartOptions);break;case "bar-chart":a.addPlot("default",{type:"Bars",gap:3}),a.addAxis("x",{includeZero:!0,fixUpper:"minor",minorLabels:!1}),a.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,
- minorLabels:!1}),a.addSeries("Series A",d.chartOptions)}c=new e(a);a.render();this._chartMap.set(b,{chart:a,tooltip:c})};q.prototype._renderMediaInfo=function(a,b){this._destroyChart(b);var m=this._renderMediaInfoType(a,b),c=a.title?t.tsx("div",{key:u("media-title",b),class:"esri-feature__media-item-title",innerHTML:a.title}):null;a=a.caption?t.tsx("div",{key:u("media-caption",b),class:"esri-feature__media-item-caption",innerHTML:a.caption}):null;return t.tsx("div",{key:u("media-container",b),class:"esri-feature__media-item-container"},
- t.tsx("div",{key:u("media-item-container",b),class:"esri-feature__media-item"},m),c,a)};q.prototype._renderMediaStatsItem=function(a,b,c){c="chart"===c?t.join("esri-feature__media-chart-icon","esri-icon-chart"):t.join("esri-feature__media-image-icon","esri-icon-media");return t.tsx("li",{class:"esri-feature__media-image-summary"},t.tsx("span",{"aria-hidden":"true",class:c}),t.tsx("span",{class:"esri-feature__media-count","aria-label":a},"("+b+")"))};q.prototype._renderMediaPageButton=function(a,b){var m=
- (a="previous"===a)?e.previous:e.next,c=a?t.join("esri-feature__button","esri-feature__media-previous"):t.join("esri-feature__button","esri-feature__media-next"),d=a?t.join("esri-feature__icon","esri-feature__media-previous-icon","esri-icon-left-triangle-arrow"):t.join("esri-feature__icon","esri-feature__media-next-icon","esri-icon-right-triangle-arrow"),g=a?t.join("esri-feature__icon","esri-feature__media-previous-icon--rtl","esri-icon-right-triangle-arrow"):t.join("esri-feature__icon","esri-feature__media-next-icon--rtl",
- "esri-icon-left-triangle-arrow"),k=a?this._previousClick:this._nextClick;return t.tsx("div",{key:u(a?"previous":"next",b),title:m,tabIndex:0,role:"button",class:c,"data-content-element-index":b,bind:this,onkeydown:k,onclick:k},t.tsx("span",{"aria-hidden":"true",class:d}),t.tsx("span",{"aria-hidden":"true",class:g}),t.tsx("span",{class:"esri-icon-font-fallback-text"},m))};q.prototype._handleMediaKeyup=function(a){var b=a.currentTarget["data-content-element-index"],d=a.keyCode;d===c.LEFT_ARROW&&(a.stopPropagation(),
- this.previousMedia(b));d===c.RIGHT_ARROW&&(a.stopPropagation(),this.nextMedia(b))};q.prototype._renderMedia=function(a,b){a=a.mediaInfos;var m=this._getMediaStats(a),c=m.total,d=(g={},g["esri-feature--media-pagination-visible"]=1<m.total,g),g=this._renderMediaStatsItem(e.numImages,m.images,"image"),m=this._renderMediaStatsItem(e.numCharts,m.charts,"chart"),k=this._renderMediaPageButton("previous",b),l=this._renderMediaPageButton("next",b),f=this._activeMediaMap.get(b);isNaN(f)&&(this._activeMediaMap.set(b,
- 0),f=0);return c?t.tsx("div",{key:u("media-element",b),"data-content-element-index":b,bind:this,onkeyup:this._handleMediaKeyup,class:t.join("esri-feature__media","esri-feature__content-element"),classes:d},t.tsx("ul",{class:"esri-feature__media-summary"},g,m),t.tsx("div",{key:u("media-element-container",b),class:"esri-feature__media-container"},k,this._renderMediaInfo(a[f],b),l)):null;var g};q.prototype._renderText=function(a,b){return a.text?t.tsx("div",{key:u("text-element",b),innerHTML:a.text,
- class:t.join("esri-feature__text","esri-feature__content-element")}):null};q.prototype._attachToNode=function(a){a.appendChild(this)};q.prototype._getMediaStats=function(a){var b=0,c=0;a.forEach(function(a){a=a.type;"image"===a?b++:-1!==a.indexOf("chart")&&c++});return{total:c+b,images:b,charts:c}};q.prototype._setContentElementMedia=function(a,b){this._clearMediaRefreshTimer(a);var m=this.viewModel.content;(m=(m=m&&m[a])&&m.mediaInfos)&&m.length&&(this._activeMediaMap.set(a,(b+m.length)%m.length),
- this._setupMediaRefreshTimer(a),this.scheduleRender())};q.prototype._pageContentElementMedia=function(a,b){b="previous"===b?-1:1;b=this._activeMediaMap.get(a)+b;this._setContentElementMedia(a,b)};q.prototype._previousClick=function(a){this.previousMedia(a.currentTarget["data-content-element-index"])};q.prototype._nextClick=function(a){this.nextMedia(a.currentTarget["data-content-element-index"])};a([b.aliasOf("viewModel.contentEnabled")],q.prototype,"contentEnabled",void 0);a([b.aliasOf("viewModel.graphic")],
- q.prototype,"graphic",void 0);a([b.aliasOf("viewModel.title")],q.prototype,"title",void 0);a([b.aliasOf("viewModel.view")],q.prototype,"view",void 0);a([b.property({type:l}),t.renderable(["viewModel.waitingForContent","viewModel.content"])],q.prototype,"viewModel",void 0);a([t.accessibleHandler()],q.prototype,"_previousClick",null);a([t.accessibleHandler()],q.prototype,"_nextClick",null);return q=a([b.subclass("esri.widgets.Feature")],q)}(b.declared(k))})},"esri/widgets/Feature/FeatureViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/assignHelper dojo/i18n!dojo/cldr/nls/number ../../Graphic ../../core/date ../../core/Error ../../core/Handles ../../core/lang ../../core/Logger ../../core/promiseUtils ../../core/watchUtils ../../core/accessorSupport/decorators ../../support/arcadeUtils ./support/featureUtils ./support/RelatedFeatures ../support/widget".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m){function B(a,b){return a&&"feature"===a.type?a.getField(b):null}function z(a){return a.replace(/[\u00A0-\u99999<>\&]/gim,function(a){return"\x26#"+a.charCodeAt(0)+";"})}var C=p.getLogger("esri.widgets.FeatureViewModel"),A=/^\s*expression\//i,D=new b("cancelled-query","cancelled feature query"),E=d.getFormat("short-date-short-time"),F="DateFormat"+E;return function(b){function e(a){a=b.call(this)||this;a._handles=new k;a._featurePromise=void 0;a._layerDateFields=
- [];a.content=null;a.contentEnabled=!0;a.formattedAttributes=null;a.title="";a.view=null;return a}f(e,b);e.prototype.destroy=function(){this._clear();this._handles.destroy();this.graphic=this.view=this._handles=null};Object.defineProperty(e.prototype,"graphic",{get:function(){return this._get("graphic")||null},set:function(a){if(a){var b=v.getSourceLayer(a);this._layerDateFields=b?this._getDateFields(b):[]}this._set("graphic",a);this._graphicChanged(a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,
- "waitingForContent",{get:function(){var a=this._featurePromise;return a?!a.isFulfilled():!1},enumerable:!0,configurable:!0});e.prototype._clear=function(){this._cancelFeatureQuery();this._set("title","");this._set("content",null);this._set("formattedAttributes",null)};e.prototype._graphicChanged=function(a){var b=this,m=this._handles;m&&(m.remove("graphic"),this._clear(),a&&(m.add(t.watch(this,["graphic.popupTemplate.title","graphic.popupTemplate.content","graphic.popupTemplate.fieldInfos","contentEnabled"],
- function(){b._graphicChanged(b.graphic)}),"graphic"),this._featurePromise=this._queryFeature().then(function(){b.notifyChange("waitingForContent")}).catch(function(a){b.notifyChange("waitingForContent");a!==D&&C.log("error","error loading template",a);throw a;}),this.notifyChange("waitingForContent")))};e.prototype._cancelFeatureQuery=function(){var a=this._featurePromise;a&&!a.isFulfilled()&&a.cancel(D)};e.prototype._compileContent=function(a,b){var c=this;if(a&&(a.nodeName||a&&m.isWidgetBase(a)||
- m.isWidget(a)))return a;if("string"===typeof a)return this._compileText({type:"text",text:a}).text;if(Array.isArray(a))return a.map(function(a,m){m=(m=b&&b[m])&&m.value;var d=a.type;if("attachments"===d)return c._compileAttachments(a,m);if("fields"===d)return c._compileFields(a);if("media"===d)return c._compileMedia(a);if("text"===d)return c._compileText(a)});a&&C.warn("invalid content type.")};e.prototype._compileFields=function(a){var b=this,m=this.graphic;a=l.clone(a);var c=m.get("popupTemplate.expressionInfos"),
- m=a.fieldInfos?void 0:m.get("popupTemplate.fieldInfos"),m=a.fieldInfos||l.clone(m),d=[];m&&m.forEach(function(a){var m=a.fieldName.toLowerCase();if(!a.hasOwnProperty("visible")||a.visible)m=b._isExpressionField(m)?b._getExpressionInfo(c,m):null,a.label=m?m.title:a.label,d.push(a)});a.fieldInfos=d;return a};e.prototype._setImageValue=function(a,b,m){var c=a.linkURL;a.sourceURL=l.substitute(b,this._fixTokens(a.sourceURL,m));a.sourceURL&&c&&(a.linkURL=(""+l.substitute(b,this._fixTokens(c,m))).trim())};
- e.prototype._compileMedia=function(a){var b=this,m=this._layerDateFields,c=this.graphic;a=l.clone(a);var d=a.mediaInfos||[],e=c.attributes,g=v.getSourceLayer(c),k=this.formattedAttributes.global,f={dateFormat:{properties:m,formatter:F}};a.mediaInfos=d.map(function(a){if(a=l.clone(a)){var m=a.value,c=a.type,d=a.title?b._processFieldsInLinks(b._fixTokens(a.title,g),e):"",B=a.caption?b._processFieldsInLinks(b._fixTokens(a.caption,g),e):"";a.title=d?(""+l.substitute(k,d,f)).trim():"";a.caption=B?(""+
- l.substitute(k,B,f)).trim():"";if("image"===c)return b._setImageValue(m,k,g),a;if("pie-chart"===c||"line-chart"===c||"column-chart"===c||"bar-chart"===c)return b._setChartValue(m,k,g),a}});return a};e.prototype._compileText=function(a){var b=this._layerDateFields,m=this.graphic;if((a=l.clone(a))&&a.text){var c=v.getSourceLayer(m),d=m.attributes,m=this.formattedAttributes.global,b={dateFormat:{properties:b,formatter:F}},c=this._processFieldsInLinks(this._fixTokens(a.text,c),d);a.text=(""+l.substitute(m,
- c,b)).trim()}return a};e.prototype._compileTitle=function(){var a=this._layerDateFields,b=this.graphic,m=b.get("popupTemplate.title"),c=b.attributes,d=v.getSourceLayer(b),a={dateFormat:{properties:a,formatter:F}},g=this.formattedAttributes.global;return"function"===typeof m?m.call(null,{graphic:b}):"string"===typeof m&&m?(b=this._processFieldsInLinks(this._fixTokens(m,d),c),(""+l.substitute(g,b,a)).trim()):""};e.prototype._getExpressionInfo=function(a,b){if(this._isExpressionField(b)){var m=b.replace(A,
- "").toLowerCase(),c;a.some(function(a){if(a.name.toLowerCase()===m)return c=a,!0});return c}};e.prototype._fixTokens=function(a,b){return a.replace(/(\{([^\{\r\n]+)\})/g,function(a,m,c){return(a=B(b,c))?"{"+a.name+"}":m})};e.prototype._encodeAttributes=function(a){var b=a?l.clone(a):{};Object.keys(b).forEach(function(a){var m=b[a];"string"===typeof m&&(m=encodeURIComponent(m).replace(/\'/g,"\x26apos;"),b[a]=m)});return b};e.prototype._formatAttributesToFieldInfos=function(a,b,m){var c=this,d=l.clone(this._layerDateFields);
- a.forEach(function(g){var e=c._getFixedFieldName(g.fieldName,b);g.fieldName=e;m[e]=c._formatValue(m[e],{fieldInfos:a,fieldName:e,layer:b});d&&g.format&&g.format.dateFormat&&(g=d.indexOf(e),-1<g&&d.splice(g,1))})};e.prototype._getArcadeViewingMode=function(a){return a&&"local"===a.viewingMode?"localScene":"globalScene"};e.prototype._getViewInfo=function(){var a=this.view;if(a){var b="3d"===a.type?this._getArcadeViewingMode(a):"map";return q.getViewInfo({viewingMode:b,scale:a.scale,spatialReference:a.spatialReference})}};
- e.prototype._formatAttributes=function(a,b,m){var c=this,d=this.graphic,g=d.attributes,e=v.getSourceLayer(d),k=g?l.clone(g):{};b&&b.forEach(function(a){var b="expression/"+a.name;a=m.get(a.name);var g=c._getViewInfo();a=q.executeFunction(a,q.createExecContext(d,g));k[b]="string"===typeof a?z(a):a});this.addRelatedFeatureAttributes(k);a&&this._formatAttributesToFieldInfos(a,e,k);if(e){var f=e.typeIdField;g&&Object.keys(g).forEach(function(a){if(!c.isRelatedField(a)){var b=g[a];l.isDefined(b)&&(b=c._getDomainName(a,
- b),l.isDefined(b)?k[a]=b:a===f&&(b=c._getTypeName(),l.isDefined(b)&&(k[a]=b)))}})}return k};e.prototype._formatValue=function(a,b){var m={dateFormat:{properties:this._layerDateFields,formatter:F}},g=b.fieldName,e=this._getFieldInfo(b.fieldInfos,g),k=l.clone(e),e=b.preventPlacesFormatting;(b=B(b.layer,g))&&"date"===b.type&&(b=k.format||{},b.dateFormat=b.dateFormat||"short-date-short-time",k.format=b);g=k&&k.format;if(!l.isDefined(a)||!k||!l.isDefined(g))return a;var f=[],k=g.hasOwnProperty("places")||
- g.hasOwnProperty("digitSeparator");b=g.hasOwnProperty("digitSeparator")?g.digitSeparator:!0;e=l.isDefined(g.places)&&(!e||0<g.places);k&&e&&f.push("places: "+Number(g.places));e=k?e?"NumberFormat("+f.join(",")+")":"NumberFormat":g.dateFormat?"DateFormat"+(d.getFormat(g.dateFormat)||E):void 0;if(!e)return a;a=l.substitute({myKey:a},"{myKey:"+e+"}",m)||"";return k&&!b&&c.group?a.replace(new RegExp("\\"+c.group,"g"),""):a};e.prototype._getDomainName=function(a,b){var m=this.graphic,c=v.getSourceLayer(m);
- return c&&"feature"===c.type?(a=c.getFieldDomain(a,{feature:m}))&&"coded-value"===a.type?a.getName(b):null:null};e.prototype._getFieldInfo=function(a,b){if(a&&a.length&&b){var m=b.toLowerCase(),c=void 0;a.some(function(a){if(a.fieldName&&a.fieldName.toLowerCase()===m)return c=a,!0});return c}};e.prototype._getTypeName=function(){var a=this.graphic,b=v.getSourceLayer(a);if(b&&"feature"===b.type&&(a=b.getFeatureType(a),!a))return a.name};e.prototype._processFieldsInLinks=function(a,b){var m=this._encodeAttributes(b),
- c=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/ig;return a?a.replace(c,function(a,c,d){c=(""+(c||d)).trim();return l.substitute(c&&"{"===c[0]?b:m,a)}):a};e.prototype._compileAttachments=function(a,b){a=l.clone(a);if(!b)return a;a.attachmentInfos=b;return a};e.prototype._queryAttachments=function(){var a=this.graphic,b=v.getSourceLayer(a);return b?(b="scene"===b.type&&b.associatedLayer?b.associatedLayer:b)&&"feature"===b.type?b.queryFeatureAttachments(a):n.resolve([]):n.resolve([])};e.prototype._queryContentElements=
- function(a){var b=this;if(!Array.isArray(a))return n.resolve();var m={};a.forEach(function(a,c){"attachments"===a.type&&(a=b._queryAttachments())&&(m[c]=a)});return Object.keys(m).length?n.eachAlways(m):n.resolve()};e.prototype._getContent=function(){var a=this.graphic;if(!this.contentEnabled)return n.resolve();var b=a.get("popupTemplate.content"),a="function"===typeof b?b.call(null,{graphic:a}):b;return n.isThenable(a)?a:n.resolve(a)};e.prototype._queryFeature=function(){var a=this;return this._getContent().then(function(b){return a._checkForRelatedFeatures(b).then(function(){a._set("formattedAttributes",
- a._createFormattedAttributes(b));a._set("title",a._compileTitle());return a._queryContentElements(b).then(function(m){m=a._compileContent(b,m);a._set("content",m||null);return m})})})};e.prototype._isExpressionField=function(a){return A.test(a)};e.prototype._createCompiledExpressionDictionary=function(a){var b=new Map;if(!a)return b;a.forEach(function(a){return b.set(a.name,q.createFunction(a.expression))});return b};e.prototype._getDateFields=function(a){return(a=a.fields)?a.filter(function(a){return"date"===
- a.type}).map(function(a){return a.name}):[]};e.prototype._createFormattedAttributes=function(a){var b=this,m=this.graphic,c=m.get("popupTemplate.fieldInfos"),d=m.get("popupTemplate.expressionInfos"),g=this._createCompiledExpressionDictionary(d),e={global:this._formatAttributes(c,d,g),content:[]};Array.isArray(a)&&a.forEach(function(a,m){"fields"===a.type&&a.fieldInfos&&(e.content[m]=b._formatAttributes(a.fieldInfos,d,g))});return e};e.prototype._getAllFieldInfos=function(a){var b=[],m=this.graphic.get("popupTemplate.fieldInfos");
- m&&b.push.apply(b,m);if(!a||!Array.isArray(a))return b;a.forEach(function(a){b.push.apply(b,a&&a.fieldInfos)});return b};e.prototype._checkForRelatedFeatures=function(a){var b=this.graphic;a=this._getAllFieldInfos(a);return this.queryRelatedInfos(b,a)};e.prototype._getChartOption=function(a,b,m,c,d){var g=v.getSourceLayer(this.graphic),e=b.normalizeField;b=b.tooltipField;e=e?this.isRelatedField(e)?m[this.getRelatedFieldInfo(e).fieldName]:m[e]:null;a=parseFloat(m[a]);var k=void 0===a?null:a&&e?a/e:
- a;a={y:k,tooltip:""+k};if(!b)return a;if(this.isRelatedField(b))return c=this.getRelatedFieldInfo(b).fieldName,m=m[c],d=this._formatValue(k,{fieldInfos:d,fieldName:m,layer:g,preventPlacesFormatting:!!e}),a.tooltip=m+":"+d,a;m=this._getFieldInfo(d,c);c=this._getFixedFieldName(c,g);d=this._formatValue(k,{fieldInfos:d,fieldName:b,layer:g,preventPlacesFormatting:!!e});a.tooltip=(m?m.fieldName:c)+":"+d;return a};e.prototype._getFixedFieldName=function(a,b){return(b=B(b,a))?b.name:a};e.prototype._getFixedFieldNames=
- function(a,b){var m=this;return a&&a.map(function(a){return m._getFixedFieldName(a,b)})};e.prototype._setChartValue=function(a,b,m){var c=this,d=this.graphic,g=this.relatedInfoCount,e=a.fields,k=a.normalizeField;a.fields=this._getFixedFieldNames(e,m);k&&(a.normalizeField=this._getFixedFieldName(k,m));if(e.some(function(a){return!!(l.isDefined(b[a])||c.isRelatedField(a)&&g)})){var f=d.get("popupTemplate.fieldInfos");a.chartOptions=a.chartOptions||[];e.forEach(function(m){c.isRelatedField(m)?a.chartOptions=
- a.chartOptions.concat(c._getRelatedChartInfos(f,m,a,b)):(m=c._getChartOption(m,a,b,m,f),a.chartOptions.push(m))})}};e.prototype._getRelatedChartInfos=function(a,b,m,c){var d=this,g=[];c=this.getRelatedFieldInfo(b);var e=c.fieldName,k=this.getRelatedInfo(c.layerId);if(!k)return g;c=k.relatedFeatures;k=k.relation;if(!k||!c)return g;k=k.cardinality;c.forEach(function(c){var k=c.attributes;k&&Object.keys(k).forEach(function(c){c===e&&g.push(d._getChartOption(c,m,k,b,a))})});return"one-to-many"===k||"many-to-many"===
- k?g:[g[0]]};a([u.property({readOnly:!0})],e.prototype,"content",void 0);a([u.property()],e.prototype,"contentEnabled",void 0);a([u.property({readOnly:!0})],e.prototype,"formattedAttributes",void 0);a([u.property({type:g})],e.prototype,"graphic",null);a([u.property({readOnly:!0})],e.prototype,"title",void 0);a([u.property()],e.prototype,"view",void 0);a([u.property({readOnly:!0})],e.prototype,"waitingForContent",null);return e=a([u.subclass("esri.widgets.FeatureViewModel")],e)}(u.declared(x))})},"esri/widgets/Feature/support/featureUtils":function(){define(["require",
- "exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.getSourceLayer=function(f){if(f)return f.get("sourceLayer")||f.get("layer")}})},"esri/widgets/Feature/support/RelatedFeatures":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../request ../../../core/Accessor ../../../core/Error ../../../core/Logger ../../../core/promiseUtils ../../../core/accessorSupport/decorators ../../../tasks/QueryTask ../../../tasks/support/Query ../../../tasks/support/StatisticDefinition ./featureUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){var u=new Map,q=d.getLogger("esri.widgets.Popup.support.RelatedFeatures");return function(c){function d(a){a=c.call(this)||this;a.relatedInfoCount=null;a.relatedInfos=new Map;return a}f(d,c);d.prototype.destroy=function(){this.relatedInfos.clear()};d.prototype.addRelatedFeatureAttributes=function(a){var b=this;this.relatedInfos.forEach(function(m){return b._addRelatedFeatureAttribute(a,m)})};d.prototype.getRelatedFieldInfo=function(a){if(-1===a.indexOf("relationships/"))return null;
- a=a.split("/").slice(1);return{layerId:a[0],fieldName:a[1]}};d.prototype.getRelatedInfo=function(a){return this.relatedInfos.get(a.toString())};d.prototype.isRelatedField=function(a){void 0===a&&(a="");return a?-1!==a.indexOf("relationships/"):!1};d.prototype.queryRelatedInfos=function(a,c){var m=this;this.relatedInfos.clear();var d=t.getSourceLayer(a);if(!d)return b.resolve();var g=c.filter(function(a){return a&&m.isRelatedField(a.fieldName)});if(!g||!g.length)return b.resolve();this._createRelatedInfos(c,
- d);return this._queryLayerInfos(d,c).then(function(b){m._updateRelatedInfoLayerInfos(b);return m._queryRelatedFeatureMap(a).then(function(a){Object.keys(a).forEach(function(b){m._setRelatedFeatures(a[b],b.toString())});return a})})};d.prototype._addRelatedFeatureAttribute=function(a,b){var m=this;a&&b&&("one-to-one"===b.relation.cardinality&&b.relatedFeatures&&b.relatedFeatures.forEach(function(c){return m._addAttributesFromFeature(a,c,b)}),b.relatedStatsFeatures&&b.relatedStatsFeatures.forEach(function(c){return m._addAttributesFromFeature(a,
- c,b)}))};d.prototype._updateRelatedInfoLayerInfo=function(a,b){if(a=a.value)this.getRelatedInfo(b).layerInfo=a.data};d.prototype._updateRelatedInfoLayerInfos=function(a){var b=this;Object.keys(a).forEach(function(m){return b._updateRelatedInfoLayerInfo(a[m],m.toString())})};d.prototype._addAttributesFromFeature=function(a,b,c){var m=this;a&&b&&c&&Object.keys(b.attributes).forEach(function(d){var g=m._relatedFieldInfoToString({layerId:c.relation.id.toString(),fieldName:d});a[g]=b.attributes[d]})};
- d.prototype._relatedFieldInfoToString=function(a){return a?"relationships/"+a.layerId+"/"+a.fieldName:""};d.prototype._createRelatedInfoForFieldInfo=function(a,b){var m=this.getRelatedFieldInfo(a.fieldName);if(m){var c=m.layerId,m=m.fieldName;c&&(b=this.getRelatedInfo(c)||this._createRelatedInfo(c,b))&&(b.relatedFields.push(m),a.statisticType&&(a=new n({statisticType:a.statisticType,onStatisticField:m,outStatisticFieldName:m}),b.outStatistics.push(a)))}};d.prototype._createRelatedInfos=function(a,
- b){var m=this;a.forEach(function(a){return m._createRelatedInfoForFieldInfo(a,b)})};d.prototype._queryRelatedFeatureMap=function(a){var m=this,c={};this.relatedInfos.forEach(function(b,d){c[d]=m._queryRelatedLayerFeatures(a,b)});return b.eachAlways(c)};d.prototype._queryLayerInfos=function(a,c){var m=this,d={};this.relatedInfos.forEach(function(c,e){c=c.relation;if(!c)return e=new g("relation-required","A relation is required on a layer to retrieve related records."),q.error(e),b.reject(e);c=c.relatedTableId;
- if(!c)return e=new g("A related table ID is required on a layer to retrieve related records."),q.error(e),b.reject(e);c=a.url+"/"+c;var k=u.get(c),l=k?k:m._queryLayerInfo(c);k||u.set(c,l);d[e]=l});return b.eachAlways(d)};d.prototype._queryLayerInfo=function(a){return e(a,{query:{f:"json"},callbackParamName:"callback"})};d.prototype._queryRelatedLayerFeatures=function(a,c){var m=t.getSourceLayer(a).layerId.toString(),d=c.layerInfo,g=c.queryTask,e=c.relation;if(m=this._getDestinationRelation(d,m)){var e=
- e.keyField,k=m.keyField,m="string"===this._getDestinationFieldType(d,m)?k+"\x3d'"+a.attributes[e]+"'":k+"\x3d"+a.attributes[e];a=g.execute(new p({where:m,outFields:c.relatedFields}));c=c.outStatistics&&0<c.outStatistics.length&&d.supportsStatistics?g.execute(new p({where:m,outFields:c.relatedFields,outStatistics:c.outStatistics})):null;return b.eachAlways({features:a,statsFeatures:c?c:b.resolve()})}return b.resolve()};d.prototype._setRelatedFeatures=function(a,b){if(b=this.getRelatedInfo(b)){var m=
- a.value;m&&(a=m.features,m=m.statsFeatures,a=a&&a.value,b.relatedFeatures=a?a.features:[],a=m&&m.value,b.relatedStatsFeatures=a?a.features:[])}};d.prototype._getRelation=function(a,b){if("feature"!==b.type)return null;var m=null;b.relationships.some(function(b){if(b.id===parseInt(a,10))return m=b,!0});return m};d.prototype._createRelatedInfo=function(a,b){var m=this._getRelation(a,b);if(m){b=b.url+"/"+m.relatedTableId;var c=new l({url:b}),m={url:b,queryTask:c,relation:m,relatedFields:[],outStatistics:[]};
- this.relatedInfos.set(a,m);return m}};d.prototype._getDestinationRelation=function(a,b){var m;a&&a.relationships&&a.relationships.some(function(a){if(""+a.relatedTableId===b)return m=a,!0});return m};d.prototype._getDestinationFieldType=function(a,b){var m=void 0;a.fields.some(function(a){if(a.name===b.keyField)return m=-1!==["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"].indexOf(a.type)?"number":"string",!0});return m};a([k.aliasOf("relatedInfos.size")],
- d.prototype,"relatedInfoCount",void 0);a([k.property()],d.prototype,"relatedInfos",void 0);return d=a([k.subclass("esri.widgets.Popup.support.RelatedFeatures")],d)}(k.declared(c))})},"esri/widgets/Feature/support/attachmentUtils":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});var f=r.toUrl("../../../themes/base/images/files/");h.isSupportedImage=function(a){a=a.toLowerCase();return"image/bmp"===a||"image/emf"===a||"image/exif"===a||"image/gif"===
- a||"image/x-icon"===a||"image/jpeg"===a||"image/png"===a||"image/tiff"===a||"image/x-wmf"===a};h.getIconPath=function(a){return"text/plain"===a?f+"text-32.svg":"application/pdf"===a?f+"pdf-32.svg":"text/csv"===a?f+"csv-32.svg":"application/gpx+xml"===a?f+"gpx-32.svg":"application/x-dwf"===a?f+"cad-32.svg":"application/postscript"===a||"application/json"===a||"text/xml"===a||"model/vrml"===a?f+"code-32.svg":"application/x-zip-compressed"===a||"application/x-7z-compressed"===a||"application/x-gzip"===
- a||"application/x-tar"===a||"application/x-gtar"===a||"application/x-bzip2"===a||"application/gzip"===a||"application/x-compress"===a||"application/x-apple-diskimage"===a||"application/x-rar-compressed"===a||"application/zip"===a?f+"zip-32.svg":-1!==a.indexOf("image/")?f+"image-32.svg":-1!==a.indexOf("audio/")?f+"sound-32.svg":-1!==a.indexOf("video/")?f+"video-32.svg":-1!==a.indexOf("msexcel")||-1!==a.indexOf("ms-excel")||-1!==a.indexOf("spreadsheetml")?f+"excel-32.svg":-1!==a.indexOf("msword")||
- -1!==a.indexOf("ms-word")||-1!==a.indexOf("wordprocessingml")?f+"word-32.svg":-1!==a.indexOf("powerpoint")||-1!==a.indexOf("presentationml")?f+"report-32.svg":f+"generic-32.svg"}})},"esri/widgets/support/uriUtils":function(){define(["require","exports","dojo/i18n!./nls/uriUtils","../../core/lang"],function(r,h,f,a){function e(a){var d=null;c.some(function(b){b.pattern.test(a)&&(d=b);return!!d});return d}Object.defineProperty(h,"__esModule",{value:!0});var c=[{id:"http",pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,
- target:"_blank",label:f.view},{id:"tel",pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{id:"mailto",pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{id:"arcgis-appstudio-player",pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"App Studio Player"},{id:"arcgis-collector",pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"Collector"},{id:"arcgis-explorer",pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:f.openInApp,
- appName:"Explorer"},{id:"arcgis-navigator",pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"Navigator"},{id:"arcgis-survey123",pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"Survey123"},{id:"arcgis-trek2there",pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"Trek2There"},{id:"arcgis-workforce",pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:f.workforce},{id:"iform",pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,
- label:f.openInApp,appName:"iForm"},{id:"flow",pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"FlowFinity"},{id:"lfmobile",pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"Laserfische"},{id:"mspbi",pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:f.openInApp,appName:"Microsoft Power Bi"}];h.autoLink=function(c){if("string"!==typeof c||!c)return c;var d=e(c);if(!d)return c;var b=c.match(d.pattern),b=a.substitute({appName:d.appName,hierPart:b&&b[2]},d.label);return c.replace(d.pattern,
- "\x3ca "+(d.target?'target\x3d"'+d.target+'"':"")+'" href\x3d"$1"\x3e'+b+"\x3c/a\x3e")}})},"esri/widgets/Spinner":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/promiseUtils ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./support/AnchorElementViewModel ./support/widget".split(" "),function(r,h,f,a,e,c,g,d,b,k){return function(d){function l(a){a=d.call(this)||this;a._animationDelay=500;a._animationPromise=null;a.location=
- null;a.view=null;a.visible=!1;a.viewModel=new b;return a}f(l,d);l.prototype.postInitialize=function(){var a=this;this.own([c.watch(this,"visible",function(b){return a._visibleChange(b)})])};l.prototype.destroy=function(){this._cancelAnimationPromise()};l.prototype.show=function(a){var b=this,c=a.location;a=a.promise;c&&(this.viewModel.location=c);this.visible=!0;a&&a.always(function(){return b.hide()})};l.prototype.hide=function(){this.visible=!1};l.prototype.render=function(){var a=this.visible,
- b=!!this.viewModel.screenLocation,a=(c={},c["esri-spinner--start"]=a&&b,c["esri-spinner--finish"]=!a&&b,c),c=this._getPositionStyles();return k.tsx("div",{class:"esri-spinner",classes:a,styles:c});var c};l.prototype._cancelAnimationPromise=function(){this._animationPromise&&(this._animationPromise.cancel(),this._animationPromise=null)};l.prototype._visibleChange=function(a){var b=this;a?this.viewModel.screenLocationEnabled=!0:(this._cancelAnimationPromise(),this._animationPromise=e.after(this._animationDelay).then(function(){b.viewModel.screenLocationEnabled=
- !1;b._animationPromise=null}))};l.prototype._getPositionStyles=function(){var a=this.viewModel,b=a.screenLocation,a=a.view;if(!a||!b)return{};a=a.padding;return{left:b.x-a.left+"px",top:b.y-a.top+"px"}};a([g.aliasOf("viewModel.location")],l.prototype,"location",void 0);a([g.aliasOf("viewModel.view")],l.prototype,"view",void 0);a([g.property(),k.renderable()],l.prototype,"visible",void 0);a([g.property({type:b}),k.renderable(["viewModel.screenLocation","viewModel.screenLocationEnabled"])],l.prototype,
- "viewModel",void 0);return l=a([g.subclass("esri.widgets.Spinner")],l)}(g.declared(d))})},"esri/widgets/support/AnchorElementViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Evented ../../core/Handles ../../core/watchUtils ../../core/watchUtils ../../core/accessorSupport/decorators".split(" "),function(r,h,f,a,e,c,g,d,b,k){return function(c){function e(){var a=c.call(this)||this;a._anchorHandles=
- new g;a.location=null;a.screenLocation=null;a.screenLocationEnabled=!1;a.view=null;a._anchorHandles.add([b.watch(a,"screenLocationEnabled,location,view.size",function(){return a._updateScreenPointAndHandle()}),b.watch(a,"view, view.ready",function(){return a._wireUpView()})]);return a}f(e,c);e.prototype.destroy=function(){this.view=null;this._anchorHandles&&this._anchorHandles.destroy();this._viewpointHandle=this._anchorHandles=null};e.prototype._wireUpView=function(){var a=this;this._anchorHandles.remove("view");
- this._viewpointHandle=null;if(this.get("view.ready")){this._setScreenLocation();var b=this.view,b=d.pausable(b,"3d"===b.type?"camera":"viewpoint",function(){return a._viewpointChange()});this._anchorHandles.add(b,"view");this._viewpointHandle=b;this._toggleWatchingViewpoint()}};e.prototype._viewpointChange=function(){this._setScreenLocation();this.emit("view-change")};e.prototype._updateScreenPointAndHandle=function(){this._setScreenLocation();this._toggleWatchingViewpoint()};e.prototype._toggleWatchingViewpoint=
- function(){var a=this._viewpointHandle,b=this.screenLocationEnabled;a&&(this.location&&b?a.resume():a.pause())};e.prototype._setScreenLocation=function(){var a=this.location,b=this.view,c=this.screenLocationEnabled,d=this.get("view.ready"),a=c&&a&&d?b.toScreen(a):null;this._set("screenLocation",a)};a([k.property()],e.prototype,"location",void 0);a([k.property({readOnly:!0})],e.prototype,"screenLocation",void 0);a([k.property()],e.prototype,"screenLocationEnabled",void 0);a([k.property()],e.prototype,
- "view",void 0);return e=a([k.subclass("esri.widgets.support.AnchorElementViewModel")],e)}(k.declared(e,c))})},"esri/widgets/Popup/PopupViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/assignHelper ../../core/Collection ../../core/Error ../../core/Handles ../../core/promiseUtils ../../core/watchUtils ../../core/accessorSupport/decorators ../../geometry/Point ../../geometry/support/webMercatorUtils ../../support/Action ../support/AnchorElementViewModel".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){function q(a,b){return b.allLayerViews.find(function(b){return b.layer===a})}r=new t({id:"zoom-to"});var v=new (c.ofType(t))([r]);return function(u){function m(a){a=u.call(this)||this;a._handles=new d;a._originalActions=null;a._pendingPromises=new Set;a.actions=v;a.goToOptions=null;a.autoCloseEnabled=!1;a.content=null;a.highlightEnabled=!0;a.title=null;a.updateLocationEnabled=!1;a.view=null;a.visible=!1;a.zoomFactor=4;return a}f(m,u);m.prototype.initialize=
- function(){this._handles.add([this.on("view-change",this._autoClose),k.watch(this,["highlightEnabled","selectedFeature","visible","view"],this._highlightFeature),k.watch(this,"selectedFeature.popupTemplate.actions",this._getSelectedFeatureActions),k.watch(this,"selectedFeature.popupTemplate.overwriteActions",this._getSelectedFeatureActions)])};m.prototype.destroy=function(){this._handles.destroy();this._handles=null;this._pendingPromises.clear();this.view=null};Object.defineProperty(m.prototype,"featureCount",
- {get:function(){return this.features.length},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"features",{get:function(){return this._get("features")||[]},set:function(a){a=a||[];this._set("features",a);var b=this.pendingPromisesCount,m=this.selectedFeatureIndex,c=this.promiseCount&&a.length;c&&b&&-1===m?this.selectedFeatureIndex=0:c&&-1!==m||(this.selectedFeatureIndex=a.length?0:-1)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"location",{get:function(){return this._get("location")||
- null},set:function(a){var b=this.get("location"),m=this.get("view.spatialReference.isWebMercator");a&&a.get("spatialReference.isWGS84")&&m&&(a=n.geographicToWebMercator(a));this._set("location",a);a!==b&&this._centerAtLocation()},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"pendingPromisesCount",{get:function(){return this._pendingPromises.size},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"waitingForResult",{get:function(){return 0<this.pendingPromisesCount&&
- 0===this.featureCount},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"promiseCount",{get:function(){return this.promises.length},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"promises",{get:function(){return this._get("promises")||[]},set:function(a){var b=this,m=this._get("promises");m&&m.forEach(function(a){a&&"function"===typeof a.cancel&&a.cancel()});this._pendingPromises.clear();this.features=[];Array.isArray(a)&&a.length?(this._set("promises",a),a=a.slice(0),
- a.forEach(function(a){b._pendingPromises.add(a);var m=function(m){b._pendingPromises.has(a)&&(b._pendingPromises.delete(a),b.notifyChange("pendingPromisesCount"),b._updateFeatures(a,m))};a.then(m,m)})):this._set("promises",[]);this.notifyChange("pendingPromisesCount")},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"selectedFeature",{get:function(){var a=this.selectedFeatureIndex;if(-1===a)return null;a=this.features[a];if(!a)return null;this.updateLocationEnabled&&(this.location=
- this._getPointFromGeometry(a.geometry));return a},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"selectedFeatureIndex",{get:function(){var a=this._get("selectedFeatureIndex");return"number"===typeof a?a:-1},set:function(a){var b=this.featureCount;a=isNaN(a)||-1>a||!b?-1:(a+b)%b;this._set("selectedFeatureIndex",a)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"state",{get:function(){return this.get("view.ready")?"ready":"disabled"},enumerable:!0,configurable:!0});
- m.prototype.centerAtLocation=function(){var a=this.location,m=this.view;return a&&m?m.goTo({target:a,scale:m.scale},this.goToOptions):b.reject(new g(this.declaredClass+"::Cannot center at location without a location and view."))};m.prototype.clear=function(){this.set({promises:[],features:[],content:null,title:null,location:null})};m.prototype.open=function(a){this.set(e({visible:!1},{updateLocationEnabled:!1,promises:[]},a));this._setVisibleWhenContentExists()};m.prototype.triggerAction=function(a){(a=
- this.actions.getItemAt(a))&&this.emit("trigger-action",{action:a})};m.prototype.next=function(){this.selectedFeatureIndex+=1;return this};m.prototype.previous=function(){--this.selectedFeatureIndex;return this};m.prototype.zoomToLocation=function(){var a=this,m=this.location,c=this.selectedFeature,d=this.view,e=this.zoomFactor;if(!m||!d)return b.reject(new g(this.declaredClass+"::Cannot zoom to location without a location and view."));var e=d.scale/e,k=this.get("selectedFeature.geometry"),l=c&&"3d"===
- d.type,m=(l=k||l)?c:m,f=l&&k&&"point"===k.type&&this._isScreenSize(c);return d.goTo({target:m,scale:f?e:void 0},this.goToOptions).then(function(){f&&"point"===k.type&&(a.location=k)})};m.prototype._setVisibleWhenContentExists=function(){var a=this,b=this._handles,m=this.promiseCount;b.remove("pendingVisible");m?(m=k.init(this,"pendingPromisesCount",function(m){a.featureCount&&(a.set("visible",!0),b.remove("pendingVisible"));m||b.remove("pendingVisible")}),b.add(m,"pendingVisible")):this.set("visible",
- !0)};m.prototype._autoClose=function(){this.autoCloseEnabled&&(this.visible=!1)};m.prototype._isScreenSize=function(a){var b=this.view;if("3d"!==b.type||"esri.Graphic"!==a.declaredClass)return!0;if((b=b.getViewForGraphic(a))&&b.whenGraphicBounds){var m=!1;b.whenGraphicBounds(a,{useViewElevation:!0}).then(function(a){m=!a||!a.boundingBox||a.boundingBox[0]===a.boundingBox[3]&&a.boundingBox[1]===a.boundingBox[4]&&a.boundingBox[2]===a.boundingBox[5]});return m}return!0};m.prototype._getSelectedFeatureActions=
- function(){this._originalActions&&(this.actions=this._originalActions,this._originalActions=null);var a=this.actions.filter(function(a){return!a.temporary}),b=this.get("selectedFeature.popupTemplate");b&&b.overwriteActions&&(this._originalActions=a);this.actions=this._getNewActions(b,a)};m.prototype._getNewActions=function(a,b){if(!a||!a.actions)return b;var m=a.actions;m.forEach(function(a){a.temporary=!0});return a.overwriteActions?m:b.concat(m)};m.prototype._getPointFromGeometry=function(a){return a?
- "point"===a.type?a:"extent"===a.type?a.center:"polygon"===a.type?a.centroid:"multipoint"===a.type||"polyline"===a.type?a.extent.center:null:null};m.prototype._centerAtLocation=function(){var a=this.location,b=this.updateLocationEnabled,m=this.get("view.extent");b&&m&&a&&!m.contains(a)&&this.centerAtLocation()};m.prototype._highlightFeature=function(){this._handles.remove("highlight");var a=this.selectedFeature,b=this.highlightEnabled,m=this.view,c=this.visible;a&&m&&b&&c&&(b=a.layer)&&(m=q(b,m))&&
- "function"===typeof m.highlight&&(b=b.objectIdField,c=a.attributes,a=m.highlight(c&&c[b]||a,{}),this._handles.add(a,"highlight"))};m.prototype._updateFeatures=function(a,b){var m=this.features;a&&b&&b.length&&!(!this._validatePromise(a)||b instanceof g||b instanceof Error)&&(m.length?(a=b.filter(function(a){return-1===m.indexOf(a)}),this.features=m.concat(a)):this.features=b)};m.prototype._validatePromise=function(a){return a&&(!a.isCanceled||!a.isCanceled())};a([l.property({type:c.ofType(t)})],m.prototype,
- "actions",void 0);a([l.property()],m.prototype,"goToOptions",void 0);a([l.property()],m.prototype,"autoCloseEnabled",void 0);a([l.property()],m.prototype,"content",void 0);a([l.property({readOnly:!0,dependsOn:["features"]})],m.prototype,"featureCount",null);a([l.property()],m.prototype,"features",null);a([l.property()],m.prototype,"highlightEnabled",void 0);a([l.property({type:p})],m.prototype,"location",null);a([l.property({readOnly:!0,dependsOn:["promises"]})],m.prototype,"pendingPromisesCount",
- null);a([l.property({readOnly:!0,dependsOn:["featureCount","pendingPromisesCount"]})],m.prototype,"waitingForResult",null);a([l.property({readOnly:!0,dependsOn:["promises"]})],m.prototype,"promiseCount",null);a([l.property()],m.prototype,"promises",null);a([l.property({value:null,readOnly:!0,dependsOn:["features","selectedFeatureIndex","updateLocationEnabled"]})],m.prototype,"selectedFeature",null);a([l.property({value:-1})],m.prototype,"selectedFeatureIndex",null);a([l.property({readOnly:!0,dependsOn:["view.ready"]})],
- m.prototype,"state",null);a([l.property()],m.prototype,"title",void 0);a([l.property()],m.prototype,"updateLocationEnabled",void 0);a([l.property()],m.prototype,"view",void 0);a([l.property()],m.prototype,"visible",void 0);a([l.property()],m.prototype,"zoomFactor",void 0);a([l.property()],m.prototype,"centerAtLocation",null);a([l.property()],m.prototype,"clear",null);a([l.property()],m.prototype,"triggerAction",null);a([l.property()],m.prototype,"next",null);a([l.property()],m.prototype,"previous",
- null);a([l.property()],m.prototype,"zoomToLocation",null);return m=a([l.subclass("esri.widgets.Popup.PopupViewModel")],m)}(l.declared(u))})},"esri/views/3d/constraints/Constraints":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ./AltitudeConstraint ./ClipDistanceConstraint ./CollisionConstraint ./TiltConstraint".split(" "),function(r,h,f,a,e,c,g,d,b,k){Object.defineProperty(h,
- "__esModule",{value:!0});r=function(e){function l(){var a=null!==e&&e.apply(this,arguments)||this;a.tilt=new k.default;a.altitude=new g.default;a.clipDistance=new d.default;a.collision=new b.default;return a}f(l,e);a([c.property({type:k.default})],l.prototype,"tilt",void 0);a([c.property({type:g.default})],l.prototype,"altitude",void 0);a([c.property({type:d.default})],l.prototype,"clipDistance",void 0);a([c.property({type:b.default})],l.prototype,"collision",void 0);return l=a([c.subclass("esri.views.3d.constraints.Constraints")],
- l)}(c.declared(e));h.Constraints=r;h.default=r})},"esri/views/3d/constraints/AltitudeConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/_base/kernel ../../../core/Accessor ../../../core/accessorSupport/decorators ../state/Constraints".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function c(){var a=null!==b&&b.apply(this,arguments)||this;a.min=d.AltitudeDefault.min;
- a.max=d.AltitudeDefault.max;return a}f(c,b);Object.defineProperty(c.prototype,"mode",{get:function(){e.deprecated("esri.views.SceneView.constraints.altitude.mode is deprecated. The altitude constraint no longer applies to local scenes and does not have an automatic mode anymore.","","4.6");return"manual"},set:function(a){e.deprecated("esri.views.SceneView.constraints.altitude.mode is deprecated. The altitude constraint no longer applies to local scenes and does not have an automatic mode anymore.",
- "","4.6")},enumerable:!0,configurable:!0});a([g.property({type:Number})],c.prototype,"min",void 0);a([g.property({type:Number})],c.prototype,"max",void 0);return c=a([g.subclass("esri.views.3d.constraints.AltitudeConstraint")],c)}(g.declared(c));h.AltitudeConstraint=r;h.default=r})},"esri/views/3d/state/Constraints":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Logger ../../../core/accessorSupport/decorators ../support/earthUtils ../support/mathUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});var k=c.getLogger("esri.views.3d.state.Constraints");r=function(c){function d(a){a=c.call(this)||this;a.collision=new p;a.distance=Infinity;a.minimumPoiDistance=4;return a}f(d,c);Object.defineProperty(d.prototype,"altitude",{get:function(){return"local"===this.mode?null:this._get("altitude")||null},set:function(a){"local"===this.mode?k.warn("Altitude constraint is ignored in local scenes"):this._set("altitude",a)},enumerable:!0,
- configurable:!0});d.prototype.clampAltitude=function(a){return this.altitude?b.clamp(a,this.altitude.min,this.altitude.max):a};d.prototype.clampTilt=function(a,c){if(!this.tilt)return c;a=this.tilt(a);return b.clamp(c,a.min,a.max)};d.prototype.clampDistance=function(a){return Math.min(a,this.distance)};d.prototype.createDefaultTilt=function(){return"local"===this.mode?this.createDefaultTiltLocal():this.createDefaultTiltGlobal()};d.prototype.createConstantMaxTilt=function(a){return function(b,c){void 0===
- c&&(c=l);c.min=h.TiltDefault.min;c.max=a;return c}};d.prototype.createDefaultTiltLocal=function(){var a=b.makePiecewiseLinearFunction([[4E3,h.TiltDefault.max],[1E4,b.deg2rad(88)],[6E6,b.deg2rad(88)]]);return function(b,c){void 0===c&&(c=l);c.min=h.TiltDefault.min;c.max=a(b);return c}};d.prototype.createDefaultTiltGlobal=function(){var a=b.makePiecewiseLinearFunction([[4E3,h.TiltDefault.max],[5E4,b.deg2rad(88)],[6E6,b.deg2rad(88)],[2E7,h.TiltDefault.min]]);return function(b,c){void 0===c&&(c=l);c.min=
- h.TiltDefault.min;c.max=a(b);return c}};a([g.property()],d.prototype,"altitude",null);a([g.property({readOnly:!0})],d.prototype,"collision",void 0);a([g.property()],d.prototype,"distance",void 0);a([g.property({readOnly:!0})],d.prototype,"minimumPoiDistance",void 0);a([g.property()],d.prototype,"tilt",void 0);a([g.property({constructOnly:!0})],d.prototype,"mode",void 0);return d=a([g.subclass("esri.views.3d.state.Constraints")],d)}(g.declared(e));h.Constraints=r;h.AltitudeDefault={min:-d.earthRadius,
- max:4*d.earthRadius};h.TiltDefault={min:b.deg2rad(.5),max:b.deg2rad(179.5)};var l={min:0,max:0},p=function(b){function c(){var a=null!==b&&b.apply(this,arguments)||this;a.enabled=!0;a.elevationMargin=5;return a}f(c,b);a([g.property({type:Boolean})],c.prototype,"enabled",void 0);a([g.property({type:Number})],c.prototype,"elevationMargin",void 0);return c=a([g.subclass("esri.views.3d.state.Constraints.CollisionConstraint")],c)}(g.declared(e));h.default=r})},"esri/views/3d/constraints/ClipDistanceConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.mode="auto";return a}f(d,e);Object.defineProperty(d.prototype,"near",{get:function(){return this._get("near")},set:function(a){this._set("near",a);a>=this._get("far")&&(this.far=a+1E-9);this.mode="manual"},enumerable:!0,configurable:!0});d.prototype.castNear=function(a){return Math.max(1E-8,a)};Object.defineProperty(d.prototype,"far",{get:function(){return this._get("far")},
- set:function(a){this._set("far",a);a<=this._get("near")&&(this.near=a-1E-9);this.mode="manual"},enumerable:!0,configurable:!0});d.prototype.castFar=function(a){return Math.max(1E-8,a)};d.prototype.autoUpdate=function(a,c){"auto"===this.mode&&(this._get("near")!==a&&this._set("near",a),this._get("far")!==c&&this._set("far",c))};a([c.property({type:Number,value:1E-8})],d.prototype,"near",null);a([c.cast("near")],d.prototype,"castNear",null);a([c.property({type:Number,value:1E-8})],d.prototype,"far",
- null);a([c.cast("far")],d.prototype,"castFar",null);a([c.property({type:String})],d.prototype,"mode",void 0);return d=a([c.subclass("esri.views.3d.constraints.ClipDistanceConstraint")],d)}(c.declared(e));h.ClipDistanceConstraint=r;h.default=r})},"esri/views/3d/constraints/CollisionConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),function(r,h,
- f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.enabled=!0;return a}f(d,e);a([c.property()],d.prototype,"enabled",void 0);return d=a([c.subclass("esri.views.3d.constraints.CollisionConstraint")],d)}(c.declared(e));h.CollisionConstraint=r;h.default=r})},"esri/views/3d/constraints/TiltConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ../state/Constraints ../support/mathUtils".split(" "),
- function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});var b=d.rad2deg(g.TiltDefault.min),k=d.rad2deg(g.TiltDefault.max);r=function(e){function g(){var a=null!==e&&e.apply(this,arguments)||this;a.mode="auto";return a}f(g,e);Object.defineProperty(g.prototype,"max",{get:function(){return this._get("max")},set:function(a){this._set("max",a);this.mode="manual"},enumerable:!0,configurable:!0});g.prototype.castMax=function(a){return d.clamp(a,b,k)};g.prototype.autoUpdate=function(a){"auto"===
- this.mode&&this._get("max")!==a&&this._set("max",a)};a([c.property({type:String})],g.prototype,"mode",void 0);a([c.property({type:Number,value:k})],g.prototype,"max",null);a([c.cast("max")],g.prototype,"castMax",null);return g=a([c.subclass("esri.views.3d.constraints.TiltConstraint")],g)}(c.declared(e));h.TiltConstraint=r;h.default=r})},"esri/views/3d/environment/SceneViewEnvironment":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ./SceneViewAtmosphere ./SceneViewLighting ../../../webscene/Environment ../../../webscene/Lighting".split(" "),
- function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});r=function(d){function k(){var a=null!==d&&d.apply(this,arguments)||this;a.atmosphere=new c.default;a.atmosphereEnabled=!0;a.starsEnabled=!0;return a}f(k,d);p=k;Object.defineProperty(k.prototype,"lighting",{set:function(a){if(a)if(this.lighting)null!=a.date&&(this.lighting.date=a.date),null!=a.defaultDate&&(this.lighting.defaultDate=a.defaultDate),null!=a.displayUTCOffset&&(this.lighting.displayUTCOffset=a.displayUTCOffset),
- this.lighting.directShadowsEnabled=a.directShadowsEnabled,null!=a.ambientOcclusionEnabled&&(this.lighting.ambientOcclusionEnabled=a.ambientOcclusionEnabled),null!=a.cameraTrackingEnabled&&(this.lighting.cameraTrackingEnabled=a.cameraTrackingEnabled);else if(a instanceof g.default)this._set("lighting",a);else if(a instanceof b){var c={directShadowsEnabled:a.directShadowsEnabled};null!=a.date&&(c.date=a.date);null!=a.displayUTCOffset&&(c.displayUTCOffset=a.displayUTCOffset);null!=a.defaultDate&&(c.defaultDate=
- a.defaultDate);this._set("lighting",new g.default(c))}else this._set("lighting",new g.default(a));else this.lighting||this._set("lighting",new g.default)},enumerable:!0,configurable:!0});k.prototype.clone=function(){return new p({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled})};a([e.property({type:c.default,json:{read:!1}})],k.prototype,"atmosphere",void 0);a([e.property({type:Boolean,json:{read:!1}})],k.prototype,
- "atmosphereEnabled",void 0);a([e.property({type:Boolean,json:{read:!1}})],k.prototype,"starsEnabled",void 0);a([e.property()],k.prototype,"lighting",null);return k=p=a([e.subclass("esri.views.3d.environment.SceneViewEnvironment")],k);var p}(e.declared(d));h.SceneViewEnvironment=r;h.default=r})},"esri/views/3d/environment/SceneViewAtmosphere":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){return null!==e&&e.apply(this,arguments)||this}f(d,e);Object.defineProperty(d.prototype,"quality",{set:function(a){-1!==["low","high"].indexOf(a)&&this._set("quality",a)},enumerable:!0,configurable:!0});d.prototype.clone=function(){return new this.constructor({quality:this.quality})};a([c.property({type:String,value:"low"})],d.prototype,"quality",null);return d=a([c.subclass("esri.views.3d.environment.SceneViewAtmosphere")],
- d)}(c.declared(e));h.SceneViewAtmosphere=r;h.default=r})},"esri/views/3d/environment/SceneViewLighting":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Evented ../../../core/accessorSupport/decorators ../../../webscene/Lighting".split(" "),function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function g(a){a=e.call(this)||this;a.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};
- a.cameraTrackingEnabled=!0;a.ambientOcclusionEnabled=!1;var b=(new Date).getFullYear(),b=new Date("March 15, "+b+" 12:00:00 UTC");a._set("defaultDate",b);a._set("date",b);return a}f(g,e);Object.defineProperty(g.prototype,"defaultDate",{get:function(){return new Date(this._get("defaultDate").getTime())},set:function(a){var b=this._get("date")===this._get("defaultDate");a=new Date(a.getTime());this._set("defaultDate",a);b&&this._set("date",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,
- "date",{set:function(a){null!=a&&(this._set("date",new Date(a.getTime())),this.positionTimezoneInfo.autoUpdated=!1,this._emitDateWillChange())},enumerable:!0,configurable:!0});g.prototype.autoUpdate=function(a,b){var c=this._calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=b.hours;this.positionTimezoneInfo.minutes=b.minutes;this.positionTimezoneInfo.seconds=b.seconds;b=null;null!=a&&(this.positionTimezoneInfo.autoUpdated=!0,b=this.date&&this.date.getTime(),this._set("date",
- new Date(a.getTime())),this._emitDateWillChange());var d=this._calculateTimezoneOffset(this.positionTimezoneInfo);c!==d&&(k.target=this,k.timezoneOffset=d,this.emit("timezone-will-change",k));if(null!=a)return b!==a.getTime()};g.prototype._calculateTimezoneOffset=function(a){return Math.round(a.hours+a.minutes/60+a.seconds/3600)};g.prototype._emitDateWillChange=function(){b.target=this;d.setTime(this._get("date").getTime());b.date=d;this.emit("date-will-change",b)};a([c.property({type:Boolean})],
- g.prototype,"cameraTrackingEnabled",void 0);a([c.property({type:Boolean})],g.prototype,"ambientOcclusionEnabled",void 0);a([c.property({type:Date})],g.prototype,"defaultDate",null);a([c.property({type:Date})],g.prototype,"date",null);return g=a([c.subclass("esri.views.3d.environment.SceneViewLighting")],g)}(c.declared(g,e));h.SceneViewLighting=r;var d=new Date,b={target:null,date:null},k={target:null,timezoneOffset:0};h.default=r})},"esri/webscene/Lighting":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){return function(e){function d(a){a=e.call(this,a)||this;a.date=null;a.directShadowsEnabled=!1;a.displayUTCOffset=null;return a}f(d,e);b=d;d.prototype.readDate=function(a,b){return null!=b.datetime&&new Date(b.datetime)||null};d.prototype.writeDate=function(a,b,c){b[c]=a.getTime()};d.prototype.readDirectShadowsEnabled=function(a,b){return!!b.directShadows};d.prototype.writedirectShadowsEnabled=function(a,b,c){a&&(b[c]=a)};d.prototype.writeDisplayUTCOffset=function(a,b){null!=
- a&&(b.displayUTCOffset=a)};d.prototype.clone=function(){return new b({date:null!=this.date?new Date(this.date.getTime()):null,directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null})};d.sanitizeJSON=function(a){var b={datetime:a.datetime};void 0!==a.directShadows&&(b.directShadows=!!a.directShadows);void 0!==a.displayUTCOffset&&(b.displayUTCOffset=a.displayUTCOffset);return b};a([c.property({type:Date,json:{type:Number,write:{target:"datetime"}}})],
- d.prototype,"date",void 0);a([c.reader("date",["datetime"])],d.prototype,"readDate",null);a([c.writer("date")],d.prototype,"writeDate",null);a([c.property({type:Boolean,json:{write:{target:"directShadows"}}})],d.prototype,"directShadowsEnabled",void 0);a([c.reader("directShadowsEnabled",["directShadows"])],d.prototype,"readDirectShadowsEnabled",null);a([c.writer("directShadowsEnabled")],d.prototype,"writedirectShadowsEnabled",null);a([c.property({type:Number,json:{write:!0}})],d.prototype,"displayUTCOffset",
- void 0);a([c.writer("displayUTCOffset")],d.prototype,"writeDisplayUTCOffset",null);return d=b=a([c.subclass("esri.webscene.Lighting")],d);var b}(c.declared(e))})},"esri/webscene/Environment":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/JSONSupport ../core/accessorSupport/decorators ./Lighting".split(" "),function(r,h,f,a,e,c,g){return function(d){function b(a){a=d.call(this,a)||this;a.lighting=new g;return a}f(b,d);e=b;b.prototype.clone=
- function(){return new e({lighting:g.prototype.clone.call(this.lighting)})};b.sanitizeJSON=function(a){return{lighting:a.lighting?g.sanitizeJSON(a.lighting):(new g).toJSON()}};a([c.property({type:g,json:{write:!0}})],b.prototype,"lighting",void 0);return b=e=a([c.subclass("esri.webscene.Environment")],b);var e}(c.declared(e))})},"esri/views/3d/environment/SceneViewEnvironmentManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Evented ../../../core/Handles ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../geometry/Point ../../../geometry/SpatialReference ../../../geometry/support/webMercatorUtils ./EnvironmentRenderer ../lib/glMatrix ../support/earthUtils ../support/sunUtils ../webgl-engine/lighting/Lightsources".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){Object.defineProperty(h,"__esModule",{value:!0});var m=[.5773502691896258,-.5773502691896258,.5773502691896258];r=function(c){function e(a){a=c.call(this)||this;a.referencePointUpdateDelay=200;a.referencePointUpdateInterval=3E3;a.referencePointUpdateDistThreshold=1E6;a._referencePosUpdateQuery=null;a._referencePosMapCoordsRequested=null;a._viewHandles=new g;a._preserveAbsoluteDateTime=!1;a._trackingEnabled=!1;a._viewConnected=!1;a._referencePosResetPreserveAbsoluteTime=
- !1;a._referencePosUpdateTimer=null;a._referencePosWGS84=null;a._referencePosMapCoords=null;a._mainLight=new x.MainLight;a._ambientLight=new x.AmbientLight;a._moonLight=new x.FillLight;a._environmentRenderer=null;a._resetReferencePosition();return a}f(e,c);e.prototype.destroy=function(){this._viewHandles.destroy();this.disposeRendering()};Object.defineProperty(e.prototype,"updating",{get:function(){return!this.noReferencePositionQueries&&(!!this._referencePosUpdateQuery||!!this._referencePosMapCoordsRequested)},
- enumerable:!0,configurable:!0});e.prototype.updateReadyChange=function(a){a&&!this._viewConnected?(this._viewConnected=!0,this.connectView(this.view)):!a&&this._viewConnected&&(this._viewConnected=!1,this.disconnectView(this.view))};e.prototype.disposeRendering=function(){this._environmentRenderer&&(this._environmentRenderer.destroy(),this._environmentRenderer=null);this._resetReferencePosition(!0)};e.prototype.connectView=function(a){this._environmentRenderer=new t({view:a});this._viewHandles.add([b.on(this.view,
- "environment.lighting","date-will-change",this._lightingDateHandler.bind(this)),this.view.watch("interacting,stationary",this._interactingStationaryHandler.bind(this)),this.view.watch("environment.lighting.directShadowsEnabled,environment.lighting.ambientOcclusionEnabled",this._updateRenderParamsHandler.bind(this)),this.view.watch("spatialReference",this._spatialReferenceHandler.bind(this)),b.init(this.view,"viewingMode",this._viewingModeHandler.bind(this)),b.init(this.view,"environment.lighting.cameraTrackingEnabled",
- this._updateCameraTracking.bind(this),!0),this.watch("noReferencePositionQueries",this._cameraHandler.bind(this,null))]);this._updateRenderParamsHandler();this._updateLightParams();this._cameraHandler()};e.prototype._updateCameraTracking=function(a){if(this._trackingEnabled=a)a=b.init(this,"view.state.camera",this._cameraHandler.bind(this,null),!0),this._viewHandles.add(a,"camera");else{if(a=this.get("view.environment.lighting"))a.positionTimezoneInfo.autoUpdated=!1;this._viewHandles.remove("camera")}};
- e.prototype.disconnectView=function(a){this.disposeRendering();this._viewHandles.removeAll()};e.prototype._lightingDateHandler=function(a){if(a=a.date){var b=this.view.environment.lighting;if(!b.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;var c=this.view.spatialReference;if(!(c.isWGS84||c.isWebMercator||(c=this.view.camera.position,this._referencePosMapCoords&&this._referencePosMapCoords.equals(c)))){this._requestReferencePositionUpdate(c);return}this._preupdateTracking(a);
- this._referencePosWGS84&&(c=q.positionToTimezone(this._referencePosWGS84,z),b.autoUpdate(null,c),this._trackingEnabled&&(b.positionTimezoneInfo.autoUpdated=!0))}this._updateLightParams(a)}};e.prototype._preupdateTracking=function(a){!this._trackingEnabled&&this.get("view.environment.lighting.cameraTrackingEnabled")&&this._cameraHandler(a)};e.prototype._cameraHandler=function(a){void 0===a&&(a=null);if(this.view.ready){var b=this.view.camera;if(b){var c=this.view.spatialReference;c.isWGS84||c.isWebMercator?
- this._cameraHandlerGlobal(b,a):this._cameraHandlerLocal(b,a)}}};e.prototype._cameraHandlerGlobal=function(a,b){a=a.position;this._referencePosWGS84||(this._referencePosWGS84=new l({spatialReference:p.WGS84}));a.spatialReference.isWebMercator?n.webMercatorToGeographic(a,!1,this._referencePosWGS84):(this._referencePosWGS84.x=a.x,this._referencePosWGS84.y=a.y);this._referencePosWGS84.z=a.z;this._autoUpdateTimezone(a,b)||this._updateLightParams(b)};e.prototype._cameraHandlerLocal=function(a,b){a=a.position;
- (!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(a))&&this._requestReferencePositionUpdate(a,!0);this.view.mapCoordsHelper&&this._referencePosWGS84&&(this._referencePosWGS84.z=a.z*this.view.mapCoordsHelper.unitInMeters,this._referencePosChanged())};e.prototype._interactingStationaryHandler=function(){!this.view.interacting&&this.view.stationary&&this._executePendingReferencePositionUpdate()};e.prototype._updateLightParams=function(a){void 0===
- a&&(a=null);var b=this.view.environment.lighting;a=a||b.date;var b=this.view._stage,c;this._referencePosWGS84?(c=v.computeColorAndIntensity(a,this._referencePosWGS84),v.computeDirection(a,this._referencePosWGS84,this.view.viewingMode,c.diffuse.direction)):c={diffuse:{color:[1,1,1],intensity:.55,direction:m},ambient:{color:[1,1,1],intensity:.55},noonFactor:.5,globalFactor:0};u.vec3d.scale(c.diffuse.color,c.diffuse.intensity*Math.PI,this._mainLight.intensity);u.vec3d.negate(c.diffuse.direction,this._mainLight.direction);
- u.vec3d.scale(c.ambient.color,c.ambient.intensity,this._ambientLight.intensity);u.vec3d.lerp(C,A,c.globalFactor,this._moonLight.intensity);u.vec3d.scale(this._moonLight.intensity,(1-.5*c.globalFactor)*(1-.4*c.noonFactor*(1-c.globalFactor)));u.vec3d.set(c.diffuse.direction,this._moonLight.direction);b.setLighting({lights:[this._mainLight,this._ambientLight,this._moonLight],globalFactor:c.globalFactor,groundLightingFactor:1-c.noonFactor});this._updateRenderParamsHandler()};e.prototype._autoUpdateTimezone=
- function(a,b){void 0===b&&(b=null);if(!this.view.get("environment.lighting.cameraTrackingEnabled"))return!1;var c=B;c.setTime((b||this.view.environment.lighting.date).getTime());a=q.positionToTimezone(a,z);var m=this.view.environment.lighting.positionTimezoneInfo;if(!m.autoUpdated)m=a;else if(m.hours===a.hours&&m.minutes===a.minutes&&m.seconds===a.seconds)return!1;var d=c.getUTCHours()-(a.hours-m.hours),e=c.getUTCMinutes()-(a.minutes-m.minutes),m=c.getUTCSeconds()-(a.seconds-m.seconds);c.setUTCHours(d);
- c.setUTCMinutes(e);c.setUTCSeconds(m);return b?!1:this.view.environment.lighting.autoUpdate(c,a)};e.prototype._updateRenderParamsHandler=function(){var a=this.view._stage,b=!0;this._referencePosWGS84&&(b=v.computeShadowsEnabled(this._referencePosWGS84,this.view.viewingMode));a&&a.setRenderParams({shadowMap:this.view.environment.lighting.directShadowsEnabled&&b,ssao:this.view.environment.lighting.ambientOcclusionEnabled})};e.prototype._spatialReferenceHandler=function(){this._resetReferencePosition()};
- e.prototype._viewingModeHandler=function(){this._resetReferencePosition()};e.prototype._resetReferencePosition=function(a){void 0===a&&(a=!1);this._cancelReferencePosUpdates();this._referencePosWGS84=this._referencePosResetPreserveAbsoluteTime=this._referencePosMapCoordsRequested=this._referencePosMapCoords=null;a||this.notifyChange("updating")};e.prototype._requestReferencePositionUpdate=function(a,b){var c=this;void 0===b&&(b=!1);if(this.view.mapCoordsHelper.canProject()&&!this.noReferencePositionQueries&&
- (this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(a):this._referencePosMapCoordsRequested=a.clone(),this._referencePosResetPreserveAbsoluteTime=!!b,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&!this.view.interacting&&this.view.stationary)){var m=this._referencePosUpdateQuery=d.after(this.referencePointUpdateDelay).then(function(){if(c._referencePosUpdateQuery===m)return c._doReferencePositionUpdateQuery(function(){return c._referencePosUpdateQuery!==
- m})}).always(function(){c._referencePosUpdateQuery===m&&(c._referencePosUpdateQuery=null,c._referencePosUpdateTimer||c._executePendingReferencePositionUpdate(),c.notifyChange("updating"))}),e=this._referencePosUpdateTimer=d.after(this.referencePointUpdateInterval).then(function(){c._referencePosUpdateTimer===e&&(c._referencePosUpdateTimer=null,c._referencePosUpdateQuery||c._executePendingReferencePositionUpdate())});this.notifyChange("updating")}};e.prototype._doReferencePositionUpdateQuery=function(a){var b=
- this;this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1);this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone();this._referencePosMapCoordsRequested=this._referencePosResetPreserveAbsoluteTime=null;return this.view.mapCoordsHelper.toGeographic(this._referencePosMapCoords).then(function(c){if(!a()&&!isNaN(c[0])&&!isNaN(c[1])){var m=b._referencePosMapCoords.z*
- b.view.mapCoordsHelper.unitInMeters;b._referencePosWGS84?(b._referencePosWGS84.x=c[0],b._referencePosWGS84.y=c[1],b._referencePosWGS84.z=m):b._referencePosWGS84=new l({x:c[0],y:c[1],z:m,spatialReference:p.WGS84});b._referencePosChanged()}})};e.prototype._executePendingReferencePositionUpdate=function(){var a=this._referencePosMapCoordsRequested;a&&this._requestReferencePositionUpdate(a,this._referencePosResetPreserveAbsoluteTime)};e.prototype._referencePosChanged=function(){this._preserveAbsoluteDateTime?
- this._updateLightParams():this._autoUpdateTimezone(this._referencePosWGS84)||this._updateLightParams()};e.prototype._exceedsReferencePosDistThreshold=function(a){return this._referencePosMapCoords?(a=this._referencePosMapCoords.distance(a),this.view.mapCoordsHelper&&(a*=this.view.mapCoordsHelper.unitInMeters),a>this.referencePointUpdateDistThreshold):!0};e.prototype._cancelReferencePosUpdates=function(){this._referencePosUpdateTimer=this._referencePosUpdateQuery=null};e.FIXED_LIGHT_DIRECTION=m;a([k.property({type:Boolean,
- dependsOn:["noReferencePositionQueries"],readOnly:!0})],e.prototype,"updating",null);a([k.property()],e.prototype,"noReferencePositionQueries",void 0);a([k.property({constructOnly:!0})],e.prototype,"view",void 0);a([k.property()],e.prototype,"_environmentRenderer",void 0);return e=a([k.subclass("esri.views.3d.environment.SceneViewEnvironmentManager")],e)}(k.declared(e,c));h.SceneViewEnvironmentManager=r;var B=new Date,z={hours:0,minutes:0,seconds:0},C=u.vec3d.createFrom(.22,.22,.33),A=u.vec3d.createFrom(.22,
- .22,.22);h.default=r})},"esri/views/3d/environment/EnvironmentRenderer":function(){define("../../../core/watchUtils ../support/ExternalRenderer ./PanoramicAtmosphere ./RealisticAtmosphere ./SimpleAtmosphere ./Stars ../webgl-engine/lib/RenderSlot".split(" "),function(r,h,f,a,e,c,g){return h.createSubclass({declaredClass:"esri.views.3d.environment.EnvironmentRenderer",properties:{view:{},viewingMode:{dependsOn:["view.viewingMode"],get:function(){return this.get("view.viewingMode")||"global"}},atmosphereQuality:{dependsOn:["view.environment.atmosphereEnabled",
- "view.environment.atmosphere.quality"],get:function(){return this.get("view.environment.atmosphereEnabled")?this.get("view.environment.atmosphere.quality")||"none":"none"}},starsEnabled:{dependsOn:["view.environment.starsEnabled"],get:function(){return this.get("view.environment.starsEnabled")||!1}},transparent:{dependsOn:["view.basemapTerrain.opacity","view.basemapTerrain.wireframe"],get:function(){var a=this.get("view.basemapTerrain");return a&&a._renderer.isTransparent()}},_atmosphere:{},_stars:{},
- needsRender:{dependsOn:["_stars.needsRender","_atmosphere.needsRender"],get:function(){return!!(this._needsRender||this._atmosphere&&this._atmosphere.needsRender||this._stars&&this._stars.needsRender)}}},constructor:function(){this._slots=[g.POSTPROCESSING_ATMOSPHERE_OPAQUE,g.POSTPROCESSING_ATMOSPHERE_TRANSPARENT];this._stars=this._atmosphere=this._atmosphereReadyPromise=this._AtmosphereClass=null;this._needsRender=!0;this.notifyChange("needsRender")},initialize:function(){this.view._stage.addExternalRenderer(this._slots,
- this);this._basemapTerrainHandle=r.when(this.view,"basemapTerrain",this._updateBasemapTerrain.bind(this))},destroy:function(){this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=null);this._stars&&(this._stars.destroy(),this._stars=null);this._basemapTerrainHandle&&this._basemapTerrainHandle.remove();this.view&&(this.view._stage.removeExternalRenderer(this),this.view=null)},setup:function(a){this.watch("viewingMode,atmosphereQuality,transparent,visible",this._updateAtmosphere.bind(this));
- this._updateAtmosphere();this.watch("starsEnabled,transparent,visible",this._updateStars.bind(this));this._updateStars();this.watch("view.basemapTerrain.loaded",function(){this._needsRender=!0;this.notifyChange("needsRender")}.bind(this))},resetNeedsRender:function(){this._atmosphere&&(this._atmosphere.resetNeedsRender?this._atmosphere.resetNeedsRender():this._atmosphere.didRender&&(this._atmosphere.needsRender=!1,this._atmosphere.didRender=!1));this._stars&&(this._stars.resetNeedsRender?this._stars.resetNeedsRender():
- this._stars.didRender&&(this._stars.needsRender=!1,this._stars.didRender=!1));this.didRender&&(this.didRender=this._needsRender=!1,this.notifyChange("needsRender"))},render:function(a){if(!this.get("view.basemapTerrain.loaded")&&"global"===this.viewingMode)return!1;if(!this._stars&&!this._atmosphere)return!0;this._stars&&this._stars.render(a);this._atmosphere&&this._atmosphere.render(a);return this._stars&&this._stars.didRender||this._atmosphere&&this._atmosphere.didRender},_updateStars:function(){var a=
- this._getSimpleAtmosphereSlot();this.starsEnabled&&!this._stars?(this._stars=new c({view:this.view,slot:a}),this._stars.initializeRenderContext(this.renderContext)):!this.starsEnabled&&this._stars?(this._stars.destroy(),this._stars=null):this._stars&&(this._stars.slot=a);this._needsRender=!0;this.notifyChange("needsRender")},_updateAtmosphere:function(){var a=this._getSimpleAtmosphereSlot();this._atmosphere&&(this._atmosphere.slot=a);if(this._updateAtmosphereClass(this.renderContext)){this._needsRender=
- !0;this.notifyChange("needsRender");var b=function(){this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=null)}.bind(this);if(this._AtmosphereClass){this._atmosphereReadyPromise&&(this._atmosphereReadyPromise.cancel(),this._atmosphereReadyPromise=null);var c=new this._AtmosphereClass({view:this.view,slot:a});c.initializeRenderContext(this.renderContext);this._atmosphere?this._atmosphereReadyPromise=c.when(function(){b();this._atmosphereReadyPromise=null;this._atmosphere=c}.bind(this)):
- this._atmosphere=c;c.when(this._updateBasemapTerrain.bind(this))}else b(),this._updateBasemapTerrain()}},_updateAtmosphereClass:function(c){var b=this._AtmosphereClass;"none"===this.atmosphereQuality?this._AtmosphereClass=null:"high"===this.atmosphereQuality&&!this.transparent&&a.isSupported(c)?this._AtmosphereClass="local"===this.viewingMode?f:a:this._AtmosphereClass="local"===this.viewingMode?f:e;return this._AtmosphereClass!==b},_getSimpleAtmosphereSlot:function(){return this.transparent&&"global"===
- this.viewingMode?g.POSTPROCESSING_ATMOSPHERE_TRANSPARENT:g.POSTPROCESSING_ATMOSPHERE_OPAQUE},_updateBasemapTerrain:function(){var c=this.get("view.basemapTerrain");c&&(c.velvetOverground=!(!this._AtmosphereClass||this._AtmosphereClass===a))}})})},"esri/views/3d/support/ExternalRenderer":function(){define("../../../core/declare ../../../core/Accessor ../../../core/Promise dojo/Deferred dojo/aspect dojo/_base/lang".split(" "),function(r,h,f,a,e,c){return r([h,f],{"-chains-":c.mixin(h._meta.chains,{setup:"after",
- initializeRenderContext:"after",uninitializeRenderContext:"before"}),properties:{gl:{readOnly:!0,get:function(){return this._gl}},needsRender:{value:!0},visible:{value:!0}},constructor:function(){this.didRender=!1;this.renderContext=null;this.watch("visible",function(){this.needsRender=!0}.bind(this));this._contextDfd=new a},initialize:function(){this.addResolvingPromise(this._contextDfd.promise);e.around(this,"render",function(a){return function(){return this.isRejected()?this.didRender=!0:this.isResolved()?
- !this.visible||a.apply(this,arguments)?this.didRender=!0:!1:!1}.bind(this)}.bind(this));this.when(function(){this.destroyed||this.setup(this.renderContext)}.bind(this))},needsRender:!0,visible:!0,initializeRenderContext:function(a){this.renderContext=a;this._contextDfd.resolve()},uninitializeRenderContext:function(a){},setup:function(a){},render:function(a){return!1}})})},"esri/views/3d/environment/PanoramicAtmosphere":function(){define("dojo/text!./materials/SimpleAtmosphereMaterial.xml dojo/Deferred ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/Texture ../webgl-engine/lib/Util ../webgl-engine/lib/GLTextureRep ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ./resources/SimpleAtmosphereTexture ../../webgl/Program ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q=a.vec2d,v=a.vec3d,x=a.mat4d,m=d.VertexAttrConstants,B=x.create();return f.createSubclass({declaredClass:"esri.views.3d.environment.PanoramicAtmosphere",properties:{view:{},needsRender:{value:!1},slot:{value:l.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={texV:q.create(),silCircleCenter:v.create(),silCircleV1:v.create(),silCircleV2:v.create()};this._textureRep=this._texture=null;this.slot=
- l.BACKGROUND},initialize:function(){this._textureDfd=new h;this.addResolvingPromise(this._textureDfd.promise)},destroy:function(){this._textureRep&&(this._texture&&(this._textureRep.release("SimpleAtmosphere"),this._textureRep.getTexture("SimpleAtmosphere").unload()),this._textureRep=null);this._program&&(this._program.dispose(),this._program=null);this._textureDfd&&(this._textureDfd.cancel(),this._textureDfd=null)},initializeRenderContext:function(a){this._textureRep=new b({SimpleAtmosphere:new g(p,
- "SimpleAtmosphere",{wrapClamp:!0})},a.programRep,function(){return this.view.state.camera.viewport}.bind(this),a.rctx);this._texture=this._textureRep.aquire("SimpleAtmosphere",void 0,function(a){this._texture=a.getGLTexture();this._textureDfd.resolve();this._textureDfd=null}.bind(this))},setup:function(a){var b=this._createGeometryData(),c=this.renderContext.rctx;this._renderer=new e(b,t.Pos3,null,c);a.shaderSnippets.vsSimpleAtmosphere||a.shaderSnippets._parse(r);this._program=new n(c,a.shaderSnippets.vsSimpleAtmosphere,
- a.shaderSnippets.fsSimpleAtmosphere,u.Default3D,["PANORAMIC"])},render:function(a){if(a.slot!==this.slot||a.pass!==k.MATERIAL||!this._textureRep.getIsLoaded("SimpleAtmosphere"))return!1;var b=this.renderContext.rctx,c=b.gl,m=this._program;b.bindProgram(m);b.bindTexture(this._texture);m.setUniform1i("tex",0);m.setUniformMatrix4fv("proj",a.camera.projectionMatrix);x.toRotationMat(a.camera.viewMatrix,B);m.setUniformMatrix4fv("view",B);m.setUniform4f("color",1,1,1,1);m.setUniform3fv("lightDirection",
- a.lightingData.direction);b.setDepthTestEnabled(!0);b.setFaceCullingEnabled(!0);b.setDepthFunction(c.LEQUAL);b.setBlendingEnabled(!0);b.setDepthWriteEnabled(!1);this._renderer.render(this._program);b.setDepthWriteEnabled(!0);b.setBlendingEnabled(!1);b.setDepthFunction(c.LESS);b.setFaceCullingEnabled(!1);return!0},_createGeometryData:function(){for(var a=c.createPolySphereGeometry(1,2),b=a.indices[m.POSITION],d=0;d<b.length;d+=3){var e=b[d];b[d]=b[d+2];b[d+2]=e}b=a.getVertexAttr();e=b[m.NORMAL].data;
- for(d=0;d<e.length;d++)e[d]=-e[d];return{indices:a.indices,vertexAttr:b}}})})},"esri/views/3d/webgl-engine/lib/GeometryRenderer":function(){define("require exports ./DefaultVertexAttributeLocations ./Util ../materials/internal/MaterialUtil ../../../webgl/BufferObject ../../../webgl/Util ../../../webgl/VertexArrayObject".split(" "),function(r,h,f,a,e,c,g,d){return function(){function b(b,l,p,n){this._drawMode=4;this._count=b.indices[a.VertexAttrConstants.POSITION].length;var k=new Float32Array(this._count*
- g.getStride(l)/4);p?p(b,void 0,void 0,null,l,k,0):e.fillInterleaved(b,void 0,void 0,null,l,k,0);this._rctx=n;this._vao=new d(n,f.Default3D,{geometry:l},{geometry:c.createVertex(n,35044,k)})}b.prototype.enablePointRendering=function(a){this._drawMode=a?0:4};b.prototype.render=function(a){var b=this._rctx;b.bindVAO(this._vao);g.assertCompatibleVertexAttributeLocations(this._vao,a);b.drawArrays(this._drawMode,0,this._count)};return b}()})},"esri/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations":function(){define(["require",
- "exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.Default3D={position:0,normal:1,normalCompressed:1,uv0:2,color:3,instanceColor:3,size:4,auxpos1:5,symbolColor:5,componentIndex:5,auxpos2:6,featureAttribute:6,instanceFeatureAttribute:6,region:7,model:8,modelNormal:12}})},"esri/views/3d/webgl-engine/lib/Util":function(){define(["require","exports","./gl-matrix"],function(r,h,f){function a(a,b){if(!a)throw a=Error("dummy"),a.stack&&console.log(a.stack),new N(b);}function e(a,
- b,c){return a<b?b:a>c?c:a}function c(a){return a/180*Math.PI}function g(a){return 180*a/Math.PI}function d(a,b,c){f.mat4d.multiply(b,a,u);f.mat4d.inverse(u);for(a=0;8>a;++a)f.mat4d.multiplyVec4(u,q[a],v),f.vec3d.set3(v[0]/v[3],v[1]/v[3],v[2]/v[3],c[a])}function b(a,b,c,d){f.vec3d.subtract(a,b,m);f.vec3d.subtract(c,b,B);f.vec3d.cross(B,m,d);f.vec3d.normalize(d);d[3]=-f.vec3d.dot(d,a)}function k(a,b,c,m){var d=6378137/Math.sqrt(1-h.ECCENTRICITY_SQUARED*Math.pow(Math.sin(a),2)),e=Math.cos(a);m[0]=(d+
- c)*Math.cos(b)*e;m[1]=(d*(1-h.ECCENTRICITY_SQUARED)+c)*Math.sin(a);m[2]=-(d+c)*Math.sin(b)*e}function l(a){for(var b in a)return b}function p(a,b){a[12]=b[0];a[13]=b[1];a[14]=b[2]}function n(a,b){void 0===b&&(b=0);for(var c=0,m=0;4>m;m++)c+=a[b+m]*X[m];return c}function t(a){return a-Math.floor(a)}Object.defineProperty(h,"__esModule",{value:!0});var u=f.mat4d.create(),q=[f.vec4d.createFrom(-1,-1,-1,1),f.vec4d.createFrom(1,-1,-1,1),f.vec4d.createFrom(1,1,-1,1),f.vec4d.createFrom(-1,1,-1,1),f.vec4d.createFrom(-1,
- -1,1,1),f.vec4d.createFrom(1,-1,1,1),f.vec4d.createFrom(1,1,1,1),f.vec4d.createFrom(-1,1,1,1)],v=f.vec4d.create(),x=[f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create(),f.vec3d.create()],m=f.vec3d.create(),B=f.vec3d.create(),z=f.vec3d.create(),C=f.vec3d.create(),A=f.vec3d.create(),D=f.vec3d.create(),E=f.vec3d.create(),F=f.vec3d.create(),I=f.vec3d.create(),P=f.vec3d.create(),G=f.vec3d.create(),M=f.vec3d.create(),H=f.vec3d.create(),
- J=f.vec3d.create(),O=f.vec3d.createFrom(0,0,0),N=function(){function a(a){this.message=a}a.prototype.toString=function(){return"AssertException: "+this.message};return a}();h.AssertException=N;h.EARTH_RADIUS=6378137;h.METER2FEET=3.28084;h.ECCENTRICITY_SQUARED=.0066943799901414;h.VertexAttrConstants={POSITION:"position",NORMAL:"normal",NORMALCOMPRESSED:"normalCompressed",UV0:"uv0",AUXPOS1:"auxpos1",AUXPOS2:"auxpos2",COLOR:"color",SYMBOLCOLOR:"symbolColor",SIZE:"size",REGION:"region",COMPONENTINDEX:"componentIndex"};
- h.assert=a;h.verify=function(a,b){a||(console.log("Verify failed: "+b),console.log(Error("dummy").stack))};h.isPowerOfTwo=function(a){return 0===(a&a-1)};h.lerp=function(a,b,c){return a+(b-a)*c};h.clamp=e;h.encodeInt16=function(a){return e(Math.round(32767*a),-32767,32767)};h.encodeNormal=function(a,b){var c=Math.abs(a[0]),m=Math.abs(a[1]),d=1/(c+m+Math.abs(a[2])),c=c*d,m=m*d,d=Math.min(a[2]*d,0);b[0]=S(a[0])*(c-d);b[1]=S(a[1])*(m-d)};var S="function"===typeof Math.sign?Math.sign:function(a){return+(0<
- a)-+(0>a)||0};h.fallbackIfUndefined=function(a,b){return void 0===a?b:a};h.hex2rgb=function(a){a=Math.floor(a);return[(a>>16&255)/255,(a>>8&255)/255,(a&255)/255]};h.rgb2hex=function(a){var b=e(Math.round(255*a[0]),0,255),c=e(Math.round(255*a[1]),0,255);a=e(Math.round(255*a[2]),0,255);return"0x"+((b<<16)+(c<<8)+a).toString(16)};h.dec2hex=function(a){a=a.toString(16);return"00000000".substr(0,8-a.length)+a};h.deg2rad=c;h.rad2deg=g;h.azimuthElevationAngle2Direction=function(a,b){a=1.5*Math.PI-a;b=.5*
- Math.PI-b;return[Math.cos(a)*Math.sin(b),Math.cos(b),Math.sin(a)*Math.sin(b)]};h.rayPlane=function(a,b,c,m){var d=f.vec3d.dot(c,b);if(0===d)return!1;c=-(f.vec3d.dot(c,a)+c[3])/d;f.vec3d.add(a,f.vec3d.scale(b,c,m),m);return!0};h.raySphere=function(a,b,c,d,e){c=c||O;var g=f.vec3d.subtract(a,c,m);c=f.vec3d.dot(b,b);var k=2*f.vec3d.dot(b,g);d=f.vec3d.dot(g,g)-d*d;d=k*k-4*c*d;if(0>d)return!1;g=Math.sqrt(d);d=(-k-g)/(2*c);c=(-k+g)/(2*c);if(0>d||c<d&&0<c)d=c;return 0<d?(f.vec3d.add(a,f.vec3d.scale(b,d,J),
- e),!0):!1};h.rayTriangle3D=function(a,b,c,m,d,e,g,k,l){void 0===l&&(l=f.vec3d.create());var q=m[g]-c[e],B=m[g+1]-c[e+1],t=m[g+2]-c[e+2];m=d[k]-c[e];g=d[k+1]-c[e+1];d=d[k+2]-c[e+2];var u=b[1]*d-g*b[2],v=b[2]*m-d*b[0],p=b[0]*g-m*b[1];k=q*u+B*v+t*p;if(-1E-5<k&&1E-5>k)return!1;k=1/k;var n=a[0]-c[e],z=a[1]-c[e+1];a=a[2]-c[e+2];l[1]=k*(n*u+z*v+a*p);if(0>l[1]||1<l[1])return!1;c=z*t-B*a;a=a*q-t*n;q=n*B-q*z;l[2]=k*(b[0]*c+b[1]*a+b[2]*q);if(0>l[2]||1<l[1]+l[2])return!1;l[0]=k*(m*c+g*a+d*q);return!0};h.rayBoxTest=
- function(a,b,c,m){var d,e=(c[0]-a[0])/b[0],g=(m[0]-a[0])/b[0];e>g&&(d=e,e=g,g=d);var k=(c[1]-a[1])/b[1],l=(m[1]-a[1])/b[1];k>l&&(d=k,k=l,l=d);if(e>l||k>g)return!1;k>e&&(e=k);l<g&&(g=l);c=(c[2]-a[2])/b[2];a=(m[2]-a[2])/b[2];c>a&&(d=c,c=a,a=d);if(e>a||c>g)return!1;a<g&&(g=a);return 0>g?!1:!0};h.rayRay2D=function(a,b,c,m,d,e){void 0===e&&(e=f.vec2d.create());var g=(m[d]-c[d])*(b[0]-a[0])-(m[0]-c[0])*(b[d]-a[d]);if(0===g)return!1;c=((m[0]-c[0])*(a[d]-c[d])-(m[d]-c[d])*(a[0]-c[0]))/g;e[0]=a[0]+c*(b[0]-
- a[0]);e[1]=a[d]+c*(b[d]-a[d]);return!0};h.matrix2frustum=d;h.matrix2frustumPlanes=function(a,c,m,e){void 0===e&&(e=m,m=x);d(a,c,m);b(m[4],m[0],m[3],e[0]);b(m[1],m[5],m[6],e[1]);b(m[4],m[5],m[1],e[2]);b(m[3],m[2],m[6],e[3]);b(m[0],m[1],m[2],e[4]);b(m[5],m[4],m[7],e[5])};h.point2plane=b;h.planeDistance=function(a,b){return b[0]*a[0]+b[1]*a[1]+b[2]*a[2]+b[3]};h.project=function(b,c,m,d,e){e||(e=b);v[0]=b[0];v[1]=b[1];v[2]=b[2];v[3]=1;f.mat4d.multiplyVec4(c,v);2<e.length&&(e[2]=-v[2]);f.mat4d.multiplyVec4(m,
- v);a(0!==v[3]);e[0]=v[0]/v[3];e[1]=v[1]/v[3];e[2]=v[2]/v[3];e[0]=(.5*e[0]+.5)*d[2]+d[0];e[1]=(.5*e[1]+.5)*d[3]+d[1]};h.geodeticToGeocentricLatidude=function(a){return Math.atan((1-h.ECCENTRICITY_SQUARED)*Math.tan(a))};h.latLon2positionWGS84Ellipsoid=k;h.pos2latLon=function(a,b){var c=f.vec3d.length(a);b[0]=Math.asin(e(a[1]/c,-1,1));b[1]=(0>a[2]?1:-1)*Math.acos(e(a[0]/(Math.cos(b[0])*c),-1,1));b[0]=g(b[0]);b[1]=g(b[1]);b[2]=c};h.pos2latLonWGS84Ellipsoid=function(a,b){var c=a[0],m=-a[2],d=a[1],e=Math.sqrt(Math.pow(6378137,
- 2)*(1-h.ECCENTRICITY_SQUARED));a=Math.sqrt(Math.pow(c,2)+Math.pow(m,2));var g=Math.atan2(6378137*d,e*a),c=Math.atan2(m,c),m=Math.atan2(d+Math.pow(Math.sqrt((Math.pow(6378137,2)-Math.pow(e,2))/Math.pow(e,2)),2)*e*Math.pow(Math.sin(g),3),a-6378137*h.ECCENTRICITY_SQUARED*Math.pow(Math.cos(g),3));a=a/Math.cos(m)-6378137/Math.sqrt(1-h.ECCENTRICITY_SQUARED*Math.pow(Math.sin(m),2))+h.EARTH_RADIUS;b[0]=m;b[1]=c;b[2]=a};h.computeGlobeTransformation=function(a,b,m){var d=c(a[0]);a=c(a[1]);k(d,a,b,z);f.mat4d.translate(m,
- z);f.mat4d.rotateY(m,.5*Math.PI+a);f.mat4d.rotateX(m,.5*Math.PI-d);return m};h.readUInt16=function(a,b){return a[b]+(a[b+1]<<8)};h.readUInt32=function(a,b){return a[b]+(a[b+1]<<8)+(a[b+2]<<16)+(a[b+3]<<24)};h.setIfDefined=function(a,b,c){void 0!==b[a]&&(c[a]=b[a])};h.array2object=function(a,b){var c={};if(void 0!==b)for(var m=0;m<a.length;m++){var d=a[m];c[b(d)]=d}else for(b=0;b<a.length;b++)d=a[b],c[d]=d;return c};h.object2array=function(a){var b=[],c;for(c in a)b.push(a[c]);return b};h.mergeObjects=
- function(a,b,c){void 0===c&&(c={});if(c!==a)for(var m in a)c[m]=a[m];if(c!==b)for(var d in b)c[d]=b[d];return c};h.subtractObjects=function(a,b){var c={},m;for(m in a)void 0===b[m]&&(c[m]=a[m]);return c};h.intersectObjects=function(a,b){var c={},m;for(m in a)void 0!==b[m]&&(c[m]=a[m]);return c};h.getFirstObjectKey=l;h.getFirstObjectValue=function(a){return a[l(a)]};h.objectEmpty=function(a){for(var b in a)return!1;return!0};h.arraysEqual=function(a,b){if(a.length!==b.length)return!1;for(var c=0,m=
- a.length;c<m;++c)if(a[c]!==b[c])return!1;return!0};var R=0;h.arrayRemove=function(a,b){for(var c=Math.max(0,R-5),m=Math.min(c+10,a.length),d=-1;c<m;++c)if(a[c]===b){d=c;break}if(-1===d&&(d=a.indexOf(b),-1===d))return null;a[d]=a[a.length-1];a.pop();R=d;return b};h.byteBuffer2base64image=function(b,c,m,d,e){var g=4*c;a(b.length===g*m,"buffer length must match image resolution");var k=document.createElement("canvas");k.width=c;k.height=m;var l=k.getContext("2d");c=l.getImageData(0,0,c,m);for(var f=
- c.data,q=0;q<m;++q)for(var B=q*g,t=(m-1-q)*g,u=0;u<g;++u)f[B++]=b[t++];l.putImageData(c,0,0);return k.toDataURL(d,e)};h.cround=function(a){return Math.round(100*a)/100};h.logWithBase=function(a,b){return Math.log(a)/Math.log(b)};h.setMatrixTranslation=p;h.setMatrixTranslation3=function(a,b,c,m){a[12]=b;a[13]=c;a[14]=m};h.getMatrixTranslation=function(a,b){void 0===b&&(b=f.vec3d.create());b[0]=a[12];b[1]=a[13];b[2]=a[14];return b};h.createTranslationMatrix=function(a,b){a=f.mat4d.identity(a);p(a,b);
- return a};h.isTranslationMatrix=function(a){return 1===a[0]&&0===a[1]&&0===a[2]&&0===a[3]&&0===a[4]&&1===a[5]&&0===a[6]&&0===a[7]&&0===a[8]&&0===a[9]&&1===a[10]&&0===a[11]&&1===a[15]};h.fovx2fovy=function(a,b,c){return 2*Math.atan(c*Math.tan(.5*a)/b)};h.fovy2fovx=function(a,b,c){return 2*Math.atan(b*Math.tan(.5*a)/c)};h.fovx2fovd=function(a,b,c){return 2*Math.atan(Math.sqrt(b*b+c*c)*Math.tan(.5*a)/b)};h.fovy2fovd=function(a,b,c){return 2*Math.atan(Math.sqrt(b*b+c*c)*Math.tan(.5*a)/c)};h.fovd2fovx=
- function(a,b,c){return 2*Math.atan(b*Math.tan(.5*a)/Math.sqrt(b*b+c*c))};h.fovd2fovy=function(a,b,c){return 2*Math.atan(c*Math.tan(.5*a)/Math.sqrt(b*b+c*c))};h.nextHighestPowerOfTwo=function(a){--a;for(var b=1;32>b;b<<=1)a|=a>>b;return a+1};h.nextHighestPowerOfTen=function(a){return Math.pow(10,Math.ceil(Math.LOG10E*Math.log(a)))};h.lineLineDistanceSquared3D=function(a,b,c,m,d){C[0]=a[0]-c[0];C[1]=a[1]-c[1];C[2]=a[2]-c[2];A[0]=m[0]-c[0];A[1]=m[1]-c[1];A[2]=m[2]-c[2];if(1E-4>Math.abs(A[0])&&1E-4>Math.abs(A[1])&&
- 1E-4>Math.abs(A[2]))return d.success=!1,d;D[0]=b[0]-a[0];D[1]=b[1]-a[1];D[2]=b[2]-a[2];if(1E-4>Math.abs(D[0])&&1E-4>Math.abs(D[1])&&1E-4>Math.abs(D[2]))return d.success=!1,d;b=C[0]*A[0]+C[1]*A[1]+C[2]*A[2];m=A[0]*D[0]+A[1]*D[1]+A[2]*D[2];var g=C[0]*D[0]+C[1]*D[1]+C[2]*D[2],k=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],l=(D[0]*D[0]+D[1]*D[1]+D[2]*D[2])*k-m*m;if(1E-4>Math.abs(l))return d.success=!1,d;g=e((b*m-g*k)/l,0,1);b=e((b+m*g)/k,0,1);E[0]=a[0]+g*D[0];E[1]=a[1]+g*D[1];E[2]=a[2]+g*D[2];F[0]=c[0]+b*A[0];F[1]=
- c[1]+b*A[1];F[2]=c[2]+b*A[2];a=f.vec3d.dist2(E,F);d.success=!0;d.dist2=a;d.pa=E;d.pb=F;return d};h.pointLineSegmentDistanceSquared2D=function(a,b,c){M[0]=b[0]-a[0];M[1]=b[1]-a[1];M[2]=0;H[0]=c[0]-a[0];H[1]=c[1]-a[1];H[2]=0;J[0]=c[0];J[1]=c[1];J[2]=0;b=f.vec2d.dot(H,M);c=f.vec2d.dot(M,M);b=e(b/c,0,1);G[0]=M[0]*b;G[1]=M[1]*b;I[0]=a[0]+G[0];I[1]=a[1]+G[1];f.vec2d.subtract(J,I,P);a=f.vec2d.dot(P,P);b=f.vec2d.dot(H,H);c=f.vec2d.dot(M,M);var m=f.vec2d.dot(G,G);if(m>b||m>c)a=Number.MAX_VALUE;return a};h.packFloatRGBA=
- function(a,b,c){void 0===c&&(c=0);a=e(a,0,Q);for(var m=0;4>m;m++)b[c+m]=Math.floor(256*t(a*Y[m]))};h.unpackFloatRGBA=n;var Y=[1,256,65536,16777216],X=[1/256,1/65536,1/16777216,1/4294967296],Q=n(new Uint8ClampedArray([255,255,255,255]))})},"esri/views/3d/webgl-engine/lib/gl-matrix":function(){define([],function(){var r={};(function(h,f){f(h,!0);f(h,!1)})(r,function(h,f){var a={};(function(){if("undefined"!=typeof Float32Array){var b=new Float32Array(1),c=new Int32Array(b.buffer);a.invsqrt=function(a){b[0]=
- a;c[0]=1597463007-(c[0]>>1);var m=b[0];return m*(1.5-.5*a*m*m)}}else a.invsqrt=function(a){return 1/Math.sqrt(a)}})();var e=Array;"undefined"!=typeof Float32Array&&(e=f?Float32Array:Array);var c={create:function(a){var b=new e(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,c){var m=new e(3);m[0]=a;m[1]=b;m[2]=c;return m},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},set3:function(a,b,c,d){d[0]=a;d[1]=b;d[2]=c;return d},add:function(a,b,c){if(!c||
- a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];return c},subtract:function(a,b,c){if(!c||a===c)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c},multiply:function(a,b,c){if(!c||a===c)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];return c},max:function(a,b,c){c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);c[2]=Math.max(a[2],b[2]);return c},min:function(a,b,c){c[0]=
- Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);return c},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,c){if(!c||a===c)return a[0]*=b,a[1]*=b,a[2]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c},normalize:function(a,b){b||(b=a);var c=a[0],m=a[1];a=a[2];var d=Math.sqrt(c*c+m*m+a*a);if(!d)return b[0]=0,b[1]=0,b[2]=0,b;if(1===d)return b[0]=c,b[1]=m,b[2]=a,b;d=1/d;b[0]=c*d;b[1]=m*d;b[2]=a*d;return b},cross:function(a,b,c){c||(c=a);
- var m=a[0],d=a[1];a=a[2];var e=b[0],g=b[1];b=b[2];c[0]=d*b-a*g;c[1]=a*e-m*b;c[2]=m*g-d*e;return c},length:function(a){var b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)},length2:function(a){var b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,c){c||(c=a);var m=a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(m*m+d*d+a*a);if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/b;c[0]=m*b;c[1]=d*b;c[2]=a*b;return c},lerp:function(a,b,c,d){d||(d=
- a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);return d},dist:function(a,b){var c=b[0]-a[0],m=b[1]-a[1];a=b[2]-a[2];return Math.sqrt(c*c+m*m+a*a)},dist2:function(a,b){var c=b[0]-a[0],m=b[1]-a[1];a=b[2]-a[2];return c*c+m*m+a*a}},g=null,d=new e(4);c.unproject=function(a,b,c,e,k){k||(k=a);g||(g=u.create());var m=g;d[0]=2*(a[0]-e[0])/e[2]-1;d[1]=2*(a[1]-e[1])/e[3]-1;d[2]=2*a[2]-1;d[3]=1;u.multiply(c,b,m);if(!u.inverse(m))return null;u.multiplyVec4(m,d);if(0===d[3])return null;
- k[0]=d[0]/d[3];k[1]=d[1]/d[3];k[2]=d[2]/d[3];return k};var b=c.createFrom(1,0,0),k=c.createFrom(0,1,0),l=c.createFrom(0,0,1);c.rotationTo=function(a,d,e){e||(e=q.create());var m=c.dot(a,d),g=c.create();if(1<=m)q.set(v,e);else if(-.999999>m)c.cross(b,a,g),1E-6>g.length&&c.cross(k,a,g),1E-6>g.length&&c.cross(l,a,g),c.normalize(g),q.fromAxisAngle(g,Math.PI,e);else{var m=Math.sqrt(2*(1+m)),f=1/m;c.cross(a,d,g);e[0]=g[0]*f;e[1]=g[1]*f;e[2]=g[2]*f;e[3]=.5*m;q.normalize(e)}1<e[3]?e[3]=1:-1>e[3]&&(e[3]=-1);
- return e};var p=c.create(),n=c.create();c.project=function(a,b,d,e){e||(e=a);c.direction(b,d,p);c.subtract(a,b,n);a=c.dot(p,n);c.scale(p,a,e);c.add(e,b,e)};c.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var t={create:function(a){var b=new e(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,c,d,g,k,l,f,q){var m=new e(9);m[0]=a;m[1]=b;m[2]=c;m[3]=d;m[4]=g;m[5]=k;
- m[6]=l;m[7]=f;m[8]=q;return m},determinant:function(a){var b=a[3],c=a[4],m=a[5],d=a[6],e=a[7],g=a[8];return a[0]*(g*c-m*e)+a[1]*(-g*b+m*d)+a[2]*(e*b-c*d)},inverse:function(a,b){var c=a[0],m=a[1],d=a[2],e=a[3],g=a[4],k=a[5],l=a[6],f=a[7];a=a[8];var q=a*g-k*f,B=-a*e+k*l,u=f*e-g*l,v=c*q+m*B+d*u;if(!v)return null;v=1/v;b||(b=t.create());b[0]=q*v;b[1]=(-a*m+d*f)*v;b[2]=(k*m-d*g)*v;b[3]=B*v;b[4]=(a*c-d*l)*v;b[5]=(-k*c+d*e)*v;b[6]=u*v;b[7]=(-f*c+m*l)*v;b[8]=(g*c-m*e)*v;return b},multiply:function(a,b,c){c||
- (c=a);var m=a[0],d=a[1],e=a[2],g=a[3],k=a[4],l=a[5],f=a[6],q=a[7];a=a[8];var t=b[0],u=b[1],v=b[2],B=b[3],p=b[4],n=b[5],z=b[6],x=b[7];b=b[8];c[0]=t*m+u*g+v*f;c[1]=t*d+u*k+v*q;c[2]=t*e+u*l+v*a;c[3]=B*m+p*g+n*f;c[4]=B*d+p*k+n*q;c[5]=B*e+p*l+n*a;c[6]=z*m+x*g+b*f;c[7]=z*d+x*k+b*q;c[8]=z*e+x*l+b*a;return c},multiplyVec2:function(a,b,c){c||(c=b);var m=b[0];b=b[1];c[0]=m*a[0]+b*a[3]+a[6];c[1]=m*a[1]+b*a[4]+a[7];return c},multiplyVec3:function(a,b,c){c||(c=b);var m=b[0],d=b[1];b=b[2];c[0]=m*a[0]+d*a[3]+b*
- a[6];c[1]=m*a[1]+d*a[4]+b*a[7];c[2]=m*a[2]+d*a[5]+b*a[8];return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a,b){if(!b||a===b){b=a[1];var c=a[2],m=a[5];a[1]=a[3];a[2]=a[6];a[3]=b;a[5]=a[7];a[6]=c;a[7]=m;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=
- a[8];return b},toMat4:function(a,b){b||(b=u.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+"]"}},u={create:function(a){var b=new e(16);4===arguments.length?(b[0]=arguments[0],b[1]=arguments[1],b[2]=arguments[2],b[3]=arguments[3],b[4]=arguments[4],b[5]=arguments[5],b[6]=arguments[6],
- b[7]=arguments[7],b[8]=arguments[8],b[9]=arguments[9],b[10]=arguments[10],b[11]=arguments[11],b[12]=arguments[12],b[13]=arguments[13],b[14]=arguments[14],b[15]=arguments[15]):a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,c,d,g,k,l,f,q,t,u,v,p,n,x,h){var m=new e(16);m[0]=a;m[1]=b;m[2]=c;m[3]=d;m[4]=g;m[5]=k;m[6]=l;m[7]=f;m[8]=q;m[9]=t;
- m[10]=u;m[11]=v;m[12]=p;m[13]=n;m[14]=x;m[15]=h;return m},createFromMatrixRowMajor:function(a){var b=new e(16);b[0]=a[0];b[4]=a[1];b[8]=a[2];b[12]=a[3];b[1]=a[4];b[5]=a[5];b[9]=a[6];b[13]=a[7];b[2]=a[8];b[6]=a[9];b[10]=a[10];b[14]=a[11];b[3]=a[12];b[7]=a[13];b[11]=a[14];b[15]=a[15];return b},createFromMatrix:function(a){var b=new e(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=
- a[15];return b},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},setRowMajor:function(a,b){b[0]=a[0];b[4]=a[1];b[8]=a[2];b[12]=a[3];b[1]=a[4];b[5]=a[5];b[9]=a[6];b[13]=a[7];b[2]=a[8];b[6]=a[9];b[10]=a[10];b[14]=a[11];b[3]=a[12];b[7]=a[13];b[11]=a[14];b[15]=a[15];return b},identity:function(a){a||(a=u.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=
- 1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){b=a[1];var c=a[2],d=a[3],m=a[6],e=a[7],g=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=b;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=m;a[11]=a[14];a[12]=d;a[13]=e;a[14]=g;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12];b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=
- a[0],c=a[1],d=a[2],e=a[3],m=a[4],g=a[5],k=a[6],l=a[7],f=a[8],q=a[9],t=a[10],u=a[11],v=a[12],p=a[13],n=a[14];a=a[15];return v*q*k*e-f*p*k*e-v*g*t*e+m*p*t*e+f*g*n*e-m*q*n*e-v*q*d*l+f*p*d*l+v*c*t*l-b*p*t*l-f*c*n*l+b*q*n*l+v*g*d*u-m*p*d*u-v*c*k*u+b*p*k*u+m*c*n*u-b*g*n*u-f*g*d*a+m*q*d*a+f*c*k*a-b*q*k*a-m*c*t*a+b*g*t*a},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],m=a[3],g=a[4],k=a[5],l=a[6],f=a[7],q=a[8],t=a[9],u=a[10],v=a[11],p=a[12],n=a[13],B=a[14];a=a[15];var x=c*k-d*g,h=c*l-e*g,r=c*f-m*
- g,Q=d*l-e*k,K=d*f-m*k,L=e*f-m*l,V=q*n-t*p,U=q*B-u*p,ca=q*a-v*p,ga=t*B-u*n,da=t*a-v*n,ka=u*a-v*B,Z=x*ka-h*da+r*ga+Q*ca-K*U+L*V;if(!Z)return null;Z=1/Z;b[0]=(k*ka-l*da+f*ga)*Z;b[1]=(-d*ka+e*da-m*ga)*Z;b[2]=(n*L-B*K+a*Q)*Z;b[3]=(-t*L+u*K-v*Q)*Z;b[4]=(-g*ka+l*ca-f*U)*Z;b[5]=(c*ka-e*ca+m*U)*Z;b[6]=(-p*L+B*r-a*h)*Z;b[7]=(q*L-u*r+v*h)*Z;b[8]=(g*da-k*ca+f*V)*Z;b[9]=(-c*da+d*ca-m*V)*Z;b[10]=(p*K-n*r+a*x)*Z;b[11]=(-q*K+t*r-v*x)*Z;b[12]=(-g*ga+k*U-l*V)*Z;b[13]=(c*ga-d*U+e*V)*Z;b[14]=(-p*Q+n*h-B*x)*Z;b[15]=(q*
- Q-t*h+u*x)*Z;return b},toRotationMat:function(a,b){b||(b=u.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=t.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10];return b},toInverseMat3:function(a,b){var c=a[0],d=a[1],e=a[2],m=a[4],g=a[5],k=a[6],l=a[8],f=a[9];a=a[10];var q=a*g-k*f,u=-a*m+k*l,v=f*m-
- g*l,p=c*q+d*u+e*v;if(!p)return null;p=1/p;b||(b=t.create());b[0]=q*p;b[1]=(-a*d+e*f)*p;b[2]=(k*d-e*g)*p;b[3]=u*p;b[4]=(a*c-e*l)*p;b[5]=(-k*c+e*m)*p;b[6]=v*p;b[7]=(-f*c+d*l)*p;b[8]=(g*c-d*m)*p;return b},multiply:function(a,b,c){c||(c=a);var d=a[0],e=a[1],m=a[2],g=a[3],k=a[4],l=a[5],f=a[6],q=a[7],t=a[8],u=a[9],v=a[10],p=a[11],n=a[12],B=a[13],z=a[14];a=a[15];var x=b[0],h=b[1],r=b[2],K=b[3],L=b[4],V=b[5],U=b[6],ca=b[7],ga=b[8],da=b[9],ka=b[10],Z=b[11],ea=b[12],ja=b[13],aa=b[14];b=b[15];c[0]=x*d+h*k+r*
- t+K*n;c[1]=x*e+h*l+r*u+K*B;c[2]=x*m+h*f+r*v+K*z;c[3]=x*g+h*q+r*p+K*a;c[4]=L*d+V*k+U*t+ca*n;c[5]=L*e+V*l+U*u+ca*B;c[6]=L*m+V*f+U*v+ca*z;c[7]=L*g+V*q+U*p+ca*a;c[8]=ga*d+da*k+ka*t+Z*n;c[9]=ga*e+da*l+ka*u+Z*B;c[10]=ga*m+da*f+ka*v+Z*z;c[11]=ga*g+da*q+ka*p+Z*a;c[12]=ea*d+ja*k+aa*t+b*n;c[13]=ea*e+ja*l+aa*u+b*B;c[14]=ea*m+ja*f+aa*v+b*z;c[15]=ea*g+ja*q+aa*p+b*a;return c},multiplyVec3:function(a,b,c){c||(c=b);var d=b[0],e=b[1];b=b[2];c[0]=a[0]*d+a[4]*e+a[8]*b+a[12];c[1]=a[1]*d+a[5]*e+a[9]*b+a[13];c[2]=a[2]*
- d+a[6]*e+a[10]*b+a[14];return c},multiplyVec4:function(a,b,c){c||(c=b);var d=b[0],e=b[1],m=b[2];b=b[3];c[0]=a[0]*d+a[4]*e+a[8]*m+a[12]*b;c[1]=a[1]*d+a[5]*e+a[9]*m+a[13]*b;c[2]=a[2]*d+a[6]*e+a[10]*m+a[14]*b;c[3]=a[3]*d+a[7]*e+a[11]*m+a[15]*b;return c},translate:function(a,b,c){var d=b[0],e=b[1];b=b[2];var g,m,k,l,f,q,t,u,v,p,n,B;if(!c||a===c)return a[12]=a[0]*d+a[4]*e+a[8]*b+a[12],a[13]=a[1]*d+a[5]*e+a[9]*b+a[13],a[14]=a[2]*d+a[6]*e+a[10]*b+a[14],a[15]=a[3]*d+a[7]*e+a[11]*b+a[15],a;g=a[0];m=a[1];k=
- a[2];l=a[3];f=a[4];q=a[5];t=a[6];u=a[7];v=a[8];p=a[9];n=a[10];B=a[11];c[0]=g;c[1]=m;c[2]=k;c[3]=l;c[4]=f;c[5]=q;c[6]=t;c[7]=u;c[8]=v;c[9]=p;c[10]=n;c[11]=B;c[12]=g*d+f*e+v*b+a[12];c[13]=m*d+q*e+p*b+a[13];c[14]=k*d+t*e+n*b+a[14];c[15]=l*d+u*e+B*b+a[15];return c},scale:function(a,b,c){var d=b[0],e=b[1];b=b[2];if(!c||a===c)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=b,a[9]*=b,a[10]*=b,a[11]*=b,a;c[0]=a[0]*d;c[1]=a[1]*d;c[2]=a[2]*d;c[3]=a[3]*d;c[4]=a[4]*e;c[5]=a[5]*e;
- c[6]=a[6]*e;c[7]=a[7]*e;c[8]=a[8]*b;c[9]=a[9]*b;c[10]=a[10]*b;c[11]=a[11]*b;c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c},maxScale:function(a){return Math.max(Math.max(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8]),Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])),Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))},rotate:function(a,b,c,d){var e=c[0],g=c[1];c=c[2];var m=Math.sqrt(e*e+g*g+c*c),k,l,f,q,t,u,v,p,n,B,z,x,C,h,r,L,V,U,ca,ga;if(!m)return null;1!==m&&(m=1/m,e*=m,g*=m,c*=m);k=Math.sin(b);l=Math.cos(b);
- f=1-l;b=a[0];m=a[1];q=a[2];t=a[3];u=a[4];v=a[5];p=a[6];n=a[7];B=a[8];z=a[9];x=a[10];C=a[11];h=e*e*f+l;r=g*e*f+c*k;L=c*e*f-g*k;V=e*g*f-c*k;U=g*g*f+l;ca=c*g*f+e*k;ga=e*c*f+g*k;e=g*c*f-e*k;g=c*c*f+l;d?a!==d&&(d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]):d=a;d[0]=b*h+u*r+B*L;d[1]=m*h+v*r+z*L;d[2]=q*h+p*r+x*L;d[3]=t*h+n*r+C*L;d[4]=b*V+u*U+B*ca;d[5]=m*V+v*U+z*ca;d[6]=q*V+p*U+x*ca;d[7]=t*V+n*U+C*ca;d[8]=b*ga+u*e+B*g;d[9]=m*ga+v*e+z*g;d[10]=q*ga+p*e+x*g;d[11]=t*ga+n*e+C*g;return d},rotateX:function(a,
- b,c){var d=Math.sin(b);b=Math.cos(b);var e=a[4],g=a[5],m=a[6],k=a[7],l=a[8],f=a[9],q=a[10],t=a[11];c?a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[4]=e*b+l*d;c[5]=g*b+f*d;c[6]=m*b+q*d;c[7]=k*b+t*d;c[8]=e*-d+l*b;c[9]=g*-d+f*b;c[10]=m*-d+q*b;c[11]=k*-d+t*b;return c},rotateY:function(a,b,c){var d=Math.sin(b);b=Math.cos(b);var e=a[0],g=a[1],k=a[2],m=a[3],l=a[8],f=a[9],q=a[10],t=a[11];c?a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12],
- c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=e*b+l*-d;c[1]=g*b+f*-d;c[2]=k*b+q*-d;c[3]=m*b+t*-d;c[8]=e*d+l*b;c[9]=g*d+f*b;c[10]=k*d+q*b;c[11]=m*d+t*b;return c},rotateZ:function(a,b,c){var d=Math.sin(b);b=Math.cos(b);var e=a[0],g=a[1],k=a[2],m=a[3],l=a[4],f=a[5],q=a[6],t=a[7];c?a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=e*b+l*d;c[1]=g*b+f*d;c[2]=k*b+q*d;c[3]=m*b+t*d;c[4]=e*-d+l*b;c[5]=g*-d+f*b;c[6]=k*-d+q*b;c[7]=m*-d+t*b;return c},
- frustum:function(a,b,c,d,e,g,k){k||(k=u.create());var m=b-a,l=d-c,f=g-e;k[0]=2*e/m;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=2*e/l;k[6]=0;k[7]=0;k[8]=(b+a)/m;k[9]=(d+c)/l;k[10]=-(g+e)/f;k[11]=-1;k[12]=0;k[13]=0;k[14]=-(g*e*2)/f;k[15]=0;return k},perspective:function(a,b,c,d,e){a=c*Math.tan(a*Math.PI/360);b*=a;return u.frustum(-b,b,-a,a,c,d,e)},ortho:function(a,b,c,d,e,g,k){k||(k=u.create());var m=b-a,l=d-c,f=g-e;k[0]=2/m;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=2/l;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=-2/f;k[11]=0;k[12]=
- -(a+b)/m;k[13]=-(d+c)/l;k[14]=-(g+e)/f;k[15]=1;return k},lookAt:function(a,b,c,d){d||(d=u.create());var e,g,k,m,l,f,q,t,v=a[0],p=a[1];a=a[2];k=c[0];m=c[1];g=c[2];q=b[0];c=b[1];e=b[2];if(v===q&&p===c&&a===e)return u.identity(d);b=v-q;c=p-c;q=a-e;t=1/Math.sqrt(b*b+c*c+q*q);b*=t;c*=t;q*=t;e=m*q-g*c;g=g*b-k*q;k=k*c-m*b;(t=Math.sqrt(e*e+g*g+k*k))?(t=1/t,e*=t,g*=t,k*=t):k=g=e=0;m=c*k-q*g;l=q*e-b*k;f=b*g-c*e;(t=Math.sqrt(m*m+l*l+f*f))?(t=1/t,m*=t,l*=t,f*=t):f=l=m=0;d[0]=e;d[1]=m;d[2]=b;d[3]=0;d[4]=g;d[5]=
- l;d[6]=c;d[7]=0;d[8]=k;d[9]=f;d[10]=q;d[11]=0;d[12]=-(e*v+g*p+k*a);d[13]=-(m*v+l*p+f*a);d[14]=-(b*v+c*p+q*a);d[15]=1;return d},fromRotationTranslation:function(a,b,c){c||(c=u.create());var d=a[0],e=a[1],g=a[2],k=a[3],m=d+d,l=e+e,f=g+g;a=d*m;var q=d*l,d=d*f,t=e*l,e=e*f,g=g*f,m=k*m,l=k*l,k=k*f;c[0]=1-(t+g);c[1]=q+k;c[2]=d-l;c[3]=0;c[4]=q-k;c[5]=1-(a+g);c[6]=e+m;c[7]=0;c[8]=d+l;c[9]=e-m;c[10]=1-(a+t);c[11]=0;c[12]=b[0];c[13]=b[1];c[14]=b[2];c[15]=1;return c},str:function(a){return"["+a[0]+", "+a[1]+
- ", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},q={create:function(a){var b=new e(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,d){var g=new e(4);g[0]=a;g[1]=b;g[2]=c;g[3]=d;return g},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},identity:function(a){a||(a=q.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},v=q.identity();
- q.calculateW=function(a,b){var c=a[0],d=a[1],e=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a;b[0]=c;b[1]=d;b[2]=e;b[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e));return b};q.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};q.inverse=function(a,b){var c=a[0],d=a[1],e=a[2],g=a[3],c=(c=c*c+d*d+e*e+g*g)?1/c:0;if(!b||a===b)return a[0]*=-c,a[1]*=-c,a[2]*=-c,a[3]*=c,a;b[0]=-a[0]*c;b[1]=-a[1]*c;b[2]=-a[2]*c;b[3]=a[3]*c;return b};q.conjugate=function(a,b){if(!b||a===b)return a[0]*=
- -1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};q.length=function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)};q.normalize=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2];a=a[3];var g=Math.sqrt(c*c+d*d+e*e+a*a);if(0===g)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;g=1/g;b[0]=c*g;b[1]=d*g;b[2]=e*g;b[3]=a*g;return b};q.add=function(a,b,c){if(!c||a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+=b[3],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+
- b[3];return c};q.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2];a=a[3];var k=b[0],l=b[1],f=b[2];b=b[3];c[0]=d*b+a*k+e*f-g*l;c[1]=e*b+a*l+g*k-d*f;c[2]=g*b+a*f+d*l-e*k;c[3]=a*b-d*k-e*l-g*f;return c};q.multiplyVec3=function(a,b,c){c||(c=b);var d=b[0],e=b[1],g=b[2];b=a[0];var k=a[1],l=a[2];a=a[3];var f=a*d+k*g-l*e,m=a*e+l*d-b*g,q=a*g+b*e-k*d,d=-b*d-k*e-l*g;c[0]=f*a+d*-b+m*-l-q*-k;c[1]=m*a+d*-k+q*-b-f*-l;c[2]=q*a+d*-l+f*-k-m*-b;return c};q.scale=function(a,b,c){if(!c||a===c)return a[0]*=b,
- a[1]*=b,a[2]*=b,a[3]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};q.toMat3=function(a,b){b||(b=t.create());var c=a[0],d=a[1],e=a[2],g=a[3],k=c+c,l=d+d,f=e+e;a=c*k;var m=c*l,c=c*f,q=d*l,d=d*f,e=e*f,k=g*k,l=g*l,g=g*f;b[0]=1-(q+e);b[1]=m+g;b[2]=c-l;b[3]=m-g;b[4]=1-(a+e);b[5]=d+k;b[6]=c+l;b[7]=d-k;b[8]=1-(a+q);return b};q.toMat4=function(a,b){b||(b=u.create());var c=a[0],d=a[1],e=a[2],g=a[3],k=c+c,l=d+d,f=e+e;a=c*k;var m=c*l,c=c*f,q=d*l,d=d*f,e=e*f,k=g*k,l=g*l,g=g*f;b[0]=1-(q+e);b[1]=
- m+g;b[2]=c-l;b[3]=0;b[4]=m-g;b[5]=1-(a+e);b[6]=d+k;b[7]=0;b[8]=c+l;b[9]=d-k;b[10]=1-(a+q);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};q.slerp=function(a,b,c,d){d||(d=a);var e=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,k;if(1<=Math.abs(e))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(e);k=Math.sqrt(1-e*e);if(.001>Math.abs(k))return d[0]=.5*a[0]+.5*b[0],d[1]=.5*a[1]+.5*b[1],d[2]=.5*a[2]+.5*b[2],d[3]=.5*a[3]+.5*b[3],d;e=Math.sin((1-c)*g)/k;c=Math.sin(c*g)/k;d[0]=a[0]*e+b[0]*
- c;d[1]=a[1]*e+b[1]*c;d[2]=a[2]*e+b[2]*c;d[3]=a[3]*e+b[3]*c;return d};q.fromRotationMatrix=function(a,b){b||(b=q.create());var c=a[0]+a[4]+a[8],d;if(0<c)d=Math.sqrt(c+1),b[3]=.5*d,d=.5/d,b[0]=(a[7]-a[5])*d,b[1]=(a[2]-a[6])*d,b[2]=(a[3]-a[1])*d;else{d=q.fromRotationMatrix.s_iNext=q.fromRotationMatrix.s_iNext||[1,2,0];c=0;a[4]>a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var e=d[c],g=d[e];d=Math.sqrt(a[3*c+c]-a[3*e+e]-a[3*g+g]+1);b[c]=.5*d;d=.5/d;b[3]=(a[3*g+e]-a[3*e+g])*d;b[e]=(a[3*e+c]+a[3*c+e])*d;b[g]=(a[3*g+
- c]+a[3*c+g])*d}return b};t.toQuat4=q.fromRotationMatrix;(function(){var a=t.create();q.fromAxes=function(b,c,d,e){a[0]=c[0];a[3]=c[1];a[6]=c[2];a[1]=d[0];a[4]=d[1];a[7]=d[2];a[2]=b[0];a[5]=b[1];a[8]=b[2];return q.fromRotationMatrix(a,e)}})();q.identity=function(a){a||(a=q.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};q.fromAngleAxis=function(a,b,c){c||(c=q.create());a*=.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2];return c};q.toAngleAxis=function(b,c){c||(c=b);var d=
- b[0]*b[0]+b[1]*b[1]+b[2]*b[2];0<d?(c[3]=2*Math.acos(b[3]),d=a.invsqrt(d),c[0]=b[0]*d,c[1]=b[1]*d,c[2]=b[2]*d):(c[3]=0,c[0]=1,c[1]=0,c[2]=0);return c};q.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var x={create:function(a){var b=new e(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,d){var g=new e(4);g[0]=a;g[1]=b;g[2]=c;g[3]=d;return g},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},identity:function(a){a||
- (a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b)return b=a[1],a[1]=a[2],a[2]=b,a;b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2];a=a[3];var g=c*a-e*d;if(!g)return null;g=1/g;b[0]=a*g;b[1]=-d*g;b[2]=-e*g;b[3]=c*g;return b},multiply:function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2];a=a[3];c[0]=d*b[0]+e*b[2];c[1]=d*b[1]+e*b[3];c[2]=g*b[0]+a*b[2];c[3]=
- g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2];a=a[3];var k=Math.sin(b);b=Math.cos(b);c[0]=d*b+e*k;c[1]=d*-k+e*b;c[2]=g*b+a*k;c[3]=g*-k+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],e=a[2],g=a[3],k=b[0];b=b[1];c[0]=a[0]*k;c[1]=d*b;c[2]=e*k;c[3]=g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};f=f?"":"d";h["glMath"+f]=a;
- h["vec2"+f]={create:function(a){var b=new e(2);a?(b[0]=a[0],b[1]=a[1]):(b[0]=0,b[1]=0);return b},createFrom:function(a,b){var c=new e(2);c[0]=a;c[1]=b;return c},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*
- b;return c},dist:function(a,b){var c=b[0]-a[0];a=b[1]-a[1];return Math.sqrt(c*c+a*a)},dist2:function(a,b){var c=b[0]-a[0];a=b[1]-a[1];return c*c+a*a},set:function(a,b){b[0]=a[0];b[1]=a[1];return b},set2:function(a,b,c){c[0]=a;c[1]=b;return c},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;
- c[2]=a;return c},length:function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,b,c){c||(c=a);var d=a[0]-b[0];a=a[1]-b[1];b=d*d+a*a;if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=d*b;c[1]=a*b;return c},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);return d},str:function(a){return"["+a[0]+", "+a[1]+"]"}};h["vec3"+f]=c;h["vec4"+f]={create:function(a){var b=new e(4);a?(b[0]=a[0],b[1]=a[1],
- b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var g=new e(4);g[0]=a;g[1]=b;g[2]=c;g[3]=d;return g},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=
- a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},set4:function(a,b,c,d,e){e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=
- a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};h["mat2"+f]=x;h["mat3"+f]=t;h["mat4"+f]=u;h["quat4"+f]=q});return r})},"esri/views/3d/webgl-engine/materials/internal/MaterialUtil":function(){define("require exports ../../../support/aaBoundingBox ../../lib/ComponentUtils ../../lib/gl-matrix ../../lib/screenSizePerspectiveUtils ../../lib/Util ../../../../webgl/Util".split(" "),function(r,h,f,a,e,c,g,d){function b(a,b,c,d,e,g){if(void 0===
- e||3!==g)for(e=0;e<g;++e)c[d+e]=a[b+e];else{var k=a[b],l=a[b+1];a=a[b+2];c[d]=e[0]*k+e[4]*l+e[8]*a+e[12];c[d+1]=e[1]*k+e[5]*l+e[9]*a+e[13];c[d+2]=e[2]*k+e[6]*l+e[10]*a+e[14]}return g}function k(a,b,c,d,e,g){for(var k=a.length,l=0;l<k;++l){for(var f=c*a[l],q=0;q<c;++q)d[e+q]=b[f+q];e+=g}}function l(a,b,c,d,e,g){d=new Uint8Array(d);e*=4;g*=4;var k=a.length;if(4===c)for(c=0;c<k;++c){var l=4*a[c];d[e]=b[l];d[e+1]=b[l+1];d[e+2]=b[l+2];d[e+3]=b[l+3];e+=g}else if(3===c)for(c=0;c<k;++c)l=3*a[c],d[e]=b[l],
- d[e+1]=b[l+1],d[e+2]=b[l+2],d[e+3]=255,e+=g}function p(a,b,c,d,e){var g=t(b,c,z);f.setMin(m,a.getBBMin());f.setMax(m,a.getBBMax());if(u(m,b,g,d)){var g=a.getPrimitiveIndices(),k=a.getIndices(),l=a.getPosition(),q=g?g.length:k.length/3;if(1E4<q&&(a=a.getChildren(),void 0!==a)){for(g=0;8>g;++g)void 0!==a[g]&&p(a[g],b,c,d,e);return}n(b,c,0,q,k,l,g,e)}}function n(a,b,c,d,g,k,l,f){var q=k.data,m=k.offsetIdx;k=k.strideIdx;var t=a[0],u=a[1];a=a[2];var v=b[0]-t,p=b[1]-u;for(b=b[2]-a;c<d;c++){var n=l?l[c]:
- c,x=m+k*g[3*n],B=m+k*g[3*n+1],h=m+k*g[3*n+2],z=q[x],F=q[x+1],r=q[x+2],x=q[B]-z,I=q[B+1]-F,B=q[B+2]-r,P=q[h]-z,G=q[h+1]-F,h=q[h+2]-r,H=p*h-G*b,M=b*P-h*v,S=v*G-P*p,J=x*H+I*M+B*S,z=t-z,N=u-F,O=a-r,F=N*B-I*O,r=O*x-B*z,w=z*I-x*N;if(J>C){H=z*H+N*M+O*S;if(0>H||H>J)continue;M=v*F+p*r+b*w;if(0>M||H+M>J)continue}else if(J<-C){H=z*H+N*M+O*S;if(0<H||H<J)continue;M=v*F+p*r+b*w;if(0<M||H+M<J)continue}else continue;J=(P*F+G*r+h*w)/J;0<=J&&(H=A,e.vec3d.set3(x,I,B,D),e.vec3d.set3(P,G,h,E),x=e.vec3d.normalize(e.vec3d.cross(D,
- E,H)),f(J,x,n))}}function t(a,b,c){return e.vec3d.set3(1/(b[0]-a[0]),1/(b[1]-a[1]),1/(b[2]-a[2]),c)}function u(a,b,c,d){var e=(a[0]-d-b[0])*c[0],g=(a[3]+d-b[0])*c[0],k=Math.min(e,g),e=Math.max(e,g),g=(a[1]-d-b[1])*c[1],l=(a[4]+d-b[1])*c[1],k=Math.max(k,Math.min(g,l)),e=Math.min(e,Math.max(g,l));if(k>e)return!1;g=(a[2]-d-b[2])*c[2];a=(a[5]+d-b[2])*c[2];k=Math.max(k,Math.min(g,a));e=Math.min(e,Math.max(g,a));return k<=e}function q(a,b){b=b?q(b):{};for(var c in a){var d=a[c];d&&d.forEach&&(d=v(d));null==
- d&&c in b||(b[c]=d)}return b}function v(a){var b=[];a.forEach(function(a){return b.push(a)});return b}Object.defineProperty(h,"__esModule",{value:!0});var x=e.mat4d.create(),m=f.create(),B=g.VertexAttrConstants;h.IDENTITY=e.mat4d.identity();h.fill=b;h.fillColor=function(a,b,c,d,e){for(var g=0;g<e;++g)c[d+g]=a[b+g];return e};h.fillInterleaved=function(a,b,c,e,g,f,q,m){for(var t=d.getStride(g)/4,u=0;u<g.length;u++){var v=g[u],p=q+v.offset/4,v=v.name,n=a.vertexAttr[v];if(null!=n&&(null==m||null!=m[v]))switch(v){case "uv0":k(a.indices[v],
- n.data,n.size,f,p,t);break;case "region":for(var v=a.indices[v],x=n.data,h=n.size,n=t,z=new Uint16Array(f.buffer),p=2*p,n=2*n,C=v.length,A=0;A<C;++A){for(var D=h*v[A],E=0;E<h;++E)z[p+E]=x[D+E];p+=n}break;case "color":if(e&&e.color)if(v=a.indices[v],x=n.data,h=e.color,A=n.size,n=t,z=new Uint8Array(f.buffer),p*=4,n*=4,C=v.length,4===A)for(A=0;A<C;++A)D=4*v[A],z[p]=x[D]*h[0],z[p+1]=x[D+1]*h[1],z[p+2]=x[D+2]*h[2],z[p+3]=x[D+3]*h[3],p+=n;else{if(3===A)for(E=255*h[3],A=0;A<C;++A)D=3*v[A],z[p]=x[D]*h[0],
- z[p+1]=x[D+1]*h[1],z[p+2]=x[D+2]*h[2],z[p+3]=E,p+=n}else l(a.indices[v],n.data,n.size,f.buffer,p,t);break;case "symbolColor":l(a.indices[v],n.data,n.size,f.buffer,p,t);break;default:if(h=v===B.POSITION?b:v===B.NORMAL?c:void 0,void 0!==h&&3===n.size)for(v=a.indices[v],x=n.data,n=f,z=t,C=v.length,A=0;A<C;++A){var F=3*v[A],D=x[F],E=x[F+1],F=x[F+2];n[p]=h[0]*D+h[4]*E+h[8]*F+h[12];n[p+1]=h[1]*D+h[5]*E+h[9]*F+h[13];n[p+2]=h[2]*D+h[6]*E+h[10]*F+h[14];p+=z}else k(a.indices[v],n.data,n.size,f,p,t)}}};h.triangleVertexArrayToWireframeLines=
- function(a,c,d,e){for(d=Math.floor(d/3)-1;0<=d;d--){var g=c+3*d*e,k=c+6*d*e+5*e;b(a,g,a,k,null,e);k-=e;b(a,g+e,a,k,null,e);k-=e;b(a,g+e,a,k,null,e);k-=e;b(a,g+2*e,a,k,null,e);k-=e;b(a,g+2*e,a,k,null,e);k-=e;b(a,g,a,k,null,e)}};h.intersectTriangleGeometry=function(b,c,d,e,k,l,q){g.assert("triangle"===b.data.primitiveType);c=c.componentVisibilities;e=e.tolerance;var v=b.getBoundingInfo();if(1<b.getComponentCount()){if(d=t(k,l,z),f.setMin(m,v.getBBMin()),f.setMax(m,v.getBBMax()),u(m,k,d,e))for(var x=
- b.data,v=b.getComponentCount(),h=x.getIndices(B.POSITION),A=x.getAttribute(B.POSITION),x=x.componentOffsets,C=0;C<v;C++)if(a.getVisibility(c,C)){var D=b.getComponentAABB(C,m);u(D,k,d,e)&&n(k,l,x[C]/3,x[C+1]/3,h,A,void 0,q)}}else a.getVisibility(c,0)&&p(v,k,l,e,q)};var z=e.vec3d.create(),C=Math.pow(2,-52),A=e.vec3d.create(),D=e.vec3d.create(),E=e.vec3d.create();h.transformToWorld=function(a,b,c){return e.vec4d.set4(a[0]-b[0],a[1]-b[1],a[2]-b[2],1,c)};h.transformToView=function(a,b,c,d){e.mat4d.translate(c,
- b,x);c=x;return e.mat4d.multiplyVec4(c,a,d)};h.transformToProjection=function(a,b,c,d){d[0]=a[0]+c[0];d[1]=a[1]+c[1];d[2]=a[2]+c[2];d[3]=a[3];return e.mat4d.multiplyVec4(b,d)};h.transformToNDC=function(a,b){return e.vec4d.scale(a,1/Math.abs(a[3]),b)};h.applyScreenSizePerspectiveScale=function(a,b,d,e,g){return c.scale(a,e,d,g)};h.verticalOffsetAtDistance=function(a,b,d,e,k){var l=d.screenLength||0;k&&(l=c.scale(l,e,b,k));return g.clamp(l*Math.tan(.5*a.fovY)/(.5*a.fullHeight)*b,d.minWorldLength||0,
- null!=d.maxWorldLength?d.maxWorldLength:Infinity)};h.aquireIfNotUndefined=function(a,b,c){if(void 0!==a)return b.aquire(a,c)};h.releaseIfNotUndefined=function(a,b){void 0!==a&&b.release(a)};var F=e.mat4.create();h.bindView=function(a,b,c){e.mat4d.translate(b,a,F);c.setUniform3fv("localOrigin",a);c.setUniformMatrix4fv("view",F)};h.bindCamPos=function(a,b,c){c.setUniform3f("camPos",b[3]-a[0],b[7]-a[1],b[11]-a[2])};h.bindVerticalOffset=function(a,b,c){if(a){var d=b.fovY;b=b.viewport[3];var e=void 0;
- void 0===e&&(e=I);e.screenLength=a.screenLength;e.perDistance=Math.tan(.5*d)/(.5*b);e.minWorldLength=a.minWorldLength;e.maxWorldLength=a.maxWorldLength;a=e;c.setUniform4f("verticalOffset",a.screenLength,a.perDistance,a.minWorldLength,a.maxWorldLength)}};h.bindScreenSizePerspective=function(a,b,c){void 0===c&&(c="screenSizePerspectiveAlignment");if(a){var d=a.parameters;b.setUniform4f(c,d.divisor,d.offset,d.minPixelSize,a.paddingPixelsOverride)}};h.copyParameters=q;h.updateParameters=function(a,b){var c=
- !1,d;for(d in b){var e=b[d];void 0!==e&&(c=!0,Array.isArray(e)?a[d]=e.slice():a[d]=e)}return c};h.colorMixModes={multiply:1,ignore:2,replace:3,tint:4};var I={screenLength:0,perDistance:0,minWorldLength:0,maxWorldLength:0}})},"esri/views/3d/support/aaBoundingBox":function(){define(["require","exports","../../../geometry/Extent","./aaBoundingRect"],function(r,h,f,a){function e(a){return a[0]>=a[3]?0:a[3]-a[0]}function c(a){return a[1]>=a[4]?0:a[4]-a[1]}function g(a){return a[2]>=a[5]?0:a[5]-a[2]}function d(a){return 6===
- a.length}Object.defineProperty(h,"__esModule",{value:!0});h.create=function(a){void 0===a&&(a=h.ZERO);return[a[0],a[1],a[2],a[3],a[4],a[5]]};h.fromExtent=function(a){return[a.xmin,a.ymin,a.zmin,a.xmax,a.ymax,a.zmax]};h.toExtent=function(a,c){return isFinite(a[2])||isFinite(a[5])?new f({xmin:a[0],xmax:a[3],ymin:a[1],ymax:a[4],zmin:a[2],zmax:a[5],spatialReference:c}):new f({xmin:a[0],xmax:a[3],ymin:a[1],ymax:a[4],spatialReference:c})};h.fromMinMax=function(a,c){return[a[0],a[1],a[2],c[0],c[1],c[2]]};
- h.expand=function(b,c,e){void 0===e&&(e=b);var g=c.declaredClass;"esri.geometry.Extent"===g?(e[0]=Math.min(b[0],c.xmin),e[1]=Math.min(b[1],c.ymin),e[3]=Math.max(b[3],c.xmax),e[4]=Math.max(b[4],c.ymax),c.hasZ&&(e[2]=Math.min(b[2],c.zmin),e[5]=Math.max(b[5],c.zmax))):"esri.geometry.Point"===g?(e[0]=Math.min(b[0],c.x),e[1]=Math.min(b[1],c.y),e[3]=Math.max(b[3],c.x),e[4]=Math.max(b[4],c.y),c.hasZ&&(e[2]=Math.min(b[2],c.z),e[5]=Math.max(b[5],c.z))):d(c)?(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),
- e[2]=Math.min(b[2],c[2]),e[3]=Math.max(b[3],c[3]),e[4]=Math.max(b[4],c[4]),e[5]=Math.max(b[5],c[5])):a.is(c)?(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),e[3]=Math.max(b[3],c[2]),e[4]=Math.max(b[4],c[3])):Array.isArray(c)&&(2===c.length?(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),e[3]=Math.max(b[3],c[0]),e[4]=Math.max(b[4],c[1])):3===c.length&&(e[0]=Math.min(b[0],c[0]),e[1]=Math.min(b[1],c[1]),e[2]=Math.min(b[2],c[2]),e[3]=Math.max(b[3],c[0]),e[4]=Math.max(b[4],c[1]),e[5]=Math.max(b[5],
- c[2])));return e};h.expandBuffer=function(a,c,d,e,g){void 0===g&&(g=a);var b=a[0],k=a[1],l=a[2],f=a[3],p=a[4];a=a[5];for(var m=0;m<e;m++)b=Math.min(b,c[d+3*m]),k=Math.min(k,c[d+3*m+1]),l=Math.min(l,c[d+3*m+2]),f=Math.max(f,c[d+3*m]),p=Math.max(p,c[d+3*m+1]),a=Math.max(a,c[d+3*m+2]);g[0]=b;g[1]=k;g[2]=l;g[3]=f;g[4]=p;g[5]=a;return g};h.allFinite=function(a){for(var b=0;6>b;b++)if(!isFinite(a[b]))return!1;return!0};h.width=e;h.depth=c;h.height=g;h.center=function(a,d){void 0===d&&(d=[0,0,0]);d[0]=a[0]+
- e(a)/2;d[1]=a[1]+c(a)/2;d[2]=a[2]+g(a)/2;return d};h.size=function(a,d){void 0===d&&(d=[0,0,0]);d[0]=e(a);d[1]=c(a);d[2]=g(a);return d};h.containsPoint=function(a,c){return c[0]>=a[0]&&c[1]>=a[1]&&c[2]>=a[2]&&c[0]<=a[3]&&c[1]<=a[4]&&c[2]<=a[5]};h.containsPointWithMargin=function(a,c,d){return c[0]>=a[0]-d&&c[1]>=a[1]-d&&c[2]>=a[2]-d&&c[0]<=a[3]+d&&c[1]<=a[4]+d&&c[2]<=a[5]+d};h.contains=function(a,c){return c[0]>=a[0]&&c[1]>=a[1]&&c[2]>=a[2]&&c[3]<=a[3]&&c[4]<=a[4]&&c[5]<=a[5]};h.intersects=function(a,
- c){return Math.max(c[0],a[0])<=Math.min(c[3],a[3])&&Math.max(c[1],a[1])<=Math.min(c[4],a[4])&&Math.max(c[2],a[2])<=Math.min(c[5],a[5])};h.offset=function(a,c,d,e,g){void 0===g&&(g=a);g[0]=a[0]+c;g[1]=a[1]+d;g[2]=a[2]+e;g[3]=a[3]+c;g[4]=a[4]+d;g[5]=a[5]+e;return g};h.setMin=function(a,c,d){void 0===d&&(d=a);d[0]=c[0];d[1]=c[1];d[2]=c[2];d!==a&&(d[3]=a[3],d[4]=a[4],d[5]=a[5]);return d};h.setMax=function(a,c,d){void 0===d&&(d=a);d[3]=c[0];d[4]=c[1];d[5]=c[2];d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2]);return a};
- h.set=function(a,c){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];return a};h.toRect=function(b,c){c||(c=a.create());c[0]=b[0];c[1]=b[1];c[2]=b[3];c[3]=b[4];return c};h.fromRect=function(a,c){a[0]=c[0];a[1]=c[1];a[3]=c[2];a[4]=c[3];return a};h.is=d;h.isPoint=function(a){return 0===e(a)&&0===c(a)&&0===g(a)};h.equals=function(a,c,e){if(null==a||null==c)return a===c;if(!d(a)||!d(c))return!1;if(e)for(var b=0;b<a.length;b++){if(!e(a[b],c[b]))return!1}else for(b=0;b<a.length;b++)if(a[b]!==
- c[b])return!1;return!0};h.POSITIVE_INFINITY=[-Infinity,-Infinity,-Infinity,Infinity,Infinity,Infinity];h.NEGATIVE_INFINITY=[Infinity,Infinity,Infinity,-Infinity,-Infinity,-Infinity];h.ZERO=[0,0,0,0,0,0]})},"esri/views/3d/support/aaBoundingRect":function(){define(["require","exports","./mathUtils"],function(r,h,f){function a(a){return a[0]>=a[2]?0:a[2]-a[0]}function e(a){return a[1]>=a[3]?0:a[3]-a[1]}function c(a){return 4===a.length}Object.defineProperty(h,"__esModule",{value:!0});h.create=function(a){void 0===
- a&&(a=h.ZERO);return[a[0],a[1],a[2],a[3]]};h.fromExtent=function(a){return[a.xmin,a.ymin,a.xmax,a.ymax]};h.expand=function(a,d,b){void 0===b&&(b=a);var e=d.declaredClass;"esri.geometry.Extent"===e?(b[0]=Math.min(a[0],d.xmin),b[1]=Math.min(a[1],d.ymin),b[2]=Math.max(a[2],d.xmax),b[3]=Math.max(a[3],d.ymax)):"esri.geometry.Point"===e?(b[0]=Math.min(a[0],d.x),b[1]=Math.min(a[1],d.y),b[2]=Math.max(a[2],d.x),b[3]=Math.max(a[3],d.y)):c(d)?(b[0]=Math.min(a[0],d[0]),b[1]=Math.min(a[1],d[1]),b[2]=Math.max(a[2],
- d[2]),b[3]=Math.max(a[3],d[3])):!Array.isArray(d)||2!==d.length&&3!==d.length||(b[0]=Math.min(a[0],d[0]),b[1]=Math.min(a[1],d[1]),b[2]=Math.max(a[2],d[0]),b[3]=Math.max(a[3],d[1]));return b};h.allFinite=function(a){for(var c=0;4>c;c++)if(!isFinite(a[c]))return!1;return!0};h.width=a;h.height=e;h.center=function(c,d){void 0===d&&(d=[0,0]);d[0]=c[0]+a(c)/2;d[1]=c[1]+e(c)/2;return d};h.containsPoint=function(a,c){return c[0]>=a[0]&&c[1]>=a[1]&&c[0]<=a[2]&&c[1]<=a[3]};h.containsPointWithMargin=function(a,
- c,b){return c[0]>=a[0]-b&&c[1]>=a[1]-b&&c[0]<=a[2]+b&&c[1]<=a[3]+b};h.intersects=function(a,c){return Math.max(c[0],a[0])<=Math.min(c[2],a[2])&&Math.max(c[1],a[1])<=Math.min(c[3],a[3])};h.contains=function(a,c){return c[0]>=a[0]&&c[2]<=a[2]&&c[1]>=a[1]&&c[3]<=a[3]};h.intersection=function(a,c,b){void 0===b&&(b=a);var d=c[0],e=c[1],g=c[2];c=c[3];b[0]=f.clamp(a[0],d,g);b[1]=f.clamp(a[1],e,c);b[2]=f.clamp(a[2],d,g);b[3]=f.clamp(a[3],e,c);return b};h.offset=function(a,c,b,e){void 0===e&&(e=a);e[0]=a[0]+
- c;e[1]=a[1]+b;e[2]=a[2]+c;e[3]=a[3]+b;return e};h.setMin=function(a,c,b){void 0===b&&(b=a);b[0]=c[0];b[1]=c[1];b!==a&&(b[2]=a[2],b[3]=a[3]);return b};h.setMax=function(a,c,b){void 0===b&&(b=a);b[2]=c[0];b[3]=c[1];b!==a&&(b[0]=a[0],b[1]=a[1]);return a};h.set=function(a,c){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];return a};h.is=c;h.isPoint=function(c){return(0===a(c)||!isFinite(c[0]))&&(0===e(c)||!isFinite(c[1]))};h.equals=function(a,d,b){if(null==a||null==d)return a===d;if(!c(a)||!c(d))return!1;if(b)for(var e=
- 0;e<a.length;e++){if(!b(a[e],d[e]))return!1}else for(e=0;e<a.length;e++)if(a[e]!==d[e])return!1;return!0};h.POSITIVE_INFINITY=[-Infinity,-Infinity,Infinity,Infinity];h.NEGATIVE_INFINITY=[Infinity,Infinity,-Infinity,-Infinity];h.ZERO=[0,0,0,0]})},"esri/views/3d/webgl-engine/lib/ComponentUtils":function(){define(["require","exports","../../../../core/arrayUtils"],function(r,h,f){function a(a,b){if(null!=a){var c=a.isVisibleBit,d=a.data,e=8*d.BYTES_PER_ELEMENT;return b<d.length*e?n(c,d,b,e):!a.isVisibleBit}return!0}
- function e(a){return null===a.component?-1:a.component}function c(b,c,d,e,k){a(c,e)&&g(b,c,d,d[e],d[e+1]-1,k)}function g(a,b,c,d,e,g){c=(b=0<a.length?a[a.length-1]:null)?b.range[1]:-1;var k=b?b.options:null;c>=d||(c+1===d&&k===g?b.range[1]=e:a.push({range:[d,e],options:g}))}function d(a){void 0===a&&(a=!0);return{isVisibleBit:!a,data:new Uint32Array(0)}}function b(a,b){return l(a,b,!0)}function k(a,b){return l(a,b,!1)}function l(a,b,c){var d=!1;a=a||u;d=a.isVisibleBit;a=a.data;b=t(b);var e=8*a.BYTES_PER_ELEMENT,
- g=a.length*e;c=c===d;if(0===a.length||0===b)d=!c;else if(g<b&&!c)d=!0;else{for(var k=q[e],g=q[0],f=0;f<a.length-1;f++)if(d=!c&&a[f]!==k||c&&a[f]!==g)return d;d=a.length-1;b=q[(b-1)%e+1];d=!c&&(a[d]&b)!==b||c&&(a[d]&b)!==g}return d}function p(a){return 0<a.length}function n(a,b,c,d){var e=c/d|0;return 0!==(b[e]&1<<c-e*d)===a}function t(a){return Math.max(0,a.length-1)}Object.defineProperty(h,"__esModule",{value:!0});h.updateVisibility=function(a,b,c,e){if(c<t(b)){null==a&&(a=d());var g=a.isVisibleBit,
- k=a.data,f=8*k.BYTES_PER_ELEMENT,l=c/f|0,q=c-f*l;b=(t(b)-1)/f|0;var m=k;e=e===g;c<m.length*f||!e||(c=Math.max(l+1,Math.ceil(1.5*m.length)),c=Math.min(c,b+1),k=new Uint32Array(c),k.set(m));l<k.length&&(k[l]=k[l]&~(1<<q)|(e?1:0)<<q);a.data=k}return a};h.getVisibility=a;h.hideAllComponents=function(a){if(null==a)a=d(!1);else{a.isVisibleBit=!0;for(var b=0;b<a.data.length;b++)a.data[b]=0}return a};h.unhideAllComponents=function(a){var b;if(null!=a)for(b=a,b.isVisibleBit=!1,a=0;a<b.data.length;a++)b.data[a]=
- 0;return b};h.generateVisibleIndexRanges=function(a,b){var c;if(a)if(p(b))if(0===a.data.length)c=[],b=[[b[0],b[b.length-1]-1]],c=a.isVisibleBit?c:b;else{c=[];for(var d=a.isVisibleBit,e=a.data,g=8*e.BYTES_PER_ELEMENT,k=e.length*g,f=t(b),l=!1,q=0;q<k&&q<f;q++){var u=n(d,e,q,g);if(u!==l){var v=b[q];u?c.push([v,0]):(l=c[c.length-1],l[1]=v-1);l=u}}a=!a.isVisibleBit;f>k&&a&&!l?c.push([b[k],b[f]-1]):l&&(l=c[c.length-1],l[1]=b[a?f:Math.min(f,k)]-1)}else c=[],c=a.isVisibleBit?c:null;else c=null;return c};
- h.addHighlight=function(a,b,c,d){a=a||[];b={component:b,options:c,id:d};a.push(b);b=e(b);for(c=a.length-1;0<c&&b<e(a[c-1]);)d=[a[c],a[c-1]],a[c-1]=d[0],a[c]=d[1],--c;return a};h.removeHighlight=function(a,b){return a?(a=a.filter(function(a){return a.id!==b}),0===a.length?null:a):a};h.generateHighlightedIndexRanges=function(a,b,d){if(b){if(p(d)){for(var e=d[0],f=d[d.length-1]-1,l=[],q=!k(a,d),u=0;u<b.length;++u){var m=b[u].options,n=b[u].component;if(null!==n)c(l,a,d,n,m);else if(q)g(l,a,d,e,f,m);
- else for(n=0;n<t(d);++n)c(l,a,d,n,m)}return 0<l.length?l:null}var q=!a||!a.isVisibleBit;return q?b.map(function(a){return{range:null,options:a.options}}):null}return null};h.defaultVisibilities=d;h.isAllVisible=function(a,b){return!k(a,b)};h.isAllHidden=function(a,c){return!b(a,c)};h.hasVisible=b;h.hasHidden=k;var u=d();h.createOffsets=function(a){return Array.isArray(a)?new Uint32Array(a):a};h.hasComponent=function(a,b){return b<t(a)};h.hasComponents=p;var q=[];for(r=0;65>r;r++)q.push(Math.pow(2,
- r)-1);h.componentCount=t;h.componentFind=function(a,b){a=f.binaryIndexOf(a,b,!0);return 0<=a?a:null}})},"esri/views/3d/webgl-engine/lib/screenSizePerspectiveUtils":function(){define(["require","exports","./Util"],function(r,h,f){function a(a){return Math.abs(a*a*a)}function e(b,c,d,e){void 0===e&&(e=l);var g=d.parameters;d=d.paddingPixelsOverride;e.scale=Math.min(g.divisor/(c-g.offset),1);e.factor=a(b);e.minPixelSize=g.minPixelSize;e.paddingPixels=d;return e}function c(a,b){return 0===a?b.minPixelSize:
- b.minPixelSize*(1+2*b.paddingPixels/a)}function g(a,b){return Math.max(f.lerp(a*b.scale,a,b.factor),c(a,b))}function d(a,b,c){a=e(a,b,c);a.minPixelSize=0;a.paddingPixels=0;return g(1,a)}Object.defineProperty(h,"__esModule",{value:!0});h.getSettings=function(a){return new b(a,h.defaultDescription)};h.getLabelSettings=function(a){var c=h.defaultDescription.curvatureDependent;return new b(a,{curvatureDependent:{min:{curvature:c.min.curvature,tiltAngle:c.min.tiltAngle,scaleFallOffFactor:k.curvatureDependent.min.scaleFallOffFactor},
- max:{curvature:c.max.curvature,tiltAngle:c.max.tiltAngle,scaleFallOffFactor:k.curvatureDependent.max.scaleFallOffFactor}},scaleStart:h.defaultDescription.scaleStart,scaleFallOffRange:h.defaultDescription.scaleFallOffRange,minPixelSize:k.minPixelSize})};h.perspectiveFactor=a;h.scaleFactor=e;h.applyScaleFactor=g;h.applyScaleFactorVec2=function(a,b,d){void 0===d&&(d=[0,0]);var e=Math.min(Math.max(b.scale,c(a[1],b)/a[1]),1);d[0]=f.lerp(a[0]*e,a[0],b.factor);d[1]=f.lerp(a[1]*e,a[1],b.factor);return d};
- h.precomputeScale=d;h.precomputeScaleFactor=function(a,b,c,e){e.scale=d(a,b,c);e.factor=0;e.minPixelSize=c.parameters.minPixelSize;e.paddingPixels=c.paddingPixelsOverride;return e};h.applyPrecomputedScaleFactorVec2=function(a,b,d){void 0===d&&(d=[0,0]);b=Math.min(Math.max(b.scale,c(a[1],b)/a[1]),1);d[0]=a[0]*b;d[1]=a[1]*b;return d};h.scale=function(a,b,c,d){return g(a,e(b,c,d))};var b=function(){function a(a,b,c,d){void 0===c&&(c={camera:{distance:0,fovY:0},divisor:0,offset:0,minPixelSize:0,paddingPixels:0});
- this.viewingMode=a;this.description=b;this.parameters=c;this._paddingPixelsOverride=d;"local"===this.viewingMode?(this.coverageCompensation=this.surfaceCoverageCompensationLocal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersLocal):(this.coverageCompensation=this.surfaceCoverageCompensationGlobal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersGlobal)}Object.defineProperty(a.prototype,"paddingPixelsOverride",{get:function(){return this._paddingPixelsOverride||
- this.parameters.paddingPixels},enumerable:!0,configurable:!0});a.prototype.update=function(a){if(this.parameters&&this.parameters.camera.fovY===a.fovY&&this.parameters.camera.distance===a.distance)return!1;this.calculateParameters(a,this.parameters);return!0};a.prototype.overridePadding=function(b){return b!==this.paddingPixelsOverride?new a(this.viewingMode,this.description,this.parameters,b):this};a.prototype.calculateParameters=function(a,b){var c=this.description,d=c.scaleStart,e=c.scaleFallOffRange,
- c=c.minPixelSize,g=a.fovY,k=a.distance,f=this.calculateCurvatureDependentParameters(a),l=this.coverageCompensation(a,f),q=f.tiltAngle,f=f.scaleFallOffFactor,k=Math.sin(q)*k,q=.5*Math.PI-q-g*(.5-d*l),d=k/Math.cos(q),e=(d-k/Math.cos(q+g*e*l)*f)/(1-f);b.camera.fovY=a.fovY;b.camera.distance=a.distance;b.offset=e;b.divisor=d-e;b.minPixelSize=c;return b};a.prototype.calculateCurvatureDependentParametersLocal=function(a,b){void 0===b&&(b=p);b.tiltAngle=this.description.curvatureDependent.min.tiltAngle;b.scaleFallOffFactor=
- this.description.curvatureDependent.min.scaleFallOffFactor;return b};a.prototype.calculateCurvatureDependentParametersGlobal=function(a,b){void 0===b&&(b=p);var c=this.description.curvatureDependent;a=1+a.distance/n;var d=[c.min.curvature,c.max.curvature],e=d[0];a=f.clamp((Math.sqrt(a*a-1)-e)/(d[1]-e),0,1);d=[c.min,c.max];c=d[0];d=d[1];b.tiltAngle=f.lerp(c.tiltAngle,d.tiltAngle,a);b.scaleFallOffFactor=f.lerp(c.scaleFallOffFactor,d.scaleFallOffFactor,a);return b};a.prototype.surfaceCoverageCompensationLocal=
- function(a,b){return(a.fovY-b.tiltAngle)/a.fovY};a.prototype.surfaceCoverageCompensationGlobal=function(a,b){var c=n*n;b=b.tiltAngle+.5*Math.PI;var d=a.fovY;a=a.distance;a=a*a+c-2*Math.cos(b)*a*n;var e=Math.sqrt(a);return(Math.acos(Math.sqrt(a-c)/e)-Math.asin(n/(e/Math.sin(b)))+.5*d)/d};return a}();h.defaultDescription={curvatureDependent:{min:{curvature:f.deg2rad(10),tiltAngle:f.deg2rad(12),scaleFallOffFactor:.5},max:{curvature:f.deg2rad(70),tiltAngle:f.deg2rad(40),scaleFallOffFactor:.8}},scaleStart:.3,
- scaleFallOffRange:.65,minPixelSize:0};var k={curvatureDependent:{min:{scaleFallOffFactor:.7},max:{scaleFallOffFactor:.95}},minPixelSize:14};h.copyParameters=function(a,b){b.camera.distance=a.camera.distance;b.camera.fovY=a.camera.fovY;b.divisor=a.divisor;b.offset=a.offset;b.minPixelSize=a.minPixelSize;return b};var l={scale:0,factor:0,minPixelSize:0,paddingPixels:0},p={tiltAngle:0,scaleFallOffFactor:0},n=6378137})},"esri/views/webgl/Util":function(){define(["require","exports","../../core/tsSupport/assignHelper",
- "../../core/Error"],function(r,h,f,a){return function(){function e(){}e.vertexCount=function(a,g){return a.vertexBuffers[g].size/e.getStride(a.layout[g])};e.getStride=function(a){return a[0].stride};e.getBytesPerElement=function(a){switch(a){case 5126:return 4;case 5124:return 4;case 5125:return 4;case 5122:return 2;case 5123:return 2;case 5120:return 1;case 5121:return 1;default:throw Error("Unknown data type");}};e.addDescriptor=function(a,g,d,b,k,f){var c=e.getBytesPerElement(b);if(0<a.length){var l=
- a[0].stride,t=l+c*d;a.forEach(function(a){return a.stride=t});a.push({name:g,count:d,type:b,offset:l,stride:t,normalized:k,divisor:f})}else a.push({name:g,count:d,type:b,offset:0,stride:c*d,normalized:k,divisor:f})};e.assertCompatibleVertexAttributeLocations=function(a,e){(a=a.locations===e.locations)||console.error("VertexAttributeLocations are incompatible");return a};e.hasAttribute=function(a,e){for(var c=0;c<a.length;c++)if(a[c].name===e)return!0;return!1};e.findAttribute=function(a,e){for(var c=
- 0;c<a.length;c++)if(a[c].name===e)return a[c];return null};e.copyFramebufferToTexture=function(a,e,d,b,k){void 0===k&&(k=0);var c=a.getBoundFramebufferObject(),g=a.getBoundTexture(0);a.bindFramebuffer(e);a.bindTexture(d,0);a.gl.copyTexImage2D(a.gl.TEXTURE_2D,k,d.descriptor.pixelFormat,b[0],b[1],b[2],b[3],0);a.gl.flush();a.bindFramebuffer(c);a.bindTexture(g,0)};e.assert=function(c,e){if(!c)throw new a(e);};e.setBaseInstanceOffset=function(a,e){var c={},b;for(b in a)c[b]=a[b].map(function(a){return a.divisor?
- f({},a,{baseInstance:e}):a});return c};return e}()})},"esri/views/webgl/BufferObject":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c,g,d){this._glName=this._context=null;this._bufferType=void 0;this._usage=35044;this._size=-1;this._indexType=void 0;this._context=a;this._bufferType=e;this._usage=c;this._id=f._nextId++;this._glName=this._context.gl.createBuffer();g&&this.setData(g,d)}f.createIndex=function(a,e,c,g){return new f(a,34963,e,c,g)};f.createVertex=
- function(a,e,c){return new f(a,34962,e,c)};Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"usage",{get:function(){return this._usage},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,
- "bufferType",{get:function(){return this._bufferType},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"indexType",{get:function(){return this._indexType},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"byteSize",{get:function(){return 34962===this._bufferType?this._size:5125===this._indexType?4*this._size:2*this._size},enumerable:!0,configurable:!0});f.prototype.dispose=function(){this._context&&(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=
- null),this._context=null)};f.prototype.setData=function(a,e){if(a){if("number"===typeof a){if(0>a&&console.error("Buffer size cannot be negative!"),34963===this._bufferType&&e)switch(this._indexType=e,this._size=a,e){case 5123:a*=2;break;case 5125:a*=4}}else e=a.byteLength,a instanceof Uint16Array&&(e/=2,this._indexType=5123),a instanceof Uint32Array&&(e/=4,this._indexType=5125),this._size=e;e=this._context.getBoundVAO();this._context.bindVAO(null);this._context.bindBuffer(this);this._context.gl.bufferData(this._bufferType,
- a,this._usage);this._context.bindVAO(e)}};f.prototype.setSubData=function(a,e,c,g){void 0===e&&(e=0);void 0===c&&(c=0);if(a){(0>e||e>=this._size)&&console.error("offset is out of range!");var d=e,b=c,k=g,f=a.byteLength;a instanceof Uint16Array&&(f/=2,d*=2,b*=2,k*=2);a instanceof Uint32Array&&(f/=4,d*=4,b*=4,k*=4);void 0===g&&(g=f-1);c>=g&&console.error("end must be bigger than start!");e+c-g>this._size&&console.error("An attempt to write beyond the end of the buffer!");e=this._context.getBoundVAO();
- this._context.bindVAO(null);this._context.bindBuffer(this);this._context.gl.bufferSubData(this._bufferType,d,(a instanceof ArrayBuffer?a:a.buffer).slice(b,k));this._context.bindVAO(e)}};f._nextId=0;return f}()})},"esri/views/webgl/VertexArrayObject":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c,g,d){this._locations=this._layout=this._glName=this._context=null;this._indexBuffer=this._buffers=void 0;this._initialized=!1;this._context=a;this._layout=c;this._buffers=
- g;this._locations=e;d&&(this._indexBuffer=d);this._id=f._nextId++}Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"vertexBuffers",{get:function(){return this._buffers},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"indexBuffer",{get:function(){return this._indexBuffer},enumerable:!0,
- configurable:!0});Object.defineProperty(f.prototype,"size",{get:function(){var a=this;return Object.keys(this._buffers).reduce(function(e,c){return e+a._buffers[c].size},this._indexBuffer?this._indexBuffer.size:0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"layout",{get:function(){return this._layout},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"locations",{get:function(){return this._locations},enumerable:!0,configurable:!0});f.prototype.dispose=function(a){void 0===
- a&&(a=!0);if(this._context){var e=this._context.capabilities.vao;e&&this._glName&&(e.deleteVertexArray(this._glName),this._glName=null);this._context.getBoundVAO()===this&&this._context.bindVAO(null);if(a){for(var c in this._buffers)this._buffers[c].dispose(),delete this._buffers[c];this._indexBuffer&&(this._indexBuffer.dispose(),this._indexBuffer=null)}this._context=null}};f.prototype.initialize=function(){if(!this._initialized){var a=this._context.capabilities.vao;if(a){var e=a.createVertexArray();
- a.bindVertexArray(e);this._bindLayout();a.bindVertexArray(null);this._glName=e}this._initialized=!0}};f.prototype.bind=function(){this.initialize();var a=this._context.capabilities.vao;a?a.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())};f.prototype._bindLayout=function(){var a=this._buffers,e=!!this._context.capabilities.vao,c=this._layout,g=this._indexBuffer;a||console.error("Vertex buffer dictionary is empty!");var d=this._context.gl,b,k,f=0,p;for(p in a)for((b=a[p])||
- console.error("Vertex buffer is uninitialized!"),(k=c[p])||console.error("Vertex element descriptor is empty!"),this._context.bindBuffer(b),f=0;f<k.length;++f){b=k[f];var n=this._locations[b.name],t=b.baseInstance?b.baseInstance*b.stride:0;void 0===n&&console.error("There is no location for vertex attribute '"+b.name+"' defined.");b.baseInstance&&!b.divisor&&console.error("Vertex attribute '"+b.name+"' uses baseInstanceOffset without divisor.");if(4>=b.count){if(d.enableVertexAttribArray(n),d.vertexAttribPointer(n,
- b.count,b.type,b.normalized,b.stride,b.offset+t),b.divisor&&0<b.divisor){var u=this._context.capabilities.instancing;u&&u.vertexAttribDivisor(n,b.divisor)}}else if(16===b.count&&5126===b.type)for(var q=0;4>q;q++)d.enableVertexAttribArray(n+q),d.vertexAttribPointer(n+q,4,b.type,b.normalized,b.stride,b.offset+16*q+t),b.divisor&&0<b.divisor&&(u=this._context.capabilities.instancing)&&u.vertexAttribDivisor(n+q,b.divisor);else console.error("Unsupported vertex attribute element count: "+b.count)}g&&(e?
- d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,g.glName):this._context.bindBuffer(g))};f.prototype.unbind=function(){this.initialize();var a=this._context.capabilities.vao;a?a.bindVertexArray(null):this._unbindLayout()};f.prototype._unbindLayout=function(){var a=this._buffers,e=this._layout,c=this._locations,g=this._context;a||console.error("Vertex buffer dictionary is empty!");var d=g.gl,b,k,f,p=0,n=0,t;for(t in a){(b=a[t])||console.error("Vertex buffer is uninitialized!");k=e[t];p=0;for(n=k.length;p<n;++p)f=
- k[p],d.disableVertexAttribArray(c[f.name]);g.unbindBuffer(b.bufferType)}(a=this._indexBuffer)&&g.unbindBuffer(a.bufferType)};f._nextId=0;return f}()})},"esri/views/3d/webgl-engine/lib/GeometryUtil":function(){define(["./GeometryData","./BufferVectorMath","./Util","./gl-matrix"],function(r,h,f,a){function e(a,b,d,e,g){if(Math.abs(c.dot(b,a))>g)return!1;c.cross(a,b,d);c.normalize(d);c.cross(d,a,e);c.normalize(e);return!0}var c=a.vec3,g=a.vec4,d=a.vec3d,b=f.VertexAttrConstants,k=h.Vec3Compact,l=d.create(),
- p=d.create(),n={createSphereGeometry:function(a,d,e,g,k,l,p){a=a||50;g=void 0!==g?g:-Math.PI;k=void 0!==k?k:2*Math.PI;l=void 0!==l?l:.5*-Math.PI;p=void 0!==p?p:Math.PI;var q=Math.max(3,Math.floor(d)||8),m=Math.max(2,Math.floor(e)||6),t=(q+1)*(m+1);e=new Float32Array(3*t);d=new Float32Array(3*t);var t=new Float32Array(2*t),n,u,v=[],x=c.create(),h=0;for(u=0;u<=m;u++){var B=[],M=u/m,H=l+M*p,J=Math.cos(H);for(n=0;n<=q;n++){var O=n/q,N=g+O*k,S=Math.cos(N)*J*a,R=Math.sin(H)*a,N=-Math.sin(N)*J*a;e[3*h]=
- S;e[3*h+1]=R;e[3*h+2]=N;c.set3(S,R,N,x);c.normalize(x);d[3*h]=x[0];d[3*h+1]=x[1];d[3*h+2]=x[2];t[2*h]=O;t[2*h+1]=M;B.push(h);++h}v.push(B)}a=new Uint32Array(2*q*(m-1)*3);for(u=h=0;u<m;u++)for(n=0;n<q;n++)g=v[u][n],k=v[u][n+1],l=v[u+1][n+1],p=v[u+1][n],0===u?(a[h++]=g,a[h++]=l,a[h++]=p):u===m-1?(a[h++]=g,a[h++]=k,a[h++]=l):(a[h++]=g,a[h++]=k,a[h++]=l,a[h++]=l,a[h++]=p,a[h++]=g);f.assert(h===a.length);q={};q[b.POSITION]=a;q[b.NORMAL]=a;q[b.UV0]=a;m={};m[b.POSITION]={size:3,data:e};m[b.NORMAL]={size:3,
- data:d};m[b.UV0]={size:2,data:t};return new r(m,q)},createPolySphereGeometry:function(a,c,d){function e(b,c){b>c&&(b=c+(c=b,0));var d=b.toString()+"."+c.toString();if(l[d])return l[d];var e=f.length;f.length+=3;k.add(f,3*b,f,3*c,f,e);k.scale(f,e,a/k.length(f,e));e/=3;return l[d]=e}var g,f;d?(f=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],d=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1]):(d=a*(1+Math.sqrt(5))/2,f=[-a,d,0,a,d,0,-a,-d,0,a,-d,0,0,-a,d,0,a,d,0,-a,-d,0,a,-d,d,0,-a,d,0,a,-d,0,-a,-d,0,a],
- d=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]);for(g=0;g<f.length;g+=3)k.scale(f,g,a/k.length(f,g));var l={};for(g=0;g<c;g++){for(var q=d.length,p=new Uint32Array(4*q),t=0;t<q;t+=3){var n=d[t],u=d[t+1],h=d[t+2],I=e(n,u),P=e(u,h),G=e(h,n),M=4*t;p[M]=n;p[M+1]=I;p[M+2]=G;p[M+3]=u;p[M+4]=P;p[M+5]=I;p[M+6]=h;p[M+7]=G;p[M+8]=P;p[M+9]=I;p[M+10]=P;p[M+11]=G}d=p;l={}}c=new Float32Array(f);for(g=0;g<c;g+=3)k.normalize(c,
- g);f=new Float32Array(f);g={};g[b.POSITION]=d;g[b.NORMAL]=d;d={};d[b.POSITION]={size:3,data:f};d[b.NORMAL]={size:3,data:c};return new r(d,g)},createPointGeometry:function(a,c,d,e,g,k,f){var l=new Float32Array(3);l[0]=c?c[0]:0;l[1]=c?c[1]:0;l[2]=c?c[2]:0;c=new Float32Array(3);c[0]=a?a[0]:0;c[1]=a?a[1]:0;c[2]=a?a[2]:1;if(null==k)a=new Float32Array(2),a[0]=0,a[1]=0;else{a=new Float32Array(k.length);for(var q=0;q<k.length;q++)a[q]=k[q]}k=new Uint8Array(4);k[0]=d?255*d[0]:255;k[1]=d?255*d[1]:255;k[2]=
- d?255*d[2]:255;k[3]=d&&3<d.length?255*d[3]:255;d=new Float32Array(2);d[0]=null!=e&&2==e.length?e[0]:1;d[1]=null!=e&&2==e.length?e[1]:1;if(null!=g){var p=new Float32Array(4);p[0]=g[0];p[1]=g[1];p[2]=g[2];p[3]=g[3]}if(null!=f){var t=new Float32Array(4);t[0]=f[0];t[1]=f[1];t[2]=f[2];t[3]=f[3]}q=new Uint32Array(1);q[0]=0;e={};e[b.POSITION]=q;e[b.NORMAL]=q;e[b.UV0]=q;e[b.COLOR]=q;e[b.SIZE]=q;null!=g&&(e[b.AUXPOS1]=q);null!=f&&(e[b.AUXPOS2]=q);q={};q[b.POSITION]={size:3,data:l};q[b.NORMAL]={size:3,data:c};
- q[b.UV0]={size:a.length,data:a};q[b.COLOR]={size:4,data:k};q[b.SIZE]={size:2,data:d};null!=g&&(q[b.AUXPOS1]={size:4,data:p});null!=f&&(q[b.AUXPOS2]={size:4,data:t});return new r(q,e,r.DefaultOffsets,"point")},createPointArrayGeometry:function(a,c){for(var d=new Float32Array(3*a.length),e=new Float32Array(c?3*a.length:3),g=new Uint32Array(a.length),k=new Uint32Array(a.length),f=0;f<a.length;f++)d[3*f]=a[f][0],d[3*f+1]=a[f][1],d[3*f+2]=a[f][2],c&&(e[3*f]=c[f][0],e[3*f+1]=c[f][1],e[3*f+2]=c[f][2]),g[f]=
- f,k[f]=0;c||(e[0]=0,e[1]=1,e[2]=0);a=new Float32Array(2);a[0]=0;a[1]=0;f={};f[b.POSITION]=g;f[b.NORMAL]=c?g:k;f[b.UV0]=k;c={};c[b.POSITION]={size:3,data:d};c[b.NORMAL]={size:3,data:e};c[b.UV0]={size:2,data:a};return new r(c,f,r.DefaultOffsets,"point")},createTriangleGeometry:function(){var a=new Float32Array(9);a[0]=0;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=100;a[6]=100;a[7]=0;a[8]=0;var c=new Uint32Array(3);c[0]=0;c[1]=1;c[2]=2;var d=new Float32Array(3);d[0]=0;d[1]=1;d[2]=0;var e=new Uint32Array(3);e[0]=
- 0;e[1]=0;e[2]=0;var g=new Float32Array(2);g[0]=0;g[1]=0;var k=new Uint32Array(3);k[0]=0;k[1]=0;k[2]=0;var f={};f[b.POSITION]=c;f[b.NORMAL]=e;f[b.UV0]=k;c={};c[b.POSITION]={size:3,data:a};c[b.NORMAL]={size:3,data:d};c[b.UV0]={size:2,data:g};return new r(c,f)},createSquareGeometry:function(a){var c,d,e=new Float32Array(12);if(a)for(c=0;4>c;c++)for(d=0;3>d;d++)e[3*c+d]=a[c][d];else e[0]=-1,e[1]=-1,e[2]=0,e[3]=1,e[4]=-1,e[5]=0,e[6]=1,e[7]=1,e[8]=0,e[9]=-1,e[10]=1,e[11]=0;d=new Uint32Array(6);d[0]=0;d[1]=
- 1;d[2]=2;d[3]=2;d[4]=3;d[5]=0;a=new Float32Array(3);a[0]=0;a[1]=0;a[2]=1;var g=new Uint32Array(6);for(c=0;6>c;c++)g[c]=0;c=new Float32Array(8);c[0]=0;c[1]=0;c[2]=1;c[3]=0;c[4]=1;c[5]=1;c[6]=0;c[7]=1;var k=new Uint8Array(4);k[0]=255;k[1]=255;k[2]=255;k[3]=255;var f={};f[b.POSITION]=d;f[b.NORMAL]=g;f[b.UV0]=d;f[b.COLOR]=g;d={};d[b.POSITION]={size:3,data:e};d[b.NORMAL]={size:3,data:a};d[b.UV0]={size:2,data:c};d[b.COLOR]={size:4,data:k};return new r(d,f)},createBoxGeometry:function(){var a,c,d=[[-.5,
- -.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],e=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],g=[0,0,1,0,1,1,0,1],k=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],f=Array(36);for(a=0;6>a;a++)for(c=0;6>c;c++)f[6*a+c]=a;var l=Array(36);for(a=0;6>a;a++)l[6*a+0]=0,l[6*a+1]=1,l[6*a+2]=2,l[6*a+3]=2,l[6*a+4]=3,l[6*a+5]=0;return function(a){var c;Array.isArray(a)||(a=[a,a,a]);var q=new Float32Array(24);for(c=0;8>c;c++)q[3*c]=d[c][0]*
- a[0],q[3*c+1]=d[c][1]*a[1],q[3*c+2]=d[c][2]*a[2];a={};a[b.POSITION]=new Uint32Array(k);a[b.NORMAL]=new Uint32Array(f);a[b.UV0]=new Uint32Array(l);c={};c[b.POSITION]={size:3,data:q};c[b.NORMAL]={size:3,data:new Float32Array(e)};c[b.UV0]={size:2,data:new Float32Array(g)};return new r(c,a)}}(),createDiamondGeometry:function(){var a=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],c=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],d=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,
- 4,3,0],e=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];return function(g){var k;Array.isArray(g)||(g=[g,g,g]);var f=new Float32Array(18);for(k=0;6>k;k++)f[3*k]=a[k][0]*g[0],f[3*k+1]=a[k][1]*g[1],f[3*k+2]=a[k][2]*g[2];g={};g[b.POSITION]=new Uint32Array(d);g[b.NORMAL]=new Uint32Array(e);k={};k[b.POSITION]={size:3,data:f};k[b.NORMAL]={size:3,data:new Float32Array(c)};return new r(k,g)}}(),createTetrahedronGeometry:function(){var a=c.createFrom(-.5,0,-.5),d=c.createFrom(.5,0,-.5),e=c.createFrom(0,
- 0,.5),g=c.createFrom(0,.5,0),k=c.create(),f=c.create(),l=c.create(),p=c.create(),n=c.create();c.subtract(a,g,k);c.subtract(a,d,f);c.cross(k,f,l);c.normalize(l,l);c.subtract(d,g,k);c.subtract(d,e,f);c.cross(k,f,p);c.normalize(p,p);c.subtract(e,g,k);c.subtract(e,a,f);c.cross(k,f,n);c.normalize(n,n);var h=[a,d,e,g],D=[0,-1,0,l[0],l[1],l[2],p[0],p[1],p[2],n[0],n[1],n[2]],E=[0,1,2,3,1,0,3,2,1,3,0,2],F=[0,0,0,1,1,1,2,2,2,3,3,3];return function(a){var c;Array.isArray(a)||(a=[a,a,a]);var d=new Float32Array(12);
- for(c=0;4>c;c++)d[3*c]=h[c][0]*a[0],d[3*c+1]=h[c][1]*a[1],d[3*c+2]=h[c][2]*a[2];a={};a[b.POSITION]=new Uint32Array(E);a[b.NORMAL]=new Uint32Array(F);c={};c[b.POSITION]={size:3,data:d};c[b.NORMAL]={size:3,data:new Float32Array(D)};return new r(c,a)}}(),createConeGeometry:function(a,d,e,g){var k=0,f=c.createFrom(0,k,0),l=c.createFrom(0,k+a,0),q=c.createFrom(0,-1,0),p=c.createFrom(0,1,0);g&&(k=a,l=c.createFrom(0,0,0),f=c.createFrom(0,k,0),q=c.createFrom(0,1,0),p=c.createFrom(0,-1,0));var f=[l,f],q=[q,
- p],p=e+2,n=0,l=Math.sqrt(a*a+d*d);if(g)for(g=e-1;0<=g;g--)n=2*Math.PI/e*g,t=c.createFrom(Math.cos(n)*d,k,Math.sin(n)*d),f.push(t),n=c.createFrom(a*Math.cos(n)/l,-d/l,a*Math.sin(n)/l),q.push(n);else for(g=0;g<e;g++){var n=2*Math.PI/e*g,t=c.createFrom(Math.cos(n)*d,k,Math.sin(n)*d);f.push(t);n=c.createFrom(a*Math.cos(n)/l,d/l,a*Math.sin(n)/l);q.push(n)}a=new Uint32Array(6*(e+2));e=new Uint32Array(6*(e+2));k=d=0;for(g=3;g<f.length;g++)a[d++]=1,a[d++]=g-1,a[d++]=g,e[k++]=0,e[k++]=0,e[k++]=0;a[d++]=f.length-
- 1;a[d++]=2;a[d++]=1;e[k++]=0;e[k++]=0;e[k++]=0;for(g=3;g<f.length;g++)a[d++]=g,a[d++]=g-1,a[d++]=0,e[k++]=g,e[k++]=g-1,e[k++]=1;a[d++]=0;a[d++]=2;a[d++]=f.length-1;e[k++]=1;e[k++]=2;e[k++]=q.length-1;k=1;Array.isArray(k)||(k=[k,k,k]);d=new Float32Array(3*p);for(g=0;g<p;g++)d[3*g]=f[g][0]*k[0],d[3*g+1]=f[g][1]*k[1],d[3*g+2]=f[g][2]*k[2];f=new Float32Array(3*p);for(g=0;g<p;g++)f[3*g]=q[g][0],f[3*g+1]=q[g][1],f[3*g+2]=q[g][2];q={};q[b.POSITION]=a;q[b.NORMAL]=e;p={};p[b.POSITION]={size:3,data:d};p[b.NORMAL]=
- {size:3,data:f};return new r(p,q)},createCylinderGeometry:function(a,d,e,g,k,f){g||(g=c.createFrom(1,0,0));k||(k=c.createFrom(0,0,0));f=void 0===f?!0:f;var l=c.create();c.normalize(g,l);g=c.create();c.scale(l,Math.abs(a),g);var q=c.create();c.scale(g,-.5,q);c.add(q,k);var p=c.createFrom(0,1,0);Math.abs(.2>1-c.dot(l,p))&&c.set3(0,0,1,p);var n=c.create();c.cross(l,p,n);c.normalize(n);c.cross(n,l,p);var m=2*e+(f?2:0),t=e+(f?2:0);k=new Float32Array(3*m);a=new Float32Array(3*t);var u=new Float32Array(2*
- m),v=new Uint32Array(3*e*(f?4:2)),h=new Uint32Array(3*e*(f?4:2));f&&(k[3*(m-2)+0]=q[0],k[3*(m-2)+1]=q[1],k[3*(m-2)+2]=q[2],u[2*(m-2)]=0,u[2*(m-2)+1]=0,k[3*(m-1)+0]=k[3*(m-2)+0]+g[0],k[3*(m-1)+1]=k[3*(m-2)+1]+g[1],k[3*(m-1)+2]=k[3*(m-2)+2]+g[2],u[2*(m-1)]=1,u[2*(m-1)+1]=1,a[3*(t-2)+0]=-l[0],a[3*(t-2)+1]=-l[1],a[3*(t-2)+2]=-l[2],a[3*(t-1)+0]=l[0],a[3*(t-1)+1]=l[1],a[3*(t-1)+2]=l[2]);var l=function(a,b,c){v[a]=b;h[a]=c},x,M,H=0,J=c.create(),O=c.create();for(x=0;x<e;x++)M=2*Math.PI/e*x,c.scale(p,Math.sin(M),
- J),c.scale(n,Math.cos(M),O),c.add(J,O),a[3*x+0]=J[0],a[3*x+1]=J[1],a[3*x+2]=J[2],c.scale(J,d),c.add(J,q),k[3*x+0]=J[0],k[3*x+1]=J[1],k[3*x+2]=J[2],u[2*x+0]=x/e,u[2*x+1]=0,k[3*(x+e)+0]=k[3*x+0]+g[0],k[3*(x+e)+1]=k[3*x+1]+g[1],k[3*(x+e)+2]=k[3*x+2]+g[2],u[2*(x+e)+0]=x/e,u[2*x+1]=1,M=(x+1)%e,l(H++,x,x),l(H++,x+e,x),l(H++,M,M),l(H++,M,M),l(H++,x+e,x),l(H++,M+e,M);if(f){for(x=0;x<e;x++)M=(x+1)%e,l(H++,m-2,t-2),l(H++,x,t-2),l(H++,M,t-2);for(x=0;x<e;x++)M=(x+1)%e,l(H++,x+e,t-1),l(H++,m-1,t-1),l(H++,M+e,
- t-1)}d={};d[b.POSITION]=v;d[b.NORMAL]=h;d[b.UV0]=v;e={};e[b.POSITION]={size:3,data:k};e[b.NORMAL]={size:3,data:a};e[b.UV0]={size:2,data:u};return new r(e,d)},createTubeGeometry:function(a,b,c,d,e){c=c||10;d=null!=d?d:!0;f.assert(1<a.length);for(var g=[],k=[],l=0;l<c;l++){g.push([0,-l-1,-((l+1)%c)-1]);var q=l/c*2*Math.PI;k.push([Math.cos(q)*b,Math.sin(q)*b])}return n.createPathExtrusionGeometry(k,a,[[0,0,0]],g,d,e)},createPathExtrusionGeometry:function(a,k,l,p,n,m){var q,t=a.length,u=new Float32Array(k.length*
- t*3+(6*l.length||0)),v=new Float32Array(k.length*t+(2*l.length||0)),x=new Float32Array(k.length*t*3+(l?6:0)),h=0,F=0,I=0,P=(k.length-1)*t*6+6*p.length,G=new Uint32Array(P),P=new Uint32Array(P),M=0,H=0,J=c.create(),O=c.create(),N=c.create(),S=c.create();c.create();var R=c.create();c.create();c.create();var Y=c.create(),X=c.create(),Q=c.create(),K=c.create(),L=c.create();c.create();c.create();var V=c.create(),U=c.create(),ca=c.create(),ga=g.create();c.set3(0,1,0,K);c.subtract(k[1],k[0],O);c.normalize(O);
- n?(c.add(k[0],m,Q),c.normalize(Q,N)):c.set3(0,0,1,N);e(O,N,R,N,.99619469809)||e(O,K,R,N,.99619469809)||e(O,K,R,N,.99619469809);c.set(N,S);c.set(R,U);for(q=0;q<l.length;q++)c.scale(R,l[q][0],Y),c.scale(N,l[q][2],Q),c.add(Y,Q),c.add(Y,k[0]),u[h++]=Y[0],u[h++]=Y[1],u[h++]=Y[2],v[I++]=0;x[F++]=-O[0];x[F++]=-O[1];x[F++]=-O[2];for(q=0;q<p.length;q++)G[M++]=0<p[q][0]?p[q][0]:-p[q][0]-1+l.length,G[M++]=0<p[q][1]?p[q][1]:-p[q][1]-1+l.length,G[M++]=0<p[q][2]?p[q][2]:-p[q][2]-1+l.length,P[H++]=0,P[H++]=0,P[H++]=
- 0;var da=l.length;q=l.length-1;for(var ka,Z=0;Z<k.length;Z++){ka=!1;if(0<Z){c.set(O,J);Z<k.length-1?(c.subtract(k[Z+1],k[Z],O),c.normalize(O)):ka=!0;c.add(J,O,L);c.normalize(L);c.add(k[Z-1],S,V);ga[0]=L[0];ga[1]=L[1];ga[2]=L[2];ga[3]=-d.dot(L,k[Z]);if(f.rayPlane(V,J,ga,Q))c.subtract(Q,k[Z]),c.normalize(Q,N),c.cross(L,N,R),c.normalize(R);else{var ea=L,ja=U,aa=K,fa=R,qa=N;e(ea,S,fa,qa,.99619469809)||e(ea,ja,fa,qa,.99619469809)||e(ea,aa,fa,qa,.99619469809)}c.set(N,S);c.set(R,U)}n&&(c.add(k[Z],m,Q),c.normalize(Q,
- ca));for(ea=0;ea<t;ea++)if(c.scale(R,a[ea][0],Y),c.scale(N,a[ea][1],Q),c.add(Y,Q),c.normalize(Y,X),x[F++]=X[0],x[F++]=X[1],x[F++]=X[2],n?v[I++]=c.dot(Y,ca):v[I++]=Y[2],c.add(Y,k[Z]),u[h++]=Y[0],u[h++]=Y[1],u[h++]=Y[2],!ka)for(ja=(ea+1)%t,G[M++]=da+ea,G[M++]=da+t+ea,G[M++]=da+ja,G[M++]=da+ja,G[M++]=da+t+ea,G[M++]=da+t+ja,ja=0;6>ja;ja++)P[H++]=G[M-6+ja]-q;da+=t}ka=k[k.length-1];for(q=0;q<l.length;q++)c.scale(R,l[q][0],Y),c.scale(N,l[q][1],Q),c.add(Y,Q),c.add(Y,ka),u[h++]=Y[0],u[h++]=Y[1],u[h++]=Y[2],
- v[I++]=0;a=F/3;x[F++]=O[0];x[F++]=O[1];x[F++]=O[2];t=da-t;for(q=0;q<p.length;q++)G[M++]=0<=p[q][0]?da+p[q][0]:-p[q][0]-1+t,G[M++]=0<=p[q][2]?da+p[q][2]:-p[q][2]-1+t,G[M++]=0<=p[q][1]?da+p[q][1]:-p[q][1]-1+t,P[H++]=a,P[H++]=a,P[H++]=a;p={};p[b.POSITION]=G;p[b.NORMAL]=P;G={};G[b.POSITION]={size:3,data:u};G.zOffset={size:1,data:v};G[b.NORMAL]={size:3,data:x};return new r(G,p)},createPolylineGeometry:function(a,c){f.assert(1<a.length,"createPolylineGeometry(): polyline needs at least 2 points");f.assert(3===
- a[0].length,"createPolylineGeometry(): malformed vertex");f.assert(void 0===c||c.length===a.length,"createPolylineGeometry: need same number of points and normals");f.assert(void 0===c||3===c[0].length,"createPolylineGeometry(): malformed normal");for(var d=new Float32Array(3*a.length),e=new Uint32Array(2*(a.length-1)),g=0,k=0,l=0;l<a.length;l++){for(var p=0;3>p;p++)d[g++]=a[l][p];0<l&&(e[k++]=l-1,e[k++]=l)}g={};k={};g[b.POSITION]=e;k[b.POSITION]={size:3,data:d};if(c){for(var d=new Float32Array(3*
- c.length),n=0,l=0;l<a.length;l++)for(p=0;3>p;p++)d[n++]=c[l][p];g[b.NORMAL]=e;k[b.NORMAL]={size:3,data:d}}return new r(k,g,r.DefaultOffsets,"line")},addVertexColors:function(a,c){var d,e=c||[1,1,1,1];c=new Uint8Array(4);c[0]=255*e[0];c[1]=255*e[1];c[2]=255*e[2];c[3]=255*(3<e.length?e[3]:1);var e={},g=a.getVertexAttr();for(d in g)e[d]=g[d];e[b.COLOR]={size:4,data:c};c={};for(d in a.indices)c[d]=a.indices[d];c[b.COLOR]=new Uint32Array(c[b.POSITION].length);return a=new r(e,c,a.componentOffsets,a.primitiveType)},
- addNormals:function(a){var b=a.getVertexAttr();a=a.indices;for(var c=h.Vec3Compact.subtract,e=new Float32Array(a.position.length/3*3),g=b.position.data,k=0,f=a.position,n=new Uint32Array(f.length),t=0;t<f.length;t+=3){c(g,3*f[t],g,3*f[t+2],p,0);c(g,3*f[t],g,3*f[t+1],l,0);d.cross(l,p);d.normalize(l);var A=k/3;e[k++]=l[0];e[k++]=l[1];e[k++]=l[2];n[t]=A;n[t+1]=A;n[t+2]=A}b.normal={size:3,data:e};a.normal=n},cgToGIS:function(a){var b=a.getVertexAttr();a=b.position.data;var b=b.normal.data,c,d;if(b)for(c=
- 0;c<b.length;c+=3)d=b[c+1],b[c+1]=-b[c+2],b[c+2]=d;if(a)for(c=0;c<a.length;c+=3)d=a[c+1],a[c+1]=-a[c+2],a[c+2]=d}};return n})},"esri/views/3d/webgl-engine/lib/GeometryData":function(){define(["require","exports","./ComponentUtils","./geometryDataUtils","./Util"],function(r,h,f,a,e){return function(){function c(g,d,b,k){void 0===d&&(d=c.DefaultIndices);void 0===b&&(b=c.DefaultOffsets);void 0===k&&(k="triangle");this.preinterleaved=!1;var l={},p;for(p in g){var n=g[p],t=n.size;l[p]={data:n.data,size:t,
- offsetIdx:0,strideIdx:t}}if(d===c.DefaultIndices){d=e.getFirstObjectValue(l);g=a.generateDefaultIndexArray(d.data.length/d.size);d={};for(var u in l)d[u]=g}this._id=a.getNewId();this._vertexAttributes=l;this._indices=d;this._componentOffsets=f.createOffsets(b);this._primitiveType=k}Object.defineProperty(c.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"vertexAttributes",{get:function(){return this._vertexAttributes},enumerable:!0,
- configurable:!0});Object.defineProperty(c.prototype,"indices",{get:function(){return this._indices},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"componentOffsets",{get:function(){return this._componentOffsets},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"indexCount",{get:function(){return e.getFirstObjectValue(this._indices).length},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"primitiveType",{get:function(){return this._primitiveType},
- enumerable:!0,configurable:!0});c.prototype.getVertexAttr=function(){return this.vertexAttributes};c.prototype.toRenderData=function(){return{id:this._id.toString(),preinterleaved:!1,indices:this._indices,vertexAttr:this._vertexAttributes}};c.prototype.getIndices=function(a){return this._indices[a]};c.prototype.getAttribute=function(a){return this._vertexAttributes[a]};c.prototype.estimateGpuMemoryUsage=function(){var a=0;this._indices.position&&(a+=12*this._indices.position.length);this._indices.normal&&
- (a+=12*this._indices.normal.length);this._indices.uv0&&(a+=8*this._indices.uv0.length);this._indices.color&&(a+=4*this._indices.color.length);return a};c.DefaultIndices={};c.DefaultOffsets=new Uint32Array(0);return c}()})},"esri/views/3d/webgl-engine/lib/geometryDataUtils":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});var f=1,a=null;h.generateDefaultIndexArray=function(c){if(c>f||null==a){for(;c>f;)f*=2;a=new Uint32Array(f);for(var e=0;e<f;e++)a[e]=
- e}return new Uint32Array(a.buffer,0,c)};var e=0;h.getNewId=function(){return e++}})},"esri/views/3d/webgl-engine/lib/Texture":function(){define("require exports ../../../../core/Logger ../../../3d/support/imageUtils ./DDSUtil ./DefaultVertexBufferLayouts ./gl-matrix ./glUtil3D ./IdGen ./Util ../../../webgl/FramebufferObject ../../../webgl/Texture ../../../webgl/Util".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p,n){function t(b,c,d,e,g,f,l){l=!1!==l;a.requestImage(c).then(function(a){k.assert(1<=a.width&&
- 1<=a.height);d.samplingMode=l?9987:9729;d.hasMipmap=l;!l&&33071===d.wrapMode||k.isPowerOfTwo(a.width)&&k.isPowerOfTwo(a.height)?(d.width=a.width,d.height=a.height,a=new p(b,d,a)):a=u(b,a,d,e,g);b.bindTexture(a);f(a)}).catch(function(a){var b=200<c.length?c.slice(0,100)+"..."+c.slice(c.length-100):c;q.error("Failed to load image from uri",b,a);f(null)})}function u(a,b,e,g,f){var q=k.nextHighestPowerOfTwo(b.width),m=k.nextHighestPowerOfTwo(b.height);k.assert(q!==b.width||m!==b.height);e.width=q;e.height=
- m;var t=new p(a,e),u=l.createWithAttachments(a,t,{colorTarget:0,depthStencilTarget:0});b=new p(a,{target:3553,pixelFormat:6408,dataType:5121,wrapMode:33071,samplingMode:9728,flipped:!!e.flipped,maxAnisotropy:8,preMultiplyAlpha:e.preMultiplyAlpha},b);a.bindFramebuffer(u);void 0===f&&(f=a.getViewport(),f=[f.x,f.y,f.width,f.height]);a.setViewport(0,0,q,m);g=g.get("texOnly");q=v.identity();a.bindProgram(g);g.setUniformMatrix4fv("model",q);g.setUniformMatrix4fv("view",q);g.setUniformMatrix4fv("proj",q);
- g.setUniform4f("color",1,1,1,1);g.setUniform1i("tex",0);g=d.createQuadVAO(a,c.Pos3Tex);a.bindTexture(b,0);a.bindVAO(g);a.setDepthTestEnabled(!1);a.setBlendingEnabled(!1);a.drawArrays(5,0,n.vertexCount(g,"geometry"));a.setDepthTestEnabled(!0);a.bindFramebuffer(null);a.setViewport(f[0],f[1],f[2],f[3]);g.dispose(!0);b.dispose();a.bindFramebuffer(null);u.detachColorTexture();u.dispose();e.hasMipmap&&t.generateMipmap();return t}var q=f.getLogger("esri.views.3d.webgl-engine.lib.Texture"),v=g.mat4d;return function(){function a(b,
- c,d){this.data=b;this.id=a.idGen.gen(c);this.unloadFunc=void 0;this.params=d||{};this.params.wrapClamp=this.params.wrapClamp||!1;this.params.mipmap=!1!==this.params.mipmap;this.params.noUnpackFlip=this.params.noUnpackFlip||!1;this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1;this.estimatedTexMemRequiredMB=a.estimateTexMemRequiredMB(this.data,this.params)}a.estimateTexMemRequiredMB=function(a,b){return null==a?0:a instanceof ArrayBuffer||a instanceof Uint8Array?a.byteLength/1E6:a instanceof
- Image||a instanceof ImageData||a instanceof HTMLCanvasElement?(b.mipmap?4/3:1)*a.width*a.height*4/1E6:(b.mipmap?4/3:1)*b.width*b.height*4/1E6||0};a.prototype.getEstimatedTexMemRequiredMB=function(){return this.estimatedTexMemRequiredMB};a.prototype.dispose=function(){this.data=void 0};a.prototype.deferredLoading=function(){return"string"===typeof this.data};a.prototype.getWidth=function(){return this.params.width};a.prototype.getHeight=function(){return this.params.height};a.prototype.initializeThroughUpload=
- function(b,c,d,g,f){var l=this.data;c.flipped=!this.params.noUnpackFlip;c.samplingMode=this.params.mipmap?9987:9729;c.hasMipmap=this.params.mipmap;c.wrapMode=this.params.wrapClamp?33071:10497;c.preMultiplyAlpha=this.params.preMultiplyAlpha;if("string"===typeof l)t(b,l,c,d,g,f,this.params.mipmap);else{if(l instanceof Image||l instanceof ImageData||l instanceof HTMLCanvasElement)this.params.width=l.width,this.params.height=l.height,!this.params.mipmap&&this.params.wrapClamp||k.isPowerOfTwo(l.width)&&
- k.isPowerOfTwo(l.height)?(c.width=l.width,c.height=l.height,c=new p(b,c,l)):c=u(b,l,c,d,g);else if(l instanceof ArrayBuffer&&this.params.encoding===a.DDS_ENCODING)c=e.createDDSTexture(b,c,l,this.params.mipmap);else if(l instanceof Uint8Array&&this.params.encoding===a.DDS_ENCODING)c=e.createDDSTexture(b,c,l.buffer,this.params.mipmap);else if(l instanceof Uint8Array)k.assert(0<this.params.width&&0<this.params.height),c.pixelFormat=1===this.params.components?6409:6408,c.width=this.params.width,c.height=
- this.params.height,c=new p(b,c,l);else{if(null!==l)throw console.warn("Unsupported image data"),Error("Unsupported image data");c=new p(b,c,null)}b.bindTexture(c);f(c)}this.data=void 0};a.prototype.setUnloadFunc=function(a){this.unloadFunc=a};a.prototype.unload=function(){void 0!==this.unloadFunc&&(this.unloadFunc(this.id),this.unloadFunc=void 0)};a.createEmpty=function(b){void 0===b&&(b="emptyTexture");return new a(new Uint8Array([0,0,0,0]),b,{width:1,height:1,wrapClamp:!0})};a.idGen=new b;a.DDS_ENCODING=
- "image/vnd-ms.dds";return a}()})},"esri/views/3d/support/imageUtils":function(){define(["require","exports","../../../request"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.dataURItoBlob=function(a){var e=atob(a.split(",")[1]);a=a.split(",")[0].split(":")[1].split(";")[0];for(var c=new ArrayBuffer(e.length),g=new Uint8Array(c),d=0;d<e.length;d++)g[d]=e.charCodeAt(d);return new Blob([c],{type:a})};h.requestImage=function(a){return f(a,{responseType:"image",allowImageDataAccess:!0}).then(function(a){return a.data})}})},
- "esri/views/3d/webgl-engine/lib/DDSUtil":function(){define(["require","exports","../../../webgl/Texture"],function(r,h,f){function a(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}Object.defineProperty(h,"__esModule",{value:!0});var e=a("DXT1"),c=a("DXT3"),g=a("DXT5");h.createDDSTexture=function(a,b,k,l){var d=new Int32Array(k,0,31);if(542327876!==d[0])return console.error("Invalid magic number in DDS header"),null;if(!(d[20]&4))return console.error("Unsupported format, must contain a FourCC code"),
- null;var n=d[21],t;switch(n){case e:n=8;t=33776;break;case c:n=16;t=33778;break;case g:n=16;t=33779;break;default:return console.error("Unsupported FourCC code:",String.fromCharCode(n&255,n>>8&255,n>>16&255,n>>24&255)),null}var u=1;d[2]&131072&&!1!==l&&(u=Math.max(1,d[7]));l=d[4];var q=d[3],v=d[1]+4,h,m;b.samplingMode=1<u?9987:9729;b.hasMipmap=1<u;b.width=d[4];b.height=d[3];b=new f(a,b);a.bindTexture(b);for(d=0;;++d){d<u&&(m=Math.floor((l+3)/4)*Math.floor((q+3)/4)*n,h=new Uint8Array(k,v,m));a.gl.compressedTexImage2D(a.gl.TEXTURE_2D,
- d,t,l,q,0,h);v+=m;if(1===l&&1===q||1===u)break;l=Math.max(1,l>>1);q=Math.max(1,q>>1)}return b}})},"esri/views/webgl/Texture":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c){this._glName=this._context=null;this._id=-1;this._desc=void 0;this._wrapModeDirty=this._samplingModeDirty=!1;this._boundToUnits=new Set;this._context=a;this._desc={pixelFormat:e.pixelFormat,internalFormat:e.internalFormat,dataType:e.dataType,target:e.target?e.target:3553,samplingMode:e.samplingMode?
- e.samplingMode:9729,wrapMode:e.wrapMode?e.wrapMode:10497,maxAnisotropy:e.maxAnisotropy,flipped:void 0!==e.flipped?e.flipped:!1,hasMipmap:void 0!==e.hasMipmap?e.hasMipmap:!1,level:void 0!==e.level?e.level:0,unpackAlignment:e.unpackAlignment?e.unpackAlignment:4,width:e.width,height:e.height,preMultiplyAlpha:void 0!==e.preMultiplyAlpha?e.preMultiplyAlpha:!1};this._id=++f._nextId;this.setData(c)}Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,
- "glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});f.prototype.dispose=function(){var a=this;if(this._context){if(this._glName){var e=this._context.gl;this._boundToUnits.forEach(function(c){a._context.bindTexture(null,c)});e.deleteTexture(this._glName);this._glName=null}this._context=null}};f.prototype.resize=function(a,e){var c=this._desc;if(c.width!==a||c.height!==
- e)c.width=a,c.height=e,this.setData(null)};f.prototype.setData=function(a){var e=this._context.gl;this._glName||(this._glName=e.createTexture());void 0===a&&(a=null);null===a&&(this._desc.width=this._desc.width||4,this._desc.height=this._desc.height||4);var c=this._context.getBoundTexture(0);this._context.bindTexture(this,0);var g=this._desc;f._validateTexture(g);e.pixelStorei(e.UNPACK_ALIGNMENT,g.unpackAlignment);e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,g.flipped?1:0);e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
- g.preMultiplyAlpha);if(a instanceof ImageData||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)g.width&&g.height&&console.assert(a.width===g.width&&a.height===g.height),e.texImage2D(e.TEXTURE_2D,g.level,g.internalFormat?g.internalFormat:g.pixelFormat,g.pixelFormat,g.dataType,a),void 0===this._desc.width&&(this._desc.width=a.width),void 0===this._desc.height&&(this._desc.height=a.height);else{null!=g.width&&null!=g.height||console.error("Width and height must be specified!");
- var d=g.internalFormat?g.internalFormat:g.pixelFormat,b=g.pixelFormat;e.DEPTH24_STENCIL8&&d===e.DEPTH_STENCIL&&(d=e.DEPTH24_STENCIL8);e.texImage2D(e.TEXTURE_2D,g.level,d,g.width,g.height,0,b,g.dataType,a)}g.hasMipmap&&this.generateMipmap();f._applySamplingMode(e,this._desc);f._applyWrapMode(e,this._desc);f._applyAnisotropicFilteringParameters(this._context,this._desc);this._context.bindTexture(c,0)};f.prototype.updateData=function(a,e,c,g,d,b){b||console.error("An attempt to use uninitialized data!");
- this._glName||console.error("An attempt to update uninitialized texture!");var k=this._context.gl,f=this._desc,p=this._context.getBoundTexture(0);this._context.bindTexture(this,0);(0>e||0>c||g>f.width||d>f.height||e+g>f.width||c+d>f.height)&&console.error("An attempt to update out of bounds of the texture!");b instanceof ImageData||b instanceof HTMLImageElement||b instanceof HTMLCanvasElement||b instanceof HTMLVideoElement?(console.assert(b.width===g&&b.height===d),k.texSubImage2D(k.TEXTURE_2D,a,
- e,c,f.pixelFormat,f.dataType,b)):k.texSubImage2D(k.TEXTURE_2D,a,e,c,g,d,f.pixelFormat,f.dataType,b);this._context.bindTexture(p,0)};f.prototype.generateMipmap=function(){var a=this._desc;a.hasMipmap||(a.hasMipmap=!0,f._validateTexture(a));9729===a.samplingMode?(this._samplingModeDirty=!0,a.samplingMode=9985):9728===a.samplingMode&&(this._samplingModeDirty=!0,a.samplingMode=9984);a=this._context.getBoundTexture(0);this._context.bindTexture(this,0);var e=this._context.gl;e.generateMipmap(e.TEXTURE_2D);
- this._context.bindTexture(a,0)};f.prototype.setSamplingMode=function(a){a!==this._desc.samplingMode&&(this._desc.samplingMode=a,f._validateTexture(this._desc),this._samplingModeDirty=!0)};f.prototype.setWrapMode=function(a){a!==this._desc.wrapMode&&(this._desc.wrapMode=a,f._validateTexture(this._desc),this._wrapModeDirty=!0)};f.prototype.applyChanges=function(){var a=this._context.gl,e=this._desc;this._samplingModeDirty&&(f._applySamplingMode(a,e),this._samplingModeDirty=!1);this._wrapModeDirty&&
- (f._applyWrapMode(a,e),this._wrapModeDirty=!1)};f.prototype.setBoundToUnit=function(a,e){e?this._boundToUnits.add(a):this._boundToUnits.delete(a)};f._isPowerOfTwo=function(a){return 0===(a&a-1)};f._validateTexture=function(a){(0>a.width||0>a.height)&&console.error("Negative dimension parameters are not allowed!");f._isPowerOfTwo(a.width)&&f._isPowerOfTwo(a.height)||(33071!==a.wrapMode&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),a.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))};
- f._applySamplingMode=function(a,e){var c=e.samplingMode;if(9985===c||9987===c)c=9729;else if(9984===c||9986===c)c=9728;a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,c);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,e.samplingMode)};f._applyWrapMode=function(a,e){a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,e.wrapMode);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,e.wrapMode)};f._applyAnisotropicFilteringParameters=function(a,e){if(null!=e.maxAnisotropy){var c=a.capabilities.textureFilterAnisotropic;
- c&&(a=a.gl,a.texParameterf(a.TEXTURE_2D,c.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy))}};f._nextId=0;return f}()})},"esri/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.Pos3=[{name:"position",count:3,type:5126,offset:0,stride:12,normalized:!1}];h.Pos3Tex=[{name:"position",count:3,type:5126,offset:0,stride:20,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:20,normalized:!1}];h.Pos3Col=
- [{name:"position",count:3,type:5126,offset:0,stride:16,normalized:!1},{name:"color",count:4,type:5121,offset:12,stride:16,normalized:!1}];h.Pos2=[{name:"position",count:2,type:5126,offset:0,stride:8,normalized:!1}];h.Pos2Tex=[{name:"position",count:2,type:5126,offset:0,stride:16,normalized:!1},{name:"uv0",count:2,type:5126,offset:8,stride:16,normalized:!1}]})},"esri/views/3d/webgl-engine/lib/glUtil3D":function(){define("require exports ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ../../../webgl/BufferObject ../../../webgl/Texture ../../../webgl/VertexArrayObject".split(" "),
- function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});h.createQuadVAO=function(c,b){void 0===b&&(b=a.Pos2);var d=b===a.Pos3Tex?new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,-1,1,0,0,1,1,1,0,1,1]):new Float32Array([-1,-1,1,-1,-1,1,1,1]);return new g(c,f.Default3D,{geometry:b},{geometry:e.createVertex(c,35044,d)})};h.createEmptyTexture=function(a){return new c(a,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:4,height:4})}})},"esri/views/3d/webgl-engine/lib/IdGen":function(){define(["require",
- "exports"],function(r,h){return function(){function f(){this._count=0}f.prototype.gen=function(a){null==a&&(a="a");return a+"_"+this._count++};return f}()})},"esri/views/webgl/FramebufferObject":function(){define(["require","exports","./Texture"],function(r,h,f){return function(){function a(e,c,g,d){this._colorAttachment=this._stencilAttachment=this._depthAttachment=this._glName=this._context=null;this._initialized=!1;this._context=e;this._desc={colorTarget:c.colorTarget,depthStencilTarget:c.depthStencilTarget,
- width:c.width,height:c.height,multisampled:c.multisampled};this._id=a._nextId++;g&&(e=void 0,g instanceof f?(this._colorAttachment=g,e=g.descriptor):(e=g,this._colorAttachment=new f(this._context,e)),0!==this._desc.colorTarget&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),a._validateTextureDimensions(e,this._desc));d&&(this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),
- g=void 0,d instanceof f?(this._depthStencilTexture=d,g=this._depthStencilTexture.descriptor):(g=d,this._depthStencilTexture=new f(this._context,g)),a._validateTextureDimensions(g,this._desc))}a.create=function(e,c){return new a(e,c)};a.createWithAttachments=function(e,c,g,d){return new a(e,g,c,d)};Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});
- Object.defineProperty(a.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"colorTexture",{get:function(){return this._colorAttachment instanceof f?this._colorAttachment:null},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"depthStencilTexture",{get:function(){return this._depthStencilTexture},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._desc.width},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this._desc.height},enumerable:!0,configurable:!0});a.prototype.dispose=function(){this._context&&this._glName&&(this._disposeColorAttachment(),this._disposeDepthStencilAttachments(),this._context.gl.deleteFramebuffer(this._glName),this._glName=null)};a.prototype.attachColorTexture=function(e){if(e){a._validateTextureDimensions(e.descriptor,this._desc);this._disposeColorAttachment();if(this._initialized){this._context.bindFramebuffer(this);
- var c=this._context.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,e.glName,0)}this._colorAttachment=e}};a.prototype.detachColorTexture=function(){var a=void 0;if(this._colorAttachment instanceof f){a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;this._context.gl.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,null,0)}this._colorAttachment=null}return a};a.prototype.attachDepthStencilTexture=function(e){if(e){var c=
- e.descriptor;34041!==c.pixelFormat&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");34042!==c.dataType&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8_WEBGL!");this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!");a._validateTextureDimensions(c,this._desc);4!==this._desc.depthStencilTarget&&(this._desc.depthStencilTarget=4);
- this._disposeDepthStencilAttachments();this._initialized&&(this._context.bindFramebuffer(this),c=this._context.gl,c.framebufferTexture2D(c.FRAMEBUFFER,c.DEPTH_STENCIL_ATTACHMENT,c.TEXTURE_2D,e.glName,0));this._depthStencilTexture=e}};a.prototype.detachDepthStencilTexture=function(){var a=this._depthStencilTexture;if(a&&this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;this._context.gl.framebufferTexture2D(c.FRAMEBUFFER,c.DEPTH_STENCIL_ATTACHMENT,c.TEXTURE_2D,null,0)}this._depthStencilTexture=
- null;return a};a.prototype.copyToTexture=function(a,c,g,d,b,k,f){(0>a||0>c||0>b||0>k)&&console.error("Offsets cannot be negative!");(0>=g||0>=d)&&console.error("Copy width and height must be greater than zero!");var e=this._desc,l=f.descriptor;3553!==f.descriptor.target&&console.error("Texture target must be TEXTURE_2D!");(a+g>e.width||c+d>e.height||b+g>l.width||k+d>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");e=this._context;e.bindTexture(f);
- e.bindFramebuffer(this);e.gl.copyTexSubImage2D(3553,0,b,k,a,c,g,d)};a.prototype.readPixels=function(a,c,g,d,b,k,f){(0>=g||0>=d)&&console.error("Copy width and height must be greater than zero!");f||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(a,c,g,d,b,k,f)};a.prototype.resize=function(e,c){var g=this._desc;if(g.width!==e||g.height!==c)if(this._initialized)g.width=e,g.height=c,this._colorAttachment instanceof f?(d=this._colorAttachment,
- g=d.descriptor,g.width=e,g.height=c,this._colorAttachment.dispose(),this._colorAttachment=new f(this._context,g),a._validateTextureDimensions(d.descriptor,this._desc)):this._colorAttachment&&this._disposeColorAttachment(),null!=this._depthStencilTexture?(g=this._depthStencilTexture.descriptor,g.width=e,g.height=c,this._depthStencilTexture.dispose(),this._depthStencilTexture=new f(this._context,g)):(this._depthAttachment||this._stencilAttachment)&&this._disposeDepthStencilAttachments(),this._context.getBoundFramebufferObject()===
- this&&this._context.bindFramebuffer(null),this._initialized=!1;else{g.width=e;g.height=c;if(this._colorAttachment instanceof f){var d=this._colorAttachment;d.resize(e,c)}this._depthStencilTexture&&this._depthStencilTexture.resize(e,c)}};a.prototype.initialize=function(){if(this._initialized)return!1;var a=this._context.gl;this._glName&&a.deleteFramebuffer(this._glName);var c=a.createFramebuffer(),g=this._desc;a.bindFramebuffer(a.FRAMEBUFFER,c);if(!this._colorAttachment)if(0===g.colorTarget)this._colorAttachment=
- new f(this._context,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:g.width,height:g.height});else{var d=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,d);a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,g.width,g.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,d);this._colorAttachment=d}this._colorAttachment instanceof f&&a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this._colorAttachment.glName,0);
- switch(g.depthStencilTarget){case 1:case 3:d=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,d);var b=1===g.depthStencilTarget?a.DEPTH_ATTACHMENT:a.DEPTH_STENCIL_ATTACHMENT;a.renderbufferStorage(a.RENDERBUFFER,1===g.depthStencilTarget?a.DEPTH_COMPONENT16:a.DEPTH_STENCIL,g.width,g.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,b,a.RENDERBUFFER,d);this._depthAttachment=d;break;case 2:d=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,d);a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX8,
- g.width,g.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.STENCIL_ATTACHMENT,a.RENDERBUFFER,d);this._stencilAttachment=d;break;case 4:this._depthStencilTexture||(this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),this._depthStencilTexture=new f(this._context,{target:3553,pixelFormat:34041,dataType:34042,samplingMode:9728,wrapMode:33071,width:g.width,height:g.height})),
- a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,this._depthStencilTexture.glName,0)}a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!");this._glName=c;return this._initialized=!0};a.prototype._disposeColorAttachment=function(){if(this._colorAttachment instanceof f){var a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var c=this._context.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,
- c.TEXTURE_2D,null,0)}a.dispose()}else this._colorAttachment instanceof WebGLRenderbuffer&&(a=this._colorAttachment,c=this._context.gl,this._initialized&&(this._context.bindFramebuffer(this),c.framebufferRenderbuffer(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(a));this._colorAttachment=null};a.prototype._disposeDepthStencilAttachments=function(){var a=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);
- var c=this._context.gl;c.framebufferRenderbuffer(c.FRAMEBUFFER,1===this._desc.depthStencilTarget?c.DEPTH_ATTACHMENT:c.DEPTH_STENCIL_ATTACHMENT,c.RENDERBUFFER,null)}a.deleteRenderbuffer(this._depthAttachment);this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),c=this._context.gl,c.framebufferRenderbuffer(c.FRAMEBUFFER,c.STENCIL_ATTACHMENT,c.RENDERBUFFER,null)),a.deleteRenderbuffer(this._stencilAttachment),this._stencilAttachment=null);this._depthStencilTexture&&
- (this._initialized&&(this._context.bindFramebuffer(this),a=this._context.gl,a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,null,0)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)};a._validateTextureDimensions=function(a,c){console.assert(0<=a.width&&0<=a.height);3553!==a.target&&console.error("Texture type must be TEXTURE_2D!");void 0!==c.width&&0<=c.width&&void 0!==c.height&&0<=c.height?c.width===a.width&&c.height===a.height||console.error("Color attachment texture must match the framebuffer's!"):
- (c.width=a.width,c.height=a.height)};a._nextId=0;return a}()})},"esri/views/3d/webgl-engine/lib/GLTextureRep":function(){define(["require","exports","../../../../core/Logger","./Util","../../../webgl/Texture"],function(r,h,f,a,e){var c=f.getLogger("esri.views.3d.webgl-engine.lib.GLTextureRep"),g=function(){function c(a){this._glTexture=null;this._refCount=0;this._glTexture=a}c.prototype.incRefCnt=function(){++this._refCount};c.prototype.decRefCnt=function(){--this._refCount;a.assert(0<=this._refCount)};
- c.prototype.getRefCnt=function(){return this._refCount};c.prototype.setGLTexture=function(a){this._glTexture=a};c.prototype.getGLTexture=function(){return this._glTexture};return c}();return function(){function d(a,c,d,e){this.NUM_PARALLEL=8;this.textures=a;this._programRepository=c;this.getViewportToRestore=d;this._rctx=e;this.NUM_PARALLEL=8;this.id2textureRef={};this.loading={};this._queue=[];this.listeners=[];this.maxMaxAnisotropy=(this.afExt=e.capabilities.textureFilterAnisotropic)?e.parameters.maxMaxAnisotropy:
- 1;this.maxAnisotropy=Math.min(8,this.maxMaxAnisotropy);this._needsRender=!0;this._fallbackTextureData=new Uint8Array(256);this._fallbackTextureTransparentData=new Uint8Array(256);for(a=0;a<this._fallbackTextureData.length;++a)this._fallbackTextureData[a]=255,this._fallbackTextureTransparentData[a]=0!==(a+1)%4?255:0;this._fallbackTextureDesc={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:8,height:8,maxAnisotropy:8}}d.prototype.resetNeedsRender=function(){this._needsRender=!1};
- d.prototype.needsRender=function(){return this._needsRender};d.prototype.aquire=function(b,d,f){var k=this,l=this.id2textureRef[b];if(null==l){var t=this.textures[b];a.assert(void 0!==t);t.setUnloadFunc(this._unload.bind(this));d=!0===d;var u=this._createGLTextureDescription(t),l=new g(null);a.assert(null==this.id2textureRef[b]);this.id2textureRef[b]=l;if(t.initializeThroughRender)b=t.initializeThroughRender(this._rctx,u),l.setGLTexture(b),f&&f(l);else if(t.deferredLoading())this.getLoadingCount()<
- this.NUM_PARALLEL?this._loadImage(b,u,f):this._queue.push([b,u,f]);else try{t.initializeThroughUpload(this._rctx,u,this._programRepository,this.getViewportToRestore(),function(a){l.setGLTexture(a);k._needsRender=!0;f&&f(l)})}catch(q){c.error("#aquire","Error loading texture: "+q.toString())}null==l.getGLTexture()&&l.setGLTexture(d?new e(this._rctx,this._fallbackTextureDesc,this._fallbackTextureTransparentData):new e(this._rctx,this._fallbackTextureDesc,this._fallbackTextureData));this._needsRender=
- !0}l.incRefCnt();return l};d.prototype.release=function(b){b=this.id2textureRef[b];void 0!==b&&(b.decRefCnt(),a.assert(0<=b.getRefCnt()))};d.prototype.getLoadingCount=function(){return Object.keys(this.loading).length};d.prototype.getIsLoaded=function(a){if(null==this.id2textureRef[a]||void 0!==this.loading[a])return!1;for(var b=0;b<this._queue.length;++b)if(this._queue[b][0]===a)return!1;return!0};d.prototype.addTextureListener=function(b){a.assert(-1===this.listeners.indexOf(b));this.listeners.push(b)};
- d.prototype.removeTextureListener=function(b){b=this.listeners.indexOf(b);a.assert(-1!==b);this.listeners.splice(b,1)};d.prototype.getTexture=function(a){return this.textures[a]};d.prototype.getMaxAnisotropy=function(){return this.maxAnisotropy};d.prototype._unload=function(a){var b=this.id2textureRef[a];void 0!==b&&((b=b.getGLTexture())&&b.dispose(),delete this.id2textureRef[a]);this.next(a)};d.prototype._createGLTextureDescription=function(a){return{target:3553,pixelFormat:6408,dataType:5121,maxAnisotropy:this.afExt&&
- a.params&&a.params.mipmap&&!a.params.disableAnisotropy?this.maxAnisotropy:void 0,wrapMode:a.params&&a.params.wrapClamp?33071:void 0}};d.prototype.next=function(a){if(a in this.loading){delete this.loading[a];var b=Object.keys(this.id2textureRef),c=Object.keys(this.loading);this.listeners.forEach(function(d){d(a,b,c)});this.processQueue()}};d.prototype._loadImage=function(b,c,d){var e=this;a.assert(null==this.loading[b]);this.loading[b]=!0;var g=this.textures[b];a.assert(void 0!==g);setTimeout(function(){var a=
- e.id2textureRef[b];a&&a.getRefCnt()&&g.initializeThroughUpload(e._rctx,c,e._programRepository,e.getViewportToRestore(),function(c){e.next(b);e._needsRender=!0;a&&a.getRefCnt()&&(a.setGLTexture(c),d&&d(a))})},0)};d.prototype.processQueue=function(){for(var a=[],c=0;c<this._queue.length;++c){var d=this._queue[c][0],e=this.id2textureRef[d];void 0!==e&&(0===e.getRefCnt()?(e.getGLTexture().dispose(),delete this.id2textureRef[d]):a.push(this._queue[c]))}this._queue=a;a=Math.min(this.NUM_PARALLEL-Object.keys(this.loading).length,
- this._queue.length);for(c=0;c<a;++c)this._loadImage(this._queue[c][0],this._queue[c][1],this._queue[c][2]);this._queue.splice(0,a)};return d}()})},"esri/views/3d/webgl-engine/lib/RenderPass":function(){define(["require","exports"],function(r,h){var f;r=f||(f={});r[r.MATERIAL=0]="MATERIAL";r[r.MATERIAL_DEPTH=1]="MATERIAL_DEPTH";r[r.MATERIAL_NORMAL=2]="MATERIAL_NORMAL";r[r.MATERIAL_DEPTH_SHADOWMAP=3]="MATERIAL_DEPTH_SHADOWMAP";r[r.MATERIAL_HIGHLIGHT=4]="MATERIAL_HIGHLIGHT";r[r.MAX_PASS=5]="MAX_PASS";
- return f})},"esri/views/3d/webgl-engine/lib/RenderSlot":function(){define(["require","exports"],function(r,h){var f;r=f||(f={});r[r.BACKGROUND=0]="BACKGROUND";r[r.INTERNAL_MATERIAL=1]="INTERNAL_MATERIAL";r[r.STENCIL_MATERIAL=2]="STENCIL_MATERIAL";r[r.OPAQUE_TERRAIN=3]="OPAQUE_TERRAIN";r[r.OPAQUE_MATERIAL=4]="OPAQUE_MATERIAL";r[r.OPAQUE_EXTERNAL=5]="OPAQUE_EXTERNAL";r[r.TRANSPARENT_MATERIAL=6]="TRANSPARENT_MATERIAL";r[r.TRANSPARENT_EXTERNAL=7]="TRANSPARENT_EXTERNAL";r[r.TRANSPARENT_TERRAIN=8]="TRANSPARENT_TERRAIN";
- r[r.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS";r[r.POSTPROCESSING_HIGHLIGHT=10]="POSTPROCESSING_HIGHLIGHT";r[r.POSTPROCESSING_ATMOSPHERE_OPAQUE=11]="POSTPROCESSING_ATMOSPHERE_OPAQUE";r[r.POSTPROCESSING_ATMOSPHERE_TRANSPARENT=12]="POSTPROCESSING_ATMOSPHERE_TRANSPARENT";r[r.POSTPROCESSING_EXTERNAL=13]="POSTPROCESSING_EXTERNAL";r[r.HUDMATERIAL1=14]="HUDMATERIAL1";r[r.HUDMATERIAL2=15]="HUDMATERIAL2";r[r.LINE_CALLOUTS=16]="LINE_CALLOUTS";r[r.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH";r[r.MAX_SLOTS=
- 18]="MAX_SLOTS";return f})},"esri/views/3d/environment/resources/SimpleAtmosphereTexture":function(){define([],function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAIACAYAAABD1gYFAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7AAAAOwAFq1okJAAAAB3RJTUUH4QkLDx4bnqU2+QAAAd1JREFUSMd9lkmWxDAIQ/Xluv+V0wuDjaeuhV+IGQUoJUnNwGfAVvx+lsBCWJIsCaMpQn8nuhgqyyEzbAX1Ih0oHaQZN5X5jul581diaDVbSgAdZv1YLoCLyn/RruCsOdcqR7RS/jXkLMa9UddcDn9O7G8gwprzs6xbQl/Fns3BE90r9veQ/wzNrTM5p1yDF1yokLCosDX5kik1lxeSWxfWsihN/lZcHuPIOuhccZ4Ovt74qQK3USkFzsQx7Ki5NgqoMI1J5ILztr9UrGoGHN2qnSEwOHiD97ByDghs/KIVYp9DfdIIoJPcBkWWnM2O2s5ru3su+8GdPLhM5048r/09UDsZmJ3HRwe5MT/aA9Ul4cG74+lIvICYlZcFY42B6vAzuz/HEVn5VbP3DDgQ7xuAGZtnI76cEkbPczDDgSMDR8iFkfBMTQV728mnsx84GopNWZxQsWJxbI9pD0hmNAzWB8bun41hRk+3mNlRFvbY86mcMEVCWWAX+xJbERJHWVPP3Wkq91uyDtuKDLrYNKLl7bww6rZulo3jnafyePJ64ZZi67aEl0MkbJtTbE1h+2vIzVOU3JwWISrNyNtfi+9xqECIXZk87ODcEMeBhjj41GN1Xf+DzP9c9UmPd39C1BID2rDpAwAAAABJRU5ErkJggg\x3d\x3d"})},
- "esri/views/webgl/Program":function(){define(["require","exports","dojo/has","./ShaderTranspiler"],function(r,h,f,a){return function(){function e(a,g,d,b,k){void 0===k&&(k={});this._glName=this._context=null;this._locations={};this._id=void 0;this._initialized=!1;this._fShader=this._vShader=null;this._defines={};this._nameToUniformLocation={};this._nameToAttribLocation={};this._nameToUniform1={};this._nameToUniform2={};this._nameToUniform3={};this._nameToUniform4={};this._nameToUniformMatrix3={};
- this._nameToUniformMatrix4={};a||console.error("RenderingContext isn't initialized!");0===g.length&&console.error("Shaders source should not be empty!");this._context=a;this._vertexShaderSource=g;this._fragmentShaderSource=d;if(Array.isArray(k))for(a=0;a<k.length;a++)this._defines[k[a]]="1";else this._defines=k;this._id=e._nextId++;this._locations=b}Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"glName",{get:function(){return this._glName},
- enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"locations",{get:function(){return this._locations},enumerable:!0,configurable:!0});e.prototype.getDefine=function(a){return this._defines[a]};e.prototype.dispose=function(){if(this._context){var a=this._context.gl;this._vShader&&(a.deleteShader(this._vShader),this._vShader=null);this._fShader&&(a.deleteShader(this._fShader),this._fShader=null);this._glName&&(a.deleteProgram(this._glName),this._glName=null);this._context=null}};e.prototype.initialize=
- function(){if(!this._initialized){this._vShader=this._loadShader(35633);this._fShader=this._loadShader(35632);this._vShader&&this._fShader||console.error("Error loading shaders!");var a=this._context.gl,e=a.createProgram();a.attachShader(e,this._vShader);a.attachShader(e,this._fShader);for(var d in this._locations)a.bindAttribLocation(e,this._locations[d],d);a.linkProgram(e);a.getProgramParameter(e,a.LINK_STATUS)||console.error("Could not initialize shader\nVALIDATE_STATUS: "+a.getProgramParameter(e,
- a.VALIDATE_STATUS)+", gl error ["+a.getError()+"]infoLog: "+a.getProgramInfoLog(e));this._glName=e;this._initialized=!0}};e.prototype.getUniformLocation=function(a){this.initialize();void 0===this._nameToUniformLocation[a]&&(this._nameToUniformLocation[a]=this._context.gl.getUniformLocation(this._glName,a));return this._nameToUniformLocation[a]};e.prototype.hasUniform=function(a){return null!==this.getUniformLocation(a)};e.prototype.getAttribLocation=function(a){this.initialize();void 0===this._nameToAttribLocation[a]&&
- (this._nameToAttribLocation[a]=this._context.gl.getAttribLocation(this._glName,a));return this._nameToAttribLocation[a]};e.prototype.setUniform1i=function(a,e){var c=this._nameToUniform1[a];if(void 0===c||e!==c)this._context.bindProgram(this),this._context.gl.uniform1i(this.getUniformLocation(a),e),this._nameToUniform1[a]=e};e.prototype.setUniform1f=function(a,e){var c=this._nameToUniform1[a];if(void 0===c||e!==c)this._context.bindProgram(this),this._context.gl.uniform1f(this.getUniformLocation(a),
- e),this._nameToUniform1[a]=e};e.prototype.setUniform1fv=function(a,g){var c=this._nameToUniform2[a];void 0!==c&&e._arraysEqual(g,c)||(this._context.bindProgram(this),this._context.gl.uniform1fv(this.getUniformLocation(a),g),void 0===c?this._nameToUniform2[a]=new Float32Array(g):c.set(g))};e.prototype.setUniform2f=function(a,e,d){var b=this._nameToUniform2[a];if(void 0===b||e!==b[0]||d!==b[1])this._context.bindProgram(this),this._context.gl.uniform2f(this.getUniformLocation(a),e,d),void 0===b?this._nameToUniform2[a]=
- new Float32Array([e,d]):(b[0]=e,b[1]=d)};e.prototype.setUniform2fv=function(a,g){var c=this._nameToUniform2[a];void 0!==c&&e._arraysEqual(g,c)||(this._context.bindProgram(this),this._context.gl.uniform2fv(this.getUniformLocation(a),g),void 0===c?this._nameToUniform2[a]=new Float32Array(g):c.set(g))};e.prototype.setUniform3f=function(a,e,d,b){var c=this._nameToUniform3[a];if(void 0===c||e!==c[0]||d!==c[1]||b!==c[2])this._context.bindProgram(this),this._context.gl.uniform3f(this.getUniformLocation(a),
- e,d,b),void 0===c?this._nameToUniform3[a]=new Float32Array([e,d,b]):(c[0]=e,c[1]=d,c[2]=b)};e.prototype.setUniform3fv=function(a,g){var c=this._nameToUniform3[a];void 0!==c&&e._arraysEqual(g,c)||(this._context.bindProgram(this),this._context.gl.uniform3fv(this.getUniformLocation(a),g),void 0===c?this._nameToUniform3[a]=new Float32Array(g):c.set(g))};e.prototype.setUniform4f=function(a,e,d,b,k){var c=this._nameToUniform4[a];if(void 0===c||e!==c[0]||d!==c[1]||b!==c[2]||k!==c[3])this._context.bindProgram(this),
- this._context.gl.uniform4f(this.getUniformLocation(a),e,d,b,k),void 0===c?this._nameToUniform4[a]=new Float32Array([e,d,b,k]):(c[0]=e,c[1]=d,c[2]=b,c[3]=k)};e.prototype.setUniform4fv=function(a,g){var c=this._nameToUniform4[a];void 0!==c&&e._arraysEqual(g,c)||(this._context.bindProgram(this),this._context.gl.uniform4fv(this.getUniformLocation(a),g),void 0===c?this._nameToUniform4[a]=new Float32Array(g):c.set(g))};e.prototype.setUniformMatrix3fv=function(a,g,d){void 0===d&&(d=!1);var b=this._nameToUniformMatrix3[a];
- void 0!==b&&(9===b.length?e._matrix3Equal(b,g):e._arraysEqual(g,b))||(this._context.bindProgram(this),this._context.gl.uniformMatrix3fv(this.getUniformLocation(a),d,g),void 0===b?this._nameToUniformMatrix3[a]=new Float32Array(g):b.set(g))};e.prototype.setUniformMatrix4fv=function(a,g,d){void 0===d&&(d=!1);var b=this._nameToUniformMatrix4[a];void 0!==b&&(16===b.length?e._matrix4Equal(b,g):e._arraysEqual(g,b))||(this._context.bindProgram(this),this._context.gl.uniformMatrix4fv(this.getUniformLocation(a),
- d,g),void 0===b?this._nameToUniformMatrix4[a]=new Float32Array(g):b.set(g))};e._padToThree=function(a){var c=a.toString();1E3>a&&(c=(" "+a).slice(-3));return c};e.prototype._addLineNumbers=function(a){var c=2;return a.replace(/\n/g,function(){return"\n"+e._padToThree(c++)+":"})};e.prototype._loadShader=function(c){var e=35633===c,d=e?this._vertexShaderSource:this._fragmentShaderSource,b;b="";for(var k in this._defines)b+="#define "+k+" "+this._defines[k]+"\n";b+=d;"webgl2"===this._context.contextVersion&&
- (b=a.transpileShader(b,e?"vertex":"fragment"));e=this._context.gl;c=e.createShader(c);e.shaderSource(c,b);e.compileShader(c);e.getShaderParameter(c,e.COMPILE_STATUS)||(console.error(e.getShaderInfoLog(c)),console.error(this._addLineNumbers(b)),"webgl2"===this._context.contextVersion&&(console.log("Shader source before transpilation:"),console.log(d)));return c};e._matrix4Equal=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]&&a[4]===e[4]&&a[5]===e[5]&&a[6]===e[6]&&a[7]===e[7]&&
- a[8]===e[8]&&a[9]===e[9]&&a[10]===e[10]&&a[11]===e[11]&&a[12]===e[12]&&a[13]===e[13]&&a[14]===e[14]&&a[15]===e[15]};e._matrix3Equal=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]&&a[4]===e[4]&&a[5]===e[5]&&a[6]===e[6]&&a[7]===e[7]&&a[8]===e[8]};e._arraysEqual=function(a,e){if(a.length!==e.length)return!1;for(var c=0;c<a.length;++c)if(a[c]!==e[c])return!1;return!0};e._nextId=0;return e}()})},"esri/views/webgl/ShaderTranspiler":function(){define(["require","exports","./reservedWordsGLSL3",
- "./lib/glsl-tokenizer/string"],function(r,h,f,a){function e(a){return a.map(function(a){return"eof"!==a.type?a.data:""}).join("")}function c(a,d,e,g){g=g||e;for(var b=0;b<a.length;b++){var k=a[b];if("ident"===k.type&&k.data===e)return g in d?d[g]++:d[g]=0,c(a,d,g+"_"+d[g],g)}return e}function g(a,c,d){void 0===d&&(d="afterVersion");var b={data:"\n",type:"whitespace"},e=function(b){return b<a.length?/[^\r\n]$/.test(a[b].data):!1},g=function(a){for(var b=-1,c=0,e=-1,g=0;g<a.length;g++){var k=a[g];"preprocessor"===
- k.type&&(k.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++c:k.data.match(/\#endif\s*.*/)&&--c);("afterVersion"===d||"afterPrecision"===d)&&"preprocessor"===k.type&&/^#version/.test(k.data)&&(e=Math.max(e,g));if("afterPrecision"===d&&"keyword"===k.type&&"precision"===k.data){a:{for(k=g;k<a.length;k++){var f=a[k];if("operator"===f.type&&";"===f.data)break a}k=null}if(null===k)throw Error("precision statement not followed by any semicolons!");e=Math.max(e,k)}b<e&&0===c&&(b=g)}return b+1}(a);e(g-1)&&a.splice(g++,
- 0,b);for(var k=0;k<c.length;k++){var f=c[k];a.splice(g++,0,f)}e(g-1)&&e(g)&&a.splice(g,0,b)}Object.defineProperty(h,"__esModule",{value:!0});var d=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];h.transpileShader=function(b,k){b=a(b);var l;a:{l="100";var p="300 es";void 0===l&&(l="100");void 0===p&&(p="300 es");for(var n=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/,t=0;t<b.length;t++){var u=b[t];if("preprocessor"===u.type){var q=n.exec(u.data);
- if(q)if(n=q[1].replace(/\s\s+/g," "),n===p){l=n;break a}else if(n===l){u.data="#version "+p;break a}else throw Error("unknown glsl version: "+n);}}b.splice(0,0,{type:"preprocessor",data:"#version "+p},{type:"whitespace",data:"\n"});l=null}if("300 es"===l)throw Error("shader is already glsl 300 es");n=u=null;t={};q={};for(l=0;l<b.length;++l)switch(p=b[l],p.type){case "keyword":"vertex"===k&&"attribute"===p.data?p.data="in":"varying"===p.data&&(p.data="vertex"===k?"out":"in");break;case "builtin":/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(p.data.trim())&&
- (p.data=p.data.replace(/(2D|Cube|EXT)/g,""));if("fragment"===k&&"gl_FragColor"===p.data){if(!u){var u=c(b,t,"fragColor"),v=void 0;void 0===v&&(v="lowp");g(b,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:v},{type:"whitespace",data:" "},{type:"keyword",data:"vec4"},{type:"whitespace",data:" "},{type:"ident",data:u},{type:"operator",data:";"}],"afterPrecision")}p.data=u}else"fragment"===k&&"gl_FragDepthEXT"===p.data&&(n||(n=c(b,t,"gl_FragDepth")),p.data=n);break;case "ident":if(0<=
- f.indexOf(p.data)){if(v="vertex"===k)a:{for(v=l-1;0<=v;v--){var h=b[v];if("whitespace"!==h.type&&"block-comment"!==h.type)if("keyword"===h.type){if("attribute"===h.data||"in"===h.data){v=!0;break a}}else break}v=!1}if(v)throw Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");p.data in q||(q[p.data]=c(b,t,p.data));p.data=q[p.data]}}for(l=b.length-1;0<=l;--l)p=b[l],"preprocessor"===p.type&&((k=p.data.match(/\#extension\s+(.*)\:/))&&k[1]&&0<=d.indexOf(k[1].trim())&&
- (k=b[l+1],b.splice(l,k&&"whitespace"===k.type?2:1)),(k=p.data.match(/\#ifdef\s+(.*)/))&&k[1]&&0<=d.indexOf(k[1].trim())&&(p.data="#if 1"),(k=p.data.match(/\#ifndef\s+(.*)/))&&k[1]&&0<=d.indexOf(k[1].trim())&&(p.data="#if 0"));return e(b)}})},"esri/views/webgl/reservedWordsGLSL3":function(){define(["require","exports"],function(r,h){return"layout centroid smooth case mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4 uint uvec2 uvec3 uvec4 samplerCubeShadow sampler2DArray sampler2DArrayShadow isampler2D isampler3D isamplerCube isampler2DArray usampler2D usampler3D usamplerCube usampler2DArray coherent restrict readonly writeonly resource atomic_uint noperspective patch sample subroutine common partition active filter image1D image2D image3D imageCube iimage1D iimage2D iimage3D iimageCube uimage1D uimage2D uimage3D uimageCube image1DArray image2DArray iimage1DArray iimage2DArray uimage1DArray uimage2DArray image1DShadow image2DShadow image1DArrayShadow image2DArrayShadow imageBuffer iimageBuffer uimageBuffer sampler1DArray sampler1DArrayShadow isampler1D isampler1DArray usampler1D usampler1DArray isampler2DRect usampler2DRect samplerBuffer isamplerBuffer usamplerBuffer sampler2DMS isampler2DMS usampler2DMS sampler2DMSArray isampler2DMSArray usampler2DMSArray trunc round roundEven isnan isinf floatBitsToInt floatBitsToUint intBitsToFloat uintBitsToFloat packSnorm2x16 unpackSnorm2x16 packUnorm2x16 unpackUnorm2x16 packHalf2x16 unpackHalf2x16 outerProduct transpose determinant inverse texture textureSize textureProj textureLod textureOffset texelFetch texelFetchOffset textureProjOffset textureLodOffset textureProjLod textureProjLodOffset textureGrad textureGradOffset textureProjGrad textureProjGradOffset".split(" ")})},
- "esri/views/webgl/lib/glsl-tokenizer/string":function(){define(["./index"],function(r){"use strict;";return function(h){var f=r(),a=[],a=a.concat(f(h));return a=a.concat(f(null))}})},"esri/views/webgl/lib/glsl-tokenizer/index":function(){define(["./lib/literals","./lib/operators","./lib/builtins"],function(r,h,f){"use strict;";var a="block-comment line-comment preprocessor operator integer float ident builtin keyword whitespace eof integer".split(" ");return function(){function e(b){b.length&&x.push({type:a[t],
- data:b,position:z,line:m,column:B})}function c(){v=v.length?[]:v;if("/"===q&&"*"===u)return z=n+p-1,t=0,q=u,p+1;if("/"===q&&"/"===u)return z=n+p-1,t=1,q=u,p+1;if("#"===u)return t=2,z=n+p,p;if(/\s/.test(u))return t=9,z=n+p,p;C=/\d/.test(u);A=/[^\w_]/.test(u);z=n+p;t=C?4:A?3:9999;return p}function g(){if(("\r"===u||"\n"===u)&&"\\"!==q)return e(v.join("")),t=999,p;v.push(u);q=u;return p+1}function d(){if("."===q&&/\d/.test(u))return t=5,p;if("/"===q&&"*"===u)return t=0,p;if("/"===q&&"/"===u)return t=
- 1,p;if("."===u&&v.length){for(;b(v););t=5;return p}if(";"===u||")"===u||"("===u){if(v.length)for(;b(v););e(u);t=999;return p+1}var a=2===v.length&&"\x3d"!==u;if(/[\w_\d\s]/.test(u)||a){for(;b(v););t=999;return p}v.push(u);q=u;return p+1}function b(a){var b=0,c,d;do{c=h.indexOf(a.slice(0,a.length+b).join(""));d=h[c];if(-1===c){if(0<b--+a.length)continue;d=a.slice(0,1).join("")}e(d);z+=d.length;v=v.slice(d.length);return v.length}while(1)}function k(){if("."===u||/[eE]/.test(u))return v.push(u),t=5,
- q=u,p+1;if("x"===u&&1===v.length&&"0"===v[0])return t=11,v.push(u),q=u,p+1;if(/[^\d]/.test(u))return e(v.join("")),t=999,p;v.push(u);q=u;return p+1}function l(){"f"===u&&(v.push(u),q=u,p+=1);if(/[eE]/.test(u)||"-"===u&&/[eE]/.test(q))return v.push(u),q=u,p+1;if(/[^\d]/.test(u))return e(v.join("")),t=999,p;v.push(u);q=u;return p+1}var p=0,n=0,t=999,u,q,v=[],x=[],m=1,B=0,z=0,C=!1,A=!1,D="",E;return function(a){x=[];if(null!==a){a=a.replace?a.replace(/\r\n/g,"\n"):a;p=0;D+=a;for(E=D.length;u=D[p],p<
- E;){a=p;switch(t){case 0:"/"===u&&"*"===q?(v.push(u),e(v.join("")),t=999):(v.push(u),q=u);p+=1;break;case 1:p=g();break;case 2:p=g();break;case 3:p=d();break;case 4:p=k();break;case 11:/[^a-fA-F0-9]/.test(u)?(e(v.join("")),t=999):(v.push(u),q=u,p+=1);break;case 5:p=l();break;case 9999:if(/[^\d\w_]/.test(u)){var b=v.join("");t=-1<r.indexOf(b)?8:-1<f.indexOf(b)?7:6;e(v.join(""));t=999}else v.push(u),q=u,p+=1;break;case 9:/[^\s]/g.test(u)?(e(v.join("")),t=999):(v.push(u),q=u,p+=1);break;case 999:p=c()}if(a!==
- p)switch(D[a]){case "\n":B=0;++m;break;default:++B}}n+=p;D=D.slice(p);return x}v.length&&e(v.join(""));t=10;e("(eof)");return x}}})},"esri/views/webgl/lib/glsl-tokenizer/lib/literals":function(){define([],function(){return"precision highp mediump lowp attribute const uniform varying break continue do for while if else in out inout float int void bool true false discard return mat2 mat3 mat4 vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow struct asm class union enum typedef template this packed goto switch default inline noinline volatile public static extern external interface long short double half fixed unsigned input output hvec2 hvec3 hvec4 dvec2 dvec3 dvec4 fvec2 fvec3 fvec4 sampler2DRect sampler3DRect sampler2DRectShadow sizeof cast namespace using".split(" ")})},
- "esri/views/webgl/lib/glsl-tokenizer/lib/operators":function(){define([],function(){"use strict;";return"\x3c\x3c\x3d \x3e\x3e\x3d ++ -- \x3c\x3c \x3e\x3e \x3c\x3d \x3e\x3d \x3d\x3d !\x3d \x26\x26 || +\x3d -\x3d *\x3d /\x3d %\x3d \x26\x3d ^^ ^\x3d |\x3d ( ) [ ] . ! ~ * / % + - \x3c \x3e \x26 ^ | ? : \x3d , ; { }".split(" ")})},"esri/views/webgl/lib/glsl-tokenizer/lib/builtins":function(){define([],function(){return"abs acos all any asin atan ceil clamp cos cross dFdx dFdy degrees distance dot equal exp exp2 faceforward floor fract gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_DepthRangeParameters gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FogParameters gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FragDepthEXT gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_LightModel gl_LightModelParameters gl_LightModelProducts gl_LightProducts gl_LightSource gl_LightSourceParameters gl_MaterialParameters gl_MaxClipPlanes gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentUniformComponents gl_MaxLights gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingFloats gl_MaxVertexAttribs gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_Point gl_PointCoord gl_PointParameters gl_PointSize gl_Position gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SecondaryColor gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex greaterThan greaterThanEqual inversesqrt length lessThan lessThanEqual log log2 matrixCompMult max min mix mod normalize not notEqual pow radians reflect refract sign sin smoothstep sqrt step tan texture2D texture2DLod texture2DProj texture2DProjLod textureCube textureCubeLod texture2DLodEXT texture2DProjLodEXT textureCubeLodEXT texture2DGradEXT texture2DProjGradEXT textureCubeGradEXT".split(" ")})},
- "esri/views/3d/environment/RealisticAtmosphere":function(){define("dojo/text!./materials/RealisticAtmosphereMaterial.xml ../../../core/watchUtils ../../../core/Handles ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/OffscreenRenderingHelper ../support/earthUtils ../../webgl/Program ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){var u=l.earthRadius,q=e.vec3d,v=e.vec2d,x=e.vec4d;e=.02*Math.PI;l=.004*Math.PI;var m=q.createFrom(1/Math.pow(.65,4),1/Math.pow(.57,4),1/Math.pow(.475,4)),B=q.create(m);q.scale(B,e);q.add(B,q.createFrom(l,l,l));var z=(1- -.99999*-.99999)/(2+-.99999*-.99999)*1.5;a=a.createSubclass({declaredClass:"esri.views.3d.environment.RealisticAtmosphere",properties:{view:{},planar:{value:!1,set:function(a){a=!!a;a!==this.planar&&this._update();this._set("planar",a)}},needsRender:{value:!1}},
- constructor:function(){this._handles=new f;this._lowerElevationBoundRadius=0;this._earthRadius=u;this._renderer=this._skyPlanarProgram=this._skyProgram=this._hazePlanarProgram=this._hazeProgram=null;this._renderData={texDepth:v.create(),v3CameraPos:q.create(),v3CameraUp:q.create(),v3CameraRight:q.create(),v3CameraDir:q.create(),halfSizeNearPlane:v.create(),v2CameraCenterOffset:v.create(),v4SphereComp:x.create(),v4AtmosParams1:x.create(),v4AtmosParams2:x.create(),v4AtmosParams3:x.create(),v3InvWavelength:m,
- v3InvWavelengthScaled:B,v4Radii:x.create(),fScale:0,fScaleDepth:.25,fLowerAlphaBlendBound:0,fScaleOverScaleDepth:0,fOneOverScaleDepth:0,fScaleDepthBlue:.05,fOneOverScaleDepthBlue:20,fScaleOverScaleDepthBlue:0,g:-.99999,g2:-.99999*-.99999,fMiePhaseCoefficients:z,showTest:0,nearFar:v.create()};this._updateRadius(u);this._hazeSlot=b.POSTPROCESSING_ATMOSPHERE_TRANSPARENT;this._skySlot=b.POSTPROCESSING_ATMOSPHERE_OPAQUE},destroy:function(){this._handles&&(this._handles.destroy(),this._handles=null);this._hazeProgram&&
- (this._hazeProgram.dispose(),this._hazeProgram=null);this._hazePlanarProgram&&(this._hazePlanarProgram.dispose(),this._hazePlanarProgram=null);this._skyProgram&&(this._skyProgram.dispose(),this._skyProgram=null);this._skyPlanarProgram&&(this._skyPlanarProgram.dispose(),this._skyPlanarProgram=null)},setup:function(a){var b=g.createSquareGeometry([[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]]).toRenderData(),d=this.renderContext.rctx;this._renderer=new c(b,n.Pos3Tex,null,d);b=this._update.bind(this);this._handles.add(h.init(this,
- "view.state.camera",b,!0));var b=this._updateElevation.bind(this),e=function(){this._updateElevation({tile:this.view.basemapTerrain.rootTiles[0]})}.bind(this),k=this._updateVisibleElevationBounds.bind(this);this._handles.add(h.on(this,"view.basemapTerrain","elevation-change",b,e));this._handles.add(h.on(this,"view.basemapTerrain","elevation-bounds-change",k,k));a.shaderSnippets.fsRealisticAtmosphere||a.shaderSnippets._parse(r);this._hazeProgram=new p(d,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,
- t.Default3D,["HAZE"]);this._skyProgram=new p(d,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,t.Default3D);this._hazePlanarProgram=new p(d,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,t.Default3D,["HAZE","PLANAR"]);this._skyPlanarProgram=new p(d,a.shaderSnippets.vsRealisticAtmosphere,a.shaderSnippets.fsRealisticAtmosphere,t.Default3D,["PLANAR"])},render:function(a){if(a.slot!==this._hazeSlot&&a.slot!==this._skySlot||a.pass!==d.MATERIAL||
- a.slot==this._hazeSlot&&a.options.earlyOcclusionPixelDraw)return!1;var b,c=this.renderContext.rctx,e=c.gl,g=a.offscreenRenderingHelper,k=!1;if(a.slot===this._hazeSlot){b=this.planar?this._hazePlanarProgram:this._hazeProgram;c.bindProgram(b);c.setBlendFunctionSeparate(e.ONE,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);g.detachDepthTextureFromBuffer();var k=!0,f=g.getDepthTexture();c.bindTexture(f,0);b.setUniform1i("tDepth",0);b.setUniform4fv("v4SphereComp",this._renderData.v4SphereComp)}a.slot===this._skySlot&&
- (b=this.planar?this._skyPlanarProgram:this._skyProgram,c.bindProgram(b),c.setBlendFunctionSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),c.setDepthFunction(e.LEQUAL),b.setUniform4fv("v4SphereComp",this._renderData.v4SphereComp),b.setUniform4fv("v4AtmosParams3",this._renderData.v4AtmosParams3));b.setUniform3fv("v3InvWavelength",this._renderData.v3InvWavelength);b.setUniform3fv("v3InvWavelengthScaled",this._renderData.v3InvWavelengthScaled);b.setUniform3fv("v3LightDir",a.lightingData.direction);
- b.setUniform3fv("v3CameraPos",this._renderData.v3CameraPos);b.setUniform3fv("v3CameraUp",this._renderData.v3CameraUp);b.setUniform3fv("v3CameraRight",this._renderData.v3CameraRight);b.setUniform3fv("v3CameraDir",this._renderData.v3CameraDir);b.setUniform2fv("nearFar",this._renderData.nearFar);b.setUniform2fv("halfSizeNearPlane",this._renderData.halfSizeNearPlane);b.setUniform2fv("v2CameraCenterOffset",this._renderData.v2CameraCenterOffset);b.setUniform4fv("v4Radii",this._renderData.v4Radii);b.setUniform4fv("v4AtmosParams1",
- this._renderData.v4AtmosParams1);b.setUniform4fv("v4AtmosParams2",this._renderData.v4AtmosParams2);b.setUniform1f("showTest",this._renderData.showTest);k?c.setDepthTestEnabled(!1):c.setDepthTestEnabled(!0);c.setBlendingEnabled(!0);c.setDepthWriteEnabled(!1);this._renderer.render(b);c.setDepthFunction(e.LESS);c.setDepthWriteEnabled(!0);c.setBlendingEnabled(!1);c.setBlendFunctionSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);k&&g.restoreDepthTextureToBuffer();return!0},_setEnableTestImage:function(a){this._renderData.showTest=
- a?1:0;this.needsRender=!0},_adjustRadiusForTesselation:function(a){return a*Math.cos(Math.PI/Math.pow(2,4)/16)},_normalizeRadius:function(a){a=this._adjustRadiusForTesselation(a);return Math.max(u-1E4,Math.min(a,u))},_updateElevation:function(a){0===a.tile.lij[0]&&(a=this._adjustRadiusForTesselation(u+a.tile.elevationBounds[0]),a!==this._lowerElevationBoundRadius&&(this._lowerElevationBoundRadius=a,this._earthRadius=-1,this._updateVisibleElevationBounds()))},_updateVisibleElevationBounds:function(){var a=
- this._adjustRadiusForTesselation(u+this.view.basemapTerrain.getElevationBounds()[0]);return 0>this._earthRadius||a<this._earthRadius?this._updateRadius(a):!1},_updateRadius:function(a){this._earthRadius=a;var b=a*a,c=a/10*10.25,d=c*c,e=1/(c-a),g=e/.25,k=e/.05,f=.3*(c-a)+a,l=1/(c-f),q=this._renderData;x.set4(e,.25,g,4,q.v4AtmosParams1);x.set4(-.99999,.05,k,20,q.v4AtmosParams2);x.set4(-.99999*-.99999,z,f,l,q.v4AtmosParams3);x.set4(a,b,c,d,q.v4Radii);q.fScale=e;q.fLowerAlphaBlendBound=f;q.fScaleOverScaleDepth=
- g;q.fScaleOverScaleDepthBlue=k;this._update();return!0},_update:function(a){if(a=a||this.get("view.state.camera")){q.negate(a.viewForward,this._renderData.v3CameraDir);q.set(a.viewUp,this._renderData.v3CameraUp);q.set(a.viewRight,this._renderData.v3CameraRight);if(this.planar){var b=this.view.renderCoordsHelper;this._renderData.fCameraHeight=b.getAltitude(a.eye)/b.unitInMeters+u}else this._renderData.fCameraHeight=q.length(a.eye);this._renderData.fCameraHeight2=this._renderData.fCameraHeight*this._renderData.fCameraHeight;
- this._renderData.fC=this._renderData.fCameraHeight2-this._renderData.v4Radii[3];this._renderData.fCSur=this._renderData.fCameraHeight2-this._renderData.v4Radii[1];this._renderData.v4SphereComp=x.createFrom(this._renderData.fCameraHeight,this._renderData.fCameraHeight2,this._renderData.fC,this._renderData.fCSur);q.set(a.eye,this._renderData.v3CameraPos);v.set2(Math.tan(a.fovX/2)/(a.width/a.fullWidth),Math.tan(a.fovY/2)/(a.height/a.fullHeight),this._renderData.halfSizeNearPlane);v.set2((a.padding[3]+
- a.width/2)/a.fullWidth-.5,(a.padding[2]+a.height/2)/a.fullHeight-.5,this._renderData.v2CameraCenterOffset);v.set2(a.near,a.far,this._renderData.nearFar);this.needsRender=!0}}});a.isSupported=function(a){return k.supportsDepthTexture(a.rctx)};return a})},"esri/views/3d/webgl-engine/lib/OffscreenRenderingHelper":function(){define("require exports dojo/text!../materials/internal/offscreen.xml ./DefaultVertexAttributeLocations ./glUtil3D ./Util ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/Texture ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){var l={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:0,height:0},p={target:3553,pixelFormat:6408,dataType:32819,samplingMode:9729,wrapMode:33071,width:0,height:0},n=[0,0,0,0],t=[0,0,0,1];return function(){function u(a,b){this._intermediateTexture=this._hudVisibilityTexture=null;this._enabled=!1;this.height=this.width=0;this._programRep=a;this._rctx=b;this.height=this.width=null}u.prototype.enable=function(){if(!this.getEnableState()){var a=
- this._rctx;this._enabled=!0;this.framebuffer=g.createWithAttachments(a,l,{colorTarget:0,depthStencilTarget:a.capabilities.depthTexture?4:3});this.quadVAO=e.createQuadVAO(a)}};u.prototype.disable=function(){this.getEnableState()&&(this._enabled=!1,this.framebuffer.dispose(),this.quadVAO.dispose(!0),this._depthStencilTextureCached=this.quadVAO=this.framebuffer=null)};u.prototype.setEnableState=function(a){a?this.enable():this.disable()};u.prototype.getEnableState=function(){return this._enabled};u.prototype.getColorTexture=
- function(){return this.framebuffer.colorTexture};u.prototype.getDepthTexture=function(){return u.supportsDepthTexture(this._rctx)?this.framebuffer.depthStencilTexture||this._depthStencilTextureCached:null};u.prototype.getHUDVisibilityTexture=function(){return this._hudVisibilityTexture};u.supportsDepthTexture=function(a){return a.capabilities.depthTexture};u.prototype.initializeFrame=function(a){c.assert(this.getEnableState());var b=this._rctx,d=b.gl;a=a.fullViewport;this.width=a[2];this.height=a[3];
- this.framebuffer.resize(this.width,this.height);b.bindFramebuffer(this.framebuffer);b.setClearStencil(0);b.setClearColor(0,0,0,1);b.clear(d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT|d.STENCIL_BUFFER_BIT)};u.prototype.renderSeparateColor=function(a,b,c){void 0===c&&(c=n);var d=this._rctx,e=d.gl;a.resize(this.width,this.height);var g=this.framebuffer.detachColorTexture();this.framebuffer.attachColorTexture(a);d.bindFramebuffer(this.framebuffer);d.setClearColor(c[0],c[1],c[2],Math.max(1E-13,c[3]));d.clear(e.COLOR_BUFFER_BIT);
- b();e.flush();this.framebuffer.detachColorTexture();this.framebuffer.attachColorTexture(g)};u.prototype.renderSeparateAndComposite=function(a,c,d){void 0===c&&(c=n);void 0===d&&(d="none");this._intermediateTexture||(this._intermediateTexture=new b(this._rctx,l));this.renderSeparateColor(this._intermediateTexture,a);this.composite(this._intermediateTexture,this.framebuffer,d)};u.prototype.renderHUDVisibility=function(a){this._hudVisibilityTexture||(this._hudVisibilityTexture=new b(this._rctx,p));this.renderSeparateColor(this._hudVisibilityTexture,
- a,t)};u.prototype.bindFramebuffer=function(){this._rctx.bindFramebuffer(this.framebuffer)};u.prototype.getFramebuffer=function(){return this.framebuffer};u.prototype.detachDepthTextureFromBuffer=function(){this._depthStencilTextureCached=this.framebuffer.depthStencilTexture;this.framebuffer.detachDepthStencilTexture()};u.prototype.restoreDepthTextureToBuffer=function(){this.framebuffer.attachDepthStencilTexture(this._depthStencilTextureCached);this._depthStencilTextureCached=null};u.prototype.composite=
- function(a,b,c){void 0===a&&(a=this.framebuffer.colorTexture);void 0===b&&(b=null);void 0===c&&(c="none");var d=this._rctx,e=this._programRep.get("offscreenProgram");d.bindFramebuffer(b);d.setDepthTestEnabled(!1);d.bindProgram(e);e.setUniform1i("tex",1);d.bindTexture(a,1);switch(c){case "none":d.setBlendingEnabled(!1);break;case "alpha":d.setBlendingEnabled(!0);d.setBlendFunction(770,771);break;case "premultiplied-alpha":d.setBlendingEnabled(!0),d.setBlendFunction(1,771)}d.bindVAO(this.quadVAO);d.drawArrays(5,
- 0,k.vertexCount(this.quadVAO,"geometry"));d.setDepthTestEnabled(!0);d.setBlendingEnabled(!1)};u.loadShaders=function(b,c,e){b._parse(f);b=new d(e,b.vsOffscreenRenderer,b.fsOffscreenRenderer,a.Default3D);c.add("offscreenProgram",b)};return u}()})},"esri/views/3d/environment/SimpleAtmosphere":function(){define("dojo/text!./materials/SimpleAtmosphereMaterial.xml dojo/Deferred ../../../core/watchUtils ../support/ExternalRenderer ../lib/glMatrix ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/Texture ../webgl-engine/lib/Util ../webgl-engine/lib/GLTextureRep ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ./resources/SimpleAtmosphereTexture ../support/earthUtils ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q=n.earthRadius,v=e.vec3d,x=e.vec2d,m=e.mat4d,B=d.VertexAttrConstants,z=(q-1E4)/q,C=(q+3E5)/q,A=-1E4/3E5,D=1-A;return a.createSubclass({declaredClass:"esri.views.3d.environment.SimpleAtmosphere",properties:{view:{},needsRender:{value:!1},slot:{value:l.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={texV:x.create(),silCircleCenter:v.create(),silCircleV1:v.create(),silCircleV2:v.create()};this._textureRep=
- this._texture=null},initialize:function(){this._textureDfd=new h;this.addResolvingPromise(this._textureDfd.promise)},destroy:function(){this._currentViewChangedHandle&&(this._currentViewChangedHandle.remove(),this._currentViewChangedHandle=null);this._textureRep&&(this._texture&&(this._textureRep.release("SimpleAtmosphere"),this._textureRep.getTexture("SimpleAtmosphere").unload()),this._textureRep=null);this._program&&(this._program.dispose(),this._program=null);this._textureDfd&&(this._textureDfd.cancel(),
- this._textureDfd=null)},initializeRenderContext:function(a){this._textureRep=new b({SimpleAtmosphere:new g(p,"SimpleAtmosphere",{wrapClamp:!0})},a.programRep,function(){return this.view.state.camera.viewport}.bind(this),a.rctx);this._texture=this._textureRep.aquire("SimpleAtmosphere",void 0,function(a){this._texture=a.getGLTexture();this._textureDfd.resolve();this._textureDfd=null}.bind(this))},setup:function(a){var b=this._createRibbonGeometryData();this._renderer=new c(b,[{name:"position",count:3,
- type:5126,offset:0,stride:12,normalized:!1}],null,a.rctx);this._currentViewChangedHandle=f.init(this,"view.state.camera",this._update.bind(this),!0);a.shaderSnippets.vsSimpleAtmosphere||a.shaderSnippets._parse(r);this._program=new t(a.rctx,a.shaderSnippets.vsSimpleAtmosphere,a.shaderSnippets.fsSimpleAtmosphere,u.Default3D)},render:function(a){if(a.slot!==this.slot||a.pass!==k.MATERIAL)return!1;var b=this.renderContext.rctx,c=b.gl,d=this._program;b.bindProgram(d);d.setUniform4f("color",1,1,1,1);d.setUniformMatrix4fv("proj",
- a.camera.projectionMatrix);d.setUniformMatrix4fv("view",a.camera.viewMatrix);d.setUniform3fv("silCircleCenter",this._renderData.silCircleCenter);d.setUniform3fv("silCircleV1",this._renderData.silCircleV1);d.setUniform3fv("silCircleV2",this._renderData.silCircleV2);d.setUniform2fv("texV",this._renderData.texV);b.bindTexture(this._texture,0);d.setUniform1i("tex",0);d.setUniform3fv("lightDirection",a.lightingData.direction);b.setDepthTestEnabled(!0);b.setDepthFunction(c.LEQUAL);b.setBlendingEnabled(!0);
- b.setDepthWriteEnabled(!1);this._renderer.render(d);b.setBlendingEnabled(!1);b.setDepthWriteEnabled(!0);b.setDepthFunction(c.LESS);return!0},_update:function(a){var b=v.create(),c=v.create(),e=v.create(),g=this.view.renderCoordsHelper.getAltitude(a.eye);v.scale(a.eye,(q+50)/v.length(a.eye),e);this._computeSilhouetteCircle(e,a.center,a.up,q);v.add(this._renderData.silCircleCenter,this._renderData.silCircleV2,b);v.scale(b,C,c);var e=this._computeScreenRimWidth(e,a.up,b,c),k=0,f=1,l=1;50>g?(k=.001953125,
- f=.1015625):500>g?(l=(g-50)/450,k=.001953125*(1-l)+.001953125*l,f=.1015625*(1-l)+.21875*l):5E3>g?(l=(g-500)/4500,k=.001953125*(1-l)+.001953125*l,f=.21875*(1-l)+.51171875*l):5E4>g&&(l=(g-5E3)/45E3,k=.001953125*(1-l)+.001953125*l,f=.51171875*(1-l)+.4140625*l);g=A+k*D;l=A+e*f*D;50<v.length(a.eye)-q&&(this._computeSilhouetteCircle(a.eye,a.center,a.up,q),v.add(this._renderData.silCircleCenter,this._renderData.silCircleV2,b),v.scale(b,C,c),a=this._computeScreenRimWidth(a.eye,a.up,b,c),a=d.clamp((a-1.5)/
- (e-1.5),0,1),g=A+a*k*D,l=A+d.lerp(1,e*f,a)*D);x.set2(g,l,this._renderData.texV);this.needsRender=!0},_computeSilhouetteCircle:function(a,b,c,d){var e=v.length(a),g=d*Math.sqrt(e*e-d*d)/e,k=this._renderData.silCircleV1,f=this._renderData.silCircleV2;v.scale(a,Math.sqrt(d*d-g*g)/e,this._renderData.silCircleCenter);v.cross(a,b,k);1>v.length2(k)&&v.cross(a,c,k);v.scale(k,g/v.length(k));v.cross(k,a,f);v.scale(f,g/v.length(f));return g},_computeScreenRimWidth:function(a,b,c,e){var g=m.create();m.lookAt(a,
- c,b,g);a=this.view.state.camera;d.project(c,g,a.projectionMatrix,a.viewport);d.project(e,g,a.projectionMatrix,a.viewport);return v.dist(c,e)/a.height},_createRibbonGeometryData:function(){for(var a=new Float32Array(768),b=new Uint32Array(768),c=0;128>c;c++){var d=6*c;a[d+0]=c;a[d+1]=z;a[d+2]=0;a[d+3]=c;a[d+4]=C;a[d+5]=1;var e=2*c,g=127===c?0:e+2;b[d+0]=e;b[d+1]=e+1;b[d+2]=g+1;b[d+3]=g+1;b[d+4]=g;b[d+5]=e}c={};c[B.POSITION]=b;b={};b[B.POSITION]={size:3,data:a};return{indices:c,vertexAttr:b}}})})},
- "esri/views/3d/environment/Stars":function(){define("dojo/text!./materials/StarMaterial.xml require ../../../request ../../../core/watchUtils ../../../core/promiseUtils ../../../core/Error ../../../core/Logger ../lib/glMatrix ../support/ExternalRenderer ../webgl-engine/lib/GeometryRenderer ../webgl-engine/lib/Util ../webgl-engine/materials/internal/MaterialUtil ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations ../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){var x=d.mat4d;d=d.mat3d;var m=l.VertexAttrConstants,B="9bb2ff;9eb5ff;aabfff;bbccff;ccd8ff ;dae2ff;e4e9ff;eeefff;f8f6ff;fff9fb;fff5ef;fff1e5;ffeddb;ffe9d2;ffe6ca;ffe3c3;ffe0bb;ffddb4;ffdaad;ffd6a5;ffd29c;ffcc8f;ffc178;ffa94b;ff7b00".split(";"),z=g.getLogger("esri.views.3d.environment.Stars"),C=d.toMat4(d.createFrom(1,0,0,0,.9174771405229186,.39778850739794974,0,-.39778850739794974,.9174771405229186)),A=d.toMat4(d.createFrom(1,0,0,0,.9174771405229186,-.39778850739794974,
- 0,.39778850739794974,.9174771405229186)),D=null;return b.createSubclass({properties:{view:{},numBinaryFloats:{value:2},numBinaryUInt8:{value:1},bytesPerStar:{value:9},needsRender:{value:!1},slot:{value:t.BACKGROUND,set:function(a){this.needsRender=!0;this._set("slot",a)}}},constructor:function(){this._renderData={model:x.identity()};this.slot=t.BACKGROUND;this._vertexBufferLayout=[{name:"position",count:3,type:5126,offset:0,stride:20,normalized:!1},{name:"color",count:4,type:5121,offset:12,stride:20,
- normalized:!1},{name:"size",count:1,type:5126,offset:16,stride:20,normalized:!1}]},initialize:function(){this._loadDataPromise=this._loadBrightStarCatalogue();this.addResolvingPromise(this._loadDataPromise)},destroy:function(){this._loadDataPromise.isFulfilled()||this._loadDataPromise.cancel("Atmosphere has been removed.");this._dateHandle&&(this._dateHandle.remove(),this._dateHandle=null);this._program&&(this._program.dispose(),this._program=null)},setup:function(b){this._numStars=this._starData.byteLength/
- this.bytesPerStar;var c=new Float32Array(this._starData,0,this._numStars*this.numBinaryFloats),d=new Uint8Array(this._starData,this._numStars*this.numBinaryFloats*4,this._numStars*this.numBinaryUInt8),c=this._createStarGeometryData(c,d);this._renderer=new k(c,this._vertexBufferLayout,this._fillInterleaved,b.rctx);this._renderer.enablePointRendering(!0);this._dateHandle=a.init(this,"view.environment.lighting.date",this._update.bind(this));b.shaderSnippets.vertexShaderStar||b.shaderSnippets._parse(r);
- this._program=new u(b.rctx,b.shaderSnippets.vertexShaderStar,b.shaderSnippets.fragmentShaderStar,q.Default3D)},render:function(a){if(a.slot!==this.slot||a.pass!==n.MATERIAL)return!1;var b=this.renderContext.rctx,c=b.gl,d=this._program;b.bindProgram(d);d.setUniformMatrix4fv("view",a.camera.viewMatrix);d.setUniformMatrix4fv("proj",a.camera.projectionMatrix);d.setUniform4fv("viewport",a.camera.fullViewport);d.setUniformMatrix4fv("model",this._renderData.model);b.setDepthTestEnabled(!0);b.setDepthFunction(c.LEQUAL);
- b.setBlendingEnabled(!0);b.setBlendFunctionSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);b.setDepthWriteEnabled(!1);this._renderer.render(d);b.setBlendingEnabled(!1);b.setDepthWriteEnabled(!0);b.setDepthFunction(c.LESS);return!0},_fillInterleaved:function(a,b,c,d,e,g,k){var f=v.getStride(e);c=f/4;var l=p.fill,q=a.indices[m.POSITION],n=a.vertexAttr[m.POSITION].data;d=k+v.findAttribute(e,"position").offset/4;for(var t=0;t<q.length;++t){var u=3*q[t];l(n,u,g,d,b,3);d+=c}b=a.indices[m.COLOR];
- q=a.vertexAttr[m.COLOR].data;d=k+v.findAttribute(e,"color").offset;n=new Uint8Array(g.buffer);for(t=0;t<b.length;++t)u=4*b[t],l(q,u,n,d,null,4),d+=f;f=a.indices[m.SIZE];a=a.vertexAttr[m.SIZE].data;d=k+v.findAttribute(e,"size").offset/4;for(t=0;t<f.length;++t)g[d]=a[f[t]],d+=c},_computeDayDuration:function(a){var b=new Date(a.getFullYear(),0,1,11,58,56),c=new Date(a.getFullYear()+1,0,1,11,58,55);return(a-b)/(c-b)},_update:function(a){if(a){var b=a.getHours()/12,c=a.getMinutes()/60*(2/24),d=a.getSeconds()/
- 60*(2/1440),b=(b+c+d-.9972222)%2;a=2*this._computeDayDuration(a);c=x.create(A);x.rotateZ(c,-a*Math.PI);x.multiply(C,c,c);x.rotateZ(c,-b*Math.PI);this._renderData.model=c;this.needsRender=!0}},_hexToRGB:function(a){return[parseInt(a.substring(0,2),16),parseInt(a.substring(2,4),16),parseInt(a.substring(4,6),16)]},_unpackUint8Attributes:function(a){return 192<=a?[2.9,a-192]:160<=a?[2.5,a-160]:128<=a?[2,a-128]:96<=a?[1.5,a-96]:64<=a?[1,a-64]:32<=a?[.7,a-32]:[.4,a]},_createStarGeometryData:function(a,
- b){for(var c=new Float32Array(3*this._numStars),d=new Uint8Array(4*this._numStars),e=new Float32Array(this._numStars),g=new Uint32Array(this._numStars),k=0;k<this._numStars;k++){var f=2*k,l=3*k,q=4*k,p=a[f+0],f=a[f+1];c[l+0]=-Math.cos(p)*Math.sin(f);c[l+1]=-Math.sin(p)*Math.sin(f);c[l+2]=-Math.cos(f);l=this._unpackUint8Attributes(b[k]);p=this._hexToRGB(B[l[1]]);d[q+0]=255*p[0];d[q+1]=255*p[1];d[q+2]=255*p[2];d[q+3]=255;e[k]=l[0];g[k]=k}a={};a[m.POSITION]=g;a[m.NORMAL]=g;a[m.UV0]=g;a[m.COLOR]=g;a[m.SIZE]=
- g;g={};g[m.POSITION]={size:3,data:c};g[m.COLOR]={size:4,data:d};g[m.SIZE]={size:1,data:e};return{indices:a,vertexAttr:g}},_verifyStartData:function(a){if(!a)throw new c("stars:no-data-received","Failed to create stars because star catalogue is missing");a=a.byteLength/this.bytesPerStar;if(0!==a%1||5E4<a||5E3>a)throw new c("stars:invalid-data","Failed to create stars because star catalogue data is invalid");},_loadBrightStarCatalogue:function(){return D?(this._starData=D,e.resolve()):f(h.toUrl("./resources/stars.wsv"),
- {responseType:"array-buffer",failOk:!0}).then(function(a){a=a.data;this._verifyStartData(a);this._starData=D=a}.bind(this)).catch(function(a){z.error("loadBrightStarCatalogue",a.message);throw a;})}})})},"esri/views/3d/support/sunUtils":function(){define(["./mathUtils","../lib/glMatrix","../lib/SunCalc"],function(r,h,f){var a=h.vec3d,e=h.mat4d,c=r.lerp,g=e.identity(),d={azimuth:0,altitude:0},b={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,diffuseAtNoon:.65,diffuseAtTwilight:.7},
- global:{altitude:8E5,ambient:.015,diffuse:.75},planarDirection:{localAltitude:1E4,globalAltitude:1E6,globalAngles:{azimuth:Math.PI/3,altitude:Math.PI/3}}},k={ambient:{color:a.create(),intensity:0},diffuse:{color:a.create(),intensity:0,direction:a.create()}},l={settings:b,computeDirection:function(b,c,k,q){q||(q=a.create());var p=e.identity(g);if("global"===k)f.getPosition(b,0,0,d),a.set3(0,0,-1,q),e.rotateX(p,-d.azimuth),e.rotateY(p,-d.altitude);else{var n=l.settings.planarDirection;k=n.globalAngles;
- n=(Math.abs(c.z)-n.localAltitude)/(n.globalAltitude-n.localAltitude);n=r.clamp(n,0,1);1>n?(f.getPosition(b,c.y,c.x,d),d.azimuth=(1-n)*d.azimuth+n*k.azimuth,d.altitude=(1-n)*d.altitude+n*k.altitude):(d.azimuth=k.azimuth,d.altitude=k.altitude);a.set3(0,-1,0,q);e.rotateZ(p,-d.azimuth);e.rotateX(p,-d.altitude)}e.multiplyVec3(p,q);return q},computeShadowsEnabled:function(a,b){return"global"===b?!0:Math.abs(a.z)<l.settings.planarDirection.localAltitude},computeColorAndIntensity:function(d,e){var g,q,n,
- t=e.z;q=l.settings;a.set3(1,1,1,k.ambient.color);k.ambient.intensity=q.global.ambient;a.set3(1,1,1,k.diffuse.color);k.diffuse.intensity=q.global.diffuse;t=(Math.abs(t)-q.local.altitude)/(q.global.altitude-q.local.altitude);t=r.clamp(t,0,1);k.globalFactor=t;e=f.getTimes(d,e.y,e.x);if(1>t){q=d.valueOf();var m,h;e.polarException===f.POLAR_EXCEPTION.MIDNIGHT_SUN?(m=q-36E5*(d.getHours()+48)-6E4*d.getMinutes(),h=m+432E6):e.polarException===f.POLAR_EXCEPTION.POLAR_NIGHT?(m=q-2,h=q-1):(m=e.sunrise.valueOf(),
- h=e.sunset.valueOf());var z=h-m;n=m+z/2;var C=z/4;g=n-C;var C=n+C,A=.06*z,z=m-A/2;m+=A/2;var D=h-A/2,E=h+A/2;h=b.local;var F=[.01,h.ambientAtNight],I=[.8,.8,1],P=[.01,.01,.01],G=[h.diffuseAtTwilight,h.ambientAtTwilight],M=[1,.75,.75],H=[.8,.8,1],J=[.9*h.diffuseAtNoon,h.ambientAtNoon],O=[1,.98,.98],N=[.98,.98,1],S=[h.diffuseAtNoon,h.ambientAtNoon],R=[1,1,1],Y=[1,1,1];h=[0,0];var X=[0,0],A=[0,0];q<z||q>E?(h=F,X=P,A=I):q<m?(A=m-z,h=p(q-z,A,F,G),X=p(q-z,A,P,M),A=p(q-z,A,I,H)):q<g?(A=g-m,h=p(q-m,A,G,J),
- X=p(q-m,A,M,O),A=p(q-m,A,H,N)):q<n?(A=n-g,h=p(q-g,A,J,S),X=p(q-g,A,O,R),A=p(q-g,A,N,Y)):q<C?(A=C-n,h=p(q-n,A,S,J),X=p(q-n,A,R,O),A=p(q-n,A,Y,N)):q<D?(A=D-C,h=p(q-C,A,J,G),X=p(q-C,A,O,M),A=p(q-C,A,N,H)):q<E&&(A=E-D,h=p(q-D,A,G,F),X=p(q-D,A,M,P),A=p(q-D,A,H,I));q=h[0];n=X;g=h[1];a.lerp(A,k.ambient.color,t,k.ambient.color);k.ambient.intensity=c(g,k.ambient.intensity,t);a.lerp(n,k.diffuse.color,t,k.diffuse.color);k.diffuse.intensity=c(q,k.diffuse.intensity,t)}t=d.valueOf();e.polarException===f.POLAR_EXCEPTION.MIDNIGHT_SUN?
- (d=t-36E5*(d.getHours()+48)-6E4*d.getMinutes(),e=d+432E6):e.polarException===f.POLAR_EXCEPTION.POLAR_NIGHT?(d=t-2,e=t-1):(d=e.sunrise.valueOf(),e=e.sunset.valueOf());d=1-r.clamp(Math.abs(t-(d+(e-d)/2))/432E5,0,1);k.noonFactor=d;return k}},p=function(a,b,c,d){for(var e=[],g=0;g<c.length;g++)e[g]=(d[g]-c[g])*a/b+c[g];return e};return l})},"esri/views/3d/lib/SunCalc":function(){define([],function(){function r(a){return new Date(864E5*(a+.5-2440588))}function h(a,b){return u(l(a)*p(m)-n(b)*l(m),p(a))}
- function f(a,b){return t(l(b)*p(m)+p(b)*l(m)*l(a))}function a(a,b,c){return u(l(a),p(a)*l(b)-n(c)*p(b))}function e(a,b,c){return t(l(b)*l(c)+p(b)*p(c)*p(a))}function c(a){return v*(1.9148*l(a)+.02*l(2*a)+3E-4*l(3*a))}function g(a,b){a=v*(357.5291+.98560028*a);var d=c(a);a=a+d+102.9372*v+k;b||(b={dec:0,ra:0});b.dec=f(a,0);b.ra=h(a,0);return b}function d(a,b,c){return 2451545+a+.0053*l(b)-.0069*l(2*c)}function b(a){var b=v*(134.963+13.064993*a),c=v*(93.272+13.22935*a);a=v*(218.316+13.176396*a)+6.289*
- v*l(b);c=5.128*v*l(c);b=385001-20905*p(b);return{ra:h(a,c),dec:f(a,c),dist:b}}var k=Math.PI,l=Math.sin,p=Math.cos,n=Math.tan,t=Math.asin,u=Math.atan2,q=Math.acos,v=k/180,x={dec:0,ra:0},m=23.4397*v,B={POLAR_EXCEPTION:{NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2},getPosition:function(b,c,d,k){d=v*-d;c*=v;var f=b.valueOf()/864E5-.5+2440588-2451545;b=g(f,x);d=v*(280.16+360.9856235*f)-d-b.ra;k||(k={azimuth:0,altitude:0});k.azimuth=a(d,c,b.dec);k.altitude=e(d,c,b.dec);return k}},z=[[-.83,"sunrise","sunset"]];
- B.addTime=function(a,b,c){z.push([a,b,c])};B.getTimes=function(a,b,e){function g(a){var b=t,c=x;a=q((l(a)-l(b)*l(c))/(p(b)*p(c)));return d(9E-4+(a+n)/(2*k)+m,u,h)}var n=v*-e,t=v*b,m=Math.round(a.valueOf()/864E5-.5+2440588-2451545-9E-4-n/(2*k));a=9E-4+(0+n)/(2*k)+m;var u=v*(357.5291+.98560028*a);b=c(u);var h=u+b+102.9372*v+k,x=f(h,0);a=d(a,u,h);b={solarNoon:r(a),nadir:r(a-.5),polarException:B.POLAR_EXCEPTION.NORMAL};var A,C,D,S;e=0;for(A=z.length;e<A;e+=1)C=z[e],D=g(C[0]*v),S=a-(D-a),b[C[1]]=r(S),
- b[C[2]]=r(D);b.polarException=function(a){a=(l(a)-l(t)*l(x))/(p(t)*p(x));return-1>a?B.POLAR_EXCEPTION.MIDNIGHT_SUN:1<a?B.POLAR_EXCEPTION.POLAR_NIGHT:B.POLAR_EXCEPTION.NORMAL}(z[0][0]*v);return b};B.getMoonPosition=function(c,d,g){g=v*-g;d*=v;var k=c.valueOf()/864E5-.5+2440588-2451545;c=b(k);g=v*(280.16+360.9856235*k)-g-c.ra;k=e(g,d,c.dec);k+=.017*v/n(k+10.26*v/(k+5.1*v));return{azimuth:a(g,d,c.dec),altitude:k,distance:c.dist}};B.getMoonFraction=function(a){var c=a.valueOf()/864E5-.5+2440588-2451545;
- a=g(c);c=b(c);a=q(l(a.dec)*l(c.dec)+p(a.dec)*p(c.dec)*p(a.ra-c.ra));a=u(149598E3*l(a),c.dist-149598E3*p(a));return(1+p(a))/2};return B})},"esri/views/3d/webgl-engine/lighting/Lightsources":function(){define(["require","exports","../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});var a=f.vec3d;r=function(){return function(e,c,g){void 0===e&&(e=a.create());void 0===c&&(c=a.createFrom(.57735,.57735,.57735));void 0===g&&(g=!0);this.intensity=e;this.direction=c;this.castShadows=
- g}}();h.MainLight=r;r=function(){return function(e,c){void 0===e&&(e=a.create());void 0===c&&(c=a.createFrom(.57735,.57735,.57735));this.intensity=a.create();this.direction=a.create();this.intensity=e;this.direction=c}}();h.FillLight=r;r=function(){return function(e){void 0===e&&(e=a.create());this.intensity=e}}();h.AmbientLight=r;r=function(){return function(){this.sh={r:[0],g:[0],b:[0]}}}();h.SphericalHarmonicsLight=r})},"esri/views/3d/input/SceneInputManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Handles ../../../core/watchUtils ../../../core/accessorSupport/decorators ./handlers/DoubleClickZoom ./handlers/DragRotate ./handlers/DragZoom ./handlers/KeyPan ./handlers/MouseWheelZoom ./handlers/PinchAndPanNavigation ./handlers/PointerDownCancelAnimation ./handlers/SingleKeyResetHeading ./handlers/SingleKeyResetTilt ./handlers/TwoFingerTilt ../../input/BrowserEventSource ../../input/InputManager ../../input/ViewEvents ../../input/handlers/PreventContextMenu".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C){r=function(e){function h(){var a=null!==e&&e.apply(this,arguments)||this;a._handles=new c;return a}f(h,e);h.prototype.initialize=function(){var a=this;this.viewEvents=new z.ViewEvents(this.view);this._handles.add([g.whenNot(this.view,"ready",function(){return a._disconnect()}),g.when(this.view,"ready",function(){return a._connect()})])};h.prototype.destroy=function(){this._handles&&(this._handles.removeAll(),this._handles=null);this._disconnect()};
- Object.defineProperty(h.prototype,"primaryDragAction",{get:function(){return this._get("primaryDragAction")},set:function(a){"pan"!==a&&"rotate"!==a||a===this._get("primaryDragAction")||(this._set("primaryDragAction",a),this._updateMode())},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"mode",{get:function(){return this._get("mode")},set:function(a){"default"!==a&&"pro"!==a||a===this._get("mode")||(this._set("mode",a),this._updateMode())},enumerable:!0,configurable:!0});h.prototype._disconnect=
- function(){this.viewEvents.disconnect();this._source&&(this._source.destroy(),this._source=null);this._inputManager&&(this._inputManager.destroy(),this._inputManager=null)};h.prototype._connect=function(){var a=this.view;this._source=new m.BrowserEventSource(this.view.surface);var c=new B.InputManager(this._source);this._inputManager=c;c.installHandlers("prevent-context-menu",[new C.PreventContextMenu]);this._modeDragPan=new t.PinchAndPanNavigation(a,"primary");this._modeDragRotate=new k.DragRotate(a,
- "secondary","center");this._modeDragZoom=new l.DragZoom(a,"tertiary");c.installHandlers("navigation",[new u.PointerDownCancelAnimation(a),new b.DoubleClickZoom(a),new p.KeyPan(a,{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j"}),new n.MouseWheelZoom(a),new v.SingleKeyResetTilt(a,"p"),new q.SingleKeyResetHeading(a,"n"),new k.DragRotate(a,"primary","eye",["b"]),new k.DragRotate(a,"secondary","center",["b"]),new t.PinchAndPanNavigation(a,"tertiary",["b"]),this._modeDragRotate,
- this._modeDragZoom,this._modeDragPan,new x.TwoFingerTilt(a)]);this.viewEvents.connect(c);this._updateMode()};h.prototype._updateMode=function(){var a=this.primaryDragAction,a=A.get(this.mode).get(a);this._modeDragPan&&(this._modeDragPan.pointerAction=a.pan);this._modeDragRotate&&(this._modeDragRotate.pointerAction=a.rotate);this._modeDragZoom&&(this._modeDragZoom.pointerAction=a.zoom)};a([d.property()],h.prototype,"view",void 0);a([d.property({value:"pan"})],h.prototype,"primaryDragAction",null);
- a([d.property({value:"default"})],h.prototype,"mode",null);a([d.property({readOnly:!0,aliasOf:"_inputManager.latestPointerType"})],h.prototype,"latestPointerType",void 0);a([d.property()],h.prototype,"_inputManager",void 0);return h=a([d.subclass("esri.views.3d.input.SceneInputManager")],h)}(d.declared(e));var A=new Map;h=new Map;e=new Map;h.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"});h.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"});e.set("pan",{pan:"primary",rotate:"tertiary",
- zoom:"secondary"});e.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"});A.set("default",h);A.set("pro",e);return r})},"esri/views/3d/input/handlers/DoubleClickZoom":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../state/controllers/global/ZoomStepController ../../state/controllers/local/ZoomStepController ../../state/helpers/PickingHelper ../../../input/InputHandler ../../../input/handlers/support".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,
- "__esModule",{value:!0});r=function(b){function g(a,d){var e=b.call(this,!0)||this;e.view=a;e.pickingHelper=new c.PickingHelper(a);e.registerIncoming("double-click",d,function(a){return e.handleDoubleClick(a)});return e}f(g,b);g.prototype.handleDoubleClick=function(b){var c=b.data;if(d.eventMatchesPointerAction(c,"primary")){var g=this.view.state.isGlobal?new a.ZoomStepController(this.view,this.pickingHelper,"animation"):new e.ZoomStepController(this.view,this.pickingHelper,"animation");this.view.state.switchCameraController(g);
- g.zoomStep(Math.log(.5)/Math.log(.6),[c.x,this.view.height-c.y]);b.stopPropagation()}};return g}(g.InputHandler);h.DoubleClickZoom=r})},"esri/views/3d/state/controllers/global/ZoomStepController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../PointToPointAnimationController ../../utils/navigationUtils ../../../webgl-engine/lib/Camera ../../../../animation/easing".split(" "),function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,
- "__esModule",{value:!0});r=function(c){function k(a,b,g){b=c.call(this,a.state,b,"interaction"===g?null:void 0)||this;b.view=a;b.mode=g;b.zoomLocation=e.vec3d.create();b.tmpCamera=new d;b.panAxis=e.vec3d.create();b.tmpViewDir=e.vec3d.create();b.targetOnSphere=e.vec3d.create();b.tmpCenter=e.vec3d.create();b.constraintOptions={selection:7,interactionType:1,interactionFactor:null,interactionStartCamera:new d,interactionDirection:null};b.sphere={center:e.vec3d.create(),radius:0};return b}f(k,c);Object.defineProperty(k.prototype,
- "isInteractive",{get:function(){return"interaction"===this.mode},enumerable:!0,configurable:!0});k.prototype.zoomStep=function(a,b){if(this.active){var c=this.view.state,d=this.constraintOptions.interactionStartCamera;this.animation.finished?d.copyFrom(c.camera):this.animation.cameraAt(1,d);d=!1;0<a&&this.pickingHelper.pickPointInScreen(b,this.zoomLocation)&&(d=!0);this.tmpCamera.copyFrom(c.camera);d?this.pickingHelper.pickRaySegment(this.tmpCamera.eye,this.tmpCamera.center,this.tmpCenter)&&(this.tmpCamera.center=
- this.tmpCenter):this.pickingHelper.pickRaySegment(this.tmpCamera.eye,this.tmpCamera.center,this.zoomLocation)?this.tmpCamera.center=this.zoomLocation:e.vec3d.set(this.tmpCamera.center,this.zoomLocation);this.updateCamera(this.tmpCamera,Math.pow(.6,a),this.zoomLocation,b);this.begin(this.tmpCamera)}};k.prototype.animationSettings=function(){return{apex:null,duration:.6,easing:b.outExpo}};k.prototype.updateCamera=function(b,c,d,k){this.sphere.radius=e.vec3d.length(d);e.vec3d.subtract(b.center,b.eye,
- this.tmpViewDir);var f=e.vec3d.length(this.tmpViewDir),l=f*c;1>=c&&4>l&&(l=4,c=l/f);1E-6>Math.abs(f-l)||(f=e.vec3d.length(b.center),this.sphere.radius!==f&&e.vec3d.scale(b.center,(this.sphere.radius+c*(f-this.sphere.radius))/f),e.vec3d.scale(this.tmpViewDir,-c),e.vec3d.add(b.center,this.tmpViewDir,b.eye),a.applyAll(this.view,b,this.constraintOptions),1E-12<e.vec3d.dist2(d,b.center)&&g.intersectSphereFromScreenPoint(this.sphere,b,k,this.targetOnSphere)&&(c=g.rotationAndAxisFromPoints(d,this.targetOnSphere,
- this.panAxis),g.applyRotation(b,this.sphere.center,this.panAxis,c)),a.applySurfaceCollision(this.view,b))};return k}(c.PointToPointAnimationController);h.ZoomStepController=r})},"esri/views/3d/camera/constraintUtils":function(){define("require exports ./constraintUtils/altitude ./constraintUtils/common ./constraintUtils/distance ./constraintUtils/surfaceCollision ./constraintUtils/tilt ../lib/glMatrix ../../animation/easing ./constraintUtils/tilt ./constraintUtils/altitude ./constraintUtils/distance ./constraintUtils/surfaceCollision".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n){Object.defineProperty(h,"__esModule",{value:!0});h.applyTilt=k.apply;h.tiltError=k.error;h.applyAltitude=l.apply;h.altitudeError=l.error;h.applyDistance=p.apply;h.distanceError=p.error;h.applySurfaceCollision=n.apply;h.applyAll=function(b,d,e,g){void 0===e&&(e=u);void 0===g&&(g=d);var k=!1;g!==d&&g.copyFrom(d);g.markViewDirty();g.computeUp(b.state.mode);for(d=0;d<q;d++){for(var f=0,l=0,p=t;l<p.length;l++){var n=p[l];if(a.hasConstraintType(e.selection,n.type)){var m=
- Math.abs(n.error(b,g,e));n.apply(b,g,e)&&(k=!0,f+=m)}}if(0===f)break}d=a.hasConstraintType(e.selection,8);e=4===e.interactionType?1:0;d&&c.apply(b,g,e)&&(k=!0);k&&g.computeUp(b.state.mode);return k};h.pixelDistanceToInteractionFactor=function(a,c){a="number"===typeof a?a:d.vec2d.dist(a,c);return b.inOutCubic(Math.min(1,a/150))};var t=[{type:1,error:function(a,b,c){return g.error(a,b,c)*b.distance},apply:g.apply},{type:2,error:f.error,apply:f.apply},{type:4,error:e.error,apply:e.apply}],u={selection:15,
- interactionType:0,interactionFactor:0,interactionStartCamera:null,interactionDirection:null},q=5})},"esri/views/3d/camera/constraintUtils/altitude":function(){define("require exports ./common ../../lib/glMatrix ../../support/intersectionUtils ../../support/mathUtils".split(" "),function(r,h,f,a,e,c){function g(a,d,e){void 0===e&&(e=f.defaultApplyOptions);var k;k=a.state.constraints.altitude;k=a.state.isGlobal&&k?2===e.interactionType&&f.hasConstraintType(e.selection,1)?!1:!0:!1;if(!k)return 0;var l=
- a.state.constraints.altitude;k=b;k.min=l.min;k.max=l.max;var p=e.interactionType;if(0!==p){var l=k.min,n=k.max,t=e.interactionStartCamera;e=e.interactionFactor;var p=2===p||1===p,u=g(a,t),t=0===u?0:a.renderCoordsHelper.getAltitude(t.eye);k.min=l;k.max=n;f.adjustRangeForInteraction(u,t,p,e,.05*t,k)}a=a.renderCoordsHelper.getAltitude(d.eye);a=c.clamp(a,k.min,k.max)-a;return 1E-6>=Math.abs(a)?0:a}function d(b,c,d,e){b.renderCoordsHelper.worldUpAtPosition(c.eye,e);a.vec3d.scale(e,d);return e}Object.defineProperty(h,
- "__esModule",{value:!0});h.apply=function(b,t,u,q){void 0===u&&(u=f.defaultApplyOptions);void 0===q&&(q=t);q!==t&&q.copyFrom(t);var n=g(b,t,u);if(0===n)return!1;var h=b.renderCoordsHelper,m=h.getAltitude(t.eye)+n;b=f.interactionDirectionTowardsConstraintMinimization(b,t,u.interactionDirection,d(b,t,c.sign(n),l),k);u=a.vec3d.set(t.viewForward,p);h.intersectManifold(t.eye,b,m,q.eye)||h.setAltitude(m,q.eye);e.closestPointOnRay(t.eye,u,t.center,t.center);q.markViewDirty();return!0};h.error=g;var b={min:0,
- max:0},k=a.vec3d.create(),l=a.vec3d.create(),p=a.vec3d.create()})},"esri/views/3d/camera/constraintUtils/common":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.hasConstraintType=function(a,c){return 0!==(a&c)};h.adjustRangeForInteraction=function(a,c,g,d,b,k){0!==a&&(g?(k.min=Math.min(k.min,c),k.max=Math.max(k.max,c)):null!=d?(k.min-=Math.max(0,(c-k.min)*(1-d)),k.max+=Math.max(0,(c-k.max)*
- (1-d))):b&&(k.min-=Math.max(0,c-k.min-b),k.max+=Math.max(0,c-k.max-b)))};h.defaultApplyOptions={selection:0,interactionType:0,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};h.interactionDirectionTowardsConstraintMinimization=function(e,c,g,d,b){g||(g=c.viewForward);f.vec3d.set(g,b);f.vec3d.scale(b,a.sign(f.vec3d.dot(g,d)));return b}})},"esri/views/3d/support/intersectionUtils":function(){define(["../lib/glMatrix"],function(r){function h(c,d,b,e){e.clip[0]=0;e.clip[1]=b?
- e.len:Number.MAX_VALUE;for(b=0;b<c.length;b++){var g;var k=c[b],f=d;g=e;var t=a.dot(k,g.dir),f=-a.dot(f,k)-k[3];0>f&&0<=t?g=!1:-1E-6<t&&1E-6>t?g=!0:!(0>f||0>t)||0>f&&0>t?(f/=t,0<t?f<g.clip[1]&&(g.clip[1]=f):f>g.clip[0]&&(g.clip[0]=f),g=g.clip[0]<=g.clip[1]):g=!0;if(!g)return!1}return!0}function f(c,d,b,k){c?(b&&k&&(e.len=a.dist(d,b)),a.set(c,e.dir)):k?(e.len=a.dist(d,b),a.scale(a.subtract(b,d,e.dir),1/e.len)):a.normalize(a.subtract(b,d,e.dir));return e}var a=r.vec3d;r=r.vec2d;var e={dir:a.create(),
- len:0,clip:r.create()},c={planeSphere:function(a,c,b){return a[0]*c[0]+a[1]*c[1]+a[2]*c[2]+a[3]<b},frustumSphere:function(a,d,b){for(var e=0;6>e;e++)if(!c.planeSphere(a[e],d,b))return!1;return!0},frustumRay:function(a,c,b,e){b=f(e,c,b,!1);return h(a,c,null,b)},frustumPoint:function(c,d){for(var b=0;6>b;b++){var e=c[b];if(0>-a.dot(d,e)-e[3])return!1}return!0},frustumLineSegment:function(a,c,b,e){e=f(e,c,b,!0);return h(a,c,b,e)},closestPointOnRay:function(c,d,b,e){b=a.dot(d,a.subtract(b,c,e));a.add(c,
- a.scale(d,b,e),e);return e}};return c})},"esri/views/3d/camera/constraintUtils/distance":function(){define(["require","exports","./common","../../lib/glMatrix","../../webgl-engine/lib/Util"],function(r,h,f,a,e){function c(b,d,e){void 0===e&&(e=f.defaultApplyOptions);if(!b.state.isLocal)return 0;var k=b.state.constraints.distance;if(!b.pointsOfInterest.surfaceOrigin.renderLocation||Infinity===k)return 0;g.min=0;g.max=k;var k=g,l=e.interactionType;if(0!==l){var p=k.min,n=k.max,t=e.interactionStartCamera;
- e=e.interactionFactor;var l=1===l||4===l,h=c(b,t),t=0===h?0:a.vec3d.dist(t.eye,b.pointsOfInterest.surfaceOrigin.renderLocation);k.min=p;k.max=n;f.adjustRangeForInteraction(h,t,l,e,.05*t,k)}b=a.vec3d.dist(d.eye,b.pointsOfInterest.surfaceOrigin.renderLocation);b=g.max-b;return-1E-6<=b?0:b}Object.defineProperty(h,"__esModule",{value:!0});h.error=c;h.apply=function(g,n,t,u){void 0===t&&(t=f.defaultApplyOptions);void 0===u&&(u=n);u!==n&&u.copyFrom(n);var q=c(g,n,t);if(0===q)return!1;var p=g.pointsOfInterest.surfaceOrigin,
- q=a.vec3d.dist(n.eye,g.pointsOfInterest.surfaceOrigin.renderLocation)+q,h=a.vec3d.set(n.eye,d);t=f.interactionDirectionTowardsConstraintMinimization(g,n,t.interactionDirection,a.vec3d.direction(g.pointsOfInterest.surfaceOrigin.renderLocation,n.eye,l),k);return e.raySphere(n.eye,t,p.renderLocation,q,u.eye)?(n=a.vec3d.subtract(u.eye,h,b),a.vec3d.add(u.center,n),u.markViewDirty(),n=g.renderCoordsHelper.getAltitude(u.center),g.renderCoordsHelper.intersectManifold(u.eye,u.viewForward,n,u.center),u.markViewDirty(),
- !0):!1};var g={min:0,max:0},d=a.vec3d.create(),b=a.vec3d.create(),k=a.vec3d.create(),l=a.vec3d.create()})},"esri/views/3d/camera/constraintUtils/surfaceCollision":function(){define(["require","exports","../intersectionUtils","../../lib/glMatrix"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.apply=function(c,g,d,b){void 0===d&&(d=0);void 0===b&&(b=g);var k=c.state.constraints;g!==b&&b.copyFrom(g);if(!k.collision.enabled)return!1;var l=f.surfaceElevationBelowEye(c,g);g=c.renderCoordsHelper.getAltitude(g.eye);
- k=k.collision.elevationMargin;if(g-l>=k)return!1;a.vec3d.subtract(b.center,b.eye,e);c.renderCoordsHelper.setAltitude(l+k,b.eye);1===d&&a.vec3d.add(b.eye,e,b.center);b.markViewDirty();return!0};var e=a.vec3d.create()})},"esri/views/3d/camera/intersectionUtils":function(){define("require exports ../../../geometry/Point ../lib/glMatrix ../support/aaBoundingRect ../support/earthUtils ../webgl-engine/lib/Selector".split(" "),function(r,h,f,a,e,c,g){function d(d,e,k,f){void 0===f&&(f=a.vec3d.create());
- var l=b[d.viewingMode];l||(l=new g(d.viewingMode),l.enableBackfacesTerrain=!d.state.isGlobal,l.enableInvisibleTerrain=!0,b[d.viewingMode]=l);d._stage.pickRay(e,k,null,null,null,null,l);if((l=l.getMinResult())&&l.getIntersectionPoint(f))return f;l=a.vec3d.direction(k,e,n);if(!d.renderCoordsHelper.intersectManifold(e,l,0,f))if("global"===d.viewingMode){d=f;var l=a.vec3d.dot(e,e),q=c.earthRadius*c.earthRadius,l=l>q?Math.sqrt(l-q)/3:1;a.vec3d.subtract(k,e,d);a.vec3d.scale(d,l/a.vec3d.length(d),d);a.vec3d.add(d,
- e)}else k!==f&&a.vec3d.set(k,f);return f}Object.defineProperty(h,"__esModule",{value:!0});h.eyeWithinExtent=function(a,b,c,d){return a.renderCoordsHelper.fromRenderCoords(b.eye,k,d)&&e.containsPoint(c,k)};h.surfaceElevationBelowEye=function(a,b){return a.renderCoordsHelper.fromRenderCoords(b.eye,p,a.basemapTerrain.spatialReference)?a.basemapTerrain.getElevation(p)||0:0};h.cameraOnContentAlongViewDirection=function(b,c,e,g){var k=b.state.camera.copy();c&&(k.eye=c);e&&(k.center=e);g&&(k.up=g);d(b,k.eye,
- k.center,l);e=b.state.constraints;g=e.minimumPoiDistance;a.vec3d.dist2(k.eye,l)<g&&(c=e.collision.enabled,a.vec3d.set(k.viewForward,n),a.vec3d.scale(n,g),c?a.vec3d.subtract(l,n,k.eye):a.vec3d.add(k.eye,n,l),b=b.renderCoordsHelper,g=b.getAltitude(k.eye),e=e.collision.elevationMargin,c&&g<e&&(a.vec3d.subtract(l,k.eye,n),b.setAltitude(e,k.eye),a.vec3d.add(k.eye,n,l)));k.center=l;return k};h.contentAlongViewDirection=d;var b={},k=a.vec3d.create(),l=a.vec3d.create(),p=new f,n=a.vec3d.create()})},"esri/views/3d/webgl-engine/lib/Selector":function(){define("require exports dojo/has ./gl-matrix ./Object3D ./PerformanceTimer".split(" "),
- function(r,h,f,a,e,c){var g=a.vec3d.create(),d=a.vec3d.create();r=function(){function c(c,d,e,g,f,l,h,m){void 0===m&&(m=!1);this.dir=a.vec3d.create();this.normalDir=null;this.minResult=new b;this.maxResult=new b;this.transform=a.mat4d.create();this._transformInverse=new k({value:this.transform},a.mat4d.inverse,a.mat4d.create);this._transformInverseTranspose=new k(this._transformInverse,a.mat4d.transpose,a.mat4d.create);this._transformTranspose=new k({value:this.transform},a.mat4d.transpose,a.mat4d.create);
- this._transformInverseRotation=new k({value:this.transform},a.mat4d.toInverseMat3,a.mat3d.create);this.enableTerrain=this.enableHUDSelection=!0;this.enableInvisibleTerrain=!1;this.enableBackfacesTerrain=!0;this.performanceInfo={queryDuration:0,numObjectsTested:0};this.viewingMode=c||"global";this.intersectObject=this.intersectObject.bind(this);this.init(d,e,g,f,l,h,m)}c.prototype.init=function(b,c,d,e,g,k,f){c&&d&&a.vec3d.subtract(d,c,this.dir);this.minResult.init(c,d);this.maxResult.init(c,d);this.numObjectsTested=
- 0;this.point=e;this.camera=g;this.isSelection=f;this.layers=b;this.p0=c;this.p1=d;this.hudResults=[];null==k&&(k=1E-5);this.tolerance=k;if(this.layers)for(b=0;b<this.layers.length;++b)if(c=this.layers[b],d=c.getSpatialQueryAccelerator?c.getSpatialQueryAccelerator():void 0)d.forEachAlongRay(this.p0,this.dir,this.intersectObject);else for(c=c.getObjects(),d=0;d<c.length;++d)this.intersectObject(c[d])};Object.defineProperty(c.prototype,"transformInverse",{get:function(){return this._transformInverse.value},
- enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"transformInverseTranspose",{get:function(){return this._transformInverseTranspose.value},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"transformInverseRotation",{get:function(){return this._transformInverseRotation.value},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"transformTranspose",{get:function(){return this._transformTranspose.value},enumerable:!0,configurable:!0});c.prototype.getDirection=
- function(){this.normalDir||(this.normalDir=a.vec3d.create(),a.vec3d.normalize(this.dir,this.normalDir));return this.normalDir};c.prototype.intersectObject=function(c){var e=this;this.numObjectsTested++;for(var k=c.id,f=c.getGeometryRecords(),l=c.objectTransformation,p,h=0;h<f.length;h++){var m=f[h],B=m.geometry,z=m.materials,C=m.instanceParameters;C.hidden||(p=B.id,a.mat4d.set(l,this.transform),a.mat4d.multiply(this.transform,m.getShaderTransformation()),this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),
- this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate(),a.mat4d.multiplyVec3(this.transformInverse,this.p0,g),a.mat4d.multiplyVec3(this.transformInverse,this.p1,d),z[0].intersect(B,C,this.transform,this,g,d,function(a,d,g,f,l,q){0<=a&&(l?(l=new b,l.init(e.p0,e.p1),l.set(c,k,a,d,f,q,p,g),e.hudResults.push(l)):((null==e.minResult.priority||f>=e.minResult.priority)&&(null==e.minResult.dist||a<e.minResult.dist)&&e.minResult.set(c,k,a,d,f,null,p,g),(null==e.maxResult.priority||
- f>=e.maxResult.priority)&&(null==e.maxResult.dist||a>e.maxResult.dist)&&e.maxResult.set(c,k,a,d,f,null,p,g)))},m.customTransformation))}};c.prototype.getMinResult=function(){return this.minResult};c.prototype.getMaxResult=function(){return this.maxResult};c.prototype.getHudResults=function(){return this.hudResults};c.DEFAULT_TOLERANCE=1E-5;return c}();var b=function(){function b(b,c){this.normal=a.vec3d.create();this.init(b,c)}b.prototype.getIntersectionPoint=function(b){if(null==this.dist)return!1;
- a.vec3d.lerp(this.p0,this.p1,this.dist,b);return!0};b.prototype.set=function(b,c,d,g,k,f,l,m){this.dist=d;a.vec3d.set(g,this.normal);this.targetType=b?b instanceof e?"StageObject":"StagePoint":"None";this.target=b;this.name=c;this.priority=k;this.center=f?a.vec3d.create(f):null;this.geometryId=l;this.triangleNr=m};b.prototype.copyFrom=function(b){this.p0=b.p0;this.p1=b.p1;this.dist=b.dist;this.targetType=b.targetType;this.target=b.target;this.name=b.name;this.priority=b.priority;this.center=b.center?
- a.vec3d.create(b.center):null;this.geometryId=b.geometryId;this.triangleNr=b.triangleNr;this.intersector=b.intersector;a.vec3d.set(b.normal,this.normal)};b.prototype.setIntersector=function(a){this.intersector=a};b.prototype.init=function(a,b){this.dist=void 0;this.targetType="None";this.priority=this.name=this.target=void 0;this.triangleNr=this.geometryId=this.center=null;this.intersector="stage";this.p0=a;this.p1=b};return b}(),k=function(){function a(a,b,c){this.original=a;this.update=b;this.dirty=
- !0;this.transform=c()}a.prototype.invalidate=function(){this.dirty=!0};Object.defineProperty(a.prototype,"value",{get:function(){this.dirty&&(this.update(this.original.value,this.transform),this.dirty=!1);return this.transform},enumerable:!0,configurable:!0});return a}();return r})},"esri/views/3d/webgl-engine/lib/Object3D":function(){define("require exports ./ComponentUtils ./GeometryRecord ./gl-matrix ./HighlightUtils ./IdGen ./ModelContentType ./Util".split(" "),function(r,h,f,a,e,c,g,d,b){var k=
- b.assert,l=e.mat4d,p=e.vec3d,n=l.identity();r=function(){function b(a){void 0===a&&(a={});this._bvObjectSpace=new t;this._bvWorldSpace=new t;this._bvDirty=!0;this._hasVolatileTransformation=!1;this.id=b._idGen.gen(a.idHint);this.name=a.name;this.castShadow=null!=a.castShadow?a.castShadow:!0;this.metadata=a.metadata;this.objectTransformation=l.identity();this._initializeGeometryRecords(a.geometries,a.materials,a.transformations)}b.prototype._initializeGeometryRecords=function(b,c,d){if(Array.isArray(b)){k(c.length===
- b.length,"Object3D: materials don't match geometries");k(d.length===b.length,"Object3D: transformations don't match geometries");this.geometryRecords=Array(b.length);this.geometries=b.slice();for(var e=0;e<b.length;e++)k(Array.isArray(c[e]),"Object3D: materials parameter must be array of array"),this.geometryRecords[e]=new a(b[e],c[e].slice(),l.create(d[e]),{});this._hasVolatileTransformation=!1}else this.geometryRecords=[],this.geometries=[]};Object.defineProperty(b.prototype,"parentLayer",{get:function(){return this._parentLayer},
- set:function(a){k(null==this._parentLayer||null==a,"Object3D can only be added to a single Layer");this._parentLayer=a},enumerable:!0,configurable:!0});b.prototype.getParentLayer=function(){return this.parentLayer};b.prototype.addParentLayer=function(a){this.parentLayer=a};b.prototype.removeParentLayer=function(a){this.parentLayer=null};b.prototype.getNumGeometryRecords=function(){return this.geometryRecords.length};b.prototype.getFirstGeometryIndex=function(a){a=this.geometries.indexOf(a);k(-1<a,
- "Object3D.getFirstGeometryIndex: geometry not found");return a};b.prototype.findGeometryRecords=function(a){for(var b=[],c=0;c<this.geometries.length;c++)this.geometries[c]===a&&b.push(this.geometryRecords[c]);return b};b.prototype.getGeometryRecord=function(a){k(0<=a&&a<this.geometryRecords.length,"Object3d.getGeometryDataByIndex: index out of range");return this.geometryRecords[a]};b.prototype.getGeometryRecords=function(){return this.geometryRecords};b.prototype.addGeometry=function(b,c,d,e,g,
- f){void 0===d&&(d=n);k(Array.isArray(c),"Object3D.addGeometry: materials must be array");this.geometries.push(b);b=new a(b,c.slice(),l.create(d),e||{},g,f);this.geometryRecords.push(b);this._hasVolatileTransformation=this.geometryRecords.some(function(a){return!!a.customTransformation});this._notifyDirty("objGeometryAdded",b);this._invalidateBoundingVolume();return b};b.prototype.hasGeometry=function(a){return-1<this.geometries.indexOf(a)};b.prototype.removeGeometry=function(a){var b=this.geometryRecords.splice(a,
- 1)[0];this._hasVolatileTransformation=this.geometryRecords.some(function(a){return!!a.customTransformation});this.geometries.splice(a,1);this._notifyDirty("objGeometryRemoved",b);this._invalidateBoundingVolume();return b};b.prototype.removeAllGeometries=function(){for(;0<this.getNumGeometryRecords();)this.removeGeometry(0)};b.prototype.geometryVertexAttrsUpdated=function(a){this._notifyDirty("vertexAttrsUpdated",this.geometryRecords[a]);this._invalidateBoundingVolume()};b.prototype.areAllComponentsHidden=
- function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var c=b[a],d=c.instanceParameters.componentVisibilities,c=c.geometry.getData().componentOffsets;if(!f.isAllHidden(d,c))return!1}return!0};b.prototype.areAllComponentsVisible=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var c=b[a],d=c.instanceParameters.componentVisibilities,c=c.geometry.getData().componentOffsets;if(!f.isAllVisible(d,c))return!1}return!0};b.prototype.hasComponents=function(){for(var a=!1,b=0;b<this.geometries.length&&
- !(a=this.geometries[b].getData(),a=f.hasComponents(a.componentOffsets));b++);return a};b.prototype.setComponentVisibility=function(a,b,c){var d=a.instanceParameters.componentVisibilities,e=a.geometry.getData().componentOffsets;b=f.updateVisibility(d,e,b,c);a.instanceParameters.componentVisibilities=b;this._notifyDirty("visibilityChanged",a)};b.prototype.setHidden=function(a,b){a.instanceParameters.hidden=!!b;this._notifyDirty("visibilityChanged",a)};b.prototype.isHidden=function(a){return!!a.instanceParameters.hidden};
- b.prototype.getComponentVisibility=function(a,b){return f.getVisibility(a.instanceParameters.componentVisibilities,b)};b.prototype.hideAllComponents=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var c=b[a],d=f.hideAllComponents(c.instanceParameters.componentVisibilities);c.instanceParameters.componentVisibilities=d}this._notifyDirty("visibilityChanged")};b.prototype.unhideAllComponents=function(){for(var a=0,b=this.geometryRecords;a<b.length;a++){var c=b[a],d=f.unhideAllComponents(c.instanceParameters.componentVisibilities);
- c.instanceParameters.componentVisibilities=d}this._notifyDirty("visibilityChanged")};b.prototype._setComponentHighlight=function(a,b,c,d){b=f.addHighlight(a.instanceParameters.componentHighlights,b,c,d);a.instanceParameters.componentHighlights=b};b.prototype.setComponentHighlight=function(a,b,d){var e=c.generateHighlightId();this._setComponentHighlight(a,b,d,e);this._notifyDirty("componentHighlightChanged");return e};b.prototype.highlightAllComponents=function(a){for(var b=c.generateHighlightId(),
- d=0,e=this.geometryRecords;d<e.length;d++)this._setComponentHighlight(e[d],null,a,b);this._notifyDirty("componentHighlightChanged");return b};b.prototype.removeHighlights=function(a){for(var b=0,c=this.geometryRecords;b<c.length;b++){var d=c[b].instanceParameters,e=f.removeHighlight(d.componentHighlights,a);d.componentHighlights=e}this._notifyDirty("componentHighlightChanged")};b.prototype.getComponentFromTriangleNr=function(a,b){k(0<=a&&a<this.geometryRecords.length,"Object3d.getComponentFromTriangleNr: index out of range");
- a=this.geometryRecords[a].geometry.getData().componentOffsets;return f.componentFind(a,3*b)};b.prototype.setGeometryTransformation=function(b,c){k(0<=b&&b<this.geometryRecords.length,"Object3d.setGeometryTransformation: index out of range");var d=this.geometryRecords[b];c=new a(d.geometry,d.materials,l.create(c),d.instanceParameters);this.geometryRecords[b]=c;this._notifyDirty("objGeometryReplaced",[d,c]);this._invalidateBoundingVolume()};b.prototype.getObjectTransformation=function(){return l.create(this.objectTransformation)};
- b.prototype.setObjectTransformation=function(a){l.set(a,this.objectTransformation);this._invalidateBoundingVolume();this._notifyDirty("objTransformation")};b.prototype.getCombinedStaticTransformation=function(a,b){b=b||l.create();l.multiply(this.objectTransformation,a.getStaticTransformation(),b);return b};b.prototype.getCombinedShaderTransformation=function(a,b){b=b||l.create();l.multiply(this.objectTransformation,a.getShaderTransformation(),b);return b};b.prototype.hasVolativeTransformation=function(){return this._hasVolatileTransformation};
- b.prototype.getCastShadow=function(){return this.castShadow};b.prototype.setCastShadow=function(a){this.castShadow=a};b.prototype.getMetadata=function(){return this.metadata};b.prototype.getName=function(){return this.name};b.prototype.getBBMin=function(a){this._validateBoundingVolume();return a?this._bvObjectSpace.bbMin:this._bvWorldSpace.bbMin};b.prototype.getBBMax=function(a){this._validateBoundingVolume();return a?this._bvObjectSpace.bbMax:this._bvWorldSpace.bbMax};b.prototype.getCenter=function(a){this._validateBoundingVolume();
- return a?this._bvObjectSpace.center:this._bvWorldSpace.center};b.prototype.getBSRadius=function(a){this._validateBoundingVolume();return a?this._bvObjectSpace.bsRadius:this._bvWorldSpace.bsRadius};b.prototype._validateBoundingVolume=function(){if(this._bvDirty||this._hasVolatileTransformation){this._bvObjectSpace.init();this._bvWorldSpace.init();for(var a=0;a<this.geometryRecords.length;++a){var b=this.geometries[a],c=this.geometryRecords[a],b=b.getBoundingInfo();this._calculateTransformedBoundingVolume(b,
- this._bvObjectSpace,c.getShaderTransformation());this._calculateTransformedBoundingVolume(b,this._bvWorldSpace,this.getCombinedShaderTransformation(c))}p.lerp(this._bvObjectSpace.bbMin,this._bvObjectSpace.bbMax,.5,this._bvObjectSpace.center);p.lerp(this._bvWorldSpace.bbMin,this._bvWorldSpace.bbMax,.5,this._bvWorldSpace.center);for(var c=p.create(),d=p.create(),e=this._getScaleFactor(this.objectTransformation),a=0;a<this.geometryRecords.length;++a){var b=this.geometries[a],g=this.geometryRecords[a].getShaderTransformation(),
- k=this._getScaleFactor(g),b=b.getBoundingInfo();l.multiplyVec3(g,b.getCenter(),c);g=p.dist(c,this._bvObjectSpace.center);b=b.getBSRadius()*k;this._bvObjectSpace.bsRadius=Math.max(this._bvObjectSpace.bsRadius,g+b);l.multiplyVec3(this.objectTransformation,c,d);k=p.dist(d,this._bvWorldSpace.center);this._bvWorldSpace.bsRadius=Math.max(this._bvWorldSpace.bsRadius,k+b*e)}this._bvDirty=!1}};b.prototype._calculateTransformedBoundingVolume=function(a,b,c){var d=a.getBBMin();a=a.getBBMax();for(var e=p.create(),
- g=p.create(),k=-1;3>k;++k){p.set(d,e);p.set(a,g);-1<k&&(e[k]=a[k],g[k]=d[k]);l.multiplyVec3(c,e);l.multiplyVec3(c,g);for(var f=0;3>f;++f)b.bbMin[f]=Math.min(b.bbMin[f],e[f],g[f]),b.bbMax[f]=Math.max(b.bbMax[f],e[f],g[f])}};b.prototype._getScaleFactor=function(a){return Math.max(Math.max(Math.sqrt(a[0]*a[0]+a[4]*a[4]+a[8]*a[8]),Math.sqrt(a[1]*a[1]+a[5]*a[5]+a[9]*a[9])),Math.sqrt(a[2]*a[2]+a[6]*a[6]+a[10]*a[10]))};b.prototype._invalidateBoundingVolume=function(){this._bvDirty=!0;this._parentLayer&&
- this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace)};b.prototype._notifyDirty=function(a,b,c,e){this._parentLayer&&(c=c||d.OBJECT,this._parentLayer.notifyDirty(a,b,c,e||this))};b._idGen=new g;return b}();var t=function(){function a(){this.bbMin=p.create();this.bbMax=p.create();this.center=p.create();this.bsRadius=0}a.prototype.init=function(){p.set3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,this.bbMin);p.set3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,this.bbMax);
- p.set3(0,0,0,this.center);this.bsRadius=0};a.prototype.getCenter=function(){return this.center};a.prototype.getBSRadius=function(){return this.bsRadius};return a}();return r})},"esri/views/3d/webgl-engine/lib/GeometryRecord":function(){define(["require","exports","./IdGen"],function(r,h,f){return function(){function a(e,c,g,d,b,k){this.id=a._idGen.gen(e.id);this.geometry=e;this.materials=c;this.transformation=g;this.instanceParameters=d;this.origin=b;this.customTransformation=k}a.prototype.getStaticTransformation=
- function(){return this.transformation};a.prototype.getShaderTransformation=function(){return this.customTransformation?this.customTransformation(this.transformation):this.transformation};a._idGen=new f;return a}()})},"esri/views/3d/webgl-engine/lib/HighlightUtils":function(){define(["require","exports","./IdGen"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});var a=new f;h.generateHighlightId=function(){return a.gen("highlight")}})},"esri/views/3d/webgl-engine/lib/ModelContentType":function(){define(["require",
- "exports"],function(r,h){return function(){function f(){}f.LAYER="layers";f.OBJECT="objects";f.GEOMETRY="geometries";f.MATERIAL="materials";f.TEXTURE="textures";return f}()})},"esri/views/3d/webgl-engine/lib/PerformanceTimer":function(){define(["require","exports","./Performance"],function(r,h,f){return function(){function a(a){this._filterSampleIndex=0;this._lastTime=NaN;this._numMeasurements=this._totalTime=0;this._filterSamples=Array(a);this.reset();this._filterSize=a}a.prototype.reset=function(){for(var a=
- this._filterSampleIndex=0;a<this._filterSize;a++)this._filterSamples[a]=NaN};a.prototype.start=function(){this._tsStart=f.now()};a.prototype.stop=function(){this._lastTime=f.now()-this._tsStart;this._totalTime+=this._lastTime;this._numMeasurements++;this._filterSize&&(this._filterSamples[this._filterSampleIndex]=this._lastTime,this._filterSampleIndex=(this._filterSampleIndex+1)%this._filterSize);return this._lastTime};a.prototype.getLast=function(){return this._lastTime};a.prototype.getLastFiltered=
- function(){for(var a=0,c=0;c<this._filterSamples.length;c++)a+=this._filterSamples[c];return a/this._filterSamples.length};a.prototype.getAverage=function(){return this._totalTime/this._numMeasurements};a.prototype.getTotal=function(){return this._totalTime};a.prototype.getNumMeasurements=function(){return this._numMeasurements};return a}()})},"esri/views/3d/webgl-engine/lib/Performance":function(){define(["require","exports","../../../../core/now"],function(r,h,f){return{now:f}})},"esri/views/3d/camera/constraintUtils/tilt":function(){define("require exports ./common ../../lib/glMatrix ../../state/utils/viewUtils ../../support/earthUtils ../../support/mathUtils".split(" "),
- function(r,h,f,a,e,c,g){function d(a,c,k,l){void 0===k&&(k=f.defaultApplyOptions);void 0===l&&(l=f.defaultApplyOptions);if(3===k.interactionType||!a.state.constraints.tilt)return 0;var q=e.viewAngle(a.renderCoordsHelper,c.center,c.eye);c=a.state.constraints.tilt(c.distance,n);if(0!==k.interactionType){var t=k.interactionStartCamera,u=k.interactionFactor,v=c.min,h=c.max,A=d(a,t,f.defaultApplyOptions,k),D=0===A?0:e.viewAngle(a.renderCoordsHelper,t.center,t.eye);c.min=v;c.max=h;2===k.interactionType?
- (f.hasConstraintType(k.selection,2)&&b(a,t,c),f.adjustRangeForInteraction(A,D,!0,u,p,c)):f.adjustRangeForInteraction(A,D,!1,u,p,c)}2===l.interactionType&&f.hasConstraintType(l.selection,2)&&b(a,l.interactionStartCamera,c);a=g.clamp(q,c.min,c.max);q-=a;return 1E-6>=Math.abs(q)?0:q}function b(b,d,e){if(!b.state.isLocal){var k=b.state.constraints;if(k.altitude){b=a.vec3d.length2(d.center);var f=Math.sqrt(b);d=d.distance;var l=k.altitude.min+c.earthRadius,k=k.altitude.max+c.earthRadius,l=(l*l-d*d-b)/
- (-2*f*d);e.min=Math.max(e.min,Math.min(Math.PI-g.acos((k*k-d*d-b)/(-2*f*d)),e.max));e.max=Math.min(e.max,Math.PI-g.acos(l))}}}Object.defineProperty(h,"__esModule",{value:!0});h.apply=function(b,c,e,g){void 0===e&&(e=f.defaultApplyOptions);void 0===g&&(g=c);c!==g&&g.copyFrom(c);b=d(b,c,e);if(0===b)return!1;a.mat4d.identity(l);a.mat4d.rotate(l,-b,c.viewRight);a.vec3d.subtract(c.center,c.eye,k);a.mat4d.multiplyVec3(l,k);a.vec3d.subtract(c.center,k,g.eye);a.mat4d.multiplyVec3(l,g.up);g.markViewDirty();
- return!0};h.error=d;var k=a.vec3d.create(),l=a.mat4d.create(),p=g.deg2rad(5),n={min:0,max:0}})},"esri/views/3d/state/utils/viewUtils":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.viewAngle=function(g,d,b){g.worldUpAtPosition(d,e);f.vec3d.subtract(b,d,c);g=f.vec3d.length(c);return 0===g?0:a.acos(f.vec3d.dot(c,e)/g)};var e=f.vec3d.create(),c=f.vec3d.create()})},"esri/views/animation/easing":function(){define(["require",
- "exports"],function(r,h){function f(a){return a}function a(a){var c=2*(a-Math.sqrt((a-1)*a)),d=c/2/a;return function(b){return b<d?a*b*b:c*b-c+1}}function e(a,e){return function(c){return c<e?e*a(c/e):1-a((1-c)/(1-e))*(1-e)}}Object.defineProperty(h,"__esModule",{value:!0});h.linear=f;h.inQuad=function(a){return a*a};h.outQuad=function(a){return 1-h.inQuad(1-a)};h.inOutQuad=function(a){return.5>a?h.inQuad(2*a)/2:(h.outQuad(2*(a-.5))+1)/2};h.inCubic=function(a){return a*a*a};h.outCubic=function(a){return 1-
- h.inCubic(1-a)};h.inOutCubic=function(a){return.5>a?h.inCubic(2*a)/2:(h.outCubic(2*(a-.5))+1)/2};h.inQuart=function(a){return a*a*a*a};h.outQuart=function(a){return 1-h.inQuart(1-a)};h.inOutQuart=function(a){return.5>a?h.inQuart(2*a)/2:(h.outQuart(2*(a-.5))+1)/2};h.inQuint=function(a){return a*a*a*a*a};h.outQuint=function(a){return 1-h.inQuint(1-a)};h.inOutQuint=function(a){return.5>a?h.inQuint(2*a)/2:(h.outQuint(2*(a-.5))+1)/2};h.inSine=function(a){return-Math.cos(a*Math.PI/2)+1};h.outSine=function(a){return 1-
- h.inSine(1-a)};h.inOutSine=function(a){return.5>a?h.inSine(2*a)/2:(h.outSine(2*(a-.5))+1)/2};h.inExpo=function(a){return Math.pow(2,10*(a-1))};h.outExpo=function(a){return 1-h.inExpo(1-a)};h.inOutExpo=function(a){return.5>a?h.inExpo(2*a)/2:(h.outExpo(2*(a-.5))+1)/2};h.inCirc=function(a){return-(Math.sqrt(1-a*a)-1)};h.outCirc=function(a){return 1-h.inCirc(1-a)};h.inOutCirc=function(a){return.5>a?h.inCirc(2*a)/2:(h.outCirc(2*(a-.5))+1)/2};h.inCoastQuad=e(a(1),1);h.outCoastQuad=e(a(1),0);h.inOutCoastQuad=
- e(a(1),.5);h.inCoastCubic=e(a(2),1);h.outCoastCubic=e(a(2),0);h.inOutCoastCubic=e(a(2),.5);h.inCoastQuart=e(a(3),1);h.outCoastQuart=e(a(3),0);h.inOutCoastQuart=e(a(3),.5);h.inCoastQuint=e(a(4),1);h.outCoastQuint=e(a(4),0);h.inOutCoastQuint=e(a(4),.5);h.named={linear:f,"in-quad":h.inQuad,"out-quad":h.outQuad,"in-out-quad":h.inOutQuad,"in-cubic":h.inCubic,"out-cubic":h.outCubic,"in-out-cubic":h.inOutCubic,"in-quart":h.inQuart,"out-quart":h.outQuart,"in-out-quart":h.inOutQuart,"in-quint":h.inQuint,"out-quint":h.outQuint,
- "in-out-quint":h.inOutQuint,"in-sine":h.inSine,"out-sine":h.outSine,"in-out-sine":h.inOutSine,"in-expo":h.inExpo,"out-expo":h.outExpo,"in-out-expo":h.inOutExpo,"in-circ":h.inCirc,"out-circ":h.outCirc,"in-out-circ":h.inOutCirc}})},"esri/views/3d/state/controllers/PointToPointAnimationController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../animation/pointToPoint/Animation ../../lib/glMatrix ./AnimationController ../../webgl-engine/lib/Camera".split(" "),function(r,
- h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(b,d,e){e=c.call(this,e)||this;e.viewState=b;e.pickingHelper=d;e.hasTarget=!1;e.animation=new a.default(e.viewState.mode);return e}f(e,c);e.prototype.begin=function(a,c){this.hasTarget=!0;c=this.animationSettings(c);d.copyFrom(this.viewState.camera);this.pickingHelper.pickRaySegment(d.eye,d.center,b)&&(d.center=b);this.animation.update(d,a,c);this.animation.finished&&this.finish()};e.prototype.finish=function(){this.animation.currentTime=
- this.animation.time;c.prototype.finish.call(this)};Object.defineProperty(e.prototype,"steppingFinished",{get:function(){return this.hasTarget&&this.animation.finished},enumerable:!0,configurable:!0});e.prototype.stepController=function(a,b){c.prototype.stepController.call(this,a,b);this.hasTarget&&this.animation.step(a,b)};e.prototype.onControllerEnd=function(a){this.hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,a),this.animation.currentTime=this.animation.time);
- c.prototype.onControllerEnd.call(this,a)};e.prototype.animationSettings=function(a){void 0===a&&(a={});return{apex:{maximumDistance:this.viewState.constraints.clampAltitude(Infinity)/6,ascensionFactor:void 0,descensionFactor:void 0},speedFactor:a.speedFactor,duration:a.duration,maxDuration:a.maxDuration,easing:a.easing}};return e}(c.AnimationController);h.PointToPointAnimationController=r;var d=new g,b=e.vec3d.create()})},"esri/views/3d/animation/pointToPoint/Animation":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Camera ../../lib/glMatrix ../../webgl-engine/lib/Camera ../../../animation/pointToPoint/Animation".split(" "),
- function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});var d=e.vec3d,b=d.create();r=function(){function e(b){this.currentTime=0;this.animation=new g.Animation(function(){return new a.default(b)});this._current=new a.default(b)}Object.defineProperty(e.prototype,"finished",{get:function(){return this.currentTime>=this.animation.time},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"time",{get:function(){return this.animation.time},enumerable:!0,configurable:!0});
- e.prototype.update=function(a,c,e){var g=this.animation.definition.source,k=this.animation.definition.target,f=d.subtract(c.center,a.center,b),l=d.length(f);1E-5<=l?(f[0]/=l,f[1]/=l,f[2]/=l):(f[0]=0,f[1]=1,f[0]=0);d.set(f,g.lookAtDirection);d.set(f,k.lookAtDirection);g.copyFromRenderCamera(a);k.copyFromRenderCamera(c);this._current.copyFrom(g);this.animation.update(g,k,e);this.currentTime=0;a.almostEquals(c,5E-4,!0)&&(this.currentTime=this.animation.time)};e.prototype.cameraAt=function(a,b){a=this.animation.cameraAt(a,
- this._current);b||(b=new c);a.copyToRenderCamera(b);return b};e.prototype.step=function(a,b){this.finished||(this.currentTime+=a,this.currentTime>=this.time&&(this.currentTime=this.time));return this.cameraAt(this.currentTime/this.time,b)};return e}();h.Animation=r;h.default=r})},"esri/views/3d/animation/pointToPoint/Camera":function(){define(["require","exports","../../lib/glMatrix","../../support/mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=a.angle,c=a.lerp,
- g=a.slerp,d=f.vec3d,b=f.mat3d,k=d.create(),l=d.create(),p=d.create(),n=d.create(),t=d.create(),u=d.create(),q=d.createFrom(0,0,1),v=d.createFrom(0,1,0),x=d.createFrom(1,0,0),m=b.create();r=function(){function a(a){void 0===a&&(a="global");this.viewingMode=a;this.center=d.create();this.distance=this.yaw=this.pitch=0;this.lookAtDirection=d.create(v)}a.prototype.pixelsPerPanAtZoom=function(a){return this.size/2/(this._zoomToPanScale*a)};a.prototype.zoomAtPixelsPerPan=function(a){return this.size/2/(this._zoomToPanScale*
- a)};a.prototype.pixelsPerRotateAtZoom=function(a){return this.size/2/Math.max(Math.cos(Math.abs(this.pitch)),.5)};a.prototype.compareTo=function(a,b){b||(b={pan:0,rotate:0,sourceZoom:0,targetZoom:0});if("global"===this.viewingMode){var c=d.length(this.center),g=d.length(a.center),c=(c+g)/2;b.pan=e(this.center,a.center)*c}else b.pan=d.dist(this.center,a.center);c=Math.abs(a.yaw-this.yaw);c>=Math.PI&&(c=2*Math.PI-c);b.rotate=Math.max(c,Math.abs(a.pitch-this.pitch));b.sourceZoom=this.distance;b.targetZoom=
- a.distance;return b};a.prototype.interpolate=function(a,b,e){"global"===this.viewingMode?g(a.center,b.center,e.pan,this.center):d.lerp(a.center,b.center,e.pan,this.center);this.distance=c(a.distance,b.distance,e.zoom);this.pitch=c(a.pitch,b.pitch,e.rotate);a=a.yaw;b=b.yaw;Math.abs(b-a)>=Math.PI&&(a+=2*(a<b?1:-1)*Math.PI);this.yaw=c(a,b,e.rotate)};a.prototype.copyFrom=function(a){d.set(a.center,this.center);this.pitch=a.pitch;this.yaw=a.yaw;this.distance=a.distance;d.set(a.lookAtDirection,this.lookAtDirection);
- this.size=a.size;this.copyFromCommon(a);this.viewingMode=a.viewingMode};a.prototype.copyFromRenderCamera=function(a){var c=this._lookAtOrientation(a.center,m);d.set(a.center,this.center);b.multiplyVec3(c,d.subtract(a.center,a.eye,n));b.multiplyVec3(c,a.up,t);this.distance=d.length(n);n[0]/=this.distance;n[1]/=this.distance;n[2]/=this.distance;this.pitch=this._eyeUpToPitch(n,t);this.yaw=this._eyeUpToYaw(n,t);this.size=Math.sqrt(a.width*a.width+a.height*a.height);this.copyFromCommon(a)};a.prototype.copyFromCommon=
- function(a){this.fov=a.fov;this._zoomToPanScale=Math.atan(.5*this.fov)};a.prototype.copyToRenderCamera=function(a){var c=this._lookAtOrientation(this.center,m);b.transpose(c);this._axisAngleVec3(x,this.pitch-Math.PI/2,v,n);this._axisAngleVec3(q,this.yaw,n);this._axisAngleVec3(x,this.pitch-Math.PI/2,q,t);this._axisAngleVec3(q,this.yaw,t);d.scale(n,this.distance);b.multiplyVec3(c,n);b.multiplyVec3(c,t);a.center=this.center;a.eye=d.subtract(this.center,n,n);a.up=t};a.prototype._axisAngleVec3=function(a,
- b,c,e){void 0===e&&(e=c);var g=Math.cos(b);b=Math.sin(b);d.scale(c,g,k);d.scale(d.cross(a,c,l),b);d.scale(a,(1-g)*d.dot(a,c),p);return d.add(d.add(k,l,e),p,e)};a.prototype._lookAtOrientation=function(a,c){this._upAtLookAt(a,p);d.normalize(d.cross(this.lookAtDirection,p,k));0===k[0]&&0===k[1]&&0===k[2]&&d.set(x,k);d.normalize(d.cross(p,k,l));c||(c=b.create());c[0]=k[0];c[1]=l[0];c[2]=p[0];c[3]=k[1];c[4]=l[1];c[5]=p[1];c[6]=k[2];c[7]=l[2];c[8]=p[2];return c};a.prototype._upAtLookAt=function(a,b){return"local"===
- this.viewingMode?d.set(q,b):d.normalize(a,b)};a.prototype._eyeUpToPitch=function(a,b){return Math.PI-e(q,a)};a.prototype._eyeUpToYaw=function(a,b){.5>Math.abs(b[2])?(d.set(b,u),0<a[2]&&d.scale(u,-1)):d.set(a,u);return e(x,d.normalize(d.cross(u,q,l)),q)};return a}();h.default=r})},"esri/views/3d/webgl-engine/lib/Camera":function(){define(["require","exports","./gl-matrix","./Util"],function(r,h,f,a){function e(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];a=b[3]-a[3];return c*c+d*d+e*e+a*a}function c(a,
- b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]}function g(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]}var d=f.vec3d,b=f.vec4d,k=f.mat4d;r=function(){function f(a,c,e){this._viewUp=d.create();this._viewForward=d.create();this._viewRight=d.create();this._viewport=b.create();this._padding=b.create();this._fov=55/180*Math.PI;this._near=0;this._far=1E3;this._viewDirty=!0;this._viewMatrix=k.create();this._projectionDirty=!0;this._projectionMatrix=k.create();this._viewProjectionDirty=
- !0;this._viewProjectionMatrix=k.create();this._viewInverseTransposeMatrixDirty=!0;this._viewInverseTransposeMatrix=k.create();this._frustumPlanesDirty=!0;this._frustumPlanes=[b.create(),b.create(),b.create(),b.create(),b.create(),b.create()];this._fullViewport=null;this.aboveGround=!0;this._eye=d.create(a);this._center=d.create(c);this._up=void 0!==e?d.create(e):d.create([0,0,1]);this._padding=b.create()}Object.defineProperty(f.prototype,"eye",{get:function(){return this._eye},set:function(a){this._compareAndSetView(a,
- this._eye)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"center",{get:function(){return this._center},set:function(a){this._compareAndSetView(a,this._center)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"up",{get:function(){return this._up},set:function(a){this._compareAndSetView(a,this._up)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"viewMatrix",{get:function(){this._ensureViewClean();return this._viewMatrix},set:function(a){k.set(a,
- this._viewMatrix);this._viewDirty=!1;this._frustumPlanesDirty=this._viewProjectionDirty=this._viewInverseTransposeMatrixDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"viewForward",{get:function(){this._ensureViewClean();return this._viewForward},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"viewUp",{get:function(){this._ensureViewClean();return this._viewUp},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"viewRight",{get:function(){this._ensureViewClean();
- return this._viewRight},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"near",{get:function(){return this._near},set:function(a){this._near!==a&&(this._near=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"far",{get:function(){return this._far},set:function(a){this._far!==a&&(this._far=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});
- Object.defineProperty(f.prototype,"viewport",{get:function(){return this._viewport},set:function(a){this.x=a[0];this.y=a[1];this.width=a[2];this.height=a[3]},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"x",{get:function(){return this._viewport[0]},set:function(a){a+=this._padding[3];this._viewport[0]!==a&&(this._viewport[0]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"y",{get:function(){return this._viewport[1]},
- set:function(a){a+=this._padding[2];this._viewport[1]!==a&&(this._viewport[1]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"width",{get:function(){return this._viewport[2]},set:function(a){this._viewport[2]!==a&&(this._viewport[2]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"height",{get:function(){return this._viewport[3]},
- set:function(a){this._viewport[3]!==a&&(this._viewport[3]=a,this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"fullWidth",{get:function(){return this._viewport[2]+this._padding[1]+this._padding[3]},set:function(a){this.width=a-(this._padding[1]+this._padding[3])},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"fullHeight",{get:function(){return this._viewport[3]+this._padding[0]+this._padding[2]},
- set:function(a){this.height=a-(this._padding[0]+this._padding[2])},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"fullViewport",{get:function(){this._fullViewport||(this._fullViewport=b.create());this._fullViewport[0]=this._viewport[0]-this._padding[3];this._fullViewport[1]=this._viewport[1]-this._padding[2];this._fullViewport[2]=this.fullWidth;this._fullViewport[3]=this.fullHeight;return this._fullViewport},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"aspect",
- {get:function(){return this.width/this.height},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"padding",{get:function(){return this._padding},set:function(a){if(this._padding[0]!==a[0]||this._padding[1]!==a[1]||this._padding[2]!==a[2]||this._padding[3]!==a[3])this._viewport[0]+=a[3]-this._padding[3],this._viewport[1]+=a[2]-this._padding[2],this._viewport[2]-=a[1]+a[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=a[0]+a[2]-(this._padding[0]+this._padding[2]),b.set(a,this._padding),
- this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"viewProjectionMatrix",{get:function(){this._viewProjectionDirty&&(k.multiply(this.projectionMatrix,this.viewMatrix,this._viewProjectionMatrix),this._viewProjectionDirty=!1);return this._viewProjectionMatrix},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"projectionMatrix",{get:function(){if(this._projectionDirty){var a=this.width,b=this.height,
- c=this.near*Math.tan(this.fovY/2),d=c*this.aspect;k.frustum(-d*(1+2*this._padding[3]/a),d*(1+2*this._padding[1]/a),-c*(1+2*this._padding[2]/b),c*(1+2*this._padding[0]/b),this.near,this.far,this._projectionMatrix);this._projectionDirty=!1}return this._projectionMatrix},set:function(a){k.set(a,this._projectionMatrix);this._projectionDirty=!1;this._frustumPlanesDirty=this._viewProjectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"fov",{get:function(){return this._fov},
- set:function(a){this._fov=a;this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"fovX",{get:function(){return a.fovd2fovx(this._fov,this.width,this.height)},set:function(b){this._fov=a.fovx2fovd(b,this.width,this.height);this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"fovY",{get:function(){return a.fovd2fovy(this._fov,
- this.width,this.height)},set:function(b){this._fov=a.fovy2fovd(b,this.width,this.height);this._frustumPlanesDirty=this._viewProjectionDirty=this._projectionDirty=!0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"distance",{get:function(){return d.dist(this._center,this._eye)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"frustumPoints",{get:function(){return this.computeFrustumPoints()},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"frustumPlanes",
- {get:function(){this._frustumPlanesDirty&&(this._frustumPlanes=this._computeFrustumPlanes(this._frustumPlanes),this._frustumPlanesDirty=!1);return this._frustumPlanes},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"viewInverseTransposeMatrix",{get:function(){if(this._viewInverseTransposeMatrixDirty||this._viewDirty)this._viewInverseTransposeMatrix||(this._viewInverseTransposeMatrix=k.create()),k.inverse(this.viewMatrix,this._viewInverseTransposeMatrix),k.transpose(this._viewInverseTransposeMatrix),
- this._viewInverseTransposeMatrixDirty=!1;return this._viewInverseTransposeMatrix},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"perPixelRatio",{get:function(){return Math.tan(this.fovX/2)/this.width},enumerable:!0,configurable:!0});f.prototype.copyFrom=function(a){d.set(a._eye,this._eye);d.set(a._center,this._center);d.set(a._up,this._up);b.set(a._viewport,this._viewport);b.set(a._padding,this._padding);this._near=a._near;this._far=a._far;this._fov=a._fov;this.aboveGround=a.aboveGround;
- a._viewDirty?this._viewDirty=!0:(k.set(a._viewMatrix,this._viewMatrix),d.set(a._viewRight,this._viewRight),d.set(a._viewUp,this._viewUp),d.set(a._viewForward,this._viewForward),this._viewDirty=!1);a._projectionDirty?this._projectionDirty=!0:(k.set(a._projectionMatrix,this._projectionMatrix),this._projectionDirty=!1);this._viewProjectionDirty=!0;a._frustumPlanesDirty?this._frustumPlanesDirty=!0:(a.copyFrustumPlanes(this._frustumPlanes),this._frustumPlanesDirty=!1);a._viewInverseTransposeMatrixDirty?
- this._viewInverseTransposeMatrixDirty=!0:(this._viewInverseTransposeMatrix?k.set(a._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix):this._viewInverseTransposeMatrix=k.create(a._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1);a._fullViewport?this._fullViewport?b.set(a._fullViewport,this._fullViewport):this._fullViewport=b.create(a._fullViewport):this._fullViewport=null;return this};f.prototype.copyViewFrom=function(a){this.eye=a.eye;this.center=a.center;this.up=a.up};
- f.prototype.copy=function(){var a=new f;a.copyFrom(this);return a};f.prototype.equivalent=function(a){return c(this._eye,a._eye)&&c(this._center,a._center)&&c(this._up,a._up)&&g(this._viewport,a._viewport)&&g(this._padding,a._padding)&&this._near===a._near&&this._far===a._far&&this._fov===a._fov};f.prototype.almostEquals=function(a,b,c){void 0===c&&(c=!1);b=d.dist(this._eye,this._center)*(b||5E-4);b*=b;c?(d.direction(a._center,a._eye,n),d.direction(this._center,this._eye,t),c=1E-10):(d.set(a._center,
- n),d.set(this._center,t),c=b);return d.dist2(a._eye,this._eye)<b&&d.dist2(n,t)<c&&.001>Math.abs(a._fov-this._fov)&&.5>e(a._padding,this._padding)&&.5>e(a._viewport,this._viewport)};f.prototype.markViewDirty=function(){this._viewProjectionDirty=this._frustumPlanesDirty=this._viewDirty=!0};f.prototype.computePixelSizeAt=function(a){return this.computePixelSizeAtDist(d.dist(a,this._eye))};f.prototype.computePixelSizeAtDist=function(a){return 2*a*Math.tan(this.fovX/2)/this.width};f.prototype.computeDistanceFromRadius=
- function(a,b){return a/Math.tan(Math.min(this.fovX,this.fovY)/(2*(b||1)))};f.prototype.copyFrustumPlanes=function(a){if(!a){a=Array(6);for(var c=0;6>c;++c)a[c]=b.create()}for(var d=this.frustumPlanes,c=0;6>c;c++)b.set(d[c],a[c]);return a};f.prototype.computeFrustumPoints=function(b){if(!b){b=Array(8);for(var c=0;8>c;++c)b[c]=d.create()}a.matrix2frustum(this.viewMatrix,this.projectionMatrix,b);return b};f.prototype.setGLViewport=function(a){var b=this.viewport,c=this.padding;a.setViewport(b[0]-c[3],
- b[1]-c[2],b[2]+c[1]+c[3],b[3]+c[0]+c[2])};f.prototype.applyProjection=function(b,c,e){void 0===e&&(e=!1);b!==l&&d.set(b,l);l[3]=1;e&&(c[2]=-l[2]);k.multiplyVec4(this.projectionMatrix,l);d.scale(l,1/Math.abs(l[3]));b=this.fullViewport;c[0]=a.lerp(0,b[0]+b[2],.5+.5*l[0]);c[1]=a.lerp(0,b[1]+b[3],.5+.5*l[1]);e||(c[2]=.5*(l[2]+1));return c};f.prototype.projectPoint=function(b,c){l[0]=b[0];l[1]=b[1];l[2]=b[2];l[3]=1;k.multiplyVec4(this.viewProjectionMatrix,l);d.scale(l,1/Math.abs(l[3]));b=this.fullViewport;
- c[0]=a.lerp(0,b[0]+b[2],.5+.5*l[0]);c[1]=a.lerp(0,b[1]+b[3],.5+.5*l[1]);c[2]=.5*(l[2]+1);return c};f.prototype.unprojectPoint=function(a,b,c){void 0===c&&(c=!1);if(c)return console.error("Camera.unprojectPoint() not yet implemented for linear Z"),null;k.multiply(this.projectionMatrix,this.viewMatrix,p);if(!k.inverse(p))return null;c=this.fullViewport;l[0]=2*(a[0]-c[0])/c[2]-1;l[1]=2*(a[1]-c[1])/c[3]-1;l[2]=2*a[2]-1;l[3]=1;k.multiplyVec4(p,l);if(0===l[3])return null;b[0]=l[0]/l[3];b[1]=l[1]/l[3];b[2]=
- l[2]/l[3];return b};f.prototype.computeUp=function(a){"global"===a?this.computeUpGlobal():this.computeUpLocal()};f.prototype.computeUpGlobal=function(){d.subtract(this.center,this.eye,n);var a=d.length(this.center);1>a?(d.set3(0,0,1,this.up),this.markViewDirty()):Math.abs(d.dot(n,this.center))>.9999*d.length(n)*a||(d.cross(n,this.center,this.up),d.cross(this.up,n,this.up),d.normalize(this.up),this.markViewDirty())};f.prototype.computeUpLocal=function(){d.direction(this.center,this.eye,n);.9999>=Math.abs(n[2])&&
- (d.scale(n,n[2]),d.set3(-n[0],-n[1],1-n[2],this.up),d.normalize(this.up),this.markViewDirty())};f.prototype._compareAndSetView=function(a,b){c(a,b)||(d.set(a,b),this._viewProjectionDirty=this._frustumPlanesDirty=this._viewDirty=!0)};f.prototype._computeFrustumPlanes=function(c){if(!c){c=Array(6);for(var d=0;6>d;++d)c[d]=b.create()}a.matrix2frustumPlanes(this.viewMatrix,this.projectionMatrix,c);return c};f.prototype._ensureViewClean=function(){this._viewDirty&&(k.lookAt(this._eye,this._center,this._up,
- this._viewMatrix),d.set3(-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10],this._viewForward),d.set3(this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9],this._viewUp),d.set3(this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8],this._viewRight),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)};return f}();var l=b.create(),p=k.create(),n=d.create(),t=d.create();return r})},"esri/views/animation/pointToPoint/Animation":function(){define("require exports ../easing ./Definition ./Settings ./apex/Path".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});var g={zoom:0,pan:0,rotate:0};r=function(){function d(b){this.createCamera=b;this.time=0;this.definition=new a.Definition(b);this.path=new c.Path}d.prototype.update=function(a,c,d){this.definition.update(a,c,d);this.path.update(this.definition,d);this.time=this._applyTimeSettings(this.path.time,d);this.settings=d};d.prototype.cameraAt=function(a,c){c||(c=this.createCamera());a=Math.min(Math.max(0,a),1);a=this.settings.easing?this.normalizedEasing(this.settings.easing,
- a,1E3*this.time):1<=this.time?this.normalizedEasing(f.inOutCoastQuad,a):this.normalizedEasing(f.outExpo,a);a=this.path.interpolateComponentsAt(a,g);c.interpolate(this.definition.source,this.definition.target,a);return c};d.prototype.normalizedEasing=function(a,c,d){d=a(0);var b=a(1);return(a(c)-d)/(b-d)};d.prototype._applyTimeSettings=function(a,c){var b=null!=c.speedFactor?c.speedFactor:1;null!=c.duration?a=c.duration:null!=c.speedFactor&&(a/=b);return a=Math.min(Math.max(null!=c.minDuration?c.minDuration:
- e.defaultSettings.minDuration/b,a),null!=c.maxDuration?c.maxDuration:e.defaultSettings.maxDuration/b)};return d}();h.Animation=r;h.default=r})},"esri/views/animation/pointToPoint/Definition":function(){define(["require","exports","./Settings"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a){this.createCamera=a;this.compared={sourceZoom:0,targetZoom:0,pan:0,rotate:0};this.settings={desiredScreenFlow:f.defaultSettings.desiredScreenFlow};this.source=a();this.target=
- a()}a.prototype.clone=function(){var e=new a(this.createCamera);e.copyFrom(this);return e};a.prototype.copyFrom=function(a){this.update(a.source,a.target,a.settings)};a.prototype.update=function(a,c,g){this.source!==a&&this.source.copyFrom(a);this.target!==c&&this.target.copyFrom(c);this.settings.desiredScreenFlow=null!=g.desiredScreenFlow?g.desiredScreenFlow:f.defaultSettings.desiredScreenFlow;this.compared=this.source.compareTo(this.target,this.compared);this.desiredPixelFlow=this.settings.desiredScreenFlow*
- this.target.size;this.halfWindowSize=this.target.size/2};a.prototype.halfWindowPanAtZoom=function(a){a=this.target.pixelsPerPanAtZoom(a);return this.halfWindowSize/a};Object.defineProperty(a.prototype,"hasZoom",{get:function(){return 1E-5<Math.abs(this.compared.sourceZoom-this.compared.targetZoom)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasPan",{get:function(){return 1E-9<this.compared.pan},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasRotate",{get:function(){return 1E-9<
- this.compared.rotate},enumerable:!0,configurable:!0});return a}();h.Definition=r;h.default=r})},"esri/views/animation/pointToPoint/Settings":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.defaultSettings={desiredScreenFlow:2,minDuration:.5,maxDuration:8}})},"esri/views/animation/pointToPoint/apex/Path":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../easing ../Path ../Segment ./planning".split(" "),function(r,
- h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(d){function b(a,b){var e=d.call(this)||this;e._preallocSegments=[new c.default,new c.default,new c.default];e.update(a,b);return e}f(b,d);b.prototype.update=function(a,b){if(a){this.definition?this.definition.copyFrom(a):this.definition=a.clone();var c=null;b&&b.apex&&(c=g.optimalDistance(a,b.apex));this.segments.length=0;this._descensionSegment=this._ascensionSegment=null;null==c?this._updateWithoutApex():this._updateWithApex(c,
- b.apex)}};b.prototype.segmentInterpolateComponentsAt=function(b,c,d){d=b.interpolateComponentsAt(c,d);b===this._ascensionSegment?d.zoom=a.outQuad(d.zoom):b===this._descensionSegment&&(d.zoom=a.inQuad(d.zoom));return d};b.prototype._updateWithApex=function(a,b){var c=this._preallocSegments,d=c[0],e=c[1],c=c[2],g=null!=b.ascensionFactor?b.ascensionFactor:.5;b=Math.min(1-g,null!=b.ascensionFactor?b.descensionFactor:.5);var f=1-g-b;d.definition?d.definition.copyFrom(this.definition):d.definition=this.definition.clone();
- d.definition.compared.targetZoom=a;d.definition.compared.pan=this.definition.compared.pan*g;d.definition.compared.rotate=this.definition.compared.rotate*g;d.update();this._ascensionSegment=d;this.segments.push(d);0<f&&(e.definition?e.definition.copyFrom(this.definition):e.definition=this.definition.clone(),e.definition.copyFrom(this.definition),e.definition.compared.sourceZoom=a,e.definition.compared.targetZoom=a,e.definition.compared.pan=this.definition.compared.pan*f,e.definition.compared.rotate=
- this.definition.compared.rotate*f,e.update(),this.segments.push(e));c.definition?c.definition.copyFrom(this.definition):c.definition=this.definition.clone();c.definition.compared.sourceZoom=a;c.definition.compared.pan=this.definition.compared.pan*b;c.definition.compared.rotate=this.definition.compared.rotate*b;c.update();this._descensionSegment=c;this.segments.push(c)};b.prototype._updateWithoutApex=function(){var a=this._preallocSegments[0];a.update(this.definition);this.segments.push(a)};return b}(e.default);
- h.Path=r;h.default=r})},"esri/views/animation/pointToPoint/Path":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(){this.segments=[]}Object.defineProperty(f.prototype,"time",{get:function(){return this.segments.reduce(function(a,e){return a+e.time},0)},enumerable:!0,configurable:!0});f.prototype.interpolateComponentsAt=function(a,e){a=Math.min(Math.max(a,0),1);a*=this.time;for(var c=0,g=0,d=this.definition,b=0;b<this.segments.length;b++){var f=
- this.segments[b],l=f.definition;if(a<=f.time||b===this.segments.length-1)return e=this.segmentInterpolateComponentsAt(f,a/f.time,e),e.pan=d.hasPan?(c+l.compared.pan*e.pan)/d.compared.pan:1,e.rotate=d.hasRotate?(g+l.compared.rotate*e.rotate)/d.compared.rotate:1,a=e.zoom*(l.compared.targetZoom-l.compared.sourceZoom)+l.compared.sourceZoom,c=this.segments[0].definition.compared.sourceZoom,g=this.segments[this.segments.length-1].definition.compared.targetZoom,e.zoom=d.hasZoom?(a-c)/(g-c):1,e;a-=f.time;
- c+=l.compared.pan;g+=l.compared.rotate}};f.prototype.segmentInterpolateComponentsAt=function(a,e,c){return a.interpolateComponentsAt(e,c)};return f}();h.Path=r;h.default=r})},"esri/views/animation/pointToPoint/Segment":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a){a&&this.update(a)}f.prototype.update=function(a){a&&(this.definition?this.definition.copyFrom(a):this.definition=a.clone());this._updatePrecomputedVariables();
- this._updatePixelFlow()};f.prototype._updatePrecomputedVariables=function(){var a=this.definition,e=a.compared,c=e.sourceZoom,g=e.targetZoom;this._sl=c>g?1:-1;this._panPixelsAtSource=e.pan*a.source.pixelsPerPanAtZoom(c);a=(a.source.pixelsPerRotateAtZoom(c)+a.target.pixelsPerRotateAtZoom(g))/2;this._rotatePixels=e.rotate*a};f.prototype._updatePixelFlow=function(){var a=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,c=this.definition.hasZoom,g=this.definition.hasPan,d=this.definition.hasRotate,
- b,f;b=g&&c?(e/a-1)/(-1/(this._sl*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource):0;f=c&&d?Math.log(a/e)/Math.LN2*this._sl*this.definition.halfWindowSize/this._rotatePixels:0;this._rotatePixelFlow=this._panPixelFlow=this._zoomPixelFlow=0;a=this.definition.desiredPixelFlow;c&&g&&d?(e=b+f+b*f,this._zoomPixelFlow=b*f/e*a,this._panPixelFlow=f/e*a,this._rotatePixelFlow=b/e*a):c&&g?(e=1+b,this._zoomPixelFlow=b/e*a,this._panPixelFlow=1/e*a):c&&d?(e=1+f,this._zoomPixelFlow=f/e*a,this._rotatePixelFlow=
- 1/e*a):g&&d?(b=this._panPixelsAtSource/this._rotatePixels,e=1+b,this._panPixelFlow=b/e*a,this._rotatePixelFlow=1/e*a):g?this._panPixelFlow=a:c?this._zoomPixelFlow=a:d&&(this._rotatePixelFlow=a);this.time=d?this.rotateTime:c?this.zoomTime:g?this.panTime:0};Object.defineProperty(f.prototype,"zoomTime",{get:function(){return this.definition.hasZoom?Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2*this._sl*this.definition.halfWindowSize/this._zoomPixelFlow:0},
- enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"panTime",{get:function(){if(this.definition.hasPan){if(this.definition.hasZoom){var a=-1/(this._sl*this.definition.halfWindowSize)*Math.LN2;return Math.log(this._zoomPixelFlow/this._panPixelFlow*this._panPixelsAtSource*a+1)/(a*this._zoomPixelFlow)}return this._panPixelsAtSource/this._panPixelFlow}return 0},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"rotateTime",{get:function(){return this.definition.hasRotate?
- this._rotatePixels/this._rotatePixelFlow:0},enumerable:!0,configurable:!0});f.prototype._interpolateComponentsZoom=function(a){if(this.definition.hasZoom){var e=this.definition.compared.sourceZoom,c=this.definition.compared.targetZoom;return(e*Math.pow(e/c,-a)-e)/(c-e)}return a};f.prototype._interpolateComponentsPan=function(a){if(this.definition.hasPan&&this.definition.hasZoom){var e=-1/(this._sl*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*this._panPixelFlow*
- (Math.pow(2,e*a*this.time)-1)/(e*Math.LN2)}return a};f.prototype._interpolateComponentsRotate=function(a){return a};f.prototype.interpolateComponentsAt=function(a,e){a=Math.min(Math.max(a,0),1);var c=this._interpolateComponentsZoom(a),g=this._interpolateComponentsPan(a);a=this._interpolateComponentsRotate(a);e?(e.zoom=c,e.pan=g,e.rotate=a):e={zoom:c,pan:g,rotate:a};return e};return f}();h.Segment=r;h.default=r})},"esri/views/animation/pointToPoint/apex/planning":function(){define(["require","exports",
- "./functions"],function(r,h,f){function a(a,c){var e=Math.max(a.compared.sourceZoom,a.compared.targetZoom);a=a.source.zoomAtPixelsPerPan(a.desiredPixelFlow/a.compared.pan)/2;return a<e?null!=c.maximumDistance?e+(c.maximumDistance-e)/2:1.5*e:c.maximumDistance?Math.min(c.maximumDistance,a):a}Object.defineProperty(h,"__esModule",{value:!0});h.optimalDistance=function(e,c){var g=a(e,c),d={ascensionFactor:null!=c.ascensionFactor?c.ascensionFactor:.5,descensionFactor:null!=c.descensionFactor?c.descensionFactor:
- .5},b=0===d.ascensionFactor,k=0===d.descensionFactor,l=b?f.tAscensionZoomOnly:f.tAscensionZoomPan,p=b?f.dtAscensionZoomOnly:f.dtAscensionZoomPan,n=b?f.ddtAscensionZoomOnly:f.ddtAscensionZoomPan,t=k?f.tDescensionZoomOnly:f.tDescensionZoomPan,u=k?f.dtDescensionZoomOnly:f.dtDescensionZoomPan,q=k?f.ddtDescensionZoomOnly:f.ddtDescensionZoomPan,b=function(a){return l(e,d,a)+f.tPanion(e,d,a)+t(e,d,a)},k=function(a){return p(e,d,a)+f.dtPanion(e,d,a)+u(e,d,a)},v=function(a){return n(e,d,a)+f.ddtPanion(e,d,
- a)+q(e,d,a)},h=b(g),m=f.tBaseLine(e),B=c.maximumIterations||20,z=null!=c.maximumDistance?c.maximumDistance:Infinity;for(c=0;c<B;c++){var C=(k(g)+1E-6)/v(g);if(isNaN(C)||g>=z&&0>C){if(!isFinite(z))return null;g=z;h=b(g);break}g-=C;if(g<e.compared.sourceZoom||g<e.compared.targetZoom)return null;C=b(g);if(.005>=Math.abs(C-h)/h)break;h=C}return h>.7*m?null:g<e.compared.sourceZoom||g<e.compared.targetZoom?null:g}})},"esri/views/animation/pointToPoint/apex/functions":function(){define(["require","exports"],
- function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.tAscensionZoomPan=function(f,a,e){var c=f.halfWindowPanAtZoom(e-f.compared.sourceZoom);return-f.halfWindowSize*(a.ascensionFactor*Math.LN2*f.compared.pan+c)*Math.log(f.compared.sourceZoom/e)/(f.desiredPixelFlow*Math.LN2*c)};h.dtAscensionZoomPan=function(f,a,e){var c=1/e,g=Math.log(f.compared.sourceZoom*c),d=1/f.desiredPixelFlow,b=1/Math.LN2;e-=f.compared.sourceZoom;var k=1/e;a=(a.ascensionFactor*Math.LN2*f.compared.pan+f.halfWindowPanAtZoom(e))/
- f.halfWindowPanAtZoom(1);return f.halfWindowSize*c*d*b*k*a-f.halfWindowSize*g*d*b*k+f.halfWindowSize*g*d*b*a/(e*e)};h.ddtAscensionZoomPan=function(f,a,e){var c=e-f.compared.sourceZoom,g=1/c,d=1/e,b=Math.log(f.compared.sourceZoom*d);a=(a.ascensionFactor*Math.LN2*f.compared.pan+f.halfWindowPanAtZoom(c))/f.halfWindowPanAtZoom(1);return f.halfWindowSize*g*(-2*g*d*a+2*g*b+2*d-2*b*a/(c*c)-a/(e*e))/(f.desiredPixelFlow*Math.LN2)};h.tAscensionZoomOnly=function(f,a,e){return-f.halfWindowSize*Math.log(f.compared.sourceZoom/
- e)/(f.desiredPixelFlow*Math.LN2)};h.dtAscensionZoomOnly=function(f,a,e){return f.halfWindowSize/(e*f.desiredPixelFlow*Math.LN2)};h.ddtAscensionZoomOnly=function(f,a,e){return-f.halfWindowSize/(e*e*f.desiredPixelFlow*Math.LN2)};h.tPanion=function(f,a,e){return-f.compared.pan*f.halfWindowSize*(a.ascensionFactor+a.descensionFactor-1)/(f.desiredPixelFlow*f.halfWindowPanAtZoom(e))};h.dtPanion=function(f,a,e){return f.compared.pan*f.halfWindowSize*(a.ascensionFactor+a.descensionFactor-1)/(f.desiredPixelFlow*
- f.halfWindowPanAtZoom(e*e))};h.ddtPanion=function(f,a,e){return-2*f.compared.pan*f.halfWindowSize*(a.ascensionFactor+a.descensionFactor-1)/(f.desiredPixelFlow*f.halfWindowPanAtZoom(e*e*e))};h.tDescensionZoomPan=function(f,a,e){return f.halfWindowSize*(-f.halfWindowPanAtZoom(e)-a.descensionFactor*Math.LN2*f.compared.pan+f.halfWindowPanAtZoom(f.compared.targetZoom))*Math.log(e/f.compared.targetZoom)/(f.desiredPixelFlow*Math.LN2*f.halfWindowPanAtZoom(-e+f.compared.targetZoom))};h.dtDescensionZoomPan=
- function(f,a,e){var c=Math.log(e/f.compared.targetZoom),g=1/f.desiredPixelFlow,d=1/Math.LN2,b=-e+f.compared.targetZoom,k=1/b;a=(-f.halfWindowPanAtZoom(e)-a.descensionFactor*Math.LN2*f.compared.pan+f.halfWindowPanAtZoom(f.compared.targetZoom))/f.halfWindowPanAtZoom(1);return-f.halfWindowSize*c*g*d*k+f.halfWindowSize*c*g*d*a/(b*b)+f.halfWindowSize*g*d*k*a/e};h.ddtDescensionZoomPan=function(f,a,e){var c=e-f.compared.targetZoom,g=1/c,d=1/e,b=Math.log(e/f.compared.targetZoom);a=(f.halfWindowPanAtZoom(e)+
- a.descensionFactor*Math.LN2*f.compared.pan-f.halfWindowPanAtZoom(f.compared.targetZoom))/f.halfWindowPanAtZoom(1);return f.halfWindowSize*g*(-2*g*d*a-2*g*b+2*d+2*b*a/(c*c)-a/(e*e))/(f.desiredPixelFlow*Math.LN2)};h.tDescensionZoomOnly=function(f,a,e){return f.halfWindowSize*Math.log(e/f.compared.targetZoom)/(f.desiredPixelFlow*Math.LN2)};h.dtDescensionZoomOnly=function(f,a,e){return f.halfWindowSize/(e*f.desiredPixelFlow*Math.LN2)};h.ddtDescensionZoomOnly=function(f,a,e){return-f.halfWindowSize/(e*
- e*f.desiredPixelFlow*Math.LN2)};h.tBaseLine=function(f){var a=Math.LN2*f.compared.pan,e=f.halfWindowPanAtZoom(f.compared.sourceZoom-f.compared.targetZoom),c=f.halfWindowSize*Math.log(f.compared.sourceZoom/f.compared.targetZoom)/(f.desiredPixelFlow*Math.LN2*e);return f.compared.sourceZoom<=f.compared.targetZoom?c*(a-e):c*(a+e)}})},"esri/views/3d/state/controllers/AnimationController":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../../ViewAnimation","./CameraController"],
- function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function g(d){void 0===d&&(d=new a);var b=c.call(this)||this;b.viewAnimation=d;return b}f(g,c);Object.defineProperty(g.prototype,"canStop",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"asyncResult",{get:function(){return this._asyncResult},set:function(a){this._asyncResult&&this._asyncResult.reject();this._asyncResult=a;if(this.state===e.State.Finished||this.state===e.State.Stopped)this._asyncResult=
- null,this.state===e.State.Finished?a.resolve():a.reject()},enumerable:!0,configurable:!0});g.prototype.onControllerStart=function(a){var b=this;c.prototype.onControllerStart.call(this,a);this.viewAnimation&&this.viewAnimation.always(function(){b.updateStateFromViewAnimation()})};g.prototype.updateStateFromViewAnimation=function(){!this.viewAnimation||this.state!==e.State.Ready&&this.state!==e.State.Running||(this.viewAnimation.state===a.State.FINISHED?this.finish():this.viewAnimation.state===a.State.STOPPED&&
- (this.state=e.State.Stopped))};g.prototype.onControllerEnd=function(a){this.viewAnimation&&(this.viewAnimation.done||(this.state===e.State.Finished?this.viewAnimation.finish():this.state===e.State.Stopped&&this.viewAnimation.stop()));this._asyncResult&&(this.state===e.State.Finished?this._asyncResult.resolve():this._asyncResult.reject());c.prototype.onControllerEnd.call(this,a)};g.prototype.finish=function(){this.finishController()};return g}(e.CameraController);h.AnimationController=r})},"esri/views/3d/state/controllers/CameraController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});var g;(function(a){a.Ready="ready";a.Rejected="rejected";a.Running="running";a.Stopped="stopped";a.Finished="finished"})(g=h.State||(h.State={}));r=function(d){function b(){var a=null!==d&&d.apply(this,arguments)||this;a.state=g.Ready;return a}f(b,d);Object.defineProperty(b.prototype,"active",{get:function(){return this.state===g.Running},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isInteractive",{get:function(){return!1},
- enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"canStop",{get:function(){return!1},enumerable:!0,configurable:!0});b.prototype.stopController=function(){return this.canStop?(this.state=g.Stopped,!0):!1};b.prototype.finishController=function(){this.state=g.Finished};b.prototype.onControllerStart=function(a){this.state=g.Running};b.prototype.onControllerEnd=function(a){};b.prototype.stepController=function(a,b){};Object.defineProperty(b.prototype,"steppingFinished",{get:function(){return!1},
- enumerable:!0,configurable:!0});a([c.property({readOnly:!0,dependsOn:["state"]})],b.prototype,"active",null);a([c.property()],b.prototype,"state",void 0);return b=a([c.subclass()],b)}(c.declared(e));h.CameraController=r})},"esri/views/3d/state/utils/navigationUtils":function(){define(["require","exports","../../lib/glMatrix","./primitiveIntersectionUtils","../../support/mathUtils"],function(r,h,f,a,e){function c(b,c,d,e,g){void 0===g&&(g=!1);var f=A;a.createRay(c,d,f,g);return a.intersectSphere(b,
- f,e)?!0:(k(b,f,e),!1)}function g(b,c,d,e){var g=A;a.createRay(c,d,g,!0);return a.intersectSphere(b,g,e)}function d(a,b,c){f.vec3d.cross(a,b,c);a=f.vec3d.dot(a,b)/(f.vec3d.length(a)*f.vec3d.length(b));return-e.acos(a)}function b(a,b,c,d){var e=x;f.mat4d.identity(e);f.mat4d.rotate(e,d,c);f.vec3d.subtract(a.eye,b);f.mat4d.multiplyVec3(e,a.eye,a.eye);f.vec3d.add(a.eye,b);f.vec3d.subtract(a.center,b);f.mat4d.multiplyVec3(e,a.center,a.center);f.vec3d.add(a.center,b);f.mat4d.multiplyVec3(e,a.up,a.up);a.markViewDirty()}
- function k(a,b,c){var d=B,g=z,k=v;f.vec3d.subtract(b.origin,a.center,g);f.vec3d.cross(g,b.direction,d);f.vec3d.cross(d,g,c);f.vec3d.scale(c,1/f.vec3d.length(c)*a.radius);a=-e.asin(a.radius/f.vec3d.length(b.origin));f.mat4d.identity(k);f.mat4d.rotate(k,a,d);f.mat4d.multiplyVec3(k,c)}function l(a,b){f.vec3d.set3(0,0,0,b);for(var c=0;c<a.length;c++)f.vec3d.add(b,a[c]);f.vec3d.scale(b,1/a.length)}Object.defineProperty(h,"__esModule",{value:!0});h.Earth={center:f.vec3d.create(),radius:6378137};h.normalizeCoordinate=
- function(a,b,c){c[0]=b[0]/a.fullWidth;c[1]=b[1]/a.fullHeight;return c};h.sphereOrSilhouettePointFromScreenPoint=c;h.intersectSphereFromScreenPoint=g;h.rotationAndAxisFromPoints=d;h.rotationFromPointsAroundAxis=function(a,b,c){var d=B,e=z,g=C;f.vec3d.set(a,e);f.vec3d.set(b,g);a=f.vec3d.dot(e,c);b=f.vec3d.dot(g,c);f.vec3d.scale(c,a,d);f.vec3d.subtract(e,d);f.vec3d.normalize(e);f.vec3d.scale(c,b,d);f.vec3d.subtract(g,d);f.vec3d.normalize(g);a=f.vec3d.dot(e,g);f.vec3d.cross(c,e,d);c=f.vec3d.dot(g,d);
- return Math.atan2(c,a)};h.setPlane=function(a,b,c){f.vec3d.set(b,c.normal);c.d=-f.vec3d.dot(b,a)};h.setPlaneD=function(a,b){b.d=-f.vec3d.dot(b.normal,a)};h.normalizeRotationDelta=function(a){for(;a>Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;return a};h.applyRotation=b;h.closestPointOnSphereSilhouette=k;h.intersectPlaneFromScreenPoint=function(b,c,d,e){var g=A;a.createRay(c,d,g);return a.intersectPlane(b,g,e)};h.applyZoomToPoint=function(a,b,c,d){var e=m;c=1-c;f.vec3d.subtract(b,a.eye,e);
- var g=f.vec3d.length(e),k=g*(1-c);0<=c&&k<d&&(k=d,c=-(k-g)/g);1E-6>Math.abs(g-k)||(f.vec3d.scale(e,c),f.vec3d.add(a.eye,e),f.vec3d.lerp(a.center,b,c))};h.applyZoomOnSphere=function(a,b,c){f.vec2d.set2(b.padding[3]+b.width/2,b.padding[2]+b.height/2,p);g(a,b,p,b.center);f.vec3d.subtract(b.center,b.eye,m);a=f.vec3d.length(m);1E-6>Math.abs(a-a*c)||(f.vec3d.scale(m,c),f.vec3d.subtract(b.center,m,b.eye),b.markViewDirty())};var p=f.vec2d.create();h.navPointToScreenPoint=function(a,b,c){f.vec2d.set2(b.x,
- a.fullHeight-b.y,c)};h.centroidOnSphere=function(a,b,c){l(b,c);f.vec3d.normalize(c);f.vec3d.scale(c,a)};h.centroid=l;var n;(function(a){a[a.Vertical=0]="Vertical";a[a.Horizontal=1]="Horizontal"})(n=h.PanMode||(h.PanMode={}));h.VerticalPanTresholds={Elevation:3E4,Angle:8/180*Math.PI};h.pickPointAndInitSphere=function(a,b,d,e){var k=f.vec3d.create(),l={center:f.vec3d.create(),radius:0},p=!0;a.pickPointInScreen(d,k)?l.radius=f.vec3d.length(k):(l.radius=f.vec3d.length(b.center),l.radius<.9*h.Earth.radius&&
- (l.radius=h.Earth.radius),l.radius=Math.max(f.vec3d.length(b.center),.9*h.Earth.radius),e?c(l,b,d,k):p=g(l,b,d,k));return{sphere:l,scenePickPoint:p?k:null}};h.decidePanMode=function(a,b,c){if(f.vec3d.length(a.eye)-h.Earth.radius<h.VerticalPanTresholds.Elevation){if(b.radius>f.vec3d.length(a.eye))return n.Vertical;f.vec3d.normalize(f.vec3d.subtract(a.eye,c,t));return Math.abs(.5*Math.PI-Math.acos(f.vec3d.dot(c,t)/f.vec3d.length(c)))<h.VerticalPanTresholds.Angle?n.Vertical:n.Horizontal}return n.Horizontal};
- var t=f.vec3d.create();h.applyPanPlanar=function(a,b,c){f.vec3d.subtract(c,b,u);f.vec3d.subtract(a.eye,u);f.vec3d.subtract(a.center,u);a.markViewDirty()};var u=f.vec3d.create();h.applyPanSpherical=function(a,c,e,g){e=d(e,g,q);b(c,a.center,q,e)};var q=f.vec3d.create(),v=f.mat4d.create(),x=f.mat4d.create(),m=f.vec3d.create(),B=f.vec3d.create(),z=f.vec3d.create(),C=f.vec3d.create(),A={origin:f.vec3d.create(),direction:f.vec3d.create()}})},"esri/views/3d/state/utils/primitiveIntersectionUtils":function(){define(["require",
- "exports","../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.createRay=function(c,e,d,b){void 0===b&&(b=!1);f.vec3d.set3(e[0],e[1],0,a);b?f.vec3d.set(c.eye,d.origin):f.vec3d.unproject(a,c.viewMatrix,c.projectionMatrix,c.fullViewport,d.origin);a[2]=1;f.vec3d.unproject(a,c.viewMatrix,c.projectionMatrix,c.fullViewport,d.direction);f.vec3d.subtract(d.direction,d.origin,d.direction);f.vec3d.normalize(d.direction)};h.intersectSphere=function(a,g,d){var b=f.vec3d.subtract(g.origin,
- a.center,e),c=f.vec3d.dot(g.direction,g.direction),l=2*f.vec3d.dot(g.direction,b);a=f.vec3d.dot(b,b)-a.radius*a.radius;a=l*l-4*c*a;if(0>a)return!1;b=Math.sqrt(a);a=(-l-b)/(2*c);c=(-l+b)/(2*c);if(0>a||c<a&&0<c)a=c;return 0<a?(f.vec3d.add(g.origin,f.vec3d.scale(g.direction,a,d),d),!0):!1};h.intersectPlane=function(a,e,d){var b=f.vec3d.dot(a.normal,e.direction);if(0===b)return!1;a=-(f.vec3d.dot(a.normal,e.origin)+a.d)/b;if(0>a)return!1;f.vec3d.add(e.origin,f.vec3d.scale(e.direction,a,d),d);return!0};
- var a=f.vec3d.create(),e=f.vec3d.create()})},"esri/views/3d/state/controllers/local/ZoomStepController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../PointToPointAnimationController ../../../webgl-engine/lib/Camera ../../../../animation/easing".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function c(a,c,d){c=b.call(this,a.state,c,"interaction"===d?null:void 0)||
- this;c.view=a;c.mode=d;c.zoomLocation=e.vec3d.create();c.tmpCamera=new g;c.tmpRayDir=e.vec3d.create();c.tmpCenter=e.vec3d.create();c.constraintOptions={selection:15,interactionType:1,interactionFactor:null,interactionStartCamera:new g,interactionDirection:null};return c}f(c,b);Object.defineProperty(c.prototype,"isInteractive",{get:function(){return"interaction"===this.mode},enumerable:!0,configurable:!0});c.prototype.zoomStep=function(a,b){if(this.active){var c=this.view.state,d=this.constraintOptions.interactionStartCamera;
- this.animation.finished?d.copyFrom(c.camera):this.animation.cameraAt(1,d);this.tmpCamera.copyFrom(c.camera);0<a?(this.pickingHelper.pickPointInScreen(b,this.zoomLocation)||this.pickingHelper.pickFreePointInScreen(b,this.zoomLocation),this.pickingHelper.pickRaySegment(this.tmpCamera.eye,this.tmpCamera.center,this.tmpCenter)&&(this.tmpCamera.center=this.tmpCenter)):this.pickingHelper.pickRaySegment(this.tmpCamera.eye,this.tmpCamera.center,this.zoomLocation)?this.tmpCamera.center=this.zoomLocation:e.vec3d.set(this.tmpCamera.center,
- this.zoomLocation);this.updateCamera(this.tmpCamera,Math.pow(.6,a),this.zoomLocation,b);this.begin(this.tmpCamera)}};c.prototype.animationSettings=function(){return{apex:null,duration:.6,easing:d.outExpo}};c.prototype.updateCamera=function(b,c,d,g){e.vec3d.subtract(d,b.eye,this.tmpRayDir);g=e.vec3d.length(this.tmpRayDir);var f=g*c;1>=c&&4>f&&(f=4,c=f/g);1E-6>Math.abs(g-f)||(e.vec3d.scale(this.tmpRayDir,c),e.vec3d.subtract(d,this.tmpRayDir,b.eye),e.vec3d.lerp(b.center,d,1-c),a.applyAll(this.view,this.tmpCamera,
- this.constraintOptions))};return c}(c.PointToPointAnimationController);h.ZoomStepController=r})},"esri/views/3d/state/helpers/PickingHelper":function(){define(["require","exports","../../camera/intersectionUtils","../../lib/glMatrix","../../webgl-engine/lib/Selector"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function c(c){this.view=c;this.tmpR0=a.vec3d.create();this.tmpR1=a.vec3d.create();this.tmpSelector=new e(this.view.viewingMode)}c.prototype.pickPointInScreen=
- function(a,c){return this.pickedIntersectionPoint(this.pickInScreen(a,!1),c)};c.prototype.pickFreePointFromSegment=function(c,d,b){a.vec3d.set(c,this.tmpR0);a.vec3d.set(d,this.tmpR1);a.vec3d.subtract(this.tmpR1,this.tmpR0);a.vec3d.normalize(this.tmpR1);var e=this.view.dataExtent;c=Math.max(e.xmax-e.xmin,e.ymax-e.ymin,8*Math.max(e.xmax-e.xmin,e.ymax-e.ymin));d=this.view.state.camera;var g=Math.max(0,e.xmin-d.eye[0],d.eye[0]-e.xmax),e=Math.max(0,e.ymin-d.eye[1],d.eye[1]-e.ymax),g=Math.sqrt(g*g+e*e),
- e=this.view.renderCoordsHelper.getAltitude(d.eye);d=f.surfaceElevationBelowEye(this.view,d);d=c/Math.max(1,Math.pow(Math.max(0,Math.log(c/(Math.abs(e-d)+Number.MIN_VALUE))),2));d=Math.max(d,Math.min(g,c));a.vec3d.scale(this.tmpR1,d);a.vec3d.add(this.tmpR0,this.tmpR1,b)};c.prototype.pickFreePointInScreen=function(a,c){this.view._pickRayWithBeginPoint(a,void 0,this.view.state.camera.viewMatrix,this.tmpR0,this.tmpR1);this.pickFreePointFromSegment(this.tmpR0,this.tmpR1,c)};c.prototype.pickRaySegment=
- function(a,c,b){return this.pickedIntersectionPoint(this.view._pickRay(a,c,null,null,null,null,this.tmpSelector),b)};c.prototype.pickInScreen=function(c,d){this.view._pickRayWithBeginPoint(c,void 0,this.view.state.camera.viewMatrix,this.tmpR0,this.tmpR1);d&&a.vec3d.set(this.view.state.camera.eye,this.tmpR0);return this.view._pickRay(this.tmpR0,this.tmpR1,c,c,null,null,this.tmpSelector)};c.prototype.pickedIntersectionPoint=function(a,c){return a?a.getMinResult().getIntersectionPoint(c):!1};return c}();
- h.PickingHelper=r})},"esri/views/input/InputHandler":function(){define(["require","exports","../../core/Logger","./EventMatch"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=f.getLogger("esri.views.input.InputHandler");r=function(){function d(a){this._manager=null;this._incoming={};this._outgoing={};this._outgoingEventTypes=this._incomingEventTypes=this._incomingEventMatches=null;this._hasSideEffects=a}Object.defineProperty(d.prototype,"incomingEventMatches",{get:function(){if(!this._incomingEventMatches){this._incomingEventMatches=
- [];for(var a in this._incoming)for(var c=0,d=this._incoming[a];c<d.length;c++)this._incomingEventMatches.push(d[c].match)}return this._incomingEventMatches},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"incomingEventTypes",{get:function(){this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(function(a){return a.eventType}));return this._incomingEventTypes},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"outgoingEventTypes",{get:function(){this._outgoingEventTypes||
- (this._outgoingEventTypes=Object.keys(this._outgoing));return this._outgoingEventTypes},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"hasSideEffects",{get:function(){return this._hasSideEffects},enumerable:!0,configurable:!0});d.prototype.onInstall=function(a){var b=this;this._manager?e.error("This InputHandler has already been registered with an InputManager"):(a.setEventCallback(function(a){return b._handleEvent(a)}),a.setUninstallCallback(function(){return b._onUninstall()}),
- this._manager=a)};d.prototype.onUninstall=function(){};d.prototype.registerIncoming=function(b,d,e){var g=this;"function"===typeof d?(e=d,d=[]):d=d||[];b="string"===typeof b?new a.EventMatch(b,d):b;var f=function(){g._incomingEventTypes=null;g._incomingEventMatches=null};d=function(a){var b=g._incoming[a.match.eventType];b&&(a=b.indexOf(a),b.splice(a,1),f(),g._manager&&g._manager.updateDependencies())};e=new c(b,e,{onPause:d,onRemove:d,onResume:function(a){var b=g._incoming[a.match.eventType];b&&
- -1===b.indexOf(a)&&(b.push(a),f(),g._manager&&g._manager.updateDependencies())}});d=this._incoming[b.eventType];d||(d=[],this._incoming[b.eventType]=d);d.push(e);f();this._manager&&this._manager.updateDependencies();return e};d.prototype.registerOutgoing=function(a){var b=this;if(this._outgoing[a])throw Error("There is already a callback registered for this outgoing InputEvent: "+a);var c=new g(a,{onEmit:function(a,c,d,e){b._manager.emit(a.eventType,c,d,e)},onRemove:function(a){delete b._outgoing[a.eventType];
- b._manager.updateDependencies()}});this._outgoing[a]=c;this._outgoingEventTypes=null;this._manager&&this._manager.updateDependencies();return c};d.prototype.startCapturingPointer=function(a){this._manager.setPointerCapture(a,!0)};d.prototype.stopCapturingPointer=function(a){this._manager.setPointerCapture(a,!1)};d.prototype._onUninstall=function(){this._manager?(this.onUninstall(),this._manager=null):e.error("This InputHandler is not registered with an InputManager")};d.prototype._handleEvent=function(a){var b=
- this._incoming[a.type];if(b)for(var c=0;c<b.length;c++){var d=b[c];if(d.match.matches(a)&&(d.callback(a),a.shouldStopPropagation()))break}};return d}();h.InputHandler=r;var c=function(){function a(a,c,d){this.match=a;this._callback=c;this._handler=d}a.prototype.pause=function(){this._handler.onPause(this)};a.prototype.resume=function(){this._handler.onResume(this)};a.prototype.remove=function(){this._handler.onRemove(this)};Object.defineProperty(a.prototype,"callback",{get:function(){return this._callback},
- enumerable:!0,configurable:!0});return a}(),g=function(){function a(a,c){this.eventType=a;this._removed=!1;this._handler=c}a.prototype.emit=function(a,c,d){if(!this._removed)this._handler.onEmit(this,a,c,d)};a.prototype.remove=function(){this._removed=!0;this._handler.onRemove(this)};return a}()})},"esri/views/input/EventMatch":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a,e){void 0===e&&(e=[]);this.eventType=a;this.keyModifiers=
- e}f.prototype.matches=function(a){if(a.type!==this.eventType)return!1;if(0===this.keyModifiers.length)return!0;a=a.modifiers;for(var e=0,c=this.keyModifiers;e<c.length;e++)if(!a.has(c[e]))return!1;return!0};return f}();h.EventMatch=r})},"esri/views/input/handlers/support":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.eventMatchesPointerAction=function(f,a){switch(a){case "primary":return"touch"===f.pointerType||0===f.button;case "secondary":return"touch"!==
- f.pointerType&&2===f.button;case "tertiary":return"touch"!==f.pointerType&&1===f.button}};h.eventMatchesMousePointerAction=function(f,a){if("touch"===f.pointerType)return!1;switch(a){case "primary":return 0===f.button;case "secondary":return 2===f.button;case "tertiary":return 1===f.button}}})},"esri/views/3d/input/handlers/DragRotate":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../state/controllers/RotateController ../../state/helpers/PickingHelper ../../../input/InputHandler ../../../input/handlers/support".split(" "),
- function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function b(a,b,d,g){var f=c.call(this,!0)||this;f.view=a;f.pointerAction=b;f.pivotPoint=d;f.pickingHelper=new e.PickingHelper(a);f.registerIncoming("drag",g,function(a){return f.handleDrag(a)});return f}f(b,c);b.prototype.handleDrag=function(b){var c=b.data;if(!(1<c.pointers.size)&&g.eventMatchesMousePointerAction(b.data,this.pointerAction)){var d=[c.center.x,this.view.height-c.center.y];switch(c.action){case "start":this.cameraController=
- new a.RotateController(this.view,this.pickingHelper,this.pivotPoint);this.view.state.switchCameraController(this.cameraController);this.cameraController.begin(d);break;case "update":this.cameraController.update(d);break;case "end":this.cameraController.end(),this.cameraController=null}b.stopPropagation()}};return b}(c.InputHandler);h.DragRotate=r})},"esri/views/3d/state/controllers/RotateController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../camera/constraintUtils ../../lib/glMatrix ../../state/Constraints ./InteractiveController ../../state/utils/navigationUtils ../../support/mathUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});r=function(g){function k(a,b,c){var d=g.call(this)||this;d.view=a;d.pickingHelper=b;d.pivot=c;d.lastPoint=e.vec2d.create();d.tmpWorldUp=e.vec3d.create();d.tmpViewDir=e.vec3d.create();d.tmpRotCurPoint=e.vec2d.create();d.tmpTransf=e.mat4d.create();d.tmpAxis=e.vec3d.create();d.pivotPos=e.vec3d.create();d.constraintOptions={selection:15,interactionType:2,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};
- d.rotScale="center"===c?3:1.5;return d}f(k,g);k.prototype.begin=function(a){if(this.active){switch(this.pivot){case "eye":e.vec3d.set(this.beginCamera.eye,this.pivotPos);this.constraintOptions.interactionType=3;this.constraintOptions.selection=0;break;case "center":this.pickingHelper.pickRaySegment(this.beginCamera.eye,this.beginCamera.center,this.pivotPos)||(this.view.state.isLocal?this.pickingHelper.pickFreePointFromSegment(this.beginCamera.eye,this.beginCamera.center,this.pivotPos):e.vec3d.set(this.beginCamera.center,
- this.pivotPos)),this.beginCamera.center=this.pivotPos,this.constraintOptions.interactionType=2,this.constraintOptions.selection=11}this.constraintOptions.interactionStartCamera=this.beginCamera;d.normalizeCoordinate(this.beginCamera,a,this.lastPoint)}};k.prototype.update=function(b){if(this.active){var c;switch(this.pivot){case "eye":c=this.currentCamera.center;break;case "center":this.currentCamera.center=this.pivotPos,c=this.currentCamera.eye}this.applyRotation(this.currentCamera,b,c,this.pivotPos);
- a.applyAll(this.view,this.currentCamera,this.constraintOptions)}};k.prototype.end=function(){this.active&&this.finishController()};k.prototype.applyRotation=function(a,g,f,k){this.view.renderCoordsHelper.worldUpAtPosition(k,this.tmpWorldUp);d.normalizeCoordinate(a,g,this.tmpRotCurPoint);g=(this.tmpRotCurPoint[1]-this.lastPoint[1])*this.rotScale;var l=(this.tmpRotCurPoint[0]-this.lastPoint[0])*this.rotScale;e.vec3d.subtract(f,k,this.tmpViewDir);var p=e.vec3d.length(this.tmpViewDir),p=b.acos(e.vec3d.dot(this.tmpViewDir,
- this.tmpWorldUp)/p);if("eye"===this.pivot){var n=.5*Math.PI-p,m=.495*Math.PI;g=n-Math.max(-m,Math.min(m,n+-.5*g))}g=b.clamp(g+p,c.TiltDefault.min,c.TiltDefault.max)-p;e.mat4d.identity(this.tmpTransf);e.vec3d.cross(a.up,this.tmpViewDir,this.tmpAxis);"center"===this.pivot&&(l=-l);e.mat4d.rotate(this.tmpTransf,l,this.tmpWorldUp);e.mat4d.rotate(this.tmpTransf,g,this.tmpAxis);e.mat4d.multiplyVec3(this.tmpTransf,this.tmpViewDir);e.vec3d.add(k,this.tmpViewDir,f);e.mat4d.multiplyVec3(this.tmpTransf,a.up);
- e.vec2d.set(this.tmpRotCurPoint,this.lastPoint);a.markViewDirty()};return k}(g.InteractiveController);h.RotateController=r})},"esri/views/3d/state/controllers/InteractiveController":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./CameraController","../../webgl-engine/lib/Camera"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c.beginCamera=new e;c.currentCamera=new e;
- return c}f(c,a);Object.defineProperty(c.prototype,"isInteractive",{get:function(){return!0},enumerable:!0,configurable:!0});c.prototype.stepController=function(c,b){a.prototype.stepController.call(this,c,b);b.copyViewFrom(this.currentCamera);this.currentCamera.copyFrom(b)};c.prototype.onControllerStart=function(c){a.prototype.onControllerStart.call(this,c);this.beginCamera.copyFrom(c);this.currentCamera.copyFrom(c)};c.prototype.onControllerEnd=function(c){c.copyViewFrom(this.currentCamera);a.prototype.onControllerEnd.call(this,
- c)};return c}(a.CameraController);h.InteractiveController=r})},"esri/views/3d/input/handlers/DragZoom":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../state/controllers/global/ZoomController ../../state/controllers/local/ZoomController ../../state/helpers/PickingHelper ../../../input/InputHandler ../../../input/handlers/support".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function g(a,d,e){var g=b.call(this,
- !0)||this;g.view=a;g.pointerAction=d;g.pickingHelper=new c.PickingHelper(a);g.registerIncoming("drag",e,function(a){return g.handleDrag(a)});return g}f(g,b);g.prototype.handleDrag=function(b){var c=b.data;if(!(1<c.pointers.size)&&d.eventMatchesMousePointerAction(b.data,this.pointerAction)){var g=[c.center.x,this.view.height-c.center.y];switch(c.action){case "start":this.cameraController=this.view.state.isGlobal?new a.ZoomController(this.view,this.pickingHelper):new e.ZoomController(this.view,this.pickingHelper);
- this.view.state.switchCameraController(this.cameraController);this.cameraController.begin(g);break;case "update":this.cameraController.update(g);break;case "end":this.cameraController.end(),this.cameraController=null}b.stopPropagation()}};return g}(g.InputHandler);h.DragZoom=r})},"esri/views/3d/state/controllers/global/ZoomController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../InteractiveController ../../utils/navigationUtils".split(" "),
- function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function b(a,b){var d=c.call(this)||this;d.view=a;d.pickingHelper=b;d.pickPoint=e.vec3d.create();d.tmpP0=e.vec3d.create();d.panAxis=e.vec3d.create();d.tmpRayDir=e.vec3d.create();d.targetOnSphere=e.vec3d.create();d.dragBeginPoint=e.vec2d.create();d.normalizedAnchorPoint=e.vec2d.create();d.constraintOptions={selection:7,interactionType:1,interactionFactor:0,interactionStartCamera:null,interactionDirection:null};d.sphere=
- {center:e.vec3d.create(),radius:0};d.hasPickPoint=!1;return d}f(b,c);b.prototype.begin=function(a){this.active&&(e.vec2d.set(a,this.dragBeginPoint),g.normalizeCoordinate(this.beginCamera,a,this.normalizedAnchorPoint),a=g.pickPointAndInitSphere(this.pickingHelper,this.beginCamera,a,!1),this.hasPickPoint=!!a.scenePickPoint,this.pickPoint=a.scenePickPoint,this.sphere=a.sphere,this.constraintOptions.interactionStartCamera=this.beginCamera)};b.prototype.update=function(b){if(this.active){this.currentCamera.eye=
- this.beginCamera.eye;this.currentCamera.center=this.beginCamera.center;this.currentCamera.up=this.beginCamera.up;e.vec3d.subtract(this.currentCamera.center,this.currentCamera.eye,this.tmpRayDir);var c=e.vec3d.length(this.tmpRayDir);g.normalizeCoordinate(this.currentCamera,b,this.tmpP0);var d=12*(this.tmpP0[1]-this.normalizedAnchorPoint[1]),f=c*Math.pow(2,d),k=this.view.state.constraints.minimumPoiDistance;0>d&&f<k&&(f=k);1E-6>Math.abs(c-f)||(this.hasPickPoint&&f<c&&(d=1-(1-f/c)*(1-this.sphere.radius/
- e.vec3d.length(this.currentCamera.center)),e.vec3d.scale(this.currentCamera.center,d)),e.vec3d.scale(this.tmpRayDir,-f/c),e.vec3d.add(this.currentCamera.center,this.tmpRayDir,this.currentCamera.eye),this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.dragBeginPoint,b),a.applyAll(this.view,this.currentCamera,this.constraintOptions),this.hasPickPoint&&(g.sphereOrSilhouettePointFromScreenPoint(this.sphere,this.currentCamera,this.dragBeginPoint,this.targetOnSphere,!0),b=g.rotationAndAxisFromPoints(this.pickPoint,
- this.targetOnSphere,this.panAxis),g.applyRotation(this.currentCamera,this.sphere.center,this.panAxis,b)),a.applySurfaceCollision(this.view,this.currentCamera))}};b.prototype.end=function(){this.active&&this.finishController()};return b}(c.InteractiveController);h.ZoomController=r})},"esri/views/3d/state/controllers/local/ZoomController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../InteractiveController ../../utils/navigationUtils ../../../support/mathUtils".split(" "),
- function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function c(a,c){var d=b.call(this)||this;d.view=a;d.pickingHelper=c;d.tmpP=e.vec3d.create();d.tmpN=e.vec3d.create();d.tmpP0=e.vec3d.create();d.tmpPoi=e.vec3d.create();d.tmpRayDir=e.vec3d.create();d.dragBeginPoint=e.vec2d.create();d.normalizedAnchorPoint=e.vec2d.create();d.constraintOptions={selection:15,interactionType:1,interactionFactor:0,interactionStartCamera:null,interactionDirection:e.vec3d.create()};d.plane=
- {normal:e.vec3d.create(),d:0};return d}f(c,b);c.prototype.begin=function(a){this.active&&(e.vec2d.set(a,this.dragBeginPoint),g.normalizeCoordinate(this.beginCamera,a,this.normalizedAnchorPoint),this.pickingHelper.pickPointInScreen(a,this.tmpP)||this.pickingHelper.pickFreePointInScreen(a,this.tmpP),e.vec3d.normalize(e.vec3d.subtract(this.beginCamera.eye,this.beginCamera.center,this.tmpN)),0>this.tmpN[1]&&e.vec3d.negate(this.tmpN),g.setPlane(this.tmpP,this.tmpN,this.plane),this.constraintOptions.interactionStartCamera=
- this.beginCamera)};c.prototype.update=function(b){if(this.active){g.intersectPlaneFromScreenPoint(this.plane,this.currentCamera,this.dragBeginPoint,this.tmpPoi)||e.vec3d.set(this.currentCamera.center,this.tmpPoi);g.normalizeCoordinate(this.currentCamera,b,this.tmpP0);var c=4*(this.normalizedAnchorPoint[1]-this.tmpP0[1]);e.vec2d.set(this.tmpP0,this.normalizedAnchorPoint);e.vec3d.subtract(this.tmpPoi,this.currentCamera.eye,this.tmpRayDir);var f=e.vec3d.length(this.tmpRayDir),k=f*(1-c);e.vec3d.set(this.tmpRayDir,
- this.constraintOptions.interactionDirection);e.vec3d.scale(this.constraintOptions.interactionDirection,d.sign(c)/f);var l=this.view.state.constraints.minimumPoiDistance;0<=c&&k<l&&(k=l,c=-(k-f)/f);1E-6>Math.abs(f-k)||(e.vec3d.scale(this.tmpRayDir,c),e.vec3d.add(this.currentCamera.eye,this.tmpRayDir),e.vec3d.lerp(this.currentCamera.center,this.tmpPoi,c),this.currentCamera.center[2]=this.tmpPoi[2]>this.beginCamera.center[2]?Math.max(this.beginCamera.center[2],this.currentCamera.center[2]):Math.min(this.beginCamera.center[2],
- this.currentCamera.center[2]),this.currentCamera.markViewDirty(),this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.dragBeginPoint,b),a.applyAll(this.view,this.currentCamera,this.constraintOptions))}};c.prototype.end=function(){this.active&&this.finishController()};return c}(c.InteractiveController);h.ZoomController=r})},"esri/views/3d/input/handlers/KeyPan":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../state/controllers/global/PanContinuousController",
- "../../../input/InputHandler"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(d,b,e){var g=c.call(this,!0)||this;g.view=d;g.keyToDirection=(f={},f[b.left]=a.Direction.LEFT,f[b.right]=a.Direction.RIGHT,f[b.forward]=a.Direction.FORWARD,f[b.backward]=a.Direction.BACKWARD,f[b.up]=a.Direction.UP,f[b.down]=a.Direction.DOWN,f);d.state.isGlobal&&(g.registerIncoming("key-down",e,function(a){return g.handleKeyDown(a)}),g.registerIncoming("key-up",e,function(a){return g.handleKeyUp(a)}));
- return g;var f}f(e,c);e.prototype.handleKeyDown=function(c){if(!c.data.repeat){var b=this.keyToDirection[c.data.key];null!=b&&(this.cameraController&&this.cameraController.active||(this.cameraController=new a.PanContinuousController(this.view),this.view.state.switchCameraController(this.cameraController)),this.cameraController.active&&this.handleKey(c,b,!0))}};e.prototype.handleKeyUp=function(a){var b=this.keyToDirection[a.data.key];null!=b&&this.cameraController&&this.cameraController.active&&this.handleKey(a,
- b,!1)};e.prototype.handleKey=function(a,b,c){c?this.cameraController.addDirection(b):this.cameraController.removeDirection(b);a.stopPropagation()};return e}(e.InputHandler);h.KeyPan=r})},"esri/views/3d/state/controllers/global/PanContinuousController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ../CameraController ../../../support/earthUtils ../../../support/mathUtils".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,
- "__esModule",{value:!0});h.Direction={LEFT:1,RIGHT:2,FORWARD:4,BACKWARD:8,UP:16,DOWN:32};var b=e.vec3d,k=e.mat4d;r=function(c){function e(a){var d=c.call(this)||this;d.view=a;d.directionStatus=0;d.direction=b.create();d.tmpAxis=b.create();d.radiusChange=0;d.velocity=0;d.tmpP1=b.create();d.tmpTransf=k.create();return d}f(e,c);Object.defineProperty(e.prototype,"isInteractive",{get:function(){return!0},enumerable:!0,configurable:!0});e.prototype.addDirection=function(a){0===this.directionStatus&&b.set3(0,
- 0,0,this.direction);this.directionStatus&a||(this.directionStatus|=a,a&(h.Direction.LEFT|h.Direction.RIGHT|h.Direction.FORWARD|h.Direction.BACKWARD)?(this.computePanAxis(a,this.tmpAxis),b.add(this.direction,this.tmpAxis)):(a=this.directionStatus&(h.Direction.UP|h.Direction.DOWN),this.radiusChange=a===h.Direction.UP?1:a===h.Direction.DOWN?-1:0),this.velocity=this.computePanVelocity())};e.prototype.removeDirection=function(a){this.directionStatus&=~a;0===this.directionStatus&&this.active?this.finishController():
- a&(h.Direction.LEFT|h.Direction.RIGHT|h.Direction.FORWARD|h.Direction.BACKWARD)?(this.computePanAxis(a,this.tmpAxis),b.subtract(this.direction,this.tmpAxis),.01>b.length(this.direction)&&b.set3(0,0,0,this.direction)):(a=this.directionStatus&(h.Direction.UP|h.Direction.DOWN),this.radiusChange=a===h.Direction.UP?1:a===h.Direction.DOWN?-1:0)};e.prototype.stepController=function(d,e){c.prototype.stepController.call(this,d,e);d*=this.velocity;var g=!1;if(0<Math.abs(this.radiusChange)){var g=1+d*this.radiusChange,
- f=e.viewForward,l=b.normalize(e.center,this.tmpP1);(-.999<b.dot(f,l)||0>this.radiusChange)&&b.scale(e.center,g);b.scale(e.eye,g);this.velocity=this.computePanVelocity();g=!0}.01<b.length2(this.direction)&&(k.identity(this.tmpTransf),k.rotate(this.tmpTransf,d,this.direction),k.multiplyVec3(this.tmpTransf,e.eye),k.multiplyVec3(this.tmpTransf,e.center),k.multiplyVec3(this.tmpTransf,e.up),g=!0);g&&a.applyAll(this.view,e,{selection:14,interactionType:4,interactionStartCamera:this.view.state.camera,interactionFactor:null,
- interactionDirection:null})};e.prototype.computePanAxis=function(a,c){var d=this.view.state.camera;b.subtract(d.center,d.eye,c);b.cross(c,d.up);if(a===h.Direction.LEFT||a===h.Direction.RIGHT)b.normalize(c),b.cross(c,d.center);a!==h.Direction.RIGHT&&a!==h.Direction.FORWARD||b.negate(c);b.normalize(c)};e.prototype.computePanVelocity=function(){var a=.5*Math.abs(b.length(this.view.state.camera.eye)-g.earthRadius),a=d.clamp(a,1,2*g.earthRadius);return d.acos(1-a*a/(2*g.earthRadius*g.earthRadius))};return e}(c.CameraController);
- h.PanContinuousController=r})},"esri/views/3d/input/handlers/MouseWheelZoom":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../state/controllers/global/ZoomStepController ../../state/controllers/local/ZoomStepController ../../state/helpers/PickingHelper ../../../input/InputHandler".split(" "),function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(d){function b(a,b){var e=d.call(this,!0)||this;e.view=a;e.pickingHelper=new c.PickingHelper(a);
- e.registerIncoming("mouse-wheel",b,function(a){return e.handleMouseWheel(a)});return e}f(b,d);b.prototype.handleMouseWheel=function(b){var c=b.data;this.cameraController&&this.cameraController.active||(this.cameraController=this.view.state.isGlobal?new a.ZoomStepController(this.view,this.pickingHelper,"interaction"):new e.ZoomStepController(this.view,this.pickingHelper,"interaction"),this.view.state.switchCameraController(this.cameraController));this.cameraController.zoomStep(-1/60*c.deltaY,[c.x,
- this.view.height-c.y]);b.stopPropagation()};return b}(g.InputHandler);h.MouseWheelZoom=r})},"esri/views/3d/input/handlers/PinchAndPanNavigation":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../state/controllers/global/PinchAndPanController ../../state/controllers/local/PinchAndPanController ../../state/helpers/PickingHelper ../../../input/InputHandler ../../../input/handlers/support".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});
- r=function(b){function g(a,d,e){var g=b.call(this,!0)||this;g.view=a;g.pointerAction=d;g.lastEndTimestamp=0;g.lastTimestamp=0;g.pickingHelper=new c.PickingHelper(a);g.registerIncoming("drag",e,function(a){return g.handleDrag(a)});return g}f(g,b);g.prototype.handleDrag=function(a){if("mouse"!==a.data.pointerType||d.eventMatchesMousePointerAction(a.data,this.pointerAction)){var b=a.timestamp-this.lastEndTimestamp,b=this.momentum&&this.momentum.active&&40>b;switch(a.data.action){case "start":case "update":if(b)break;
- this.controller&&this.controller.active?2<a.data.timestamp-this.lastTimestamp&&(this.controller.update(a.data),this.lastTimestamp=a.timestamp):this.startController(a);break;case "end":case "removed":this.endController(a,!0);break;case "added":this.endController(a,!1),this.startController(a)}a.stopPropagation()}};g.prototype.endController=function(a,b){this.controller&&this.controller.active&&(this.lastEndTimestamp=a.timestamp,a=this.controller.end(a.data),b&&a&&(this.momentum=a,this.view.state.switchCameraController(this.momentum)));
- this.controller=null};g.prototype.startController=function(a){this.controller=this.createController();this.view.state.switchCameraController(this.controller);this.controller.begin(a.data);this.lastTimestamp=a.timestamp};g.prototype.createController=function(){return this.view.state.isGlobal?new a.PinchAndPanController(this.view,this.pickingHelper):new e.PinchAndPanController(this.view,this.pickingHelper)};return g}(g.InputHandler);h.PinchAndPanNavigation=r})},"esri/views/3d/state/controllers/global/PinchAndPanController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../input/util ../../../lib/glMatrix ../InteractiveController ../momentum/PanPlanarMomentumController ../momentum/PanSphericalMomentumController ../momentum/RotationMomentumController ../momentum/ZoomPlanarMomentumController ../momentum/ZoomSphericalMomentumController ../../utils/navigationUtils ../../utils/navigationUtils ../../../webgl-engine/lib/Camera ../../../../navigation/PanPlanarMomentumEstimator ../../../../navigation/PanSphericalMomentumEstimator ../../../../navigation/RotationMomentumEstimator ../../../../navigation/ZoomMomentumEstimator".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m){Object.defineProperty(h,"__esModule",{value:!0});r=function(g){function h(a,b){var d=g.call(this)||this;d.view=a;d.pickingHelper=b;d.smoothRotation=new e.ExponentialFalloff(.05);d.rotationAxis=c.vec3d.create();d.panningPlane={normal:c.vec3d.create(),d:0};d.smoothScaling=new e.ExponentialFalloff(.05);d.zoomCenterScreen=c.vec2d.create();d.zoomMomentumEstimator=new m.ZoomMomentumEstimator;d.rotationMomentumEstimator=new x.RotationMomentumEstimator;d.panSphericalMomentumEstimator=
- new v.PanSphericalMomentumEstimator;d.panPlanarMomentumEstimator=new q.PanPlanarMomentumEstimator;d.adjustedSphere={center:c.vec3d.create(),radius:0};d.tmp2d=c.vec2d.create();d.tmp3d=c.vec3d.create();d.beginScreenPoint=c.vec2d.create();d.beginScenePoint=c.vec3d.create();d.screenPickPoint=c.vec2d.create();d.panMode=t.PanMode.Horizontal;d.tmpInteractionDirection=c.vec3d.create();d.constraintOptions={selection:15,interactionType:0,interactionFactor:0,interactionStartCamera:new u,interactionDirection:null};
- return d}f(h,g);h.prototype.begin=function(a){if(this.active){this.beginRadius=a.radius;this.pointerCount=a.pointers.size;this.beginAngle=a.angle;this.smoothRotation.reset();n.navPointToScreenPoint(this.currentCamera,a.center,this.screenPickPoint);c.vec2d.set(this.screenPickPoint,this.beginScreenPoint);var b=n.pickPointAndInitSphere(this.pickingHelper,this.beginCamera,this.screenPickPoint,!0);this.scenePickPoint=b.scenePickPoint;this.sphere=b.sphere;c.vec3d.set(this.scenePickPoint,this.beginScenePoint);
- this.panMode=n.decidePanMode(this.beginCamera,this.sphere,this.scenePickPoint);if(this.panMode===t.PanMode.Vertical){c.vec3d.set(this.beginCamera.viewForward,this.panningPlane.normal);c.vec3d.normalize(this.panningPlane.normal);c.vec3d.negate(this.panningPlane.normal);n.setPlane(this.scenePickPoint,this.panningPlane.normal,this.panningPlane);b=c.vec3d.create();c.vec3d.set3(this.screenPickPoint[0],this.currentCamera.fullHeight,0,b);var d=c.vec3d.create(),e=c.vec3d.length(this.beginCamera.eye);this.adjustedSphere.radius=
- e<this.sphere.radius?e-100:this.sphere.radius;n.sphereOrSilhouettePointFromScreenPoint(this.adjustedSphere,this.beginCamera,b,d);this.beginCamera.projectPoint(d,b);this.screenPickPoint[1]=Math.min(this.screenPickPoint[1],.9*b[1]);this.pickingHelper.pickPointInScreen(this.screenPickPoint,this.scenePickPoint)&&n.setPlane(this.scenePickPoint,this.panningPlane.normal,this.panningPlane);n.navPointToScreenPoint(this.currentCamera,a.center,this.tmp2d);n.intersectPlaneFromScreenPoint(this.panningPlane,this.beginCamera,
- this.tmp2d,this.beginScenePoint)}this.constraintOptions.interactionStartCamera.copyFrom(this.beginCamera)}};h.prototype.update=function(a){if(this.active){this.currentCamera.copyFrom(this.beginCamera);var b=1<a.pointers.size;this.panMode===t.PanMode.Horizontal?(b&&this.zoomSpherical(a),this.panningSpherical(a),b&&this.rotateSpherical(a)):(b&&this.zoomPlanar(a),this.panningPlanar(a),b&&this.rotatePlanar(a));this.currentCamera.markViewDirty()}};h.prototype.end=function(a){a.pointers.size===this.pointerCount&&
- this.update(a);this.finishController();if(a=this.zoomMomentumEstimator.evaluateMomentum())return this.panMode===t.PanMode.Horizontal?new p.ZoomSphericalMomentumController(this.view,a,this.zoomCenterScreen,this.beginScenePoint,this.sphere.radius):new l.ZoomPlanarMomentumController(this.view,a,this.beginScenePoint);if(a=this.rotationMomentumEstimator.evaluateMomentum())return new k.RotationMomentumController(this.view,a,this.sphere.center,this.rotationAxis);if(this.panMode===t.PanMode.Horizontal){if(a=
- this.panSphericalMomentumEstimator.evaluateMomentum())return new b.PanSphericalMomentumController(this.view,a)}else if(a=this.panPlanarMomentumEstimator.evaluateMomentum())return new d.PanPlanarMomentumController(this.view,a);return null};h.prototype.zoomSpherical=function(b){var c=this.beginRadius/b.radius;this.smoothScaling.gain=.001875*Math.min(Math.max(b.radius,40),120);this.smoothScaling.update(c);n.applyZoomOnSphere(this.sphere,this.currentCamera,this.smoothScaling.value);n.navPointToScreenPoint(this.currentCamera,
- b.center,this.zoomCenterScreen);this.zoomMomentumEstimator.add(this.smoothScaling.value,.001*b.timestamp);this.constraintOptions.interactionType=1;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(b.radius-this.beginRadius);a.applyAll(this.view,this.currentCamera,this.constraintOptions)};h.prototype.panningSpherical=function(b){n.navPointToScreenPoint(this.currentCamera,b.center,this.tmp2d);n.sphereOrSilhouettePointFromScreenPoint(this.sphere,this.currentCamera,this.tmp2d,
- this.tmp3d);n.applyPanSpherical(this.sphere,this.currentCamera,this.beginScenePoint,this.tmp3d);this.panSphericalMomentumEstimator.add(this.tmp2d,this.tmp3d,.001*b.timestamp);this.constraintOptions.interactionType=4;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.screenPickPoint,this.tmp2d);a.applyAll(this.view,this.currentCamera,this.constraintOptions)};h.prototype.rotateSpherical=function(b){c.vec3d.normalize(this.scenePickPoint,this.rotationAxis);var d=this.smoothRotation.value,
- e=n.normalizeRotationDelta(b.angle-d),d=d+e;this.smoothRotation.gain=.00125*Math.min(Math.max(b.radius,40),120);this.smoothRotation.update(d);e=this.smoothRotation.value-this.beginAngle;this.rotationMomentumEstimator.add(e,.001*b.timestamp);n.applyRotation(this.currentCamera,this.sphere.center,this.rotationAxis,e);this.constraintOptions.interactionType=2;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(b.radius*d);a.applyAll(this.view,this.currentCamera,this.constraintOptions)};
- h.prototype.panningPlanar=function(b){n.navPointToScreenPoint(this.currentCamera,b.center,this.tmp2d);n.intersectPlaneFromScreenPoint(this.panningPlane,this.currentCamera,this.tmp2d,this.tmp3d)&&(n.applyPanPlanar(this.currentCamera,this.beginScenePoint,this.tmp3d),this.panPlanarMomentumEstimator.add(this.tmp2d,this.tmp3d,.001*b.timestamp),this.constraintOptions.interactionType=4,this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.beginScreenPoint,this.tmp2d),this.constraintOptions.interactionDirection=
- this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this.tmpInteractionDirection),a.applyAll(this.view,this.currentCamera,this.constraintOptions),this.constraintOptions.interactionDirection=null)};h.prototype.zoomPlanar=function(b){var c=this.beginRadius/b.radius;this.smoothScaling.gain=.001875*Math.min(Math.max(b.radius,40),120);this.smoothScaling.update(c);this.zoomMomentumEstimator.add(this.smoothScaling.value,.001*b.timestamp);n.applyZoomToPoint(this.currentCamera,this.beginScenePoint,
- this.smoothScaling.value,this.view.state.constraints.minimumPoiDistance);this.constraintOptions.interactionType=1;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(b.radius-this.beginRadius);a.applyAll(this.view,this.currentCamera,this.constraintOptions)};h.prototype.rotatePlanar=function(b){c.vec3d.set(this.beginScenePoint,this.rotationAxis);var d=this.smoothRotation.value,e=b.angle-d,e=n.normalizeRotationDelta(e);this.smoothRotation.gain=.00125*Math.min(Math.max(b.radius,
- 40),120);this.smoothRotation.update(d+e);d=this.smoothRotation.value-this.beginAngle;this.rotationMomentumEstimator.add(d,.001*b.timestamp);n.applyRotation(this.currentCamera,this.sphere.center,this.rotationAxis,d);this.constraintOptions.interactionType=2;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(b.radius*d);a.applyAll(this.view,this.currentCamera,this.constraintOptions)};return h}(g.InteractiveController);h.PinchAndPanController=r})},"esri/views/3d/input/util":function(){define(["require",
- "exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a){this._gain=a}f.prototype.reset=function(a){this._value=a};Object.defineProperty(f.prototype,"gain",{set:function(a){this._gain=a},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"value",{get:function(){return void 0===this._value?0:this._value},enumerable:!0,configurable:!0});f.prototype.update=function(a){this._value=void 0===this._value?a:this._gain*a+(1-this._gain)*this._value};
- return f}();h.ExponentialFalloff=r})},"esri/views/3d/state/controllers/momentum/PanPlanarMomentumController":function(){define(["require","exports","../../../../../core/tsSupport/extendsHelper","../../../lib/glMatrix","./MomentumController"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(d,b){d=c.call(this,d,4)||this;d.momentum=b;d.tmpPan=a.vec3d.create();return d}f(e,c);e.prototype.momentumStep=function(c,b){c=this.momentum.value(c);a.vec3d.scale(this.momentum.direction,
- c,this.tmpPan);a.vec3d.subtract(b.eye,this.tmpPan);a.vec3d.subtract(b.center,this.tmpPan);b.markViewDirty();this.constraintOptions.interactionDirection=this.tmpPan};return e}(e.MomentumController);h.PanPlanarMomentumController=r})},"esri/views/3d/state/controllers/momentum/MomentumController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../AnimationController ../../../webgl-engine/lib/Camera".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,
- "__esModule",{value:!0});r=function(e){function d(a,d){d=e.call(this)||this;d.view=a;d.beginCamera=new c;d.elapsedTimeSec=0;d.constraintOptions={selection:15,interactionType:4,interactionFactor:0,interactionStartCamera:new c,interactionDirection:null};return d}f(d,e);Object.defineProperty(d.prototype,"steppingFinished",{get:function(){return this.momentum.isFinished(this.elapsedTimeSec)},enumerable:!0,configurable:!0});d.prototype.onControllerStart=function(a){this.beginCamera.copyFrom(a);this.constraintOptions.interactionStartCamera=
- this.beginCamera;e.prototype.onControllerStart.call(this,a)};d.prototype.stepController=function(b,c){c.copyViewFrom(this.beginCamera);this.elapsedTimeSec+=b;this.momentumStep(this.elapsedTimeSec,c);a.applyAll(this.view,c,this.constraintOptions)};return d}(e.AnimationController);h.MomentumController=r})},"esri/views/3d/state/controllers/momentum/PanSphericalMomentumController":function(){define(["require","exports","../../../../../core/tsSupport/extendsHelper","./MomentumController","../../utils/navigationUtils"],
- function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});var c=[0,0,0];r=function(a){function d(b,c){b=a.call(this,b,4)||this;b.momentum=c;return b}f(d,a);d.prototype.momentumStep=function(a,d){a=this.momentum.value(a);e.applyRotation(d,c,this.momentum.axis,a)};return d}(a.MomentumController);h.PanSphericalMomentumController=r})},"esri/views/3d/state/controllers/momentum/RotationMomentumController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../lib/glMatrix ./MomentumController ../../utils/navigationUtils".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(b,c,d,g){b=e.call(this,b,2)||this;b.momentum=c;b.axis=a.vec3d.create();b.center=a.vec3d.create();a.vec3d.set(g,b.axis);a.vec3d.set(d,b.center);return b}f(d,e);d.prototype.momentumStep=function(a,d){a=this.momentum.value(a);c.applyRotation(d,this.center,this.axis,a)};return d}(e.MomentumController);h.RotationMomentumController=r})},"esri/views/3d/state/controllers/momentum/ZoomPlanarMomentumController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../lib/glMatrix ./MomentumController ../../utils/navigationUtils".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(b,c,d){b=e.call(this,b,1)||this;b.momentum=c;b.zoomCenter=a.vec3d.create();a.vec3d.set(d,b.zoomCenter);b.constraintOptions.interactionDirection=a.vec3d.create();return b}f(d,e);d.prototype.momentumStep=function(b,d){a.vec3d.set(d.eye,this.constraintOptions.interactionDirection);b=this.momentum.valueDelta(0,b);c.applyZoomToPoint(d,this.zoomCenter,b,this.view.state.constraints.minimumPoiDistance);this.constraintOptions.interactionDirection=
- a.vec3d.direction(this.constraintOptions.interactionDirection,d.eye)};return d}(e.MomentumController);h.ZoomPlanarMomentumController=r})},"esri/views/3d/state/controllers/momentum/ZoomSphericalMomentumController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../lib/glMatrix ./MomentumController ../../utils/navigationUtils".split(" "),function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function b(a,
- b,d,g,f){a=c.call(this,a,1)||this;a.momentum=b;a.screenCenter=e.vec2d.create();a.sceneCenter=e.vec3d.create();a.tmpSceneCenter=e.vec3d.create();a.tmpZoomAxis=e.vec3d.create();a.sphere={center:e.vec3d.create(),radius:0};e.vec2d.set(d,a.screenCenter);e.vec3d.set(g,a.sceneCenter);a.sphere.radius=f;return a}f(b,c);b.prototype.momentumStep=function(b,c){b=this.momentum.valueDelta(0,b);g.applyZoomOnSphere(this.sphere,c,b);this.constraintOptions.interactionType=1;a.applyAll(this.view,c,this.constraintOptions);
- g.sphereOrSilhouettePointFromScreenPoint(this.sphere,c,this.screenCenter,this.tmpSceneCenter);b=g.rotationAndAxisFromPoints(this.sceneCenter,this.tmpSceneCenter,this.tmpZoomAxis);g.applyRotation(c,this.sphere.center,this.tmpZoomAxis,b);this.constraintOptions.interactionType=4};return b}(c.MomentumController);h.ZoomSphericalMomentumController=r})},"esri/views/navigation/PanPlanarMomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/lib/glMatrix ./FilteredFiniteDifference ./Momentum".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});var g=function(a){function b(b,c,d,e,g){b=a.call(this,b,c,d)||this;b.sceneVelocity=e;b.direction=g;return b}f(b,a);b.prototype.value=function(b){return a.prototype.valueFromInitialVelocity.call(this,this.sceneVelocity,b)};return b}(c.Momentum);h.PanPlanarMomentum=g;r=function(){function c(b,c,d){void 0===b&&(b=300);void 0===c&&(c=12);void 0===d&&(d=.84);this.minimumInitialVelocity=b;this.stopVelocity=c;this.friction=d;this.time=
- new e.FilteredFiniteDifference(.6);this.screen=[new e.FilteredFiniteDifference(.4),new e.FilteredFiniteDifference(.4)];this.scene=[new e.FilteredFiniteDifference(.6),new e.FilteredFiniteDifference(.6),new e.FilteredFiniteDifference(.6)];this.tmpDirection=a.vec3d.create()}c.prototype.add=function(a,c,d){this.time.hasLastValue&&.015>this.time.computeDelta(d)||(this.screen[0].update(a[0]),this.screen[1].update(a[1]),this.scene[0].update(c[0]),this.scene[1].update(c[1]),this.scene[2].update(c[2]),this.time.update(d))};
- c.prototype.reset=function(){this.screen[0].reset();this.screen[1].reset();this.scene[0].reset();this.scene[1].reset();this.scene[2].reset();this.time.reset()};c.prototype.evaluateMomentum=function(){if(!this.screen[0].hasFilteredDelta)return null;var a=this.screen[0].filteredDelta,c=this.screen[1].filteredDelta,a=Math.sqrt(a*a+c*c)/this.time.filteredDelta;return Math.abs(a)<this.minimumInitialVelocity?null:this.createMomentum(a,this.stopVelocity,this.friction)};c.prototype.createMomentum=function(b,
- c,d){a.vec3d.set3(this.scene[0].filteredDelta,this.scene[1].filteredDelta,this.scene[2].filteredDelta,this.tmpDirection);var e=a.vec3d.length(this.tmpDirection);0<e&&a.vec3d.scale(this.tmpDirection,1/e);return new g(b,c,d,e/this.time.filteredDelta,this.tmpDirection)};return c}();h.PanPlanarMomentumEstimator=r})},"esri/views/navigation/FilteredFiniteDifference":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a){this.gain=
- a}f.prototype.update=function(a){if(this.hasLastValue){var e=this.computeDelta(a);this.updateDelta(e)}this.lastValue=a};f.prototype.reset=function(){this.filteredDelta=this.lastValue=void 0};Object.defineProperty(f.prototype,"hasLastValue",{get:function(){return void 0!==this.lastValue},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"hasFilteredDelta",{get:function(){return void 0!==this.filteredDelta},enumerable:!0,configurable:!0});f.prototype.computeDelta=function(a){return a-
- this.lastValue};f.prototype.updateDelta=function(a){this.filteredDelta=this.hasFilteredDelta?(1-this.gain)*this.filteredDelta+this.gain*a:a};return f}();h.FilteredFiniteDifference=r})},"esri/views/navigation/Momentum":function(){define(["require","exports","../../core/tsSupport/extendsHelper"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a,c,g){this._initialVelocity=a;this._stopVelocity=c;this._friction=g;this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/
- this._stopVelocity)/Math.log(1-this._friction))}Object.defineProperty(a.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0});a.prototype.isFinished=function(a){return a>this.duration};Object.defineProperty(a.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0});a.prototype.value=function(a){return this.valueFromInitialVelocity(this._initialVelocity,a)};a.prototype.valueDelta=function(a,c){var e=this.value(a);return this.value(a+
- c)-e};a.prototype.valueFromInitialVelocity=function(a,c){c=Math.min(c,this.duration);var e=1-this.friction;return a*(Math.pow(e,c)-1)/Math.log(e)};return a}();h.Momentum=r})},"esri/views/navigation/PanSphericalMomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/lib/glMatrix ../../views/3d/state/utils/navigationUtils ./FilteredFiniteDifference ./FilteredValue ./Momentum".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});
- var b=function(a){function b(b,c,d,e,g){b=a.call(this,b,c,d)||this;b.angularVelocity=e;b.axis=g;return b}f(b,a);b.prototype.value=function(b){return a.prototype.valueFromInitialVelocity.call(this,this.angularVelocity,b)};return b}(d.Momentum);h.PanSphericalMomentum=b;r=function(){function d(b,d,e){void 0===b&&(b=300);void 0===d&&(d=12);void 0===e&&(e=.84);this.minimumInitialVelocity=b;this.stopVelocity=d;this.friction=e;this.tmpAxis=a.vec3d.create();this.time=new c.FilteredFiniteDifference(.3);this.screen=
- [new c.FilteredFiniteDifference(.4),new c.FilteredFiniteDifference(.4)];this.angle=new g.FilteredValue(.6);this.axis=a.vec3d.create();this.lastScene=a.vec3d.create()}d.prototype.add=function(b,c,d){if(this.time.hasLastValue){if(.01>this.time.computeDelta(d))return;var g=e.rotationAndAxisFromPoints(this.lastScene,c,this.tmpAxis);1E-5>a.vec3d.length2(this.tmpAxis)?g=0:a.vec3d.normalize(this.tmpAxis,this.axis);this.angle.update(g);a.vec3d.set(c,this.lastScene)}this.screen[0].update(b[0]);this.screen[1].update(b[1]);
- this.time.update(d)};d.prototype.reset=function(){this.screen[0].reset();this.screen[1].reset();this.angle.reset();this.time.reset()};d.prototype.evaluateMomentum=function(){if(!this.screen[0].hasFilteredDelta)return null;var a=this.screen[0].filteredDelta,b=this.screen[1].filteredDelta,a=Math.sqrt(a*a+b*b)/this.time.filteredDelta;return Math.abs(a)<this.minimumInitialVelocity?null:this.createMomentum(a,this.stopVelocity,this.friction)};d.prototype.createMomentum=function(a,c,d){return new b(a,c,
- d,this.angle.filteredValue/this.time.filteredDelta,this.axis)};return d}();h.PanSphericalMomentumEstimator=r})},"esri/views/navigation/FilteredValue":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a){this.gain=a}f.prototype.update=function(a){this.filteredValue=this.hasFilteredValue?(1-this.gain)*this.filteredValue+this.gain*a:a};f.prototype.reset=function(){this.filteredValue=void 0};Object.defineProperty(f.prototype,
- "hasFilteredValue",{get:function(){return void 0!==this.filteredValue},enumerable:!0,configurable:!0});return f}();h.FilteredValue=r})},"esri/views/navigation/RotationMomentumEstimator":function(){define(["require","exports","../../core/tsSupport/extendsHelper","./MomentumEstimator"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c,d,b,e){void 0===c&&(c=3);void 0===d&&(d=.01);void 0===b&&(b=.95);void 0===e&&(e=12);return a.call(this,c,d,b,e)||this}f(c,
- a);c.prototype.add=function(c,d){if(this.value.hasLastValue){var b=this.value.lastValue;for(c-=b;c>Math.PI;)c-=2*Math.PI;for(;c<-Math.PI;)c+=2*Math.PI;c=b+c}a.prototype.add.call(this,c,d)};return c}(a.MomentumEstimator);h.RotationMomentumEstimator=r})},"esri/views/navigation/MomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/support/mathUtils ./FilteredFiniteDifference ./Momentum".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});
- r=function(){function g(a,b,c,g){void 0===a&&(a=2.5);void 0===b&&(b=.01);void 0===c&&(c=.95);void 0===g&&(g=12);this.minimumInitialVelocity=a;this.stopVelocity=b;this.friction=c;this.maxVelocity=g;this.value=new e.FilteredFiniteDifference(.8);this.time=new e.FilteredFiniteDifference(.3)}g.prototype.add=function(a,b){if(this.time.hasLastValue){if(.01>this.time.computeDelta(b))return;if(this.value.hasFilteredDelta){var c=this.value.computeDelta(a);0>this.value.filteredDelta*c&&this.value.reset()}}this.time.update(b);
- this.value.update(a)};g.prototype.reset=function(){this.value.reset();this.time.reset()};g.prototype.evaluateMomentum=function(){if(!this.value.hasFilteredDelta)return null;var c=this.value.filteredDelta/this.time.filteredDelta,c=a.clamp(c,-this.maxVelocity,this.maxVelocity);return Math.abs(c)<this.minimumInitialVelocity?null:this.createMomentum(c,this.stopVelocity,this.friction)};g.prototype.createMomentum=function(a,b,e){return new c.Momentum(a,b,e)};return g}();h.MomentumEstimator=r})},"esri/views/navigation/ZoomMomentumEstimator":function(){define(["require",
- "exports","../../core/tsSupport/extendsHelper","./Momentum","./MomentumEstimator"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});var c=function(a){function c(b,c,d){return a.call(this,b,c,d)||this}f(c,a);c.prototype.value=function(b){b=a.prototype.value.call(this,b);return Math.exp(b)};c.prototype.valueDelta=function(b,c){var d=a.prototype.value.call(this,b);b=a.prototype.value.call(this,b+c);return Math.exp(b-d)};return c}(a.Momentum);h.ZoomMomentum=c;r=function(a){function d(b,
- c,d,e){void 0===b&&(b=2.5);void 0===c&&(c=.01);void 0===d&&(d=.95);void 0===e&&(e=12);return a.call(this,b,c,d,e)||this}f(d,a);d.prototype.add=function(b,c){a.prototype.add.call(this,Math.log(b),c)};d.prototype.createMomentum=function(a,d,e){return new c(a,d,e)};return d}(e.MomentumEstimator);h.ZoomMomentumEstimator=r})},"esri/views/3d/state/controllers/local/PinchAndPanController":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../camera/constraintUtils ../../../input/util ../../../lib/glMatrix ../InteractiveController ../momentum/PanPlanarMomentumController ../momentum/RotationMomentumController ../momentum/ZoomPlanarMomentumController ../../utils/navigationUtils ../../../webgl-engine/lib/Camera ../../../../navigation/PanPlanarMomentumEstimator ../../../../navigation/RotationMomentumEstimator ../../../../navigation/ZoomMomentumEstimator".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){Object.defineProperty(h,"__esModule",{value:!0});var q;(function(a){a[a.Vertical=0]="Vertical";a[a.Horizontal=1]="Horizontal"})(q=h.PanMode||(h.PanMode={}));var v=c.vec3d.createFrom(0,0,1),x=16/180*Math.PI;r=function(g){function m(a,b){var d=g.call(this)||this;d.view=a;d.pickingHelper=b;d.rotationValueSmooth=new e.ExponentialFalloff(.05);d.scalingValueSmooth=new e.ExponentialFalloff(.05);d.planeHorizontal={normal:c.vec3d.create(),d:0};d.planeVertical={normal:c.vec3d.create(),
- d:0};d.rotationMomentumEstimator=new t.RotationMomentumEstimator;d.panMomentumEstimator=new n.PanPlanarMomentumEstimator(300,12,.9);d.zoomMomentumEstimator=new u.ZoomMomentumEstimator;d.beginCenter=c.vec3d.create();d.tmpPoints=[];d.beginCenterScreen=c.vec2d.create();d.tmpCentroid3d=c.vec3d.create();d.tmpCentroid2d=c.vec2d.create();d.tmp2d=c.vec2d.create();d.constraintOptions={selection:15,interactionType:0,interactionFactor:0,interactionStartCamera:new p,interactionDirection:null};return d}f(m,g);
- m.prototype.begin=function(a){if(this.active){this.beginRadius=a.radius;this.pointerCount=a.pointers.size;this.beginAngle=a.angle;this.rotationValueSmooth.reset();this.scalingValueSmooth.reset();l.navPointToScreenPoint(this.beginCamera,a.center,this.beginCenterScreen);this.planeHorizontal.d=0;c.vec3d.set(v,this.planeHorizontal.normal);var b=c.vec3d.create();this.pickingHelper.pickPointInScreen(this.beginCenterScreen,b)||this.pickingHelper.pickFreePointInScreen(this.beginCenterScreen,b);var d=c.vec3d.create();
- c.vec3d.negate(this.beginCamera.viewForward,d);var e=c.vec3d.create();c.vec3d.set(v,e);var g=c.vec3d.dot(d,e);this.panMode=Math.asin(0>g?-g:g)>=x?q.Horizontal:q.Vertical;l.setPlaneD(b,this.planeHorizontal);0>c.vec3d.dot(this.planeHorizontal.normal,this.beginCamera.eye)+this.planeHorizontal.d&&(c.vec3d.negate(this.planeHorizontal.normal),this.planeHorizontal.d*=-1);this.panMode===q.Vertical?(c.vec3d.scale(e,g),c.vec3d.subtract(d,e,this.planeVertical.normal),c.vec3d.normalize(this.planeVertical.normal),
- l.setPlaneD(b,this.planeVertical),this.computePlanePoints(a.pointers,this.planeVertical,this.beginCamera,this.tmpPoints)):this.computePlanePoints(a.pointers,this.planeHorizontal,this.beginCamera,this.tmpPoints);l.centroid(this.tmpPoints,this.beginCenter);this.constraintOptions.interactionStartCamera.copyFrom(this.beginCamera)}};m.prototype.update=function(b){if(this.active){this.currentCamera.copyFrom(this.beginCamera);var c=1<b.pointers.size,d=this.panMode===q.Horizontal?this.planeHorizontal:this.planeVertical,
- e=this.beginCenter;if(c){var g=this.beginRadius/b.radius,f=.001875*Math.min(Math.max(b.radius,40),120);this.scalingValueSmooth.gain=f;this.scalingValueSmooth.update(g);l.applyZoomToPoint(this.currentCamera,e,this.scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance);this.zoomMomentumEstimator.add(this.scalingValueSmooth.value,.001*b.timestamp);this.constraintOptions.interactionType=1;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(Math.abs(b.radius-this.beginRadius));
- a.applyAll(this.view,this.currentCamera,this.constraintOptions)}this.computePlanePoints(b.pointers,d,this.currentCamera,this.tmpPoints);l.centroid(this.tmpPoints,this.tmpCentroid3d);l.navPointToScreenPoint(this.currentCamera,b.center,this.tmpCentroid2d);l.applyPanPlanar(this.currentCamera,e,this.tmpCentroid3d);this.panMomentumEstimator.add(this.tmpCentroid2d,this.tmpCentroid3d,.001*b.timestamp);this.constraintOptions.interactionType=4;this.constraintOptions.interactionFactor=a.pixelDistanceToInteractionFactor(this.beginCenterScreen,
- this.tmpCentroid2d);a.applyAll(this.view,this.currentCamera,this.constraintOptions);c&&(c=this.planeHorizontal.normal,d=this.rotationValueSmooth.value,g=l.normalizeRotationDelta(b.angle-d),f=.00125*Math.min(Math.max(b.radius,40),120),this.rotationValueSmooth.gain=f,this.rotationValueSmooth.update(d+g),f=this.rotationValueSmooth.value-this.beginAngle,this.rotationMomentumEstimator.add(f,.001*b.timestamp),l.applyRotation(this.currentCamera,e,c,f),this.constraintOptions.interactionType=2,this.constraintOptions.interactionFactor=
- a.pixelDistanceToInteractionFactor(Math.abs(b.radius*f)),a.applyAll(this.view,this.currentCamera,this.constraintOptions));this.currentCamera.markViewDirty()}};m.prototype.end=function(a){a.pointers.size===this.pointerCount&&this.update(a);this.finishController();return(a=this.zoomMomentumEstimator.evaluateMomentum())?new k.ZoomPlanarMomentumController(this.view,a,this.beginCenter):(a=this.rotationMomentumEstimator.evaluateMomentum())?new b.RotationMomentumController(this.view,a,this.beginCenter,this.planeHorizontal.normal):
- (a=this.panMomentumEstimator.evaluateMomentum())?new d.PanPlanarMomentumController(this.view,a):null};m.prototype.computePlanePoints=function(a,b,d,e){e.length=a.size;var g=this.tmp2d,f=0;a.forEach(function(a){l.navPointToScreenPoint(d,a,g);void 0===e[f]&&(e[f]=c.vec3d.create());l.intersectPlaneFromScreenPoint(b,d,g,e[f]);f+=1});return e};return m}(g.InteractiveController);h.PinchAndPanController=r})},"esri/views/3d/input/handlers/PointerDownCancelAnimation":function(){define(["require","exports",
- "../../../../core/tsSupport/extendsHelper","../../../input/InputHandler"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c,d){var b=a.call(this,!0)||this;b.view=c;b.registerIncoming("pointer-down",d,function(a){return b.view.state.stopActiveCameraController()});return b}f(c,a);return c}(a.InputHandler);h.PointerDownCancelAnimation=r})},"esri/views/3d/input/handlers/SingleKeyResetHeading":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper",
- "./SingleKey"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c,d,b){b=a.call(this,"esri.views.3d.input.handlers.SingleKeyResetHeading",d,b)||this;b.view=c;b.key=d;return b}f(c,a);c.prototype.activate=function(){this.view.goTo({heading:0})};return c}(a.SingleKey);h.SingleKeyResetHeading=r})},"esri/views/3d/input/handlers/SingleKey":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../../input/InputHandler"],function(r,
- h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c,d,b){var e=a.call(this,!0)||this;e.key=d;e.registerIncoming("key-down",b,function(a){return e._handleKeyDown(a)});return e}f(c,a);c.prototype._handleKeyDown=function(a){a.data.key===this.key&&(this.activate(),a.stopPropagation())};return c}(a.InputHandler);h.SingleKey=r})},"esri/views/3d/input/handlers/SingleKeyResetTilt":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./SingleKey"],
- function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c,d,b){b=a.call(this,"esri.views.3d.input.handlers.SingleKeyResetTilt",d,b)||this;b.view=c;b.key=d;return b}f(c,a);c.prototype.activate=function(){this.view.goTo({tilt:0})};return c}(a.SingleKey);h.SingleKeyResetTilt=r})},"esri/views/3d/input/handlers/TwoFingerTilt":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../state/controllers/RotateController ../../state/helpers/PickingHelper ../../../input/InputHandler".split(" "),
- function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function d(a,d){void 0===d&&(d=!1);var b=c.call(this,!0)||this;b.view=a;b.invert=d;b.pickingHelper=new e.PickingHelper(a);b.registerIncoming("vertical-two-finger-drag",function(a){return b.handleTwoFinger(a)});return b}f(d,c);d.prototype.handleTwoFinger=function(b){var c=[0,-b.data.delta*(this.invert?-1:1)];switch(b.data.action){case "begin":this.cameraController=new a.RotateController(this.view,this.pickingHelper,
- "center");this.view.state.switchCameraController(this.cameraController);this.cameraController.begin(c);break;case "update":this.cameraController.update(c);break;case "end":this.cameraController.end(),this.cameraController=null}};return d}(c.InputHandler);h.TwoFingerTilt=r})},"esri/views/input/BrowserEventSource":function(){define(["require","exports","dojo/sniff","../../core/libs/pep/pep","./keys"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});var c=f("trident"),g=f("edge"),
- d=f("chrome"),b=f("ff"),k=f("safari");r=function(){function f(b){this._active={};this._activePointerCaptures=new Set;this._keyDownState=new Set;this._element=b;a.applyLocal(b);b.getAttribute("tabindex")||b.setAttribute("tabindex","0");this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,
- "mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost};this._initialCssTouchAction=b.style.touchAction;b.style.touchAction="none";this._element.addEventListener("keydown",this._preventAltKeyDefault)}f.prototype.destroy=function(){var a=this;this.activeEvents=this._callback=null;this._activePointerCaptures.forEach(function(b){a._element.releasePointerCapture(b)});this._activePointerCaptures=null;this._element.style.touchAction=this._initialCssTouchAction;this._element.removeEventListener("keydown",
- this._preventAltKeyDefault)};Object.defineProperty(f.prototype,"onEventReceived",{set:function(a){this._callback=a},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"activeEvents",{set:function(a){var b=this,c;for(c in this._active)a&&a.has(c)||(this._element.removeEventListener(l[c],this._active[c]),delete this._active[c]);a&&a.forEach(function(a){if(!b._active[a]&&l[a]){var c=(b._eventHandlers[a]||b._handleDefault).bind(b,a);b._element.addEventListener(l[a],c);b._active[a]=c}})},
- enumerable:!0,configurable:!0});f.prototype.setPointerCapture=function(a,b){b?(this._element.setPointerCapture(a.pointerId),this._activePointerCaptures.add(a.pointerId)):(this._element.releasePointerCapture(a.pointerId),this._activePointerCaptures.delete(a.pointerId))};f.prototype._updateNormalizedPointerLikeEvent=function(a,b){var c=this._element.getBoundingClientRect();b.x=a.clientX-Math.round(c.left);b.y=a.clientY-Math.round(c.top);return b};f.prototype._handleKey=function(a,b){var c=e.eventKey(b);
- c&&"key-up"===a&&this._keyDownState.delete(c);b={native:b,key:c,repeat:c&&this._keyDownState.has(c)};c&&"key-down"===a&&this._keyDownState.add(b.key);this._callback(a,b)};f.prototype._handlePointer=function(a,b){b=this._updateNormalizedPointerLikeEvent(b,{native:b,x:0,y:0,pointerType:b.pointerType,button:b.button,buttons:b.buttons});this._callback(a,b)};f.prototype._handlePointerPreventDefault=function(a,b){var c=this._updateNormalizedPointerLikeEvent(b,{native:b,x:0,y:0,pointerType:b.pointerType,
- button:b.button,buttons:b.buttons});b.preventDefault();this._callback(a,c)};f.prototype._handleMouseWheel=function(a,e){e.preventDefault();var f=e.deltaY;switch(e.deltaMode){case 0:if(c||g)f=f/document.documentElement.clientHeight*600;break;case 1:f*=30;break;case 2:f*=900}c||g?f*=.7:d||k?f*=.6:b&&(f*=1.375);var l=Math.abs(f);100<l&&(f=f/l*200/(1+Math.exp(-.02*(l-100))));e=this._updateNormalizedPointerLikeEvent(e,{native:e,x:0,y:0,deltaY:f});this._callback(a,e)};f.prototype._handlePointerCaptureLost=
- function(a,b){this._activePointerCaptures.delete(b.pointerId);this._handleDefault(a,b)};f.prototype._handleDefault=function(a,b){var c={native:b};b.preventDefault();this._callback(a,c)};f.prototype._preventAltKeyDefault=function(a){"Alt"===a.key&&a.preventDefault()};return f}();h.BrowserEventSource=r;var l={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture",
- "context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave"}})},"esri/core/libs/pep/pep":function(){define(function(){function r(a,b){b=b||Object.create(null);var c=document.createEvent("Event");c.initEvent(a,b.bubbles||!1,b.cancelable||!1);a=2;for(var d;a<k.length;a++)d=k[a],c[d]=b[d]||l[a];c.buttons=b.buttons||0;a=0;a=b.pressure?b.pressure:c.buttons?.5:0;c.x=c.clientX;c.y=c.clientY;c.pointerId=b.pointerId||0;c.width=b.width||0;c.height=b.height||0;c.pressure=a;c.tiltX=
- b.tiltX||0;c.tiltY=b.tiltY||0;c.pointerType=b.pointerType||"";c.hwTimestamp=b.hwTimestamp||0;c.isPrimary=b.isPrimary||!1;return c}function h(){this.array=[];this.size=0}function f(a,b,c,d){this.addCallback=a.bind(d);this.removeCallback=b.bind(d);this.changedCallback=c.bind(d);A&&(this.observer=new A(this.mutationWatcher.bind(this)))}function a(a){return"body /shadow-deep/ "+e(a)}function e(a){return'[touch-action\x3d"'+a+'"]'}function c(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; touch-action-delay: none; }"}
- function g(){if(I){E.forEach(function(b){String(b)===b?(F+=e(b)+c(b)+"\n",P&&(F+=a(b)+c(b)+"\n")):(F+=b.selectors.map(e)+c(b.rule)+"\n",P&&(F+=b.selectors.map(a)+c(b.rule)+"\n"))});var b=document.createElement("style");b.textContent=F;document.head.appendChild(b)}}function d(a){if(!v.pointermap.has(a))throw a=Error("InvalidPointerId"),a.name="InvalidPointerId",a;}function b(a){if(!a.ownerDocument.contains(a))throw a=Error("InvalidStateError"),a.name="InvalidStateError",a;}var k="bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedTarget pageX pageY".split(" "),
- l=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],p=window.Map&&window.Map.prototype.forEach?Map:h;h.prototype={set:function(a,b){if(void 0===b)return this.delete(a);this.has(a)||this.size++;this.array[a]=b},has:function(a){return void 0!==this.array[a]},delete:function(a){this.has(a)&&(delete this.array[a],this.size--)},get:function(a){return this.array[a]},clear:function(){this.size=this.array.length=0},forEach:function(a,b){return this.array.forEach(function(c,d){a.call(b,c,d,this)},this)}};var n=
- "bubbles cancelable view detail screenX screenY clientX clientY ctrlKey altKey shiftKey metaKey button relatedTarget buttons pointerId width height pressure tiltX tiltY pointerType hwTimestamp isPrimary type target currentTarget which pageX pageY timeStamp".split(" "),t=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],u={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},q="undefined"!==typeof SVGElementInstance,v={pointermap:new p,eventMap:Object.create(null),
- captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(a,b){var c=b.events;c&&(c.forEach(function(a){b[a]&&(this.eventMap[a]=b[a].bind(b))},this),this.eventSources[a]=b,this.eventSourceList.push(b))},register:function(a){for(var b=this.eventSourceList.length,c=0,d;c<b&&(d=this.eventSourceList[c]);c++)d.register.call(d,a)},unregister:function(a){for(var b=this.eventSourceList.length,c=0,d;c<b&&(d=this.eventSourceList[c]);c++)d.unregister.call(d,
- a)},contains:function(a,b){try{return a.contains(b)}catch(ka){return!1}},down:function(a){a.bubbles=!0;this.fireEvent("pointerdown",a)},move:function(a){a.bubbles=!0;this.fireEvent("pointermove",a)},up:function(a){a.bubbles=!0;this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1;this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1;this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0;this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0;this.fireEvent("pointerout",
- a)},cancel:function(a){a.bubbles=!0;this.fireEvent("pointercancel",a)},leaveOut:function(a){this.out(a);this.propagate(a,this.leave,!1)},enterOver:function(a){this.over(a);this.propagate(a,this.enter,!0)},eventHandler:function(a){if(!a._handledByPE){var b=a.type;(b=this.eventMap&&this.eventMap[b])&&b(a);a._handledByPE=!0}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,
- this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){this.captureInfo[b.pointerId]&&(b.relatedTarget=null);a=new r(a,b);b.preventDefault&&(a.preventDefault=b.preventDefault);a._target=a._target||b.target;return a},fireEvent:function(a,b){a=this.makeEvent(a,b);return this.dispatchEvent(a)},cloneEvent:function(a){for(var b=Object.create(null),c,d=0;d<n.length;d++)c=n[d],b[c]=a[c]||t[d],q&&("target"===c||"relatedTarget"===c)&&b[c]instanceof
- SVGElementInstance&&(b[c]=b[c].correspondingUseElement);a.preventDefault&&(b.preventDefault=function(){a.preventDefault()});return b},getTarget:function(a){var b=this.captureInfo[a.pointerId];if(!b)return a._target;if(a._target===b||!(a.type in u))return b},propagate:function(a,b,c){for(var d=a.target,e=[];!d.contains(a.relatedTarget)&&d!==document;)e.push(d),d=d.parentNode;c&&e.reverse();e.forEach(function(c){a.target=c;b.call(this,a)},this)},setCapture:function(a,b){this.captureInfo[a]&&this.releaseCapture(a);
- this.captureInfo[a]=b;var c=new r("gotpointercapture");c.pointerId=a;this.implicitRelease=this.releaseCapture.bind(this,a);document.addEventListener("pointerup",this.implicitRelease);document.addEventListener("pointercancel",this.implicitRelease);c._target=b;this.asyncDispatchEvent(c)},releaseCapture:function(a){var b=this.captureInfo[a];if(b){var c=new r("lostpointercapture");c.pointerId=a;this.captureInfo[a]=void 0;document.removeEventListener("pointerup",this.implicitRelease);document.removeEventListener("pointercancel",
- this.implicitRelease);c._target=b;this.asyncDispatchEvent(c)}},dispatchEvent:function(a){var b=this.getTarget(a);if(b)return b.dispatchEvent(a)},asyncDispatchEvent:function(a){requestAnimationFrame(this.dispatchEvent.bind(this,a))}};v.boundHandler=v.eventHandler.bind(v);var x={shadow:function(a){if(a)return a.shadowRoot||a.webkitShadowRoot},canTarget:function(a){return a&&!!a.elementFromPoint},targetingShadow:function(a){a=this.shadow(a);if(this.canTarget(a))return a},olderShadow:function(a){var b=
- a.olderShadowRoot;!b&&(a=a.querySelector("shadow"))&&(b=a.olderShadowRoot);return b},allShadows:function(a){var b=[];for(a=this.shadow(a);a;)b.push(a),a=this.olderShadow(a);return b},searchRoot:function(a,b,c){if(a){var d=a.elementFromPoint(b,c),e;for(e=this.targetingShadow(d);e;){if(a=e.elementFromPoint(b,c))return d=this.targetingShadow(a),this.searchRoot(d,b,c)||a;e=this.olderShadow(e)}return d}},owner:function(a){for(;a.parentNode;)a=a.parentNode;a.nodeType!==Node.DOCUMENT_NODE&&a.nodeType!==
- Node.DOCUMENT_FRAGMENT_NODE&&(a=document);return a},findTarget:function(a){var b=a.clientX,c=a.clientY;a=this.owner(a.target);a.elementFromPoint(b,c)||(a=document);return this.searchRoot(a,b,c)}},m=Array.prototype.forEach.call.bind(Array.prototype.forEach),B=Array.prototype.map.call.bind(Array.prototype.map),z=Array.prototype.slice.call.bind(Array.prototype.slice),C=Array.prototype.filter.call.bind(Array.prototype.filter),A=window.MutationObserver||window.WebKitMutationObserver,D={subtree:!0,childList:!0,
- attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};f.prototype={watchSubtree:function(a){this.observer&&x.canTarget(a)&&this.observer.observe(a,D)},enableOnSubtree:function(a){this.watchSubtree(a);a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){m(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll("[touch-action]"):[]},removeElement:function(a){this.removeCallback(a)},
- addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(z(b))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){var b=B(a,this.findElements,this);b.push(C(a,this.isElement));return b.reduce(this.concatLists,[])},
- mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){"childList"===a.type?(this.flattenMutationTree(a.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(a.removedNodes).forEach(this.removeElement,this)):"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}};var E=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],F="",I=window.PointerEvent||window.MSPointerEvent,P=!window.ShadowDOMPolyfill&&
- document.head.createShadowRoot,G=v.pointermap,M=[1,4,2,8,16],H=!1;try{H=1===(new MouseEvent("test",{buttons:1})).buttons}catch(ga){}var J={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){v.listen(a,this.events)},unregister:function(a){v.unlisten(a,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(a){var b=this.lastTouches,c=a.clientX;a=a.clientY;for(var d=0,e=b.length,g;d<e&&(g=b[d]);d++){var f=Math.abs(a-g.y);
- if(25>=Math.abs(c-g.x)&&25>=f)return!0}},prepareEvent:function(a){var b=v.cloneEvent(a),c=b.preventDefault;b.preventDefault=function(){a.preventDefault();c()};b.pointerId=this.POINTER_ID;b.isPrimary=!0;b.pointerType=this.POINTER_TYPE;return b},prepareButtonsForMove:function(a,b){var c=G.get(this.POINTER_ID);a.buttons=0!==b.which&&c?c.buttons:0;b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=G.get(this.POINTER_ID),c=this.prepareEvent(a);H||(c.buttons=M[c.button],
- b&&(c.buttons|=b.buttons),a.buttons=c.buttons);G.set(this.POINTER_ID,a);b&&0!==b.buttons?v.move(c):v.down(c)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);H||this.prepareButtonsForMove(b,a);b.button=-1;G.set(this.POINTER_ID,a);v.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=G.get(this.POINTER_ID),c=this.prepareEvent(a);if(!H){var d=M[c.button];c.buttons=b?b.buttons&~d:0;a.buttons=c.buttons}G.set(this.POINTER_ID,a);c.buttons&=
- ~M[c.button];0===c.buttons?v.up(c):v.move(c)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);H||this.prepareButtonsForMove(b,a);b.button=-1;G.set(this.POINTER_ID,a);v.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);H||this.prepareButtonsForMove(b,a);b.button=-1;v.leaveOut(b)}},cancel:function(a){a=this.prepareEvent(a);v.cancel(a);this.deactivateMouse()},deactivateMouse:function(){G.delete(this.POINTER_ID)}},
- O=v.captureInfo,N=x.findTarget.bind(x),S=x.allShadows.bind(x),R=v.pointermap,Y,X={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){Y.enableOnSubtree(a)},unregister:function(a){},elementAdded:function(a){var b=a.getAttribute("touch-action"),c=this.touchActionToScrollType(b);c&&(a._scrollType=c,v.listen(a,this.events),S(a).forEach(function(a){a._scrollType=c;v.listen(a,this.events)},this))},elementRemoved:function(a){a._scrollType=void 0;v.unlisten(a,this.events);S(a).forEach(function(a){a._scrollType=
- void 0;v.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute("touch-action"),d=this.touchActionToScrollType(c);b=this.touchActionToScrollType(b);d&&b?(a._scrollType=d,S(a).forEach(function(a){a._scrollType=d},this)):b?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=this.scrollTypes;if("none"===a)return"none";if(a===
- b.XSCROLLER)return"X";if(a===b.YSCROLLER)return"Y";if(b.SCROLLER.exec(a))return"XY"},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){if(0===R.size||1===R.size&&R.has(1))this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount()},removePrimaryPointer:function(a){a.isPrimary&&(this.firstXY=this.firstTouch=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=
- function(){this.clickCount=0;this.resetId=null}.bind(this);this.resetId=setTimeout(a,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;if("touchstart"===a||"touchmove"===a)b=1;return b},touchToPointer:function(a){var b=this.currentTouchEvent,c=v.cloneEvent(a),d=c.pointerId=a.identifier+2;c.target=O[d]||N(c);c.bubbles=!0;c.cancelable=!0;c.detail=this.clickCount;c.button=0;c.buttons=this.typeToButtons(b.type);c.width=a.radiusX||a.webkitRadiusX||
- 0;c.height=a.radiusY||a.webkitRadiusY||0;c.pressure=a.force||a.webkitForce||.5;c.isPrimary=this.isPrimaryTouch(a);c.pointerType=this.POINTER_TYPE;c.altKey=b.altKey;c.ctrlKey=b.ctrlKey;c.metaKey=b.metaKey;c.shiftKey=b.shiftKey;var e=this;c.preventDefault=function(){e.scrolling=!1;e.firstXY=null;b.preventDefault()};return c},processTouches:function(a,b){var c=a.changedTouches;this.currentTouchEvent=a;a=0;for(var d;a<c.length;a++)d=c[a],b.call(this,this.touchToPointer(d))},shouldScroll:function(a){if(this.firstXY){var b;
- b=a.currentTarget._scrollType;if("none"===b)b=!1;else if("XY"===b)b=!0;else{a=a.changedTouches[0];var c="Y"===b?"X":"Y";b=Math.abs(a["client"+b]-this.firstXY[b])>=Math.abs(a["client"+c]-this.firstXY[c])}this.firstXY=null;return b}},findTouch:function(a,b){for(var c=0,d=a.length,e;c<d&&(e=a[c]);c++)if(e.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(R.size>=b.length){var c=[];R.forEach(function(a,d){1===d||this.findTouch(b,d-2)||c.push(a.out)},this);c.forEach(this.cancelOut,
- this)}},touchstart:function(a){this.vacuumTouches(a);this.setPrimaryTouch(a.changedTouches[0]);this.dedupSynthMouse(a);this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){R.set(a.pointerId,{target:a.target,out:a,outTarget:a.target});v.enterOver(a);v.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=R.get(a.pointerId);
- if(b){var c=b.out,d=b.outTarget;v.move(a);c&&d!==a.target&&(c.relatedTarget=a.target,a.relatedTarget=d,c.target=d,a.target?(v.leaveOut(c),v.enterOver(a)):(a.target=d,a.relatedTarget=null,this.cancelOut(a)));b.out=a;b.outTarget=a.target}},touchend:function(a){this.dedupSynthMouse(a);this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(v.up(a),v.leaveOut(a));this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){v.cancel(a);v.leaveOut(a);
- this.cleanUpPointer(a)},cleanUpPointer:function(a){R.delete(a.pointerId);this.removePrimaryPointer(a)},dedupSynthMouse:function(a){var b=J.lastTouches;a=a.changedTouches[0];this.isPrimaryTouch(a)&&(a={x:a.clientX,y:a.clientY},b.push(a),b=function(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}.bind(null,b,a),setTimeout(b,2500))}};Y=new f(X.elementAdded,X.elementRemoved,X.elementChanged,X);var Q=v.pointermap,K=window.MSPointerEvent&&"number"===typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,L={events:"MSPointerDown MSPointerMove MSPointerUp MSPointerOut MSPointerOver MSPointerCancel MSGotPointerCapture MSLostPointerCapture".split(" "),
- register:function(a){v.listen(a,this.events)},unregister:function(a){v.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;K&&(b=v.cloneEvent(a),b.pointerType=this.POINTER_TYPES[a.pointerType]);return b},cleanup:function(a){Q.delete(a)},MSPointerDown:function(a){Q.set(a.pointerId,a);a=this.prepareEvent(a);v.down(a)},MSPointerMove:function(a){a=this.prepareEvent(a);v.move(a)},MSPointerUp:function(a){var b=this.prepareEvent(a);v.up(b);this.cleanup(a.pointerId)},
- MSPointerOut:function(a){a=this.prepareEvent(a);v.leaveOut(a)},MSPointerOver:function(a){a=this.prepareEvent(a);v.enterOver(a)},MSPointerCancel:function(a){var b=this.prepareEvent(a);v.cancel(b);this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){a=v.makeEvent("lostpointercapture",a);v.dispatchEvent(a)},MSGotPointerCapture:function(a){a=v.makeEvent("gotpointercapture",a);v.dispatchEvent(a)}},V,U;window.navigator.msPointerEnabled?(V=function(a){d(a);b(this);0!==v.pointermap.get(a).buttons&&
- this.msSetPointerCapture(a)},U=function(a){d(a);this.msReleasePointerCapture(a)}):(V=function(a){d(a);b(this);0!==v.pointermap.get(a).buttons&&v.setCapture(a,this)},U=function(a){d(a);v.releaseCapture(a,this)});var ca=window.PointerEvent||window.MSPointerEvent;return{dispatcher:v,Installer:f,PointerEvent:r,PointerMap:p,targetFinding:x,applyGlobal:function(){g();window.PointerEvent||(window.PointerEvent=r,window.navigator.msPointerEnabled?(Object.defineProperty(window.navigator,"maxTouchPoints",{value:window.navigator.msMaxTouchPoints,
- enumerable:!0}),v.registerSource("ms",L)):(v.registerSource("mouse",J),void 0!==window.ontouchstart&&v.registerSource("touch",X)),v.register(document));window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:V},releasePointerCapture:{value:U}})},applyLocal:function(a){ca||(window.PointerEvent||(window.navigator.msPointerEnabled?v.registerSource("ms",L):(v.registerSource("mouse",J),void 0!==window.ontouchstart&&v.registerSource("touch",
- X)),v.register(document)),window.Element&&!Element.prototype.setPointerCapture&&(a.setPointerCapture=V.bind(a),a.releasePointerCapture=U.bind(a)),a.getAttribute("touch-action")||a.setAttribute("touch-action","none"))}}})},"esri/views/input/keys":function(){define(["require","exports","../../core/sniff"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.primaryKey=f("mac")?"Meta":"Ctrl";var a={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",
- 37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(r=48;58>r;r++)a[r]=String.fromCharCode(r);for(r=1;25>r;r++)a[111+r]="F"+r;for(r=65;91>r;r++)a[r]=[String.fromCharCode(r+32),String.fromCharCode(r)];var e={Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"};h.eventKey=function(c){if(void 0!==c.key)return e[c.key]||c.key;var g=a[c.keyCode];return Array.isArray(g)?c.shiftKey?g[1]:g[0]:g};h.isSystemModifier=function(a){switch(a){case "Ctrl":case "Alt":case "Shift":case "Meta":case "Primary":return!0}}})},
- "esri/views/input/InputManager":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Logger ../../core/now ../../core/accessorSupport/decorators ./keys ./recognizers ./handlers/LatestPointerType".split(" "),function(r,h,f,a,e,c,g,d,b,k,l){Object.defineProperty(h,"__esModule",{value:!0});var p=c.getLogger("esri.views.input.InputManager");r=function(c){function e(a,d){a=c.call(this)||this;a._pointerCaptures=new Map;
- a._nameToGroup={};a._handlers=[];a._currentPropagation=null;a._sourceEvents=new Set;a._keyModifiers=new Set;a._activeKeyModifiers=new Set;a.primaryKey=b.primaryKey;a.latestPointerType="mouse";a._installRecognizers();return a}f(e,c);e.prototype.normalizeCtorArgs=function(a,b){this._browserEvents=a;this._browserEvents.onEventReceived=this._onEventReceived.bind(this);this._recognizers=b;this._recognizers||(this._recognizers=k.defaults.map(function(a){return new a}));return{}};e.prototype.destroy=function(){for(var a=
- 0,b=Object.keys(this._nameToGroup);a<b.length;a++)this.uninstallHandlers(b[a])};e.prototype.installHandlers=function(a,b){var c=this;if(this._nameToGroup[a])p.error("There is already an InputHandler group registered under the name `"+a+"`");else if(0===b.length)p.error("Can't register a group of zero handlers");else{var d={name:a,handlers:b.map(function(a,b){return{handler:a,active:!0,removed:!1,priorityIndex:0,eventCallback:null,uninstallCallback:null}})};this._nameToGroup[a]=d;a=function(a){var b=
- d.handlers[a];e._handlers.push(b);b.handler.onInstall({updateDependencies:function(){c.updateDependencies()},emit:function(a,d,e,g){c._emitInputEvent(b.priorityIndex,a,d,e,g)},setPointerCapture:function(a,e){c._setPointerCapture(d,b,a,e)},setEventCallback:function(a){b.eventCallback=a},setUninstallCallback:function(a){b.uninstallCallback=a}})};var e=this;for(b=d.handlers.length-1;0<=b;b--)a(b);this.updateDependencies()}};e.prototype.uninstallHandlers=function(a){var b=this._nameToGroup[a];b?(b.handlers.forEach(function(a){a.removed=
- !0;a.uninstallCallback()}),delete this._nameToGroup[a],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):p.error("There is no InputHandler group registered under the name `"+a+"`")};e.prototype.hasHandlers=function(a){return void 0!==this._nameToGroup[a]};e.prototype.updateDependencies=function(){var a=new Set,c=new Set;this._handlersPriority=[];for(var d=this._handlers.length-1;0<=d;d--){var e=this._handlers[d];e.priorityIndex=
- d;this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(d=this._handlersPriority.length-1;0<=d;d--){e=this._handlersPriority[d];e.priorityIndex=d;var g=e.handler.hasSideEffects;if(!g)for(var f=0,k=e.handler.outgoingEventTypes;f<k.length;f++)if(a.has(k[f])){g=!0;break}if(g)for(f=0,k=e.handler.incomingEventMatches;f<k.length;f++){var l=k[f];a.add(l.eventType);for(var p=0,l=l.keyModifiers;p<l.length;p++){var n=l[p];b.isSystemModifier(n)||c.add(n)}}e.active=
- g}this._sourceEvents=a;this._keyModifiers=c;0<this._pointerCaptures.size&&this._sourceEvents.add("pointer-capture-lost");0<this._keyModifiers.size&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up"));this._browserEvents&&(this._browserEvents.activeEvents=this._sourceEvents)};e.prototype._setLatestPointerType=function(a){this._set("latestPointerType",a)};e.prototype._onEventReceived=function(a,b){"pointer-capture-lost"===a&&this._pointerCaptures.delete(b.native.pointerId);this._updateKeyModifiers(a,
- b);this._emitInputEventFromSource(a,b,b.native.timestamp)};e.prototype._updateKeyModifiers=function(a,b){var c=this;if(b){var d=!1,e=function(){if(!d){var a=new Set;c._activeKeyModifiers.forEach(function(b){a.add(b)});c._activeKeyModifiers=a;d=!0}},g=function(a,b){b&&!c._activeKeyModifiers.has(a)?(e(),c._activeKeyModifiers.add(a)):!b&&c._activeKeyModifiers.has(a)&&(e(),c._activeKeyModifiers.delete(a))};if("key-down"===a||"key-up"===a){var f=b.key;this._keyModifiers.has(f)&&g(f,"key-down"===a)}a=b.native;
- g("Alt",!(!a||!a.altKey));g("Ctrl",!(!a||!a.ctrlKey));g("Shift",!(!a||!a.shiftKey));g("Meta",!(!a||!a.metaKey));g("Primary",this._activeKeyModifiers.has(this.primaryKey))}};e.prototype._installRecognizers=function(){var a=this;this._latestPointerTypeHandler=new l.LatestPointerType(function(b){return a._setLatestPointerType(b)});0<this._recognizers.length&&this.installHandlers("default",this._recognizers);this.installHandlers("input-manager-logic",[this._latestPointerTypeHandler])};e.prototype._setPointerCapture=
- function(a,b,c,d){a=a.name+"-"+b.priorityIndex;b=this._pointerCaptures.get(c.pointerId)||new Set;this._pointerCaptures.set(c.pointerId,b);d?(b.add(a),1===b.size&&this._browserEvents&&this._browserEvents.setPointerCapture(c,!0)):b.has(a)&&(b.delete(a),0===b.size&&(this._pointerCaptures.delete(c.pointerId),this._browserEvents&&this._browserEvents.setPointerCapture(c,!1)))};e.prototype._garbageCollectRemovedHandlers=function(){this._handlers=this._handlers.filter(function(a){return!a.removed});this.updateDependencies()};
- e.prototype._emitInputEventFromSource=function(a,b,c){this._emitInputEvent(0,a,b,c)};e.prototype._emitInputEvent=function(a,b,c,d,e){d=void 0!==d?d:this._currentPropagation?this._currentPropagation.timestamp:g();b=new n(b,c,d,e||this._activeKeyModifiers);this._currentPropagation?this._currentPropagation.addedEvents.push(b):this._doNewPropagation(a,b)};e.prototype._doNewPropagation=function(a,b){for(a=this._currentPropagation={events:[b],addedEvents:[],currentHandler:this._handlersPriority[a],needsHandlerGarbageCollect:!1,
- timestamp:b.timestamp};a.currentHandler;){if(a.currentHandler.removed)a.needsHandlerGarbageCollect=!0;else{b=a.events;var c=[];a.addedEvents=[];for(var d=0;d<b.length;d++){var e=b[d];a.currentHandler.active&&a.currentHandler.eventCallback(e);e.shouldStopPropagation()||c.push(e)}a.events=c.concat(a.addedEvents)}a.currentHandler=this._handlersPriority[a.currentHandler.priorityIndex+1]}a.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers();this._currentPropagation=null};e.prototype._compareHandlerPriority=
- function(a,b){if(a.handler.hasSideEffects!==b.handler.hasSideEffects)return a.handler.hasSideEffects?1:-1;for(var c=0,d=a.handler.incomingEventMatches;c<d.length;c++)for(var e=d[c],g=function(a){if(e.eventType!==a.eventType)return"continue";var b=e.keyModifiers.filter(function(b){return-1!==a.keyModifiers.indexOf(b)});if(b.length===e.keyModifiers.length!==(b.length===a.keyModifiers.length))return{value:e.keyModifiers.length>a.keyModifiers.length?-1:1}},f=0,k=b.handler.incomingEventMatches;f<k.length;f++){var l=
- g(k[f]);if("object"===typeof l)return l.value}return a.priorityIndex>b.priorityIndex?-1:1};e.prototype._sortHandlersPriority=function(a){for(var b=[],c=0;c<a.length;c++){for(var d=a[c],e=0;e<b.length&&0<=this._compareHandlerPriority(d,b[e]);)e++;b.splice(e,0,d)}return b};a([d.property({readOnly:!0})],e.prototype,"latestPointerType",void 0);return e=a([d.subclass("esri.views.input.InputManager")],e)}(d.declared(e));h.InputManager=r;var n=function(){function a(a,b,c,d){this.type=a;this.data=b;this.timestamp=
- c;this.modifiers=d;this._stopPropagation=!1}a.prototype.stopPropagation=function(){this._stopPropagation=!0};a.prototype.shouldStopPropagation=function(){return this._stopPropagation};return a}()})},"esri/views/input/recognizers":function(){define("require exports ./recognizers/Drag ./recognizers/PointerClickHoldAndDrag ./recognizers/SingleAndDoubleClick ./recognizers/VerticalTwoFingerDrag".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});h.defaults=[a.PointerClickHoldAndDrag,
- e.SingleAndDoubleClick,f.Drag,c.VerticalTwoFingerDrag]})},"esri/views/input/recognizers/Drag":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(r,h,f,a,e){function c(a){var b=[];a.forEach(function(a){b.push(a.event)});return e.fitCircleLSQ(b)}function g(a){var d=c(a),e=0;a.forEach(function(a){for(var c=b(a,d),c=c-a.lastAngle;c>Math.PI;)c-=2*Math.PI;for(;c<-Math.PI;)c+=2*Math.PI;c=a.lastAngle+c;a.lastAngle=c;e+=c-a.initialAngle});
- e/=a.size||1;return{angle:e,radius:d.radius,center:d.center}}function d(a){var b=new Map;a.forEach(function(a,c){return b.set(c,a.event)});return b}function b(a,b){a=a.event;return Math.atan2(a.y-b.center.y,a.x-b.center.x)}Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function e(){var b=a.call(this,!1)||this;b.startStateModifiers=new Set;b.activePointerMap=new Map;b.isDragging=!1;b.drag=b.registerOutgoing("drag");b.registerIncoming("pointer-drag",b.handlePointerDrag.bind(b));b.registerIncoming("pointer-up",
- b.handlePointerUpAndPointerLost.bind(b));b.registerIncoming("pointer-capture-lost",b.handlePointerUpAndPointerLost.bind(b));return b}f(e,a);e.prototype.createPayload=function(a,b,c,e){return{action:a,pointerType:this.pointerType,button:this.mouseButton,buttons:b.buttons,timestamp:e,pointers:d(this.activePointerMap),pointer:b,angle:c.angle,radius:c.radius,center:c.center}};e.prototype.addPointer=function(a){var d=a.native.pointerId,e=g(this.activePointerMap).angle;a={event:a,initialAngle:0,lastAngle:0};
- this.activePointerMap.set(d,a);d=b(a,c(this.activePointerMap));a.initialAngle=d;a.lastAngle=d;this.updatePointerAngles(e)};e.prototype.updatePointer=function(a){if(!a||null!=a.x||null!=a.y){var b=this.activePointerMap.get(a.native.pointerId);b?b.event=a:this.addPointer(a)}};e.prototype.removePointer=function(a){var b=g(this.activePointerMap).angle;this.activePointerMap.delete(a);this.updatePointerAngles(b)};e.prototype.updatePointerAngles=function(a){var c=g(this.activePointerMap);this.activePointerMap.forEach(function(d){d.initialAngle=
- b(d,c)-a;d.lastAngle=b(d,c)-a})};e.prototype.emitEvent=function(a,b,c){var d=g(this.activePointerMap);this.drag.emit(this.createPayload(a,b,d,c),void 0,this.startStateModifiers)};e.prototype.handlePointerUpAndPointerLost=function(a){var b=a.data.native.pointerId,c=a.timestamp;this.activePointerMap.get(b)&&(1===this.activePointerMap.size?(this.updatePointer(a.data),this.emitEvent("end",a.data,c),this.isDragging=!1,this.removePointer(b)):(this.removePointer(b),this.emitEvent("removed",a.data,a.timestamp)))};
- e.prototype.handlePointerDrag=function(a){var b=a.data,c=b.currentEvent,d=a.timestamp;switch(b.action){case "start":case "update":this.isDragging?this.activePointerMap.has(c.native.pointerId)?(this.updatePointer(c),this.emitEvent("update",c,d)):(this.addPointer(c),this.emitEvent("added",c,d)):(this.updatePointer(c),this.pointerType=a.data.startEvent.pointerType,this.mouseButton=a.data.startEvent.button,this.startStateModifiers=a.modifiers,this.isDragging=!0,this.emitEvent("start",c,d))}};return e}(a.InputHandler);
- h.Drag=r;(function(a){a[a.Left=0]="Left";a[a.Middle=1]="Middle";a[a.Right=2]="Right";a[a.Back=3]="Back";a[a.Forward=4]="Forward";a[a.Undefined=-1]="Undefined"})(h.Button||(h.Button={}))})},"esri/views/input/recognizers/support":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.manhattanDistance=function(f,a){return Math.abs(a.x-f.x)+Math.abs(a.y-f.y)};h.euclideanDistance=function(f,a){var e=a.x-f.x;f=a.y-f.y;return Math.sqrt(e*e+f*f)};h.fitCircleLSQ=
- function(f,a){a?(a.radius=0,a.center.x=0,a.center.y=0):a={radius:0,center:{x:0,y:0}};if(0===f.length)return a;if(1===f.length)return a.center.x=f[0].x,a.center.y=f[0].y,a;if(2===f.length){var e=f[0];f=f[1];var c=[f.x-e.x,f.y-e.y],g=c[0],c=c[1];a.radius=Math.sqrt(g*g+c*c)/2;a.center.x=(e.x+f.x)/2;a.center.y=(e.y+f.y)/2;return a}for(var d=0,b=0,k=0;k<f.length;k++)d+=f[k].x,b+=f[k].y;for(var d=d/f.length,b=b/f.length,l=f.map(function(a){return a.x-d}),p=f.map(function(a){return a.y-b}),n=e=a=0,t=0,u=
- g=0,k=c=0;k<l.length;k++){var q=l[k],v=p[k],h=q*q,m=v*v;a+=h;e+=m;n+=q*v;t+=h*q;g+=m*v;u+=q*m;c+=v*h}k=a;l=n;p=e;t=.5*(t+u);g=.5*(g+c);c=k*p-n*l;u=(t*p-g*l)/c;g=(k*g-n*t)/c;return{radius:Math.sqrt(u*u+g*g+(a+e)/f.length),center:{x:u+d,y:g+b}}}})},"esri/views/input/recognizers/PointerClickHoldAndDrag":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});h.DefaultParameters=
- {maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilTouchDrag:6,holdDelay:500};r=function(a){function c(c,b,e,g){void 0===c&&(c=h.DefaultParameters.maximumClickDelay);void 0===b&&(b=h.DefaultParameters.movementUntilMouseDrag);void 0===e&&(e=h.DefaultParameters.movementUntilTouchDrag);void 0===g&&(g=h.DefaultParameters.holdDelay);var d=a.call(this,!1)||this;d.maximumClickDelay=c;d.movementUntilMouseDrag=b;d.movementUntilTouchDrag=e;d.holdDelay=g;d._pointerState=new Map;d._pointerDrag=d.registerOutgoing("pointer-drag");
- d._immediateClick=d.registerOutgoing("immediate-click");d._pointerHold=d.registerOutgoing("hold");d.registerIncoming("pointer-down",d._handlePointerDown.bind(d));d.registerIncoming("pointer-up",d._handlePointerUpOrLost.bind(d));d.registerIncoming("pointer-capture-lost",d._handlePointerUpOrLost.bind(d));d._moveHandle=d.registerIncoming("pointer-move",d._handlePointerMove.bind(d));d._moveHandle.pause();return d}f(c,a);c.prototype.onUninstall=function(){this._pointerState.forEach(function(a){0!==a.holdTimeout&&
- (clearTimeout(a.holdTimeout),a.holdTimeout=0)});a.prototype.onUninstall.call(this)};c.prototype._handlePointerDown=function(a){var b=this,c=a.data,d=c.native.pointerId,e=0;0===this._pointerState.size&&(e=setTimeout(function(){var c=b._pointerState.get(d);c&&(c.isDragging||(b._pointerHold.emit(c.previousEvent,void 0,a.modifiers),c.holdEmitted=!0),c.holdTimeout=0)},this.holdDelay));e={startEvent:c,previousEvent:c,startTimestamp:a.timestamp,isDragging:!1,downButton:c.native.button,holdTimeout:e,modifiers:new Set};
- this._pointerState.set(d,e);this.startCapturingPointer(c.native);this._moveHandle.resume();1<this._pointerState.size&&this.startDragging(a)};c.prototype._createPointerDragData=function(a,b,c){return{action:a,startEvent:b.startEvent,previousEvent:b.previousEvent,currentEvent:c}};c.prototype._handlePointerMove=function(a){var b=a.data,c=this._pointerState.get(b.native.pointerId);c&&(c.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",c,b),void 0,c.modifiers):e.euclideanDistance(b,
- c.startEvent)>("touch"===b.native.pointerType?this.movementUntilTouchDrag:this.movementUntilMouseDrag)&&this.startDragging(a),c.previousEvent=b)};c.prototype.startDragging=function(a){var b=this,c=a.data,d=c.native.pointerId;this._pointerState.forEach(function(e){0!==e.holdTimeout&&(clearTimeout(e.holdTimeout),e.holdTimeout=0);e.isDragging||(e.modifiers=a.modifiers,e.isDragging=!0,d===e.startEvent.native.pointerId?b._pointerDrag.emit(b._createPointerDragData("start",e,c)):b._pointerDrag.emit(b._createPointerDragData("start",
- e,e.previousEvent),a.timestamp))})};c.prototype._handlePointerUpOrLost=function(a){var b=a.data,c=b.native.pointerId,d=this._pointerState.get(c);d&&(0!==d.holdTimeout&&clearTimeout(d.holdTimeout),d.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",d,b),void 0,d.modifiers):d.downButton===b.native.button&&a.timestamp-d.startTimestamp<=this.maximumClickDelay&&!d.holdEmitted&&this._immediateClick.emit(b),this._pointerState.delete(c),this.stopCapturingPointer(b.native),0===this._pointerState.size&&
- this._moveHandle.pause())};return c}(a.InputHandler);h.PointerClickHoldAndDrag=r})},"esri/views/input/recognizers/SingleAndDoubleClick":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});h.DefaultParameters={maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};r=function(a){function c(c,b,e,g){void 0===c&&(c=
- h.DefaultParameters.maximumDoubleClickDelay);void 0===b&&(b=h.DefaultParameters.maximumDoubleClickDistance);void 0===e&&(e=h.DefaultParameters.maximumDoubleTouchDelay);void 0===g&&(g=h.DefaultParameters.maximumDoubleTouchDistance);var d=a.call(this,!1)||this;d.maximumDoubleClickDelay=c;d.maximumDoubleClickDistance=b;d.maximumDoubleTouchDelay=e;d.maximumDoubleTouchDistance=g;d._pointerState=new Map;d._click=d.registerOutgoing("click");d._doubleClick=d.registerOutgoing("double-click");d.registerIncoming("immediate-click",
- d._handleImmediateClick.bind(d));return d}f(c,a);c.prototype.onUninstall=function(){this._pointerState.forEach(function(a){0!==a.doubleClickTimeout&&(clearTimeout(a.doubleClickTimeout),a.doubleClickTimeout=0)})};c.prototype._pointerId=function(a){a=a.native;return"mouse"===a.pointerType?a.pointerId+":"+a.button:""+a.pointerType};c.prototype._handleImmediateClick=function(a){var b=a.data,c=this._pointerId(b),d=this._pointerState.get(c);if(d){clearTimeout(d.doubleClickTimeout);d.doubleClickTimeout=
- 0;var g="touch"===b.native.pointerType?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;e.manhattanDistance(d.event.data,b)>g?(this._doubleClickTimeoutExceeded(c),this._startClick(a)):(this._doubleClick.emit(b,void 0,d.event.modifiers),this._pointerState.delete(c))}else this._startClick(a)};c.prototype._startClick=function(a){var b=this,c=this._pointerId(a.data);this._pointerState.set(c,{event:a,doubleClickTimeout:setTimeout(function(){return b._doubleClickTimeoutExceeded(c)},"touch"===
- a.data.native.pointerType?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay)})};c.prototype._doubleClickTimeoutExceeded=function(a){var b=this._pointerState.get(a);this._click.emit(b.event.data,void 0,b.event.modifiers);b.doubleClickTimeout=0;this._pointerState.delete(a)};return c}(a.InputHandler);h.SingleAndDoubleClick=r})},"esri/views/input/recognizers/VerticalTwoFingerDrag":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../DragEventSeparator","../InputHandler"],
- function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(c){function e(d,b){void 0===d&&(d=20);void 0===b&&(b=40);var e=c.call(this,!1)||this;e._threshold=d;e._maxDelta=b;e.state="ready";e.emittedArtificalEnd2=!1;e._vertical=e.registerOutgoing("vertical-two-finger-drag");e._artificalDrag=e.registerOutgoing("drag");e.dragEventSeparator=new a.DragEventSeparator({start:function(a,b){return e.observeStart(a,b)},update:function(a,b,c){return e.observeUpdate(a,b,c)},end:function(a,
- b){return e.observeEnd(a,b)}});e.registerIncoming("drag",function(a){return e.dragEventSeparator.handle(a)});return e}f(e,c);Object.defineProperty(e.prototype,"failed",{get:function(){return"failed"===this.state},enumerable:!0,configurable:!0});e.prototype.observeStart=function(a,b){1===a&&this.emittedArtificalEnd2&&(this.emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:b.data.button,buttons:b.data.buttons,pointerType:b.data.pointerType,timestamp:b.data.timestamp,pointers:b.data.pointers,
- pointer:b.data.pointer,angle:b.data.angle,radius:b.data.radius,center:b.data.center,artifical:!0}),b.stopPropagation());this.state=2===a?"ready":"failed"};e.prototype.observeUpdate=function(a,b,c){"failed"!==this.state&&2===a&&("active"===this.state?(this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"update"}),b.stopPropagation()):this.checkMovementWithinLimits(b.data,c.data)?this.checkVerticalThresholdReached(b.data,c.data)&&(this.state="active",this.emittedArtificalEnd2=
- !0,this._thresholdReachedCenter=b.data.center,this._artificalDrag.emit({action:"end",button:b.data.button,buttons:b.data.buttons,pointerType:b.data.pointerType,timestamp:b.data.timestamp,pointers:b.data.pointers,pointer:b.data.pointer,angle:b.data.angle,radius:b.data.radius,center:b.data.center,artifical:!0}),this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),b.stopPropagation()):this.state="failed")};e.prototype.observeEnd=function(a,b){"active"===this.state&&
- (this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this.state="ready",b.stopPropagation())};e.prototype.checkMovementWithinLimits=function(a,b){var c=-Infinity,d=Infinity,e=-Infinity,g=Infinity;b.pointers.forEach(function(a){c=Math.max(c,a.x);d=Math.min(d,a.x);e=Math.max(e,a.y);g=Math.min(g,a.y)});var f=-Infinity,u=Infinity,q=-Infinity,v=Infinity;a.pointers.forEach(function(a){f=Math.max(f,a.x);u=Math.min(u,a.x);q=Math.max(q,a.y);v=Math.min(v,a.y)});return Math.abs(a.center.x-
- b.center.x)<this._threshold&&Math.abs(f-u-(c-d))<=this._maxDelta&&Math.abs(q-v-(e-g))<=this._maxDelta};e.prototype.checkVerticalThresholdReached=function(a,b){var c=Math.abs(a.center.y-b.center.y);a.pointers.forEach(function(a,d){d=b.pointers.get(d);c=Math.min(c,Math.abs(a.y-d.y))});return c>=this._threshold};return e}(e.InputHandler);h.VerticalTwoFingerDrag=r})},"esri/views/input/DragEventSeparator":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});
- r=function(){function f(a){this.callbacks=a;this.currentCount=0;this.callbacks.condition||(this.callbacks.condition=function(){return!0})}f.prototype.handle=function(a){var e=a.data,c=e.pointers.size;switch(e.action){case "start":this.currentCount=c;this.emitStart(a);break;case "added":this.emitEnd(this.previousEvent);this.currentCount=c;this.emitStart(a);break;case "update":this.emitUpdate(a);break;case "removed":this.startEvent&&this.emitEnd(this.previousEvent);this.currentCount=c;this.emitStart(a);
- break;case "end":this.emitEnd(a),this.currentCount=0}this.previousEvent=a};f.prototype.emitStart=function(a){this.startEvent=a;this.callbacks.condition(this.currentCount,a)&&this.callbacks.start(this.currentCount,a,this.startEvent)};f.prototype.emitUpdate=function(a){this.callbacks.condition(this.currentCount,a)&&this.callbacks.update(this.currentCount,a,this.startEvent)};f.prototype.emitEnd=function(a){this.callbacks.condition(this.currentCount,a)&&this.callbacks.end(this.currentCount,a,this.startEvent);
- this.startEvent=null};return f}();h.DragEventSeparator=r})},"esri/views/input/handlers/LatestPointerType":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(c){var d=a.call(this,!0)||this;d._onChange=c;d._value="mouse";d.registerIncoming("pointer-down",function(a){d._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});d._moveHandler=d.registerIncoming("pointer-move",
- function(a){d._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});d._moveHandler.pause();return d}f(c,a);c.prototype._setValue=function(a){a!==this._value&&("touch"===a?this._moveHandler.resume():this._moveHandler.pause(),this._value=a,this._onChange(a))};return c}(a.InputHandler);h.LatestPointerType=r})},"esri/views/input/ViewEvents":function(){define("require exports ../../core/tsSupport/extendsHelper ../../geometry/ScreenPoint ../3d/support/mathUtils ./InputHandler".split(" "),function(r,
- h,f,a,e,c){function g(a){return!!b[a]}function d(a){for(var b=0;b<a.length;b++)if(!g(a[b]))return!1;return!0}Object.defineProperty(h,"__esModule",{value:!0});var b={click:!0,"double-click":!0,"immediate-click":!0,hold:!0,drag:!0,"key-down":!0,"key-up":!0,"pointer-down":!0,"pointer-move":!0,"pointer-up":!0,"pointer-drag":!0,"mouse-wheel":!0,"pointer-enter":!0,"pointer-leave":!0},k;(function(a){a[a.Left=0]="Left";a[a.Middle=1]="Middle";a[a.Right=2]="Right"})(k||(k={}));r=function(){function a(a){this.handlers=
- new Map;this.counter=0;this.handlerCounts=new Map;this.view=a;this.inputManager=null}a.prototype.connect=function(a){var b=this;a&&this.disconnect();this.inputManager=a;this.handlers.forEach(function(a,c){return b.inputManager.installHandlers(c,[a])})};a.prototype.disconnect=function(){var a=this;this.inputManager&&this.handlers.forEach(function(b,c){return a.inputManager.uninstallHandlers(c)});this.inputManager=null};a.prototype.destroy=function(){this.disconnect();this.handlers.clear();this.view=
- null};a.prototype.register=function(a,b,c){var e=this,f=Array.isArray(a)?a:a.split(",");if(!d(f))return f.some(g)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;a=Array.isArray(b)?b:[];c=Array.isArray(b)?c:b;var k=this.createUniqueGroupName();b=new l(this.view,f,a,c);this.handlers.set(k,b);for(c=0;c<f.length;c++){a=f[c];var m=this.handlerCounts.get(a)||0;this.handlerCounts.set(a,m+1)}this.inputManager&&this.inputManager.installHandlers(k,
- [b]);return{remove:function(){return e.removeHandler(k,f)}}};a.prototype.hasHandler=function(a){return!!this.handlerCounts.get(a)};a.prototype.removeHandler=function(a,b){if(this.handlers.has(a)){this.handlers.delete(a);for(var c=0;c<b.length;c++){var d=b[c],e=this.handlerCounts.get(d);void 0===e?console.error("Trying to remove handler for event that has no handlers registered: ",d):1===e?this.handlerCounts.delete(d):this.handlerCounts.set(d,e-1)}}this.inputManager&&this.inputManager.uninstallHandlers(a)};
- a.prototype.createUniqueGroupName=function(){this.counter+=1;return"viewEvents_"+this.counter};return a}();h.ViewEvents=r;var l=function(b){function c(a,c,d,e){var g=b.call(this,!0)||this;g.view=a;for(a=0;a<c.length;a++)switch(c[a]){case "click":g.registerIncoming("click",d,function(a){return e(g.wrapClick(a))});break;case "double-click":g.registerIncoming("double-click",d,function(a){return e(g.wrapDoubleClick(a))});break;case "immediate-click":g.registerIncoming("immediate-click",d,function(a){return e(g.wrapImmediateClick(a))});
- break;case "hold":g.registerIncoming("hold",d,function(a){return e(g.wrapHold(a))});break;case "drag":g.registerIncoming("drag",d,function(a){return e(g.wrapDrag(a))});break;case "key-down":g.registerIncoming("key-down",d,function(a){return e(g.wrapKeyDown(a))});break;case "key-up":g.registerIncoming("key-up",d,function(a){return e(g.wrapKeyUp(a))});break;case "pointer-down":g.registerIncoming("pointer-down",d,function(a){return e(g.wrapPointer(a,"pointer-down"))});break;case "pointer-move":g.registerIncoming("pointer-move",
- d,function(a){return e(g.wrapPointer(a,"pointer-move"))});break;case "pointer-up":g.registerIncoming("pointer-up",d,function(a){return e(g.wrapPointer(a,"pointer-up"))});break;case "pointer-drag":g.registerIncoming("pointer-drag",d,function(a){return e(g.wrapPointerDrag(a))});break;case "mouse-wheel":g.registerIncoming("mouse-wheel",d,function(a){return e(g.wrapMouseWheel(a))});break;case "pointer-enter":g.registerIncoming("pointer-enter",d,function(a){return e(g.wrapPointer(a,"pointer-enter"))});
- break;case "pointer-leave":g.registerIncoming("pointer-leave",d,function(a){return e(g.wrapPointer(a,"pointer-leave"))})}return g}f(c,b);c.prototype.wrapClick=function(b){var c=b.data,d=c.x,e=c.y;return{type:"click",pointerType:c.pointerType,button:c.button,buttons:c.buttons,x:d,y:e,native:c.native,timestamp:b.timestamp,screenPoint:new a(d,e),mapPoint:this.view.toMap(d,e),stopPropagation:function(){return b.stopPropagation()}}};c.prototype.wrapDoubleClick=function(a){var b=a.data,c=b.x,d=b.y;return{type:"double-click",
- pointerType:b.pointerType,button:b.button,buttons:b.buttons,x:c,y:d,native:b.native,timestamp:a.timestamp,mapPoint:this.view.toMap(c,d),stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapImmediateClick=function(a){var b=a.data,c=b.x,d=b.y;return{type:"immediate-click",pointerType:b.pointerType,button:b.button,buttons:b.buttons,x:c,y:d,native:b.native,timestamp:a.timestamp,mapPoint:this.view.toMap(c,d),stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapHold=
- function(a){var b=a.data,c=b.x,d=b.y;return{type:"hold",pointerType:b.pointerType,button:b.button,buttons:b.buttons,x:c,y:d,native:b.native,timestamp:a.timestamp,mapPoint:this.view.toMap(c,d),stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapDrag=function(a){var b=a.data,c=b.center,d=c.x,c=c.y,g=b.action,f=b.pointerType,k=b.button;"start"===g&&(this.latestDragStart=b);var l=b.pointer.native,n=a.timestamp;return{type:"drag",action:g,x:d,y:c,origin:{x:this.latestDragStart.center.x,
- y:this.latestDragStart.center.y},pointerType:f,button:k,buttons:b.buttons,radius:b.radius,angle:e.rad2deg(b.angle),native:l,timestamp:n,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapKeyDown=function(a){var b=a.data;return{type:"key-down",key:b.key,repeat:b.repeat,native:b.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapKeyUp=function(a){var b=a.data;return{type:"key-up",key:b.key,native:b.native,timestamp:a.timestamp,
- stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapPointer=function(a,b){var c=a.data,d=c.native;return{type:b,x:c.x,y:c.y,pointerId:d.pointerId,pointerType:d.pointerType,button:c.button,buttons:c.buttons,native:d,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapPointerDrag=function(a){var b=a.data.currentEvent,c=a.data.startEvent.native;return{type:"pointer-drag",x:b.x,y:b.y,pointerId:c.pointerId,pointerType:c.pointerType,button:a.data.startEvent.button,
- buttons:b.buttons,action:a.data.action,origin:{x:a.data.startEvent.x,y:a.data.startEvent.y},native:b.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};c.prototype.wrapMouseWheel=function(a){var b=a.data;return{type:"mouse-wheel",x:b.x,y:b.y,deltaY:b.deltaY,native:b.native,timestamp:a.timestamp,stopPropagation:function(){return a.stopPropagation()}}};return c}(c.InputHandler)})},"esri/views/input/handlers/PreventContextMenu":function(){define(["require","exports",
- "../../../core/tsSupport/extendsHelper","../InputHandler"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(a){function c(){var c=a.call(this,!0)||this;c.registerIncoming("context-menu",function(a){a.data.native.preventDefault()});return c}f(c,a);return c}(a.InputHandler);h.PreventContextMenu=r;h.default=r})},"esri/views/3d/layers/GraphicsView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/promiseUtils ../../../core/accessorSupport/decorators ./graphics/Graphics3DCore ./graphics/Graphics3DElevationAlignment ./graphics/Graphics3DSpatialIndex ../../layers/GraphicsView".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){return function(k){function l(){var a=null!==k&&k.apply(this,arguments)||this;a.graphicsCore=null;a.spatialIndex=null;a.elevationAlignment=null;a.supportsDraping=!0;a._overlayUpdating=!1;a._eventHandles=[];return a}f(l,k);Object.defineProperty(l.prototype,"graphics",{set:function(a){a!==this.loadedGraphics&&(this.loadedGraphics=a);this._set("graphics",a)},enumerable:!0,configurable:!0});l.prototype.initialize=function(){var a=this;this.mockLayerId="__sceneView.graphics-"+
- Date.now().toString(16);this.spatialIndex=new b;this.spatialIndex.whenLoaded().then(function(){return a.deferredInitialize()})};l.prototype.deferredInitialize=function(){var a=this;if(!this.destroyed){this.loadedGraphics=this.graphics;this.graphicsCore=new g;this.elevationAlignment=new d;var b={id:this.mockLayerId,uid:this.mockLayerId};this.spatialIndex.initialize(this,b,this.view.spatialReference,this.graphicsCore);this.elevationAlignment.initialize(this,function(b,c,d){a.spatialIndex.intersects(b,
- c,d)},this.graphicsCore,this.view.elevationProvider);this.graphicsCore.initialize(this,b,this.elevationAlignment,null,this.spatialIndex,null,null,null,null,this.view.basemapTerrain);this._eventHandles.push(this.view.watch("clippingArea",function(){return a.updateClippingExtent()}));this.updateClippingExtent();this.view.resourceController.registerIdleFrameWorker(this,{needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate})}};l.prototype.destroy=function(){this._eventHandles.forEach(function(a){return a.remove()});
- this._eventHandles=null;this.view.resourceController.deregisterIdleFrameWorker(this);this.spatialIndex&&(this.spatialIndex.destroy(),this.spatialIndex=null);this.elevationAlignment&&(this.elevationAlignment.destroy(),this.elevationAlignment=null);this.graphicsCore&&(this.graphicsCore.destroy(),this.graphicsCore=null);this.loadedGraphics=null};l.prototype.getGraphicsFromStageObject=function(a,b){var c=a.getMetadata().graphicId,d=null;this.loadedGraphics&&this.loadedGraphics.some(function(a){return a.uid===
- c?(d=a,!0):!1});return e.create(function(a,b){null!==d?a(d):b()})};l.prototype.whenGraphicBounds=function(a,b){var c=this;return this.spatialIndex?this.spatialIndex.whenLoaded().then(function(){return c.graphicsCore?c.graphicsCore.whenGraphicBounds(a,b):e.reject()}):e.reject()};l.prototype._needsIdleUpdate=function(){return this.elevationAlignment.needsIdleUpdate()};l.prototype._idleUpdate=function(a){this.elevationAlignment.idleUpdate(a)};l.prototype._notifySuspendedChange=function(){};l.prototype._notifyDrapedDataChange=
- function(){this.view.basemapTerrain&&this.view.basemapTerrain.overlayManager.setOverlayDirty()};l.prototype._evaluateUpdatingState=function(){if(this.elevationAlignment){var a;a=0+this.elevationAlignment.numNodesUpdating();a+=this.graphicsCore.numNodesUpdating();this.updating=a=(a=(a=0<a||this._overlayUpdating)||this.spatialIndex.isUpdating())||this.graphicsCore.needsIdleUpdate()}else this.updating=!1};l.prototype.updateClippingExtent=function(){this.graphicsCore.setClippingExtent(this.view.clippingArea,
- this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()};a([c.property()],l.prototype,"graphics",null);a([c.property()],l.prototype,"loadedGraphics",void 0);a([c.property({value:!0})],l.prototype,"updating",void 0);a([c.property({value:!1})],l.prototype,"suspended",void 0);return l=a([c.subclass("esri.views.3d.layers.GraphicsView3D")],l)}(c.declared(k))})},"esri/views/3d/layers/graphics/Graphics3DCore":function(){define("require exports ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper dojo/Deferred ../../../../core/arrayUtils ../../../../core/Error ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/watchUtils ../../../../geometry/Extent ../../../../geometry/Point ../../../../renderers/UniqueValueRenderer ../../../../renderers/support/diffUtils ../../../../renderers/support/rendererConversion ../../../../symbols/LabelSymbol3D ../../../../symbols/TextSymbol ../../../../symbols/WebStyleSymbol ../../../../symbols/support/symbolConversion ../../../../symbols/support/unitConversionUtils ./ElevationQuery ./featureExpressionInfoUtils ./Graphics3DGraphic ./Graphics3DOwner ./Graphics3DSymbolFactory ./Graphics3DWebStyleSymbol ./graphicUtils ../../lib/glMatrix ../../support/aaBoundingBox ../../support/mathUtils ../../support/projectionUtils ../../webgl-engine/Stage ../../webgl-engine/lib/FloatingBoxLocalOriginFactory ../../webgl-engine/lib/Layer ../../webgl-engine/lib/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G,M,H,J,O,N,S){function R(a){(a=a.elevationInfo&&a.elevationInfo.unit)&&!B.supportsUnit(a)&&Q.warn("elevationInfo.unit","'"+a+"' is not a valid unit")}r=P.vec3d;var Y=new p,X=r.create(),Q=d.getLogger("esri.views.3d.layers.graphics.Graphics3DCore");return function(){function d(a){void 0===a&&(a=!0);this.elevationFeatureExpressionEnabled=a;this.graphics={};this.graphicsDrapedIds={};this.graphicsBySymbol={};this.graphicsKeys=[];this.symbols=
- {};this.graphicsWithoutSymbol={};this.computedExtent=null;this.symbolCreationContext=new D.Graphics3DSymbolCreationContext;this.hasDraped=!1;this.updatingGraphicIds=new Set;this.graphicTransformFunc=this.onComputedExtentChange=this.stage=this.labelStageLayer=this.stageLayer=this.tilingSchemeHandle=this.lastFastUpdate=null;this.eventHandles=[];this.sharedSymbolResourcesOwnerHandle=this.highlights=this.elevationQueryView=this.elevationQueryService=this.labeling=this.spatialIndex=this.scaleVisibility=
- this.elevation=this.layer=this.layerView=this.viewSR=null;this.whenGraphics3DGraphicRequests={}}d.prototype.initialize=function(a,b,c,e,g,f,l,m,n,q){var p=this;this.layerView=a;this.layer=b;this.viewSR=a.view.spatialReference;this.elevation=c;this.scaleVisibility=e;this.spatialIndex=g;this.labeling=f;this.highlights=l;this.onComputedExtentChange=m;this.graphicTransformFunc=n;var t=this.layerView.view;this.elevationQueryService=new z.ElevationQuery(this.viewSR,function(){return t.map.ground},{maximumAutoTileRequests:4});
- this.elevationQueryView=new z.ElevationQueryView(this.viewSR,t.basemapTerrain);this.initializeStage(t,this.layer.uid);this.symbolCreationContext.sharedResources=t.sharedSymbolResources;this.sharedSymbolResourcesOwnerHandle=t.sharedSymbolResources.addGraphicsOwner(this);this.symbolCreationContext.renderer=this.layer.renderer;this.symbolCreationContext.stage=this.stage;this.symbolCreationContext.streamDataSupplier=t.sharedSymbolResources.streamDataSupplier;this.symbolCreationContext.renderSpatialReference=
- t.renderSpatialReference;this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper;this.symbolCreationContext.layer=this.layer;this.symbolCreationContext.layerView=this.layerView;this.symbolCreationContext.layerOrder=0;this.symbolCreationContext.localOriginFactory=d.createLocalOriginFactory();this.symbolCreationContext.elevationProvider=t.elevationProvider;R(this.layer);b=C.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=
- C.createContext(b,this.viewSR,Q);t.deconflictor.addGraphicsOwner(this);this.symbolCreationContext.screenSizePerspectiveEnabled=t.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;this.tilingSchemeHandle=k.when(q,"tilingScheme",function(a){a.spatialReference.equals(p.symbolCreationContext.overlaySR)||(p.symbolCreationContext.overlaySR=q.spatialReference,p.recreateAllGraphics())});this.eventHandles.push(this.layerView.watch("suspended",function(){return p.suspendedChange()}));this.eventHandles.push(this.layerView.watch("layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled",
- function(){p.symbolCreationContext.screenSizePerspectiveEnabled=t.screenSizePerspectiveEnabled&&p.layer.screenSizePerspectiveEnabled;p.recreateAllGraphics()}));this.eventHandles.push(k.on(a,"loadedGraphics","change",function(a){return p.graphicsCollectionChanged(a)},function(){p.clearSymbolsAndGraphics();p.graphicsCollectionChanged({added:p.layerView.loadedGraphics.toArray(),removed:[]})}));this.validateRenderer(this.layer.renderer)};d.prototype.destroy=function(){var a=this;this.layerView.view.deconflictor.removeGraphicsOwner(this);
- this.clear();if(this.stage){var b=[this.stageLayer.id];this.labelStageLayer&&b.push(this.labelStageLayer.id);this.stage.removeFromViewContent(b);b.forEach(function(b){return a.stage.remove(J.ModelContentType.LAYER,b)});this.stage=this.labelStageLayer=this.stageLayer=null}this.tilingSchemeHandle&&(this.tilingSchemeHandle.remove(),this.tilingSchemeHandle=null);this.eventHandles.forEach(function(a){return a.remove()});this.layerView=this.labeling=this.scaleVisibility=this.viewSR=this.onComputedExtentChange=
- this.eventHandles=null;for(var c in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[c].reject(new g("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null;this.sharedSymbolResourcesOwnerHandle&&(this.sharedSymbolResourcesOwnerHandle.remove(),this.sharedSymbolResourcesOwnerHandle=null)};d.prototype.clear=function(){var a=!1,b;for(b in this.graphics){var c=this.graphics[b],a=a||c.isDraped();c.destroy()}this.graphics={};this.graphicsKeys=
- null;for(var d in this.symbols)(b=this.symbols[d])&&b.destroy();this.symbols={};this.graphicsBySymbol={};this.graphicsWithoutSymbol={};this.hasDraped=!1;a&&this.layerView._notifyDrapedDataChange()};d.prototype.initializeStage=function(a,b){this.stage=a._stage;this.stageLayer=new N(b,{isPickable:!this.layerView.suspended},b);this.stage.add(J.ModelContentType.LAYER,this.stageLayer);a=[this.stageLayer.id];this.labeling&&(this.labelStageLayer=new N(b,{isPickable:!1},b+"_labels"),this.stage.add(J.ModelContentType.LAYER,
- this.labelStageLayer),a.push(this.labelStageLayer.id));this.stage.addToViewContent(a)};d.prototype.setDrawingOrder=function(a){this.symbolCreationContext.layerOrder=a;var b={},c={},d;for(d in this.graphics)this.graphics[d].setDrawOrder(a,b,c);for(var e in c)(c=this.symbols[e])&&c.setDrawOrder(a,b);S.objectEmpty(b)||(this.stage.getTextureGraphicsRenderer().updateRenderOrder(b),this.layerView._notifyDrapedDataChange())};d.prototype.suspendedChange=function(){!0===this.layerView.suspended?(this.stageLayer.isPickable=
- !1,this.hideAllGraphics()):!1===this.layerView.suspended&&(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility())};d.prototype.getGraphics3DGraphics=function(){return this.graphics};d.prototype.getGraphics3DGraphicById=function(a){return this.graphics[a]};d.prototype.getGraphics3DGraphicsKeys=function(){null===this.graphicsKeys&&(this.graphicsKeys=Object.keys(this.graphics));return this.graphicsKeys};d.prototype.labelsEnabled=function(){return!(!this.labeling||!this.labeling.layerLabelsEnabled())};
- d.prototype.getSymbolUpdateType=function(){var a=0,b=0,c=0,d;for(d in this.symbols){var e=this.symbols[d];e&&(e=e.getFastUpdateStatus(),a+=e.loading,c+=e.fast,b+=e.slow)}return 0<a?"unknown":0<=c&&0===b?"fast":0<=b&&0===c?"slow":"mixed"};d.prototype.numNodesUpdating=function(){return this.updatingGraphicIds.size};d.prototype.needsIdleUpdate=function(){return!!this.lastFastUpdate&&500<performance.now()-this.lastFastUpdate};d.prototype.idleUpdate=function(a){a.done()||(this.lastFastUpdate&&(this.labeling&&
- this.labeling.updateLabelingInfo(),this.lastFastUpdate=null),this.layerView._evaluateUpdatingState())};d.prototype.whenGraphics3DGraphic=function(a){var c=this.graphics[a.uid];if(c)return b.resolve(c);c=this.whenGraphics3DGraphicRequests[a.uid];c||(c=new e,this.whenGraphics3DGraphicRequests[a.uid]=c);return c.promise};d.prototype.boundsForGraphics3DGraphic=function(b,c){return a(this,void 0,void 0,function(){var a,d,e,g,k,l,m,n,p,q;return f(this,function(f){switch(f.label){case 0:return a=this.layerView.view.spatialReference,
- d=this.layerView.view.renderSpatialReference,e=this.layerView.view.basemapTerrain.spatialReference,g=function(b,c,e){return H.bufferToBuffer(b,d,c,b,a,c,e)},k=function(b,c,d){return H.bufferToBuffer(b,e,c,b,a,c,d)},l=c&&c.useViewElevation?this.elevationQueryView:this.elevationQueryService,[4,b.getProjectedBoundingBox(g,k,l)];case 1:m=f.sent();if(!m)return[2,null];n=m.boundingBox;m.requiresDrapedElevation&&(p=this.symbolCreationContext.elevationProvider)&&(G.center(n,X),Y.x=X[0],Y.y=X[1],Y.z=void 0,
- Y.spatialReference=a,q=p.getElevation(Y)||0,n[2]=Math.min(n[2],q),n[5]=Math.max(n[5],q));return[2,{boundingBox:n,screenSpaceObjects:m.screenSpaceObjects}]}})})};d.prototype.whenGraphicBounds=function(a,b){var c=this;return k.whenOnce(this.layerView,"loadedGraphics").then(function(){var b=c.layerView.layer&&c.layerView.layer.objectIdField,d=c.layerView.loadedGraphics.find(function(c){return c===a||b&&c.attributes&&a.attributes&&c.attributes[b]===a.attributes[b]?!0:!1});if(d)return c.whenGraphics3DGraphic(d);
- throw new g("internal:graphic-not-part-of-view","Graphic is not part of this view");}).then(function(a){return c.boundsForGraphics3DGraphic(a,b)})};d.prototype.graphicsCollectionChanged=function(a){var b=this.graphicTransformFunc?this.graphicTransformFunc(a.added):a.added;this.add(b);this.remove(a.removed)};d.prototype.graphicUpdateHandler=function(a){var b=this.graphics[a.graphic.uid];if(b)switch(a.property){case "visible":b.setVisibilityFlag(0,a.newValue)&&(b.isDraped()&&this.layerView._notifyDrapedDataChange(),
- this.labeling&&this.layerView.view.deconflictor.setDirty())}};d.prototype.beginGraphicUpdate=function(a){this.updatingGraphicIds.add(a.uid);"symbolsUpdating"in this.layerView&&!this.layerView.get("symbolsUpdating")&&this.layerView.set("symbolsUpdating",!0);this.layerView._evaluateUpdatingState()};d.prototype.endGraphicUpdate=function(a){a&&this.updatingGraphicIds.delete(a.uid);"symbolsUpdating"in this.layerView&&this.layerView.get("symbolsUpdating")&&0===this.updatingGraphicIds.size&&(this.layerView.view.flushDisplayModifications(),
- this.layerView.set("symbolsUpdating",!1));this.layerView._evaluateUpdatingState()};d.prototype.expandComputedExtent=function(a){var b,c,e,g,f,k;if("point"===a.type)b=c=a.x,e=g=a.y,a.z&&(f=k=a.z);else if("polygon"===a.type||"polyline"===a.type||"multipoint"===a.type){k=a.extent;if(!k)return;b=k.xmin;c=k.xmax;e=k.ymin;g=k.ymax;f=k.zmin;k=k.zmax}var m=this.viewSR,n=d.tmpVec;!a.spatialReference.equals(m)&&H.xyzToVector(b,e,0,a.spatialReference,n,m)&&(b=n[0],e=n[1],H.xyzToVector(c,g,0,a.spatialReference,
- n,m),c=n[0],g=n[1]);if(M.isFinite(b)&&M.isFinite(c)&&M.isFinite(e)&&M.isFinite(g)){(m=this.computedExtent)?(b<m.xmin&&(m.xmin=b),c>m.xmax&&(m.xmax=c),e<m.ymin&&(m.ymin=e),g>m.ymax&&(m.ymax=g)):this.computedExtent=m=new l(b,e,c,g,a.spatialReference);if(M.isFinite(f)&&!M.isFinite(k)){if(null==m.zmin||f<m.zmin)m.zmin=f;if(null==m.zmax||k>m.zmax)m.zmax=k}this.onComputedExtentChange&&this.onComputedExtentChange()}};d.prototype.updateHasDraped=function(){this.hasDraped=!1;for(var a in this.graphicsDrapedIds)if(this.graphicsDrapedIds.hasOwnProperty(a)){this.hasDraped=
- !0;break}};d.prototype.elevationInfoChange=function(){R(this.layer);var a=C.extractExpressionInfo(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=C.createContext(a,this.viewSR,Q);this.labeling&&this.labeling.elevationInfoChange();this.layer.renderer!==this.symbolCreationContext.renderer&&this.rendererChange(this.layer.renderer);for(var b in this.graphicsBySymbol){var c=this.symbols[b],a=this.graphicsBySymbol[b];if(c&&c.layerPropertyChanged("elevationInfo",
- a)){for(var d in a){var e=a[d],c=e.graphic,e=e._labelGraphics;this.elevation&&this.elevation.markGraphicElevationDirty(c.uid);for(var g=0;g<e.length;g++){var f=e[g];f.graphics3DSymbolLayer.updateGraphicElevationContext(c,f)}}this.layerView._evaluateUpdatingState()}else this._recreateSymbol(b)}};d.prototype.clearSymbolsAndGraphics=function(){this.clear();this.elevation&&this.elevation.clear();this.labeling&&this.labeling.clear()};d.prototype.recreateAllGraphics=function(){this.clearSymbolsAndGraphics();
- this.computedExtent=null;this.onComputedExtentChange&&this.onComputedExtentChange();this.layerView.loadedGraphics&&this.layerView.view.basemapTerrain.tilingScheme&&this.add(this.layerView.loadedGraphics.toArray())};d.prototype._recreateSymbol=function(a){var b=this.graphicsBySymbol[a],c=[],d=!1,e;for(e in b){var g=b[e];g.isDraped()&&(delete this.graphicsDrapedIds[e],d=!0);c.push(g.graphic);g.destroy();delete this.graphics[e]}this.graphicsBySymbol[a]={};(b=this.symbols[a])&&b.destroy();delete this.symbols[a];
- this.updateHasDraped();d&&this.layerView._notifyDrapedDataChange();this.add(c)};d.prototype.add=function(a){if(this.layerView.view.basemapTerrain&&this.layerView.view.basemapTerrain.tilingScheme){for(var b=a.length,c=Array(b),d=Array(b),e=Array(b),g=!1,f=0;f<b;f++){var k=a[f],l=k.geometry;if(l)if(this.expandComputedExtent(l),l=this.layerView.getRenderingInfo?this.layerView.getRenderingInfo(k):{symbol:k.symbol},this.graphicsWithoutSymbol[k.uid]=k,l&&l.symbol){if(d[f]=l.symbol,e[f]=l,l=this.getOrCreateGraphics3DSymbol(d[f],
- l.renderer))c[f]=l,this.beginGraphicUpdate(k)}else g||(g=!0,Q.warn("Graphic in layer "+this.layer.id+" has no symbol and will not render"))}for(f=0;f<b;f++)this.waitForSymbol(c[f],d[f],a[f],e[f])}};d.prototype.waitForSymbol=function(a,b,c,d){var e=this;a&&a.then(function(){e.createGraphics3DGraphic(a,c,d);e.endGraphicUpdate(c);e.labeling&&e.layerView.view.deconflictor.setDirty()},function(){e.endGraphicUpdate(c)})};d.prototype.remove=function(a){for(var b=!1,c=a.length,d=0;d<c;d++){var e=a[d].uid,
- g=this.graphics[e];if(g){g.isDraped()&&(delete this.graphicsDrapedIds[e],b=!0);var f=g.graphics3DSymbol.symbol.id;g.destroy();delete this.graphics[e];delete this.graphicsBySymbol[f][e];delete this.graphicsWithoutSymbol[e];this.graphicsKeys=null}}this.updateHasDraped();b&&this.layerView._notifyDrapedDataChange();this.layerView.view.deconflictor.setDirty()};d.prototype.hasLabelingContext=function(a){if(a instanceof q||a instanceof v){var b=this.symbolCreationContext.layer;return b.labelingInfo?b.labelingInfo.some(function(b){return b.symbol===
- a}):!1}return!1};d.prototype.hasValidSymbolCreationContext=function(a){return a instanceof q&&!this.hasLabelingContext(a)?(Q.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1):!0};d.prototype.createGraphics3DSymbol=function(a,b){if(!this.hasValidSymbolCreationContext(a))return null;a=m.to3D(a,!0,!1,this.hasLabelingContext(a));if(a.symbol){var c=void 0;b&&b.backgroundFillSymbol&&(b=m.to3D(b.backgroundFillSymbol,!1,!0),b.symbol&&
- (c=b.symbol.symbolLayers));return E.make(a.symbol,this.symbolCreationContext,c)}a.error&&Q.error(a.error.message);return null};d.prototype.getOrCreateGraphics3DSymbol=function(a,b){var c=this,d=this.symbols[a.id];void 0===d&&(d=a instanceof x?new F(a,function(a){return c.createGraphics3DSymbol(a,b)}):this.createGraphics3DSymbol(a,b),this.symbols[a.id]=d);return d};d.prototype.createGraphics3DGraphic=function(a,b,c){delete this.graphicsWithoutSymbol[b.uid];if(!this.symbols[a.symbol.id])this.add([b]);
- else if(!this.graphics[b.uid]){c=a.createGraphics3DGraphic(b,c);this.graphics[b.uid]=c;this.graphicsKeys=null;this.graphicsBySymbol[a.symbol.id]||(this.graphicsBySymbol[a.symbol.id]={});this.graphicsBySymbol[a.symbol.id][b.uid]=c;c.initialize(this.stageLayer,this.stage);c.isDraped()&&(this.hasDraped=this.graphicsDrapedIds[b.uid]=!0,this.layerView._notifyDrapedDataChange());c.centroid=null;"point"!==b.geometry.type&&c instanceof A&&(c.centroid=I.computeCentroid(b.geometry,this.viewSR));a=this.scaleVisibility&&
- this.scaleVisibility.scaleRangeActive();this.spatialIndex&&this.spatialIndex.shouldAddToSpatialIndex(b,c,a)&&this.spatialIndex.addGraphicToSpatialIndex(b,c);this.labeling&&this.labeling.layerLabelsEnabled()&&this.labeling.createLabelsForGraphic(b,c);a&&this.scaleVisibility.updateGraphicScaleVisibility(b,c);c.setVisibilityFlag(0,b.visible&&!this.layerView.suspended);if(a=this.whenGraphics3DGraphicRequests[b.uid])delete this.whenGraphics3DGraphicRequests[b.uid],a.resolve(c);this.highlights&&this.highlights.graphicCreated(c)}};
- d.prototype.rendererChange=function(a){var b=this.symbolCreationContext.renderer;if(a!==b){this.validateRenderer(a);var c=t.diff(b,a);this.updateUnchangedSymbolMappings(c,a,b);this.symbolCreationContext.renderer=a;c&&("complete"===c.type?this.recreateAllGraphics():"partial"===c.type&&(this.applyRendererDiff(c,a,b)?this.volatileGraphicsUpdated():this.recreateAllGraphics()))}};d.prototype.diffHasSymbolChange=function(a){for(var b in a.diff)switch(b){case "visualVariables":break;case "defaultSymbol":break;
- case "uniqueValueInfos":break;case "authoringInfo":case "fieldDelimiter":delete a.diff[b];break;default:return!0}return!1};d.prototype.applySymbolSetDiff=function(a,b,c,d){d=!1;a=a||[];b=b||[];for(var e=[],g=0;g<b.length;g++){var f=b[g],k=this.graphicsBySymbol[f.id],l;for(l in k){var m=k[l],n=m.graphic;if(f!==c.defaultSymbol||c.getSymbol(n)!==c.defaultSymbol)m.isDraped()&&(delete this.graphicsDrapedIds[l],d=!0),a.length||c.defaultSymbol?e.push(n):this.graphicsWithoutSymbol[l]=n,m.destroy(),this.highlights&&
- this.highlights.graphicDeleted(this.graphics[l]),delete k[l],delete this.graphics[l],this.graphicsKeys=null}if(void 0===k||0===Object.keys(k).length)delete this.graphicsBySymbol[f.id],(k=this.symbols[f.id])&&k.destroy(),delete this.symbols[f.id]}if(a.length||e.length){for(l in this.graphicsWithoutSymbol)e.push(this.graphicsWithoutSymbol[l]);this.graphicsWithoutSymbol={};this.add(e)}this.updateHasDraped();d&&this.layerView._notifyDrapedDataChange();this.layerView.view.deconflictor.setDirty()};d.prototype.applyUniqueValueRendererDiff=
- function(a,b,c){var d=a.diff.defaultSymbol,e=a.diff.uniqueValueInfos;if(d||e){var g=e?e.added.map(function(a){return a.symbol}):[],f=e?e.removed.map(function(a){return a.symbol}):[];if(e)for(var k=0;k<e.changed.length;k++)g.push(e.changed[k].newValue.symbol),f.push(e.changed[k].oldValue.symbol);d?(c.defaultSymbol&&f.push(c.defaultSymbol),b.defaultSymbol&&g.push(b.defaultSymbol)):c.defaultSymbol&&g.length&&f.push(b.defaultSymbol);this.applySymbolSetDiff(g,f,b,c);delete a.diff.defaultSymbol;delete a.diff.uniqueValueInfos;
- return!0}return!1};d.prototype.calculateUnchangedSymbolMapping=function(a,b,c){if(b instanceof n&&c instanceof n)if(!a){if(c&&c.defaultSymbol)return[{oldId:c.defaultSymbol.id,newId:b.defaultSymbol.id}]}else if("partial"===a.type){var d=a.diff;a=d.defaultSymbol;var d=d.uniqueValueInfos,e=void 0,e=d?d.unchanged.map(function(a){return{oldId:a.oldValue.symbol.id,newId:a.newValue.symbol.id}}):c.uniqueValueInfos.map(function(a,c){return{oldId:a.symbol.id,newId:b.uniqueValueInfos[c].symbol.id}});!a&&c.defaultSymbol&&
- e.push({oldId:c.defaultSymbol.id,newId:b.defaultSymbol.id});return e}return[]};d.prototype.updateUnchangedSymbolMappings=function(a,b,c){var d=0;for(a=this.calculateUnchangedSymbolMapping(a,b,c);d<a.length;d++)if(c=a[d],b=c.oldId,c=c.newId,b&&b!==c){var e=this.graphicsBySymbol[b];delete this.graphicsBySymbol[b];void 0!==e&&(this.graphicsBySymbol[c]=e);e=this.symbols[b];delete this.symbols[b];void 0!==e&&(this.symbols[c]=e,e.symbol.id=c)}};d.prototype.applyRendererDiff=function(a,b,c){var d=!1;if(this.diffHasSymbolChange(a))return!1;
- if(b instanceof n&&c instanceof n&&this.applyUniqueValueRendererDiff(a,b,c)&&0===Object.keys(a.diff).length)return!0;for(var e in this.graphicsBySymbol)if(c=this.symbols[e]){var g=this.graphicsBySymbol[e];if(!c.applyRendererDiff(a,b,g))return!1;if(!d)for(var f in g)if(g[f].isDraped()){this.layerView._notifyDrapedDataChange();d=!0;break}}return!0};d.prototype.opacityChange=function(){var a=!1,b;for(b in this.graphicsBySymbol){var c=this.symbols[b];if(c){var d=this.graphicsBySymbol[b];c.layerPropertyChanged("opacity");
- if(!a)for(var e in d)if(d[e].isDraped()){this.layerView._notifyDrapedDataChange();a=!0;break}}}};d.prototype.setClippingExtent=function(a,b){var d=this.symbolCreationContext.clippingExtent,e=[];H.extentToBoundingRect(a,e,b)?this.symbolCreationContext.clippingExtent=[e[0],e[1],-Infinity,e[2],e[3],Infinity]:this.symbolCreationContext.clippingExtent=null;return!c.equals(this.symbolCreationContext.clippingExtent,d)};d.prototype.forEachGraphics3DGraphic=function(a){var b=this;if(this.layerView.loadedGraphics){var c=
- !1,d=!1;this.layerView.loadedGraphics.forEach(function(e){var g=b.getGraphics3DGraphicById(e.uid);g&&a(g,e)&&(c=!0,d=d||g.isDraped())});c&&this.layerView.view.deconflictor.setDirty();d&&this.layerView._notifyDrapedDataChange()}};d.prototype.updateAllGraphicsVisibility=function(){var a=this;this.forEachGraphics3DGraphic(function(b,c){var d=b.setVisibilityFlag(0,c.visible),e=!1;a.scaleVisibility&&(e=a.scaleVisibility.updateGraphicScaleVisibility(c,b));return d||e})};d.prototype.hideAllGraphics=function(){this.forEachGraphics3DGraphic(function(a){return a.setVisibilityFlag(0,
- !1)})};d.prototype.validateRenderer=function(a){(a=u.validateTo3D(a))&&Q.warn("Renderer for layer '"+(this.layer.title?this.layer.title+", ":"")+", id:"+this.layer.id+"' is not supported in a SceneView",a.message)};d.prototype.volatileGraphicsUpdated=function(){this.labeling&&(this.lastFastUpdate=performance.now());this.stageLayer.invalidateSpatialQueryAccelerator();this.stageLayer.shaderTransformationChanged();this.layerView._evaluateUpdatingState()};d.createLocalOriginFactory=function(){return new O(5E6,
- 16)};d.prototype.snapshotInternals=function(){var a=this;return{graphics:Object.keys(this.graphics).sort(),symbols:Object.keys(this.symbols).sort(),graphicsBySymbol:Object.keys(this.graphicsBySymbol).sort().map(function(b){return{symbolId:b,graphics:Object.keys(a.graphicsBySymbol[b]).sort()}}),graphicsWithoutSymbol:Object.keys(this.graphicsWithoutSymbol).sort(),graphicsDrapedIds:Object.keys(this.graphicsDrapedIds).sort()}};d.tmpVec=P.vec3d.create();return d}()})},"esri/core/tsSupport/generatorHelper":function(){define([],
- function(){return function(r,h){function f(b){return function(c){return a([b,c])}}function a(a){if(c)throw new TypeError("Generator is already executing.");for(;e;)try{if(c=1,g&&(d=g[a[0]&2?"return":a[0]?"throw":"next"])&&!(d=d.call(g,a[1])).done)return d;if(g=0,d)a=[0,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++;g=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(d=e.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||
- 2===a[0])){e=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))e.label=a[1];else if(6===a[0]&&e.label<d[1])e.label=d[1],d=a;else if(d&&e.label<d[2])e.label=d[2],e.ops.push(a);else{d[2]&&e.ops.pop();e.trys.pop();continue}}a=h.call(r,e)}catch(l){a=[6,l],g=0}finally{c=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var e={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},c,g,d,b;return b={next:f(0),"throw":f(1),"return":f(2)},"function"===typeof Symbol&&(b[Symbol.iterator]=
- function(){return this}),b}})},"esri/core/tsSupport/awaiterHelper":function(){define(["dojo/Deferred","dojo/when"],function(r,h){return function(f,a,e,c){function g(a){try{b(c.next(a))}catch(p){k.reject(p)}}function d(a){try{b(c["throw"](a))}catch(p){k.reject(p)}}function b(a){a.done?h(a.value).then(k.resolve,k.reject):h(a.value).then(g,d)}var k=new r;b((c=c.apply(f,a||[])).next());return k.promise}})},"esri/renderers/support/rendererConversion":function(){define(["require","exports","../../core/Error",
- "../../symbols/support/symbolConversion"],function(r,h,f,a){function e(a,b){if(!b)return null;b=Array.isArray(b)?b:[b];if(0<b.length){var c=b.map(function(a){return a.details.symbol.type||a.details.symbol.declaredClass}).filter(function(a){return!!a});c.sort();var d=[];c.forEach(function(a,b){0!==b&&a===c[b-1]||d.push(a)});return new f("renderer-conversion-3d:unsupported-symbols","Renderer contains symbols ("+d.join(", ")+") which are not supported in 3D",{renderer:a,symbolErrors:b})}return null}
- function c(c){var b=c.uniqueValueInfos.map(function(b){return a.to3D(b.symbol).error}).filter(function(a){return!!a}),d=a.to3D(c.defaultSymbol);d.error&&b.unshift(d.error);return e(c,b)}function g(c){var b=c.classBreakInfos.map(function(b){return a.to3D(b.symbol).error}).filter(function(a){return!!a}),d=a.to3D(c.defaultSymbol);d.error&&b.unshift(d.error);return e(c,b)}Object.defineProperty(h,"__esModule",{value:!0});h.validateTo3D=function(d){return d?"simple"===d.type?e(d,a.to3D(d.symbol).error):
- "unique-value"===d.type?c(d):"class-breaks"===d.type?g(d):new f("renderer-conversion-3d:unsupported-renderer","Unsupported renderer of type '"+(d.type||d.declaredClass)+"'",{renderer:d}):null}})},"esri/symbols/support/unitConversionUtils":function(){define(["require","exports","../../renderers/support/utils"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.supportsUnit=function(a){return null!=f.meterIn[a]};h.getMetersPerUnit=function(a){return 1/(f.meterIn[a]||1)}})},"esri/views/3d/layers/graphics/ElevationQuery":function(){define("require exports ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper dojo/Deferred dojo/_base/lang ../../../../geometry ../../../../core/promiseUtils ../../../../core/scheduling".split(" "),
- function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function b(a,b){this.spatialReference=a;this.elevationProvider=b;this.point=new g.Point;this.point.spatialReference=a}b.prototype.queryElevation=function(b,c){return a(this,void 0,void 0,function(){return f(this,function(a){this.point.x=b;this.point.y=c;return[2,d.resolve(this.elevationProvider&&this.elevationProvider.getElevation(this.point)||0)]})})};return b}();h.ElevationQueryView=r;r=function(){function d(a,
- b,d){this.spatialReference=a;this._getElevationQueryProvider=b;this._queries=[];this._isScheduled=!1;this._queryOptions=c.mixin({},d,{ignoreInvisibleLayers:!0})}d.prototype.queryElevation=function(b,c){return a(this,void 0,void 0,function(){var a;return f(this,function(d){a=new e;this._queries.push({x:b,y:c,result:a});this._scheduleDoQuery();return[2,a.promise]})})};d.prototype._scheduleDoQuery=function(){var a=this;this._isScheduled||(b.schedule(function(){return a._doQuery()}),this._isScheduled=
- !0)};d.prototype._doQuery=function(){return a(this,void 0,void 0,function(){var a,b,c,d,e,k,h;return f(this,function(f){switch(f.label){case 0:this._isScheduled=!1;a=this._queries;this._queries=[];b=a.map(function(a){return[a.x,a.y]});c=new g.Multipoint({points:b,spatialReference:this.spatialReference});d=this._getElevationQueryProvider();if(!d)return a.forEach(function(a,b){return a.result.reject()}),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,d.queryElevation(c,this._queryOptions)];case 2:return e=
- f.sent(),[3,4];case 3:return k=f.sent(),a.forEach(function(a){return a.result.reject(k)}),[2];case 4:return h=e.geometry.points,a.forEach(function(a,b){return a.result.resolve(h[b][2])}),[2]}})})};return d}();h.ElevationQuery=r})},"esri/views/3d/layers/graphics/featureExpressionInfoUtils":function(){define(["require","exports","../../../../arcade/Feature","../../../../support/arcadeUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.createContext=function(e,c,g){var d=null;
- e=e&&e.expression;"string"===typeof e&&(d="0"===e?0:null,null!=d?d={cachedResult:d}:(d=a.createSyntaxTree(e),a.dependsOnView(d)?(null!=g&&g.error("Expressions containing '$view' are not supported on ElevationInfo"),d={cachedResult:0}):d={arcade:{func:a.createFunction(d),context:a.createExecContext(null,{sr:c})}}));return d};h.createFeature=function(a){return f.createFromGraphic(a)};h.setContextFeature=function(e,c){null!=e&&null==e.cachedResult&&a.updateExecContext(e.arcade.context,c)};h.execute=
- function(e){if(null!=e){if(null!=e.cachedResult)return e.cachedResult;var c=e.arcade,c=a.executeFunction(c.func,c.context);"number"!==typeof c&&(c=e.cachedResult=0);return c}return 0};h.extractExpressionInfo=function(a,c){void 0===c&&(c=!1);var e=(a=a&&a.featureExpressionInfo)&&a.expression;c||"0"===e||(a=null);return a};h.zeroContext={cachedResult:0}})},"esri/views/3d/layers/graphics/Graphics3DGraphic":function(){define("require exports ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ../../../../core/asyncUtils ../../../../core/ObjectPool ./featureExpressionInfoUtils ../../support/aaBoundingBox ../../support/aaBoundingRect".split(" "),
- function(r,h,f,a,e,c,g,d,b){var k=new c(Array,function(a){return d.set(a,d.ZERO)},null,10,5),l=b.create();return function(){function c(a,b,c){this.addedToSpatialIndex=!1;this._labelGraphics=[];this._auxiliaryGraphics=[];for(var d=Array(2),e=0;e<d.length;e++)d[e]=Array(3);this._visibilityFlags=d;this._featureExpressionFeature=null;this.graphics3DSymbol=b;this.graphic=a;this._graphics=c;this._featureExpressionFeature=g.createFeature(a)}c.prototype.initialize=function(a,b){var c=this;this._layer=a;this._stage=
- b;this.forEachSymbolLayerGraphic(function(d){d.initialize(a,b);d.setVisibility(c.isVisible())})};c.prototype.destroy=function(){this.forEachRenderedGraphic(function(a){return a.destroy()});this._graphics.length=0;this._labelGraphics.length=0;this._auxiliaryGraphics.length=0};c.prototype.clearLabelGraphics=function(){this.forEachLabelGraphic(function(a){return a.destroy()});this._labelGraphics.length=0};c.prototype.addLabelGraphic=function(a,b,c){this._labelGraphics.push(a);a.initialize(b,c);a.setVisibility(this.isVisible(1))};
- c.prototype.addAuxiliaryGraphic=function(a){this._auxiliaryGraphics.push(a);this._layer&&(a.initialize(this._layer,this._stage),a.setVisibility(this.isVisible()))};c.prototype.isDraped=function(){var a=!1;this.forEachSymbolLayerGraphic(function(b){b.isDraped()&&(a=!0)});return a};c.prototype.setDrawOrder=function(a,b,c){var d=this;c[this.graphics3DSymbol.symbol.id]=!0;this.forEachSymbolLayerGraphic(function(e,g){e.setDrawOrder(a+(1-(1+g)/d._graphics.length),b,c)})};c.prototype.areVisibilityFlagsSet=
- function(a,b,c){void 0===c&&(c=0);c=this._visibilityFlags[c];if(null!=a)return c[a];a=!0;for(var d=0;d<c.length;d++)if(d!==b){var e=c[d];a=a&&(null==e||!0===e)}return a};c.prototype.isVisible=function(a){void 0===a&&(a=0);for(var b=!0,c=0;c<=a;c++)for(var d=this._visibilityFlags[c],e=0;e<d.length;e++)var g=d[e],b=b&&(null==g||!0===g);return b};c.prototype.setVisibilityFlag=function(a,b,c){void 0===c&&(c=0);var d=this.isVisible(c);this._visibilityFlags[c][a]=b;var e=this.isVisible(c);if(d!==e){if(1===
- c)this.forEachLabelGraphic(function(a){return a.setVisibility(e)});else{this.forEachSymbolLayerGraphic(function(a){return a.setVisibility(e)});var g=this.isVisible(1);this.forEachLabelGraphic(function(a){return a.setVisibility(g)})}return!0}return!1};c.prototype.getBSRadius=function(){var a=0;this.forEachSymbolLayerGraphic(function(b){a=Math.max(a,b.getBSRadius())});return a};c.prototype.getCenterObjectSpace=function(){return this._graphics[0].getCenterObjectSpace()};c.prototype.getProjectedBoundingBox=
- function(c,g,p,q){return a(this,void 0,void 0,function(){var n=this;return f(this,function(t){switch(t.label){case 0:return q||(q={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]}),q.boundingBox?d.set(q.boundingBox,d.NEGATIVE_INFINITY):q.boundingBox=d.create(d.NEGATIVE_INFINITY),q.requiresDrapedElevation=!1,[4,e.forEach(this._graphics,function(b){return a(n,void 0,void 0,function(){var a,e,l;return f(this,function(f){switch(f.label){case 0:if(!b)return[2];a=b.isDraped()?g:c;e=k.acquire();
- return[4,b.getProjectedBoundingBox(a,p,e,q.screenSpaceObjects)];case 1:return l=f.sent(),isFinite(l[2])&&isFinite(l[5])||(q.requiresDrapedElevation=!0),l&&d.expand(q.boundingBox,e),k.release(e),[2]}})})})];case 1:return t.sent(),d.allFinite(q.boundingBox)||b.allFinite(d.toRect(q.boundingBox,l))?[2,q]:[2,null]}})})};c.prototype.needsElevationUpdates=function(){for(var a=0,b=this._graphics;a<b.length;a++){var c=b[a];if(c&&c.needsElevationUpdates)return!0}a=0;for(b=this._labelGraphics;a<b.length;a++)if((c=
- b[a])&&c.needsElevationUpdates)return!0;return!1};c.prototype.alignWithElevation=function(a,b){var c=this;this.forEachRenderedGraphic(function(d){d.alignWithElevation(a,b,c._featureExpressionFeature)})};c.prototype.addHighlight=function(a,b){this.forEachSymbolLayerGraphic(function(c){return c.addHighlight(a,b)})};c.prototype.removeHighlight=function(a){this.forEachSymbolLayerGraphic(function(b){return b.removeHighlight(a)})};c.prototype.forEachGraphicList=function(a,b){a.forEach(function(a,c){return a&&
- b(a,c)})};c.prototype.forEachSymbolLayerGraphic=function(a){this.forEachGraphicList(this._graphics,a);this.forEachGraphicList(this._auxiliaryGraphics,a)};c.prototype.forEachLabelGraphic=function(a){this.forEachGraphicList(this._labelGraphics,a)};c.prototype.forEachRenderedGraphic=function(a){this.forEachSymbolLayerGraphic(a);this.forEachLabelGraphic(a)};return c}()})},"esri/core/asyncUtils":function(){define(["require","exports","./tsSupport/generatorHelper","./tsSupport/awaiterHelper","./promiseUtils"],
- function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});h.forEach=function(c,g,d){return a(this,void 0,void 0,function(){return f(this,function(a){switch(a.label){case 0:return[4,e.eachAlways(c.map(function(a,b){return g.apply(d,[a,b])}))];case 1:return a.sent(),[2]}})})};h.map=function(c,g,d){return a(this,void 0,void 0,function(){var a;return f(this,function(b){switch(b.label){case 0:return[4,e.eachAlways(c.map(function(a,b){return g.apply(d,[a,b])}))];case 1:return a=b.sent(),[2,a.map(function(a){return a.value})]}})})}})},
- "esri/views/3d/layers/graphics/Graphics3DOwner":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){return function(){this.featureExpressionInfoContext=this.localOriginFactory=this.layerView=this.layer=this.overlaySR=this.renderCoordsHelper=this.renderSpatialReference=this.clippingExtent=this.layerOrderDelta=this.layerOrder=this.stage=this.renderer=this.elevationProvider=this.streamDataSupplier=this.sharedResources=null;this.screenSizePerspectiveEnabled=
- !0}}();h.Graphics3DSymbolCreationContext=r})},"esri/views/3d/layers/graphics/Graphics3DSymbolFactory":function(){define(["require","exports","./Graphics3DPointSymbol","./Graphics3DSymbol"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.make=function(e,c,g){var d;switch(e.type){case "point-3d":d=f;break;default:d=a}return new d(e,c,g)}})},"esri/views/3d/layers/graphics/Graphics3DPointSymbol":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./Graphics3DCalloutSymbolLayerFactory",
- "./Graphics3DSymbol"],function(r,h,f,a,e){return function(c){function e(d,b,e){d=c.call(this,d,b,e)||this;d.calloutSymbolLayer=null;d.symbol.hasVisibleCallout()&&(d.calloutSymbolLayer=a.make(d.symbol,b));return d}f(e,c);e.prototype.destroy=function(){c.prototype.destroy.call(this)};e.prototype.createGraphics3DGraphic=function(a,b,e){e=c.prototype.createGraphics3DGraphic.call(this,a,b,e);this.calloutSymbolLayer&&(a=this.createCalloutGraphic(a,b))&&e.addAuxiliaryGraphic(a);return e};e.prototype.layerPropertyChanged=
- function(a,b){var d=this;return c.prototype.layerPropertyChanged.call(this,a,b)?this.calloutSymbolLayer?this.calloutSymbolLayer.layerPropertyChanged(a,b,function(a){var b=0;for(a=a._auxiliaryGraphics;b<a.length;b++){var c=a[b];if(c.graphics3DSymbolLayer===d.calloutSymbolLayer)return c}}):!0:!1};e.prototype.createCalloutGraphic=function(a,b){return this.calloutSymbolLayer.createGraphics3DGraphic(a,{renderer:b.renderer,symbol:b.symbol,needsOffsetAdjustment:b.needsOffsetAdjustment,translation:[0,0,0],
- centerOffset:[0,0,0,0],screenOffset:[0,0],centerOffsetUnits:"world",elevationOffset:0,materialCollection:null})};return e}(e)})},"esri/views/3d/layers/graphics/Graphics3DCalloutSymbolLayerFactory":function(){define(["require","exports","../../../../core/Logger","../../../../symbols/callouts/calloutUtils","./Graphics3DLineCalloutSymbolLayer"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});var c=f.getLogger("esri.views.3d.layers.graphics.Graphics3DCalloutSymbolLayerFactory");h.make=
- function(d,b){if(!a.isCalloutSupport(d))return c.error("Graphics3DCalloutSymbolLayerFactory#make","symbol of type '"+d.type+"' does not support callouts"),null;if(!d.callout)return null;var e=g[d.callout.type];return e?new e(d,b):(c.error("Graphics3DCalloutSymbolLayerFactory#make","unknown or unsupported callout type "+d.callout.type),null)};var g={line:e}})},"esri/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../core/screenUtils ./ElevationAligners ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Util ../../webgl-engine/materials/LineCalloutMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){var u=n.VertexAttrConstants;r=function(b){function n(a,c){a=b.call(this,a,null,c,!0)||this;a._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};return a}f(n,b);n.prototype.destroy=function(){b.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(k.ModelContentType.MATERIAL,this._material.id),this._material=null)};n.prototype._prepareResources=function(){var a=this._getStageIdHint();this._createMaterialsAndAddToStage(this._context.stage,
- a);this.resolve()};n.prototype.perInstanceMaterialParameters=function(a){var b=this.materialParameters;b.screenOffset=a.screenOffset||[0,0];b.centerOffsetUnits=a.centerOffsetUnits||"world";return b};Object.defineProperty(n.prototype,"materialParameters",{get:function(){var b=this.symbolContainer,c=b.callout,d=a.toUnitRGBA(c.color);d[3]*=this._getLayerOpacity();var g=e.pt2px(c.size||0),f=null;if(b.verticalOffset)var f=b.verticalOffset,k=f.minWorldLength,l=f.maxWorldLength,f={screenLength:e.pt2px(f.screenLength),
- minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity};c=c.border&&c.border.color?a.toUnitRGBA(c.border.color):null;k="object"===b.symbolLayers.getItemAt(0).type;return{color:d,size:g,verticalOffset:f,screenSizePerspective:this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null,screenOffset:[0,0],centerOffsetUnits:"world",borderColor:c,occlusionTest:!k,shaderPolygonOffset:k?0:void 0,depthHUDAlignStart:"label-3d"===b.type}},enumerable:!0,configurable:!0});
- n.prototype._createMaterialsAndAddToStage=function(a,b){this._material=new t(this.materialParameters,b+"_lineCallout_common");a.add(k.ModelContentType.MATERIAL,this._material)};n.prototype._defaultElevationInfoNoZ=function(){return m};n.prototype.createGraphics3DGraphic=function(a,b){null!=b.needsOffsetAdjustment&&(this._elevationOptions.needsOffsetAdjustment=b.needsOffsetAdjustment);var c=this.getGraphicElevationContext(a,b.elevationOffset||0),d=b.symbol,e="on-the-ground"===this._elevationContext.mode&&
- !d.symbolLayers.some(function(a){return"object"===a.type||"text"===a.type});if("label-3d"!==d.type&&e)return null;d=this._getGeometryCentroid(a);return null===d?null:this._createAs3DShape(a,d,c,b,"graphic"+a.uid,a.uid)};n.prototype.layerPropertyChanged=function(a,b,c){switch(a){case "opacity":return this.layerOpacityChanged(b,c);case "elevationInfo":return this.layerElevationInfoChanged(b,c)}return!1};n.prototype.layerOpacityChanged=function(a,b){this._material.setParameterValues(this.materialParameters);
- return!0};n.prototype.layerElevationInfoChanged=function(a,b){var c=this._elevationContext.mode;this._updateElevationContext();var d=this._elevationContext.mode;if(c!==d&&("on-the-ground"===c||"on-the-ground"===d))return!1;for(var e in a)c=a[e],(d=b(c))&&this.updateGraphicElevationContext(c.graphic,d);return!0};n.prototype.getGraphicElevationContext=function(a,c){void 0===c&&(c=0);a=b.prototype.getGraphicElevationContext.call(this,a);a.addOffsetRenderUnits(c);return a};n.prototype.updateGraphicElevationContext=
- function(a,b){a=this.getGraphicElevationContext(a,b.metadata.elevationOffset);b.elevationContext.set(a);b.needsElevationUpdates=d.needsElevationUpdates2D(a.mode)};n.prototype.createVertexData=function(a){var b=a.translation;a=a.centerOffset;if(!b&&!a)return q;b=b?{size:3,data:[b[0],b[1],b[2]]}:q[u.POSITION];a=a?{size:4,data:[a[0],a[1],a[2],a[3]]}:q[u.AUXPOS1];return c={},c[u.POSITION]=b,c[u.NORMAL]=q[u.NORMAL],c[u.AUXPOS1]=a,c;var c};n.prototype.getOrCreateMaterial=function(a,b){var c=this.perInstanceMaterialParameters(a),
- d=t.uniqueMaterialIdentifier(c);if(d===this._material.uniqueMaterialIdentifier)return{material:this._material,isUnique:!1};if(a.materialCollection){var e=a.materialCollection.getMaterial(d);e||(e=new t(c,b+"_lineCallout_shared"),a.materialCollection.addMaterial(d,e));return{material:e,isUnique:!1}}e=new t(c,b+"_lineCallout_unique");return{material:e,isUnique:!0}};n.prototype._createAs3DShape=function(a,b,e,f,k,m){a=new p(this.createVertexData(f),x,p.DefaultOffsets,"point");a=[new l(a,k)];var n=this.getOrCreateMaterial(f,
- k);k=d.createStageObjectForPoint.call(this,b,a,[[n.material]],null,null,e,k,this._context.layer.uid,m,!0);if(null===k)return null;m=new g(this,k.object,a,n.isUnique?[n.material]:null,null,c.perObjectElevationAligner,e);m.metadata={elevationOffset:f.elevationOffset||0};m.alignedTerrainElevation=k.terrainElevation;m.needsElevationUpdates=d.needsElevationUpdates2D(e.mode);d.extendPointGraphicElevationContext(m,b,this._context.elevationProvider);return m};return n}(b);var q=(v={},v[u.POSITION]={size:3,
- data:[0,0,0]},v[u.NORMAL]={size:3,data:[0,0,1]},v[u.AUXPOS1]={size:4,data:[0,0,0,1]},v),v=new Uint32Array([0]),x=(B={},B[u.POSITION]=v,B[u.NORMAL]=v,B[u.AUXPOS1]=v,B),m={mode:"relative-to-ground",offset:0},v,B;return r})},"esri/views/3d/layers/graphics/ElevationAligners":function(){define("require exports ../../../../geometry/Point ./Graphics3DSymbolCommonCode ./graphicUtils ../../lib/glMatrix ../../support/debugFlags ../../support/projectionUtils ../../webgl-engine/lib/Util".split(" "),function(r,
- h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});var k=b.VertexAttrConstants;r=c.vec3d;var l=new f,p=r.create(),n=r.create(),t=r.create(),u={verticalDistanceToGround:0,terrainElevation:0};h.perVertexElevationAligner=function(b,c,d,e){l.spatialReference=d.spatialReference;for(var f=b.getGeometryRecords(),m=f.length,q="absolute-height"!==c.mode,v=0,x=0;x<m;x++){var E=f[x].geometry,r=f[x].getShaderTransformation(),I=E.getData();n[0]=r[12];n[1]=r[13];n[2]=r[14];E.invalidateBoundingInfo();
- for(var r=I.getVertexAttr(),I=r[k.POSITION],E=I.data,r=r.mapPos.data,I=I.size,P=E.length/I,G=0,M=0,H=!1,J=0,O=0;O<P;O++){l.x=r[M++];l.y=r[M++];l.z=r[M++];t[0]=E[G];t[1]=E[G+1];t[2]=E[G+2];var N=a.computeElevation(d,l,c,e,q?u:null);q&&(J+=u.terrainElevation);p[0]=E[G]+n[0];p[1]=E[G+1]+n[1];p[2]=E[G+2]+n[2];e.setAltitude(N,p);E[G]=p[0]-n[0];E[G+1]=p[1]-n[1];E[G+2]=p[2]-n[2];if(g.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS)H=!0;else if(N=h.updateThresholdInMeters/e.unitInMeters,Math.abs(t[0]-E[G])>=N||
- Math.abs(t[1]-E[G+1])>=N||Math.abs(t[2]-E[G+2])>=N)H=!0;G+=I}v+=J/P;H&&b.geometryVertexAttrsUpdated(x)}return v/m};h.perObjectElevationAligner=function(b,c,f,k,l){var m=c.centerPointInElevationSR,n=0;l=0;if(b.metadata.usesVerticalDistanceToGround)n=a.computeElevation(f,m,c,k,u),e.updateVertexAttributeAuxpos1w(b,u.verticalDistanceToGround),l=u.terrainElevation;else{var q="absolute-height"!==c.mode,n=a.computeElevation(f,m,c,k,q?u:null);q&&(l=u.terrainElevation)}c=b.getObjectTransformation();f=[c[12],
- c[13],c[14]];g.DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES?(p[0]=m.x,p[1]=m.y,p[2]=n,d.computeLinearTransformation(m.spatialReference,p,c,k.spatialReference)&&b.setObjectTransformation(c)):k.setAltitudeOfTransformation(n,c);k=h.updateThresholdInMeters/k.unitInMeters;(Math.abs(c[12]-f[0])>=k||Math.abs(c[13]-f[1])>=k||Math.abs(c[14]-f[2])>=k)&&b.setObjectTransformation(c);return l};h.updateThresholdInMeters=.01;h.iterativeUpdatesEnabled=!0})},"esri/views/3d/layers/graphics/Graphics3DSymbolCommonCode":function(){define("require exports ../../../../geometry/Point ../../../../geometry/support/coordsUtils ../../../../geometry/support/triangulationUtils ../../../../symbols/callouts/calloutUtils ./graphicUtils ../../lib/glMatrix ../../support/projectionUtils ../../webgl-engine/lib/Object3D".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){function l(a,b,c,d,e){var g=0,f=b.z||0,k=0,k=c.mode;d=c.calculateOffsetRenderUnits(d);c=c.featureExpressionInfoContext;"on-the-ground"===k?(g=k=a.getElevation(b,"ground")||0,e&&(e.verticalDistanceToGround=0,e.terrainElevation=k)):"relative-to-ground"===k?(k=a.getElevation(b,"ground")||0,g=d,null==c&&(g+=f),e&&(e.verticalDistanceToGround=g,e.terrainElevation=k),g+=k):"relative-to-scene"===k?(k=a.getElevation(b,"scene")||0,g=d,e&&(e.verticalDistanceToGround=g,e.terrainElevation=
- k),g+=k):"absolute-height"===k&&(g=d,null==c&&(g+=f),e&&(k=a.getElevation(b,"ground")||0,e.verticalDistanceToGround=g-k,e.terrainElevation=k));return g}function p(a,b){a=e.pathsToTriangulationInfo(a,b);return{vertexData:a.position,polygons:a.polygons,outlines:a.outlines}}function n(a,b,c,d,e){b*=3;d*=3;for(var g=0;g<e;++g)c[d++]=a[b++],c[d++]=a[b++],c[d++]=a[b++]}function t(a,c,d,e,g,f,k){return b.bufferToBuffer(a,d,c,e,f,g,k)}function u(a,c,d){b.pointToVector(a,c,d)}function q(a,b){return!(a[0]>
- b[3]||a[0]<b[0]||a[1]>b[4]||a[1]<b[1])}function v(a,b){return!(b[0]>a[3]||b[3]<a[0]||b[1]>a[4]||b[4]<a[1])}Object.defineProperty(h,"__esModule",{value:!0});r=d.mat4d;var x=d.vec3d.create(),m=r.identity(),B=new f({x:0,y:0,z:0,spatialReference:null});h.createStageObjectForPoint=function(a,c,d,e,f,n,p,t,h,v,B){var A=c?c.length:0,C=this._context.clippingExtent;u(a,x,this._context.elevationProvider.spatialReference);if(C&&!q(x,C))return null;u(a,x,this._context.renderSpatialReference);C=this._context.localOriginFactory.getOrigin(x);
- p=new k({castShadow:!1,metadata:{layerUid:t,graphicId:h,usesVerticalDistanceToGround:!!v},idHint:p});for(t=0;t<A;t++)p.addGeometry(c[t],d[t],e?e[t]:m,f,C,B);c=this._context.renderSpatialReference;e=this._context.elevationProvider;f=this._context.renderCoordsHelper;d=0;var D;p.metadata.usesVerticalDistanceToGround?(d=l(e,a,n,f,z),g.updateVertexAttributeAuxpos1w(p,z.verticalDistanceToGround),D=z.terrainElevation):(B="absolute-height"!==n.mode,d=l(e,a,n,f,B?z:null),B&&(D=z.terrainElevation));n=p.getObjectTransformation();
- x[0]=a.x;x[1]=a.y;x[2]=d;b.computeLinearTransformation(a.spatialReference,x,n,c)?p.setObjectTransformation(n):console.warn("Could not locate symbol object properly, it might be misplaced");return{object:p,terrainElevation:D}};h.extendPointGraphicElevationContext=function(a,b,c){a=a.elevationContext;c=c.spatialReference;u(b,x,c);a.centerPointInElevationSR=new f({x:x[0],y:x[1],z:b.hasZ?x[2]:0,spatialReference:c})};h.placePointOnPolyline=function(b){var c=b.paths[0];if(!c||0===c.length)return null;c=
- a.getPointOnPath(c,a.getPathLength(c)/2);return new f({x:c[0],y:c[1],z:c[2],spatialReference:b.spatialReference})};h.placePointOnPolygon=function(a){return g.computeCentroid(a)};h.computeElevation=l;h.getSingleSizeDriver=function(a,b){void 0===b&&(b=0);return isFinite(a[b])?a[b]:null};h.copyPathData=p;h.copyVertices=n;h.chooseOrigin=function(a,b,c,d){b=Math.floor(b+(c-1)/2);d[0]=a[3*b+0];d[1]=a[3*b+1];d[2]=a[3*b+2]};h.subtractCoordinates=function(a,b,c,d){b*=3;for(var e=0;e<c;++e)a[b++]-=d[0],a[b++]-=
- d[1],a[b++]-=d[2]};h.setZ=function(a,b,c,d){b*=3;for(var e=0;e<c;++e)a[b+2]=d,b+=3};h.offsetZ=function(a,b,c,d){b*=3;for(var e=0;e<c;++e)a[b+2]+=d,b+=3};h.scaleZ=function(a,b,c,d){b*=3;for(var e=0;e<c;++e)a[b+2]*=d,b+=3};h.flatArrayToArrayOfArrays=function(a,b,c){var d=[];b*=3;for(var e=0;e<c;++e)d.push([a[b++],a[b++],a[b++]]);return d};h.reproject=t;h.reprojectPoint=u;h.getGeometryVertexData3D=function(a,b,c,d,e,g,f){var k=e.spatialReference;a=p(a,b);b=a.vertexData;var l=b.length/3,m=new Float64Array(b.length),
- q=!0;c.equals(k)?n(b,0,m,0,b.length):q=t(b,0,c,m,0,k,l);var h=c=0,u=f.mode,v=0,x=0,z=0;g=f.calculateOffsetRenderUnits(g);f=f.featureExpressionInfoContext;B.spatialReference=e.spatialReference;c*=3;for(var h=3*h,A=0;A<l;++A)B.x=m[c+0],B.y=m[c+1],B.z=m[c+2],"on-the-ground"===u?(x=v=e.getElevation(B)||0,z+=v):"relative-to-ground"===u?(v=e.getElevation(B)||0,x=v+g,null==f&&(x+=B.z),z+=v):"relative-to-scene"===u?(v=e.getElevation(B,"scene")||0,x=v+g,z+=v):"absolute-height"===u&&(x=g,null==f&&(x+=B.z)),
- b[h+0]=m[c+0],b[h+1]=m[c+1],b[h+2]=x,c+=3,h+=3;e=z/l;k.equals(d)||t(b,0,k,b,0,d,l);return{geometryData:a,vertexData:b,eleVertexData:m,terrainElevation:e,projectionSuccess:q}};h.getGeometryVertexDataDraped=function(a,c,d){a=p(a,!1);var e=a.vertexData,g=e.length/3,f=!0;c.equals(d)||(f=b.bufferToBuffer(e,c,0,e,d,0,g));return{geometryData:a,vertexData:e,projectionSuccess:f}};h.computeBoundingBox=function(a,b,c,d){d[0]=Number.MAX_VALUE;d[1]=Number.MAX_VALUE;d[2]=Number.MAX_VALUE;d[3]=-Number.MAX_VALUE;
- d[4]=-Number.MAX_VALUE;d[5]=-Number.MAX_VALUE;b*=3;for(var e=0;e<c;++e){var g=a[b++],f=a[b++],k=a[b++];g<d[0]&&(d[0]=g);f<d[1]&&(d[1]=f);k<d[2]&&(d[2]=k);g>d[3]&&(d[3]=g);f>d[4]&&(d[4]=f);k>d[5]&&(d[5]=k)}return d};h.pointInBox2D=q;h.boxesIntersect2D=v;h.boundingBoxClipped=function(a,b){return b?!v(a,b):!1};h.needsElevationUpdates2D=function(a){return"relative-to-ground"===a||"relative-to-scene"===a};h.needsElevationUpdates3D=function(a){return"absolute-height"!==a};h.needsOffsetAdjustment=function(a,
- b,d,e){if(!1===b.needsOffsetAdjustment||!1===b.supportsOffsetAdjustment||"on-the-ground"===a.mode)return!1;if(0===a.meterUnitOffset){if(!0===b.needsOffsetAdjustment)return!0;if(c.isCalloutSupport(e)&&e.hasVisibleVerticalOffset())return!1;if("relative-to-ground"===a.mode&&(!d.hasZ||a.featureExpressionInfoContext)||"relative-to-scene"===a.mode)return!0}return!1};var z={verticalDistanceToGround:0,terrainElevation:0}})},"esri/views/3d/layers/graphics/graphicUtils":function(){define(["require","exports",
- "../../../../geometry","../../../../geometry/support/webMercatorUtils","../../lib/glMatrix"],function(r,h,f,a,e){function c(b,c){var d=b.spatialReference;d.equals(c)||(d.isWebMercator&&c.wkid===f.SpatialReference.WGS84.wkid?a.webMercatorToGeographic(b,!1,b):c.isWebMercator&&d.wkid===f.SpatialReference.WGS84.wkid&&a.geographicToWebMercator(b,!1,b))}function g(a){if(Array.isArray(a)){for(var b=0;b<a.length;b++)if(!g(a[b]))return!1;return!0}return null==a||0<=a}Object.defineProperty(h,"__esModule",{value:!0});
- var d=e.vec4d,b=e.mat4d,k=[1,1,1];h.computeCentroid=function(a,b){if("extent"===a.type)return a.center;if("polygon"===a.type)return a.centroid;if("mesh"===a.type)return a.extent.center;for(var d=0,e=0,g=0,k=a.hasZ,l=0,p=0,m=a.paths;p<m.length;p++){for(var h=m[p],z=0,C=h;z<C.length;z++){var A=C[z],d=d+A[0],e=e+A[1];k&&(g+=A[2])}l+=h.length}a=new f.Point({x:d/l,y:e/l,z:k?g/l:void 0,spatialReference:a.spatialReference});b&&c(a,b);return a};h.convertToSR=c;h.enlargeExtent=function(a,b,c){if(a){b||(b=
- d.create());var e=.5*a.width*(c-1);c=.5*a.height*(c-1);a.width<1E-7*a.height?e+=c/20:a.height<1E-7*a.width&&(c+=e/20);d.set4(a.xmin-e,a.ymin-c,a.xmax+e,a.ymax+c,b);return b}return null};h.updateVertexAttributeAuxpos1w=function(a,b){for(var c=0;c<a.geometries.length;++c){var d=a.geometries[c].data.vertexAttributes.auxpos1;d&&d.data[3]!==b&&(d.data[3]=b,a.geometryVertexAttrsUpdated(c))}};h.mixinColorAndOpacity=function(a,b){var c=[1,1,1,1];null!=a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2]);null!==b&&void 0!==
- b?c[3]=b:null!=a&&3<a.length&&(c[3]=a[3]);return c};h.overrideColor=function(a,b,c,d,e,g){void 0===g&&(g=[0,0,0,0]);for(var f=0;3>f;++f)g[f]=a&&null!=a[f]?a[f]:c&&null!=c[f]?c[f]:e[f];g[3]=null!=b?b:null!=d?d:e[3];return g};h.computeObjectScale=function(a,b,c,d){void 0===a&&(a=k);void 0===d&&(d=1);var e=Array(3);if(null==b||null==c)e[0]=1,e[1]=1,e[2]=1;else{for(var g=void 0,f=0,l=2;0<=l;l--){var m=a[l],n=void 0,p=null!=m,t=0===l&&!g&&!p,h=c[l];"symbolValue"===m||t?n=0!==h?b[l]/h:1:p&&"proportional"!==
- m&&isFinite(m)&&(n=0!==h?m/h:1);null!=n&&(g=e[l]=n,f=Math.max(f,Math.abs(n)))}for(l=2;0<=l;l--)null==e[l]?e[l]=g:0===e[l]&&(e[l]=.001*f)}for(l=2;0<=l;l--)e[l]/=d;return e};h.computeSizeWithResourceSize=function(a,b){var c=b.width,d=b.depth,e=b.height;b=b.isPrimitive?10:1;if(null==c&&null==e&&null==d)return[b*a[0],b*a[1],b*a[2]];for(var c=[c,d,e],g,d=0;3>d;d++)if(e=c[d],null!=e){g=e/a[d];break}for(d=0;3>d;d++)null==c[d]&&(c[d]=a[d]*g);return c};h.validateSymbolLayerSize=function(a){null!=a.isPrimitive&&
- (a=[a.width,a.depth,a.height]);return g(a)?null:"Symbol sizes may not be negative values"};h.computeObjectRotation=function(a,c,d,e){void 0===e&&(e=b.identity());a=a||0;c=c||0;d=d||0;0!==a&&b.rotateZ(e,-a/180*Math.PI,e);0!==c&&b.rotateX(e,c/180*Math.PI,e);0!==d&&b.rotateY(e,d/180*Math.PI,e);return e}})},"esri/views/3d/support/debugFlags":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){return new (function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.SCENEVIEW_HITTEST_RETURN_SELECTOR=!1;a.SCENEVIEW_LOCKING_LOG=!1;a.HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED=!1;a.HIGHLIGHTS_VISUALIZE_BLOCKS=!1;a.HIGHLIGHTS_PROFILE_TO_CONSOLE=!1;a.DECONFLICTOR_SHOW_OUTLINES=!1;a.DECONFLICTOR_SHOW_GRID=!1;a.LABELS_SHOW_BORDER=!1;a.OVERLAY_DRAW_TEST_TEXTURE=!1;a.OVERLAY_SHOW_CENTER=!1;a.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS=!1;a.DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES=
- !1;a.DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES=!1;a.DRAW_MESH_GEOMETRY_NORMALS=!1;return a}f(d,e);a([c.property()],d.prototype,"SCENEVIEW_HITTEST_RETURN_SELECTOR",void 0);a([c.property()],d.prototype,"SCENEVIEW_LOCKING_LOG",void 0);a([c.property()],d.prototype,"HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED",void 0);a([c.property()],d.prototype,"HIGHLIGHTS_VISUALIZE_BLOCKS",void 0);a([c.property()],d.prototype,"HIGHLIGHTS_PROFILE_TO_CONSOLE",void 0);a([c.property()],d.prototype,"DECONFLICTOR_SHOW_OUTLINES",
- void 0);a([c.property()],d.prototype,"DECONFLICTOR_SHOW_GRID",void 0);a([c.property()],d.prototype,"LABELS_SHOW_BORDER",void 0);a([c.property()],d.prototype,"OVERLAY_DRAW_TEST_TEXTURE",void 0);a([c.property()],d.prototype,"OVERLAY_SHOW_CENTER",void 0);a([c.property()],d.prototype,"TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS",void 0);a([c.property()],d.prototype,"DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES",void 0);a([c.property()],d.prototype,"DISABLE_ELEVATION_ALIGNERS_ITERATIVE_UPDATES",void 0);
- a([c.property()],d.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0);return d=a([c.subclass()],d)}(c.declared(e)))})},"esri/views/3d/layers/graphics/Graphics3DGraphicLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ./featureExpressionInfoUtils ./Graphics3DGraphicElevationContext ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage".split(" "),function(r,h,f,a,e,c,g,
- d,b,k){r=d.vec3d;var l=d.mat4d,p=[0,0,0];d=function(){function d(a,b,c,e,f,k,l,n){this._addedToStage=!1;this.alignedTerrainElevation=0;this.needsElevationUpdates=!1;this.graphics3DSymbolLayer=a;this.uniqueMaterials=e;this.uniqueGeometries=c;this.uniqueTextures=f;this.stageObject=b;this.elevationAligner=k;this.elevationContext=new g(l);this.stageLayer=this.stage=null;this._visible=!1;this.visibilityMode=null!=n?n:d.VisibilityModes.HIDE_FACERANGE}d.prototype.initialize=function(a,b){this.stageLayer=
- a;this.stage=b;if(this.uniqueMaterials)for(a=0;a<this.uniqueMaterials.length;a++)b.add(k.ModelContentType.MATERIAL,this.uniqueMaterials[a]);if(this.uniqueGeometries)for(a=0;a<this.uniqueGeometries.length;a++)b.add(k.ModelContentType.GEOMETRY,this.uniqueGeometries[a]);if(this.uniqueTextures)for(a=0;a<this.uniqueTextures.length;a++)b.add(k.ModelContentType.TEXTURE,this.uniqueTextures[a]);b.add(k.ModelContentType.OBJECT,this.stageObject)};d.prototype.isDraped=function(){return!1};d.prototype.setVisibility=
- function(a){if(null!=this.stage)return this._visible!==a?((this._visible=a)?this._addedToStage?this.stageObject.unhideAllComponents():(this.stageLayer.addObject(this.stageObject),this._addedToStage=!0):this.visibilityMode===d.VisibilityModes.HIDE_FACERANGE?this.stageObject.hideAllComponents():(this.stageLayer.removeObject(this.stageObject),this._addedToStage=!1),(a=this.stage.view.getEdgeView())&&a.hasObject(this.stageObject)&&a.updateObjectVisibility(this.stageObject,this._visible),!0):!1};d.prototype.destroy=
- function(){var a=this.stage;if(this.stageLayer){if(this.uniqueMaterials)for(var b=0;b<this.uniqueMaterials.length;b++)a.remove(k.ModelContentType.MATERIAL,this.uniqueMaterials[b].id);if(this.uniqueGeometries)for(b=0;b<this.uniqueGeometries.length;b++)a.remove(k.ModelContentType.GEOMETRY,this.uniqueGeometries[b].id);if(this.uniqueTextures)for(b=0;b<this.uniqueTextures.length;b++)a.remove(k.ModelContentType.TEXTURE,this.uniqueTextures[b].id)}a.remove(k.ModelContentType.OBJECT,this.stageObject.id);this._addedToStage&&
- (this.stageLayer.removeObject(this.stageObject),this._addedToStage=!1);(a=this.stage.view.getEdgeView())&&a.hasObject(this.stageObject)&&a.removeObject(this.stageObject);this._visible=!1;this.stage=this.stageLayer=null};d.prototype.alignWithElevation=function(a,b,d){this.elevationAligner&&(c.setContextFeature(this.elevationContext.featureExpressionInfoContext,d),a=this.elevationAligner(this.stageObject,this.elevationContext,a,b),null!=a&&(this.alignedTerrainElevation=a))};d.prototype.setDrawOrder=
- function(a,b,c){};d.prototype.getBSRadius=function(){return this.stageObject.getBSRadius()};d.prototype.getCenterObjectSpace=function(){return this.stageObject.getCenter(!0)};d.prototype.getBoundingBoxObjectSpace=function(a){var c=this.stageObject;a||(a=b.create());b.setMin(a,c.getBBMin(!0));b.setMax(a,c.getBBMax(!0));return a};d.prototype.getProjectedBoundingBox=function(c,d,g,f){return e(this,void 0,void 0,function(){var e,k,m,q,h,v,B,x;return a(this,function(a){switch(a.label){case 0:e=this.getBoundingBoxObjectSpace(g);
- k=u;m=b.isPoint(e)?1:k.length;for(q=0;q<m;q++)h=k[q],t[0]=e[h[0]],t[1]=e[h[1]],t[2]=e[h[2]],l.multiplyVec3(this.stageObject.objectTransformation,t),n[3*q+0]=t[0],n[3*q+1]=t[1],n[3*q+2]=t[2];if(!c(n,0,m))return[3,6];b.set(e,b.NEGATIVE_INFINITY);v=null;this.calculateRelativeScreenBounds&&(v=this.calculateRelativeScreenBounds());for(q=0;q<3*m;q+=3){for(B=0;3>B;B++)e[B]=Math.min(e[B],n[q+B]),e[B+3]=Math.max(e[B+3],n[q+B]);v&&f.push({location:n.slice(q,q+3),screenSpaceBoundingRect:v})}if(!d)return[3,5];
- b.center(e,p);if("absolute-height"===this.elevationContext.mode)return[3,5];x=void 0;a.label=1;case 1:return a.trys.push([1,3,,4]),[4,d.queryElevation(p[0],p[1])];case 2:return x=a.sent(),[3,4];case 3:return a.sent(),x=null,[3,4];case 4:null!=x&&b.offset(e,0,0,-this.alignedTerrainElevation+x),a.label=5;case 5:return[2,e];case 6:return[2,null]}})})};d.prototype.addHighlight=function(a,b){b=this.stageObject.highlightAllComponents(b);a.addObject(this.stageObject,b)};d.prototype.removeHighlight=function(a){a.removeObject(this.stageObject)};
- d.VisibilityModes={REMOVE_OBJECT:0,HIDE_FACERANGE:1};return d}();var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=r.create(),u=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];return d})},"esri/views/3d/layers/graphics/Graphics3DGraphicElevationContext":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./ElevationContext"],function(r,h,f,a){return function(a){function c(c){c=a.call(this,c)||this;c.centerPointInElevationSR=null;return c}f(c,
- a);return c}(a)})},"esri/views/3d/layers/graphics/ElevationContext":function(){define(["require","exports","../../../../symbols/support/unitConversionUtils","./featureExpressionInfoUtils"],function(r,h,f,a){return function(){function e(a){a?this.set(a):this.setDefaults()}Object.defineProperty(e.prototype,"meterUnitOffset",{get:function(){return this._meterUnitOffset},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"unit",{get:function(){return this._unit},enumerable:!0,configurable:!0});
- e.prototype.setUnit=function(a){this._unit=a;this._metersPerElevationInfoUnit=f.getMetersPerUnit(a)};e.prototype.setDefaults=function(){this.mode=null;this._renderUnitOffset=this._meterUnitOffset=0;this.featureExpressionInfoContext=null;this.hasOffsetAdjustment=!1;this.setUnit("meters")};e.prototype.set=function(a){this.mode=a.mode;this._meterUnitOffset=a._meterUnitOffset||0;this._renderUnitOffset=a._renderUnitOffset||0;this.featureExpressionInfoContext=a.featureExpressionInfoContext;this.hasOffsetAdjustment=
- a.hasOffsetAdjustment;this.setUnit(a.unit)};e.prototype.setOffsetMeters=function(a){this._meterUnitOffset=a;this._renderUnitOffset=0};e.prototype.setOffsetElevationInfoUnits=function(a){this._meterUnitOffset=a*this._metersPerElevationInfoUnit;this._renderUnitOffset=0};e.prototype.setOffsetRenderUnits=function(a){this._meterUnitOffset=0;this._renderUnitOffset=a};e.prototype.addOffsetRenderUnits=function(a){this._renderUnitOffset+=a};e.prototype.mixinApi=function(a){null!=a.mode&&(this.mode=a.mode);
- null!=a.unit&&this.setUnit(a.unit);null!=a.offset&&this.setOffsetElevationInfoUnits(a.offset)};e.prototype.calculateOffsetRenderUnits=function(c){var e=this._meterUnitOffset,d=this.featureExpressionInfoContext;null!=d&&(e+=a.execute(d)*this._metersPerElevationInfoUnit);return e/c.unitInMeters+this._renderUnitOffset};return e}()})},"esri/views/3d/webgl-engine/Stage":function(){define("require exports ./lib/Camera ./lib/gl-matrix ./lib/ModelContentType ./lib/Selector ./lib/Util ./lighting/Lightsources ./parts/Model ./parts/View".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){r=a.vec2d;h=a.vec2;var l=a.vec3d;a=function(){function a(a,e,g){this._intersectTolerance=c.DEFAULT_TOLERANCE;this._viewContent=[];this._externalIntersectionHandlers=[];this.container=e;this.viewingMode=a;this.model=new b;this.view=new k(e,this,this.model.getDirtySet(),g);this._validateHUDSelector=new c(this.viewingMode);this._validateHUDSelector.enableHUDSelection=!1;this.view.setLighting({lights:[new d.MainLight(l.createFrom(.7,.7,.7)),new d.AmbientLight(l.createFrom(.3,
- .3,.3))],groundLightingFactor:.5,globalFactor:.5})}a.prototype.setNeedsRender=function(){this.view.setNeedsRender()};a.prototype.dispose=function(){this.view.dispose();this.model=this.view=null};a.prototype.frame=function(a,b){void 0===b&&(b=0);var c=Math.max(1E-6,a.getBSRadius());b=Math.max(2,b+2);b*=c;var c=this.getCamera(),d=l.create(c.viewForward);l.scale(d,-(1.5*b/Math.tan(c.fov)));l.set(a.getCenter(),c.center);l.add(c.center,d,c.eye);c=new f(c.eye,c.center,c.up);this.setCamera(c)};a.prototype.beginMod=
- function(){a.DebugSettings.fineGrainedContentValidation&&this.model.validateContent()};a.prototype.endMod=function(b){void 0===b&&(b=!1);a.DebugSettings.fineGrainedContentValidation&&!b&&this.model.validateContent()};a.prototype.add=function(a,b){this.model.add(a,b);"function"===typeof b.addParentStage&&b.addParentStage(this)};a.prototype.remove=function(a,b){a=this.model.remove(a,b);"function"===typeof a.removeParentStage&&a.removeParentStage(this);return a};a.prototype.notifyDirty=function(a,b,
- c,d){this.model.notifyDirty(a,b,c,d)};a.prototype.processDirty=function(){var b=this.model.getDirtySet(),c=b.getDirtyMaterials();if(b.hasDirtyGeometryRecords()||c){a.DebugSettings.endFrameContentValidation&&this.model.validateContent();a.DebugSettings.logDirtySet&&console.log("Dirty set: "+this.model.getDirtySet().formatDebugInfo(!1));var d=b.getAddRemoveUpdateListFilteredByLayers(this._viewContent,!0);(0<d[0].length+d[1].length+d[2].length||c)&&this.view.modify(d[0],d[1],d[2],c);a.DebugSettings.logDirtySet&&
- (console.log("RGs add: "+d[0].map(function(a){return a.uniqueName})),console.log("RGs remove: "+d[1].map(function(a){return a.uniqueName})));b.getAddRemoveUpdateList(!0);b.clearDirtyMaterials();this.view.setNeedsRender()}};a.prototype.processDirtyLayer=function(a){var b=this.model.getDirtySet(),c=b.getDirtyMaterials();a=b.getAddRemoveUpdateListFilteredByLayers([a],!0);(0<a[0].length+a[1].length+a[2].length||c)&&this.view.modify(a[0],a[1],a[2],c);b.clearDirtyMaterials();this.view.setNeedsRender()};
- a.prototype.get=function(a,b){return this.model.get(a,b)};a.prototype.getAll=function(a){return this.model.getAll(a)};a.prototype.addTextureListener=function(a){this.view.addTextureListener(a)};a.prototype.removeTextureListener=function(a){this.view.removeTextureListener(a)};a.prototype.getContainer=function(){return this.container};a.prototype.getCamera=function(){return this.view.getCamera()};a.prototype.setCamera=function(a){this.view.setCamera(a)};a.prototype.getViewParams=function(a){return this.view.getViewParams(a)};
- a.prototype.setViewParams=function(a){this.view.setViewParams(a)};a.prototype.getLayers=function(){return this.model.getAll(e.LAYER)};a.prototype.setLighting=function(a){this.view.setLighting(a)};a.prototype.getCanvas=function(){return this.view.getCanvas()};a.prototype.setRenderParams=function(a){this.view.setRenderParams(a)};a.prototype.getRenderParams=function(){return this.view.getRenderParams()};a.prototype.has=function(a){return this.view.has(a)};a.prototype.getViewContent=function(){return this._viewContent.slice(0)};
- a.prototype.setViewContent=function(a){var b=g.array2object(this._viewContent),c=g.array2object(a),d=g.subtractObjects(c,b),b=g.subtractObjects(b,c);this.processDirty();c=this.model.getDirtySet();d=c.getResidentRenderGeometriesFilteredByLayers(g.object2array(d));b=c.getResidentRenderGeometriesFilteredByLayers(g.object2array(b));this.view.modify(d,b,[]);this._viewContent=a.slice(0)};a.prototype.addToViewContent=function(a){for(var b=[],c=0;c<a.length;c++)-1===this._viewContent.indexOf(a[c])&&b.push(a[c]);
- 0<a.length&&(this.processDirty(),a=this.model.getDirtySet().getResidentRenderGeometriesFilteredByLayers(b),this.view.modify(a,[],[]),this._viewContent.push.apply(this._viewContent,b))};a.prototype.removeFromViewContent=function(a){this.processDirty();for(var b=this.model.getDirtySet(),c=this._viewContent,d=[],e=0;e<a.length;e++){var g=c.indexOf(a[e]);-1<g&&(c[g]=c[c.length-1],c.pop(),d.push(a[e]))}a=b.getResidentRenderGeometriesFilteredByLayers(d);this.view.modify([],a,[])};a.prototype.getViewFrustumObjects=
- function(){return this.view.getFrustumObjects()};a.prototype.getLocalOrigin=function(a,b,c){return this.model.getOrigin(a,b,c)};a.prototype.getFrameTask=function(){return this.view.getFrameTask()};a.prototype.requestScreenCapture=function(a,b){this.view.requestScreenCapture(a,b)};a.prototype.getAllTexturesLoaded=function(){return this.view.getAllTexturesLoaded()};a.prototype.getTextureLoaded=function(a){return this.view.getTextureLoaded(a)};a.prototype.addExternalRenderer=function(a,b){"function"===
- typeof b.intersect&&this._externalIntersectionHandlers.push(b);return this.view.addExternalRenderer(a,b)};a.prototype.removeExternalRenderer=function(a){var b=this._externalIntersectionHandlers.indexOf(a);-1<b&&this._externalIntersectionHandlers.splice(b,1);return this.view.removeExternalRenderer(a)};a.prototype.getContentDebugStrings=function(a){return this.model.formatDebugInfo(a)};a.prototype.getRenderStats=function(){return this.view.getCombinedStats()};a.prototype.getRenderStatString=function(a){var b=
- this.getRenderStats(),c="";if(a){var c=c+"\x3ctable\x3e",d;for(d in b)c+="\x3ctr\x3e\x3ctd\x3e"+d+'\x3c/td\x3e\x3ctd style\x3d"text-align: right"\x3e'+Math.round(b[d])+"\x3c/td\x3e\x3c/tr\x3e";c+="\x3c/table\x3e"}else for(d in b)c+=d+": "+b[d]+"\n";return c};a.prototype.pick=function(a,b,c,d){var e=l.create(),g=l.create();this.view.getPickRay(a,e,g);return this.pickRay(e,g,a,a,b,c,d)};a.prototype.pickRayWithBeginPoint=function(a,b,c,d,e){this.view.pickRayWithBeginPoint(a,b,c,d,e)};a.prototype.pickRay=
- function(a,d,e,g,f,k,h){g=this.view.getCamera();e||(e=p,g.projectPoint(d,e));var m;if(f){m=Array(f.length);for(var q=0;q<m.length;q++)m[q]=this.model.get(b.ContentType.LAYER,f[q])}else{m=[];f=this.getViewContent();for(var u=this.model.getAll(b.ContentType.LAYER),q=0;q<f.length;q++){var v=u[f[q]];v&&v.isPickable&&m.push(v)}}h?h.init(m,a,d,e,g,this._intersectTolerance,k):h=new c(this.viewingMode,m,a,d,e,g,this._intersectTolerance,k);for(q=0;q<this._externalIntersectionHandlers.length;q++)this._externalIntersectionHandlers[q].intersect(h,
- a,d,e);if(h.getHudResults().length){q=h.getHudResults();q.sort(function(a,b){return b.dist-a.dist});d=q[q.length-1];f=n;g.projectPoint(d.center,f);f[0]=Math.round(f[0]);f[1]=Math.round(f[1]);u=t;this.view.getPickRay(f,a,u);e=l.dist(d.center,a)/l.dist(a,u)*.99;this._validateHUDSelector.init(m,a,u,f,g,this._intersectTolerance,k);for(q=0;q<this._externalIntersectionHandlers.length;q++)this._externalIntersectionHandlers[q].intersect(this._validateHUDSelector,a,u,f);a=this._validateHUDSelector.getMinResult();
- (null==a.dist||e<=a.dist)&&h.getMinResult().copyFrom(d)}return h};a.prototype.getIntersectTolerance=function(){return this._intersectTolerance};a.prototype.setIntersectTolerance=function(a){void 0===a&&(a=1E-5);this._intersectTolerance=a};a.prototype.getTextureGraphicsRenderer=function(){return this.view.getTextureGraphicsRenderer()};a.DebugSettings={fineGrainedContentValidation:!1,endFrameContentValidation:!1,logDirtySet:!1};a.ModelContentType=e;return a}();var p=r.create(),n=h.create(),t=l.create();
- return a})},"esri/views/3d/webgl-engine/parts/Model":function(){define("require exports dojo/string ../lib/gl-matrix ../lib/ModelContentType ../lib/ModelDirtySet ../lib/RenderGeometry ../lib/Util".split(" "),function(r,h,f,a,e,c,g,d){var b=d.assert,k=a.vec3d,l=a.mat4d,p=d.logWithBase;return function(){function a(){this.dirtySet=new c(this);this._uniqueIdx=0;this._id2origin={};this.content={};for(var a in e)this.content[e[a]]={}}a.prototype.getAll=function(a){a=this.content[a];b(void 0!==a);return a};
- a.prototype.get=function(a,b){return this.getAll(a)[b]};a.prototype.add=function(a,c){var d=this.content[a];b(void 0!==d);var g=c.id;b(null==d[g],"Model/Stage already contains object to be added");d[g]=c;a===e.LAYER&&this.notifyDirty(a,c,"layerAdded")};a.prototype.remove=function(a,c){var d=this.content[a];b(void 0!==d);var g=d[c];b(void 0!==g,"Model/Stage doesn't contain object to be removed");delete d[c];a===e.TEXTURE&&g.unload();a===e.LAYER&&this.notifyDirty(a,g,"layerRemoved");return g};a.prototype.getDirtySet=
- function(){return this.dirtySet};a.prototype.notifyDirty=function(a,b,c,d){this.dirtySet.handleUpdate(b,c,d)};a.prototype.getOrigin=function(a,b,c){void 0===c&&(c=10);var d=0;b=b*c/1E4;1<b&&(d=Math.ceil(p(b,2)));b=1E4*Math.pow(2,d);c=Math.round(a[0]/b);var e=Math.round(a[1]/b);a=Math.round(a[2]/b);var d=d+"_"+c+"_"+e+"_"+a,g=this._id2origin[d];null==g&&(g={vec3:k.createFrom(c*b,e*b,a*b),id:d},this._id2origin[d]=g);return g};a.prototype.getGeometryRenderGeometries=function(a,b,c){var d=a.id,e=b.geometry,
- f=e.getData(),k=!!e.singleUse,n=b.materials,p=b.instanceParameters,q=a.getCombinedStaticTransformation(b),t=l.maxScale(q),h=b.origin,e=e.getBoundingInfo(),u=b.id,r=this._uniqueIdx++;a=new g(f,e,n[0],q,b.customTransformation,t,a.getCastShadow(),k,d,u,r);a.origin=h||this.getOrigin(a.center,a.bsRadius);a.instanceParameters=p;c.push(a)};a.prototype.updateRenderGeometryTransformation=function(a,b,c){a.getCombinedStaticTransformation(b,c.transformation);c.updateTransformation(c.transformation)};a.prototype.formatDebugInfo=
- function(a){var b=[];if(a){b[0]="\x3ctable\x3e";for(var c in e)a=e[c],b[0]+="\x3ctr\x3e\x3ctd\x3e"+a+'\x3c/td\x3e\x3ctd style\x3d"text-align: right"\x3e'+Object.keys(this.getAll(a)).length+"\x3c/td\x3e\x3c/tr\x3e";b[0]+="\x3c/table\x3e";b[1]=this.dirtySet.formatDebugInfo(!0)}else{b[0]="";for(c in e)a=e[c],b[0]+=f.pad(String(Object.keys(this.getAll(a)).length),6," ")+" "+a+", ";b[1]=this.dirtySet.formatDebugInfo(!1)}return b};a.prototype.validateContent=function(){var a=this.getAll(e.OBJECT),b;for(b in a)this.validateObject(a[b]);
- var a=this.getAll(e.LAYER),c;for(c in a)this.validateLayer(a[c]);c=this.getAll(e.MATERIAL);for(var d in c)this.validateMaterial(c[d])};a.prototype.validateObject=function(a){a=a.geometryRecords;for(var c=0;c<a.length;++c){var d=a[c];b(null!=this.get(e.GEOMETRY,d.geometry.id));b(1===d.materials.length,"object materials do not match geometry groups");b(null!=this.get(e.MATERIAL,d.materials[0].id))}};a.prototype.validateLayer=function(a){a=a.getObjects();for(var c=0;c<a.length;++c){var d=this.get(e.OBJECT,
- a[c].id);b(null!=d)}};a.prototype.validateMaterial=function(a){a=a.getAllTextureIds();for(var c=0;c<a.length;++c){var d=this.get(e.TEXTURE,a[c]);b(null!=d)}};a.ContentType=e;return a}()})},"esri/views/3d/webgl-engine/lib/ModelDirtySet":function(){define(["require","exports","./ModelContentType","./Util"],function(r,h,f,a){var e=a.objectEmpty,c=a.assert;return function(){function a(a){this._residentGeomRecords={};this._dirtyGeomRecords={};this._dirtyMaterials={};this._model=a}Object.defineProperty(a.prototype,
- "residentLayerCount",{get:function(){return Object.keys(this._residentGeomRecords).length},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"residentObjectCount",{get:function(){var a=0,b;for(b in this._residentGeomRecords)a+=Object.keys(this._residentGeomRecords[b]).length;return a},enumerable:!0,configurable:!0});a.prototype._getResidentGeometryRecords=function(){return this._residentGeomRecords};a.prototype._getDirtyGeometryRecords=function(){return this._dirtyGeomRecords};a.prototype.getDirtyMaterials=
- function(){return e(this._dirtyMaterials)?null:this._dirtyMaterials};a.prototype.clearDirtyMaterials=function(){this._dirtyMaterials={}};a.prototype.hasDirtyGeometryRecords=function(){for(var a in this._dirtyGeomRecords)for(var b in this._dirtyGeomRecords[a]){var c=this._dirtyGeomRecords[a][b];if(c&&!e(c))return!0}return!1};a.prototype.handleUpdate=function(a,b,e){c(this[b],"ModelDirtySet doesn't know how to process "+b);return this[b](a,e)};a.prototype.shaderTransformationChanged=function(a){if(a=
- this._residentGeomRecords[a.id])for(var b in a){var c=this._model.content[f.OBJECT][b];if(c&&c.hasVolativeTransformation()){var c=a[b],d;for(d in c)for(var e=0,g=c[d][1];e<g.length;e++)g[e].shaderTransformationChanged()}}};a.prototype.getAddRemoveUpdateList=function(a){return this.getAddRemoveUpdateListFilteredByLayers(Object.keys(this._dirtyGeomRecords),a)};a.prototype.getAddRemoveUpdateListFilteredByLayers=function(a,b){for(var d=[],g=[],p=[],n=0;n<a.length;n++){var t=a[n];if(t in this._dirtyGeomRecords){for(var h in this._dirtyGeomRecords[t]){var q=
- this._dirtyGeomRecords[t][h];if(q){var v=this._createObjectRecordObjIfNonexistent(this._residentGeomRecords,t,h),x;for(x in q){var m=q[x],B=m[0],z=m[1],m=m[2],C=z&2&&m&1;if(z&4||C){var A=v[x];A?g.push.apply(g,A[1]):4===z&&c(!1,"ModelDirtySet.getAddRemoveListFilteredByLayers: invalid remove");b&&A&&delete v[x]}if(z&1||C){var A=[B,[]],D=this._model.get(f.OBJECT,h);this._model.getGeometryRenderGeometries(D,B,A[1]);d.push.apply(d,A[1]);b&&(v[x]=A)}if(z&2&&!C)if(A=v[x],D=this._model.get(f.OBJECT,h),A){z=
- A[1];C=z.length;if(m&16)for(A=0;A<C;A++){var E=z[A];this._model.updateRenderGeometryTransformation(D,B,E)}for(A=0;A<C;A++)E=z[A],p.push({renderGeometry:E,updateType:m})}else c(!1,"ModelDirtySet.getAddRemoveListFilteredByLayers: invalid update")}e(v)&&delete this._residentGeomRecords[t][h]}}e(this._residentGeomRecords[t])&&delete this._residentGeomRecords[t]}b&&delete this._dirtyGeomRecords[t]}return[d,g,p]};a.prototype.getResidentRenderGeometries=function(){return this.getResidentRenderGeometriesFilteredByLayers(Object.keys(this._residentGeomRecords))};
- a.prototype.getResidentRenderGeometriesFilteredByLayers=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d in this._residentGeomRecords)for(var e in this._residentGeomRecords[d]){var g=this._residentGeomRecords[d][e];if(g)for(var f in g)b.push.apply(b,g[f][1])}}return b};a.prototype.visibilityChanged=function(a,b,c){if(null!=b)this._componentPropertyChanged(a,b,c,2);else{b=0;for(var d=a.getGeometryRecords();b<d.length;b++)this._componentPropertyChanged(a,d[b],c,2)}};a.prototype.componentHighlightChanged=
- function(a,b,c){if(null!=b)this._componentPropertyChanged(a,b,c,32);else{b=0;for(var d=a.getGeometryRecords();b<d.length;b++)this._componentPropertyChanged(a,d[b],c,32)}};a.prototype.vertexAttrsUpdated=function(a,b,c){this._updateOrCreateDirtyRecord(a,b,c,2,0,0,2,5,4)};a.prototype.matChanged=function(a){this._dirtyMaterials[a.id]=!0};a.prototype.layerAdded=function(a){for(var b=a.getObjects(),c=0;c<b.length;c++)this.layObjectAdded(a,b[c])};a.prototype.layerRemoved=function(a){for(var b=a.getObjects(),
- c=0;c<b.length;c++)this.layObjectRemoved(a,b[c])};a.prototype.layObjectAdded=function(a,b){a=a.id;for(var c=b.getGeometryRecords(),d=0;d<c.length;d++)this.objGeometryAdded(b,c[d],a)};a.prototype.layObjectRemoved=function(a,b){a=a.id;for(var c=b.getGeometryRecords(),d=0;d<c.length;d++)this.objGeometryRemoved(b,c[d],a)};a.prototype.layObjectReplaced=function(a,b){this.layObjectRemoved(a,b[0]);this.layObjectAdded(a,b[1])};a.prototype.objDirty=function(a,b){b=b||this._getParentLayerId(a);var c=this._createObjectRecordObjIfNonexistent(this._residentGeomRecords,
- b,a.id),d;for(d in c)this._updateOrCreateDirtyRecord(a,c[d][0],b,2,0,2,0,5,1)};a.prototype.objTransformation=function(a,b){b=b||this._getParentLayerId(a);var c=this._createObjectRecordObjIfNonexistent(this._residentGeomRecords,b,a.id),d;for(d in c)this._updateOrCreateDirtyRecord(a,c[d][0],b,2,0,0,2,5,16)};a.prototype.objGeometryAdded=function(a,b,c){this._updateOrCreateDirtyRecord(a,b,c,1,4,0,0,0)};a.prototype.objGeometryRemoved=function(a,b,c){this._updateOrCreateDirtyRecord(a,b,c,4,1,2,0,0)};a.prototype.objGeometryReplaced=
- function(a,b){this.objGeometryRemoved(a,b[0]);this.objGeometryAdded(a,b[1])};a.prototype.objGeometryTransformation=function(a,b){this.objGeometryReplaced(a,b)};a.prototype._componentPropertyChanged=function(a,b,c,e){this._updateOrCreateDirtyRecord(a,b,c,2,0,0,2,5,e)};a.prototype._updateOrCreateDirtyRecord=function(a,b,e,g,f,n,t,h,q){e=e||this._getParentLayerId(a);var d=b.id;a=this._createObjectRecordObjIfNonexistent(this._dirtyGeomRecords,e,a.id);(e=a[d])?(b=e[1],b&f?delete a[d]:b&n?(e[1]=g,e[2]=
- q):b&t?e[2]|=q:b&h||c(!1,"ModelDirtySet.objGeometryAdded: inconsistent state")):a[d]=[b,g,q]};a.prototype._createObjectRecordObjIfNonexistent=function(a,b,c){a[b]||(a[b]={});a[b][c]||(a[b][c]={});return a[b][c]};a.prototype._getParentLayerId=function(a){return a.parentLayer.id};a.prototype.formatDebugInfo=function(a){var b=["ADD","UPD",void 0,"REM"];if(a)return"";a="";for(var c in this._dirtyGeomRecords)for(var d in this._dirtyGeomRecords[c]){var e=this._dirtyGeomRecords[c][d];if(e){0<a.length&&(a+=
- "\n");a+=c+"."+d;var g=[],f;for(f in e){var h=e[f][1];g[h]||(g[h]=[]);g[h].push(e[f][0].geometry.id)}for(e=0;e<g.length;e++)if(g[e])for(a+=" "+b[e-1]+": ",h=0;h<g[e].length;h++)a+=g[e][h]+", "}}return a};return a}()})},"esri/views/3d/webgl-engine/lib/RenderGeometry":function(){define(["require","exports","./gl-matrix"],function(r,h,f){var a=f.vec3d,e=f.mat4d;return function(){function c(c,d,b,e,f,p,n,t,h,q,v){this.shaderTransformationDirty=!0;this.data=c.toRenderData();this.componentOffsets=c.componentOffsets;
- this.boundingInfo=d;this.material=b;this.origin=null;this.center=a.create();this.bsRadius=0;this.transformation=null;this.calculateShaderTransformation=f;e&&this.updateTransformation(e,p);this.castShadow=n;this.singleUse=t;this.name=h;this.uniqueName=q;this.idx=v;this.canBeMerged=!0;this.instanceParameters={}}c.prototype.updateTransformation=function(a,c){this.transformation=a;this.shaderTransformationDirty=!0;this.bsRadius=this.getBoundingSphere(a,c,this.center)};c.prototype.shaderTransformationChanged=
- function(){this.shaderTransformationDirty=!0};c.prototype.getBoundingSphere=function(a,c,b){c=c||e.maxScale(a);e.multiplyVec3(a,this.boundingInfo.getCenter(),b);return this.boundingInfo.getBSRadius()*c};Object.defineProperty(c.prototype,"hasShaderTransformation",{get:function(){return!!this.calculateShaderTransformation},enumerable:!0,configurable:!0});c.prototype.getShaderTransformation=function(){return this.calculateShaderTransformation?(this.shaderTransformationDirty&&(this.shaderTransformation||
- (this.shaderTransformation=e.create()),e.set(this.calculateShaderTransformation(this.transformation),this.shaderTransformation),this.shaderTransformationDirty=!1),this.shaderTransformation):this.transformation};return c}()})},"esri/views/3d/webgl-engine/parts/View":function(){define("require exports ../../../../core/Logger ../../../../core/sniff ../lib/gl-matrix ../lib/GLMaterialRep ../lib/GLTextureRep ../lib/HighlightHelper ../lib/OffscreenRenderingHelper ../lib/ProgramRepository ../lib/RenderOccludedHelper ../lib/ShaderSnippets ../lib/SSAOHelperObscurance ../lib/TextureRenderer ../lib/tracer ../lighting/Lightsources ../materials/repository ./Model ./Viewport ../../../support/screenshotUtils ../../../webgl/context-util ../../../webgl/RenderingContext".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C){var A=e.vec3d,D=e.vec4d,E=f.getLogger("esri.views.3d.webgl-engine.parts.View");return function(){function e(a,b,d,e){var f=this;this._backgroundColor=D.createFrom(1,1,1,1);this._lightDirection=A.createFrom(0,1,0);this._didRender=!1;this._idleSuspend=this._needsRender=!0;this._shouldRender=!1;this._screenCaptureQueue=[];this._container=a;this._stage=b;this._initializeContext(e);this._initializeShaders(e);this._textureRep=new g(b.getAll(x.ContentType.TEXTURE),
- this._programRepository,function(){return f._viewport.getCamera().viewport},this._rctx);this._materialRep=new c(this._textureRep,this._programRepository);this._viewport=new m(this._programRepository,this._materialRep,this._textureRep,this._rctx);this._initializeViewportCamera();this._textureRenderer=new t(this._rctx,this._canvas,this._programRepository,this._materialRep,this._textureRep,d);this._initializeFrameTask()}Object.defineProperty(e.prototype,"isLoadingResources",{get:function(){return this._viewport.isLoadingResources},
- enumerable:!0,configurable:!0});e.prototype._initializeFrameTask=function(){var a=this;this._frameTask={preRender:function(){u.begin();a._stage.processDirty();a.needsRender()?(a._shouldRender=!0,a._viewport.getCamera().setGLViewport(a._rctx),a._rctx.setClearColor.apply(a._rctx,a._backgroundColor),a._rctx.clear(16640)):a._shouldRender=!1},render:function(){a._shouldRender&&(a._didRender=!0,a._viewport.render(a._lightDirection,null))},postRender:function(){u.end()},update:function(){a._performScreenCaptures();
- a.resetNeedsRender()}}};e.prototype._initializeViewportCamera=function(){var a=this._container.getBoundingClientRect(),b=this._viewport.getCamera();b.viewport[2]=a.width;b.viewport[3]=a.height;this._viewport.setCamera(b)};e.prototype._initializeContext=function(b){this._canvas=b.canvas;this._canvas||(this._canvas=document.createElement("canvas"));this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");var c=z.createContextOrErrorHTML(this._canvas,{alpha:b.alpha||!1,antialias:!1,
- depth:!0,stencil:null==b.stencil?!0:b.stencil},b.renderContext);this._gl=u.instrumentContext(c);this._rctx=new C(this._gl,{disabledExtensions:b.deactivatedWebGLExtensions});!b.alpha&&this._rctx.contextAttributes.alpha&&E.error("WebGL context has alpha channel even though no alpha channel was requested");11<=a("safari")&&(this._container.style.backgroundColor="black");this._container.appendChild(this._canvas)};e.prototype._initializeShaders=function(a){this._shaderSnippets=new p({fsprecisionf:"\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\nprecision highp sampler2D;\n#else\nprecision mediump float;\nprecision mediump sampler2D;\n#endif\n",
- vsprecisionf:"\nprecision highp float;\nprecision highp sampler2D;\n",viewingMode:"global"===a.viewingMode?"#define VIEWING_MODE_GLOBAL 1 \n":" #define VIEWING_MODE_LOCAL 1 \n"});this._programRepository=new k;v.initializeShaders(this._shaderSnippets,this._programRepository,this._rctx);d.loadShaders(this._shaderSnippets,this._programRepository,this._rctx);l.loadShaders(this._shaderSnippets,this._programRepository,this._rctx);n.loadShaders(this._shaderSnippets,this._programRepository,this._rctx);b.loadShaders(this._shaderSnippets,
- this._programRepository,this._rctx)};e.prototype.dispose=function(){this._viewport.dispose();this._viewport=null;this._textureRenderer.dispose();this._textureRenderer=null;this._programRepository.dispose();this._programRepository=null;this._container.contains(this._canvas)&&this._container.removeChild(this._canvas);this._gl=this._canvas=this._container=null};e.prototype.getCombinedStats=function(){return this._viewport.getCombinedStats()};e.prototype.setNeedsRender=function(){this._didRender=!1;this._needsRender=
- !0};e.prototype.resetNeedsRender=function(){this._didRender&&(this._didRender=this._needsRender=!1);this._viewport.resetNeedsRender();this._textureRep.resetNeedsRender()};e.prototype.needsRender=function(){return this._needsRender||!this._idleSuspend||this._viewport.needsRender()||this._textureRep.needsRender()};e.prototype.getFrameTask=function(){return this._frameTask};e.prototype.setLighting=function(a){A.set3(0,0,0,this._lightDirection);for(var b=0,c=a.lights;b<c.length;b++){var d=c[b];if(d instanceof
- q.MainLight){A.negate(d.direction,this._lightDirection);break}}this._viewport.setLighting(a);this._needsRender=!0};e.prototype.getEdgeView=function(){return this._viewport.getEdgeView()};e.prototype.getMainLightDirection=function(){return this._lightDirection};e.prototype.getViewParams=function(a){var b=this._viewport.getViewParams(a);if(!a||a.backgroundColor)b.backgroundColor=this._backgroundColor;return b};e.prototype.setViewParams=function(a){this._needsRender=!0;a.backgroundColor&&(this._backgroundColor=
- a.backgroundColor);this._viewport.setViewParams(a)};e.prototype.setRenderParams=function(a){this._needsRender=!0;void 0!==a.idleSuspend&&(this._idleSuspend=!!a.idleSuspend);this._viewport.setRenderParams(a)};e.prototype.getRenderParams=function(){var a=this._viewport.getRenderParams();a.anisotropicFiltering=this._textureRep.getMaxAnisotropy();a.idleSuspend=this._idleSuspend;return a};Object.defineProperty(e.prototype,"renderingContext",{get:function(){return this._rctx},enumerable:!0,configurable:!0});
- e.prototype.has=function(a){return"s3tc"===a?!!this._rctx.capabilities.compressedTextureS3TC:"standardDerivatives"===a?!!this._rctx.capabilities.standardDerivatives:"shaderTextureLOD"===a?!!this._rctx.capabilities.shaderTextureLOD:"instancedRendering"===a?!!this._rctx.capabilities.instancing:!1};e.prototype.getFrustumObjects=function(){return this._viewport.getFrustumObjects()};e.prototype.modify=function(a,b,c,d){this._viewport.modify(a,b,c,d)};e.prototype.setCamera=function(a){this._viewport.setCamera(a)};
- e.prototype.getCamera=function(){return this._viewport.getCamera()};e.prototype.getPickRay=function(a,b,c){this._viewport.getPickRay(a,b,c)};e.prototype.pickRayWithBeginPoint=function(a,b,c,d,e){this._viewport.pickRayWithBeginPoint(a,b,c,d,e)};e.prototype.getCanvas=function(){return this._canvas};e.prototype.getTextureGraphicsRenderer=function(){return this._textureRenderer};e.prototype.requestScreenCapture=function(a,b){this._screenCaptureQueue.push({settings:a||{},callback:b});this._needsRender=
- !0};e.prototype.getAllTexturesLoaded=function(){return 0===this._textureRep.getLoadingCount()};e.prototype.getTextureLoaded=function(a){return this._textureRep.getIsLoaded(a)};e.prototype.addTextureListener=function(a){this._textureRep.addTextureListener(a)};e.prototype.removeTextureListener=function(a){this._textureRep.removeTextureListener(a)};e.prototype.addExternalRenderer=function(a,b){return this._viewport.addExternalRenderer(a,b)?(b.initializeRenderContext({rctx:this._rctx,gl:this._rctx.gl,
- shaderSnippets:this._shaderSnippets,programRep:this._programRepository,textureRep:this._textureRep}),!0):!1};e.prototype.removeExternalRenderer=function(a){return this._viewport.removeExternalRenderer(a)?(a.uninitializeRenderContext({rctx:this._rctx,gl:this._rctx.gl}),!0):!1};e.prototype._performScreenCaptures=function(){if(0!==this._screenCaptureQueue.length){for(var a=0;a<this._screenCaptureQueue.length;a++){var b=this._screenCaptureQueue[a],c=0,d=0,e=this._canvas.width,g=this._canvas.height,f=
- this._canvas.width,k=this._canvas.height,l=b.settings.area;l&&(c=l.x,d=l.y,e=l.width,g=l.height);void 0!==b.settings.width&&void 0!==b.settings.height?(l=b.settings.width/b.settings.height,g*l<e?(l*=g,c+=Math.floor((e-l)/2),e=Math.floor(l)):(l=e/l,d+=Math.floor((g-l)/2),g=Math.floor(l)),f=b.settings.width,k=b.settings.height):(f=e,k=g);var m=this._canvas,l=null;if(0!==c||0!==d||e!==this._canvas.width||g!==this._canvas.height||f!==this._canvas.width||k!==this._canvas.height){this._resizeCanvas||(this._resizeCanvas=
- document.createElement("canvas"));this._resizeCanvas.width=f;this._resizeCanvas.height=k;var n=this._resizeCanvas.getContext("2d"),l=new Uint8Array(e*g*4);this._gl.readPixels(c,this._canvas.height-(d+g),e,g,6408,5121,l);c=n.getImageData(0,0,f,k);B.resampleHermite(l,e,g,c.data,f,k,!0);n.putImageData(c,0,0);m=this._resizeCanvas;n=null}e={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"}[b.settings.format?b.settings.format.toLowerCase():"png"];g=1;void 0!==b.settings.quality&&(g=b.settings.quality/
- 100);e={dataURL:m.toDataURL(e,g),x:0,y:0,width:f,height:k};b.settings.returnByteBuffer&&(e.data=l);b.callback(e)}this._screenCaptureQueue=[]}};return e}()})},"esri/views/3d/webgl-engine/lib/GLMaterialRep":function(){define(["require","exports","./Util"],function(r,h,f){var a=function(){function a(a){this.refCnt=0;this.glMaterial=a}a.prototype.incRefCnt=function(){++this.refCnt};a.prototype.decRefCnt=function(){--this.refCnt;f.assert(0<=this.refCnt)};a.prototype.getRefCnt=function(){return this.refCnt};
- a.prototype.getGLMaterial=function(){return this.glMaterial};return a}();return function(){function e(a,e){this.textureRep=a;this.programRep=e;this.id2glMaterialRef={}}e.prototype.aquire=function(a){return this.aquireExt(a,"color")};e.prototype.aquireDepthShadowMap=function(a){return this.aquireExt(a,"depthShadowMap")};e.prototype.aquireDepth=function(a){return this.aquireExt(a,"depth")};e.prototype.aquireNormal=function(a){return this.aquireExt(a,"normal")};e.prototype.aquireHighlight=function(a){return this.aquireExt(a,
- "highlight")};e.prototype.aquireExt=function(c,e){var d=c.id+"_"+e,b=this.id2glMaterialRef[d];null==b?(c=(b=c.getGLMaterials()[e])?new b(c,this.programRep,this.textureRep):void 0,b=new a(c),this.id2glMaterialRef[d]=b):c=b.getGLMaterial();b.incRefCnt();c&&this.increaseProgramReferences(c);return c};e.prototype.release=function(a){this.releaseExt(a,"color")};e.prototype.releaseDepth=function(a){this.releaseExt(a,"depth")};e.prototype.releaseNormal=function(a){this.releaseExt(a,"normal")};e.prototype.releaseDepthShadowMap=
- function(a){this.releaseExt(a,"depthShadowMap")};e.prototype.releaseHighlight=function(a){this.releaseExt(a,"highlight")};e.prototype.releaseExt=function(a,e){a=a+"_"+e;e=this.id2glMaterialRef[a];e.decRefCnt();if(0===e.getRefCnt()){if(e=e.getGLMaterial())this.decreaseProgramReferences(e),e.dispose();delete this.id2glMaterialRef[a]}};e.prototype.updateMaterialParameters=function(a){var c=this.id2glMaterialRef[a+"_color"];c&&c.getGLMaterial()&&this.updateParamsForMat(c.getGLMaterial());(c=this.id2glMaterialRef[a+
- "_depth"])&&c.getGLMaterial()&&this.updateParamsForMat(c.getGLMaterial());(c=this.id2glMaterialRef[a+"_depthShadowMap"])&&c.getGLMaterial()&&this.updateParamsForMat(c.getGLMaterial());(c=this.id2glMaterialRef[a+"_normal"])&&c.getGLMaterial()&&this.updateParamsForMat(c.getGLMaterial());(a=this.id2glMaterialRef[a+"_highlight"])&&a.getGLMaterial()&&this.updateParamsForMat(a.getGLMaterial())};e.prototype.updateParamsForMat=function(a){a.updateParameters&&a.updateParameters()};e.prototype.increaseProgramReferences=
- function(a){a=a.getPrograms();for(var c=0;c<a.length;c++)this.programRep.increaseRefCount(a[c])};e.prototype.decreaseProgramReferences=function(a){a=a.getPrograms();for(var c=0;c<a.length;c++)this.programRep.decreaseRefCount(a[c])};return e}()})},"esri/views/3d/webgl-engine/lib/HighlightHelper":function(){define("require exports dojo/text!../materials/internal/highlight.xml ../../support/debugFlags ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ./gl-matrix ./glUtil3D ./Util ../../../webgl/BufferObject ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/Util ../../../webgl/VertexArrayObject".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){var u=g.vec4d;return function(){function g(a,b,c){this._grid={coverageMipmap:null,vao:null,verticalCellCount:0,horizontalCellCount:0,cellPixelSize:0,mipmapLevels:0,viewportWidth:0,viewportHeight:0};this.blur1Fbo=this.blur0Fbo=this.quadVAO=null;this._rctx=c;this.viewportToRestore=u.create();this.programRep=a;this.defaultOptions={color:new Float32Array([1,0,1,1]),haloOpacity:1,fillOpacity:.2,haloOpacityOccluded:.25,fillOpacityOccluded:.05}}g.prototype._gridUpdateResources=
- function(a,b){var d=this._rctx,g=this._grid,f=!1;null===g.coverageMipmap&&(g.coverageMipmap=[a],f=!0);if(g.viewportWidth!==a.width||g.viewportHeight!==a.height)f=!0,g.viewportWidth=a.width,g.viewportHeight=a.height;g.coverageMipmap[0]=a;g.cellPixelSize!==b&&(g.cellPixelSize=b,f=!0);if(f){for(b=1;b<g.coverageMipmap.length;b++)g.coverageMipmap[b].dispose();g.mipmapLevels=Math.ceil(Math.log(g.cellPixelSize)*Math.LOG2E);g.coverageMipmap.length=g.mipmapLevels+1;for(b=0;b<g.mipmapLevels;b++)f=g.coverageMipmap[b],
- f=l.createWithAttachments(d,{target:3553,pixelFormat:6407,dataType:33635,samplingMode:9729,wrapMode:33071,width:Math.ceil(f.width/2),height:Math.ceil(f.height/2)},{colorTarget:0,depthStencilTarget:0,width:Math.ceil(f.width/2),height:Math.ceil(f.height/2)}),g.coverageMipmap[b+1]=f}var f=Math.ceil(a.height/g.cellPixelSize),n=Math.ceil(a.width/g.cellPixelSize);if(!g.vao||g.verticalCellCount!==f||g.horizontalCellCount!==n){g.verticalCellCount=f;g.horizontalCellCount=n;a=f+1;b=n+1;for(var f=1/f,n=1/n,
- p=new Float32Array(24*a*b),q=0,h=0;h<a;h++)for(var u=0;u<b;u++)p[q+0]=(u-.5)*n*2-1,p[q+1]=(h-.5)*f*2-1,p[q+2]=u*n,p[q+3]=h*f,p[q+4]=(u+.5)*n*2-1,p[q+5]=(h-.5)*f*2-1,p[q+6]=u*n,p[q+7]=h*f,p[q+8]=(u-.5)*n*2-1,p[q+9]=(h+.5)*f*2-1,p[q+10]=u*n,p[q+11]=h*f,p[q+12]=(u-.5)*n*2-1,p[q+13]=(h+.5)*f*2-1,p[q+14]=u*n,p[q+15]=h*f,p[q+16]=(u+.5)*n*2-1,p[q+17]=(h-.5)*f*2-1,p[q+18]=u*n,p[q+19]=h*f,p[q+20]=(u+.5)*n*2-1,p[q+21]=(h+.5)*f*2-1,p[q+22]=u*n,p[q+23]=h*f,q+=24;g.vao&&g.vao.dispose(!0);g.vao=new t(d,e.Default3D,
- {geometry:c.Pos2Tex},{geometry:k.createVertex(d,35044,p)})}};g.prototype._gridComputeMipmap=function(){var a=this._rctx,b=this._grid,c=this.programRep.get("conservative-downsample");a.bindVAO(this.quadVAO);for(var d=0;d<b.mipmapLevels;d++){a.bindFramebuffer(b.coverageMipmap[d+1]);a.bindTexture(b.coverageMipmap[d].colorTexture,0);var e=b.coverageMipmap[d+1].width,g=b.coverageMipmap[d+1].height;a.bindProgram(c);c.setUniform1i("tex",0);c.setUniform2f("invFramebufferDim",1/e,1/g);a.setViewport(0,0,e,
- g);a.drawArrays(5,0,n.vertexCount(this.quadVAO,"geometry"))}};Object.defineProperty(g.prototype,"profilingCallback",{get:function(){return a.HIGHLIGHTS_PROFILE_TO_CONSOLE?function(a){return console.log(a)}:null},enumerable:!0,configurable:!0});g.prototype.getIsSupported=function(){return!0};g.prototype.setEnableState=function(a){a?this.enable():this.disable()};g.prototype.getEnableState=function(){return null!==this.blur0Fbo};g.prototype.enable=function(){this.quadVAO=d.createQuadVAO(this._rctx);
- var a={colorTarget:0,depthStencilTarget:0,width:0,height:0},b={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:0,height:0};this.blur0Fbo=l.createWithAttachments(this._rctx,b,a);this.blur1Fbo=l.createWithAttachments(this._rctx,b,a)};g.prototype.disable=function(){this.getEnableState()&&(this.quadVAO.dispose(!0),this.blur1Fbo.dispose(),this.blur0Fbo.dispose(),this.blur1Fbo=this.blur0Fbo=this.quadVAO=null)};g.prototype.getHighlightFBO=function(){return this.blur0Fbo};
- g.prototype.render=function(c,d,e){var g=!a.HIGHLIGHTS_GRID_OPTIMIZATION_DISABLED,f=a.HIGHLIGHTS_VISUALIZE_BLOCKS,k=this._rctx;b.assert(this.getEnableState());u.set(c.fullViewport,this.viewportToRestore);c=Math.ceil(e.width/1);var l=Math.ceil(e.height/1);this.blur0Fbo.resize(c,l);this.blur1Fbo.resize(c,l);k.bindVAO(this.quadVAO);k.setDepthWriteEnabled(!1);k.setDepthTestEnabled(!1);k.setBlendingEnabled(!1);var m=null,p=m=null,q=null;if(g){var h=this._grid;this._gridUpdateResources(e,32);this._gridComputeMipmap();
- p=h.vao;q=4;m=this.programRep.get("highlight-blur-grid-5");k.bindProgram(m);k.bindTexture(h.coverageMipmap[h.mipmapLevels].colorTexture,1);m.setUniform1i("coverageTex",1)}else p=this.quadVAO,q=5,m=this.programRep.get("highlight-blur-5"),k.bindProgram(m);k.bindVAO(p);k.bindFramebuffer(this.blur0Fbo);k.setViewport(0,0,c,l);k.setClearColor(0,0,0,0);k.clear(k.gl.COLOR_BUFFER_BIT);m.setUniform1i("tex",0);k.bindTexture(e.colorTexture,0);m.setUniform2f("blurSize",1/c,0);k.drawArrays(q,0,n.vertexCount(p,
- "geometry"));k.bindFramebuffer(this.blur1Fbo);k.clear(k.gl.COLOR_BUFFER_BIT);k.bindTexture(this.blur0Fbo.colorTexture,0);m.setUniform2f("blurSize",0,1/l);k.drawArrays(q,0,n.vertexCount(p,"geometry"));k.bindFramebuffer(d);k.setBlendingEnabled(!0);k.setBlendFunctionSeparate(770,771,1,771);k.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],this.viewportToRestore[2],this.viewportToRestore[3]);g?(m=this.programRep.get(f?"highlight-apply-grid-debug":"highlight-apply-grid"),k.bindProgram(m),
- m.setUniform1i("coverageTex",2),k.bindTexture(this._grid.coverageMipmap[this._grid.mipmapLevels].colorTexture,2)):(m=this.programRep.get("highlight-apply"),k.bindProgram(m));m.setUniform1i("tex",0);k.bindTexture(this.blur1Fbo.colorTexture,0);m.setUniform1i("origin",1);k.bindTexture(e.colorTexture,1);m.setUniform4fv("color",this.defaultOptions.color);m.setUniform1f("outlineSize",8.6);m.setUniform1f("blurSize",.4);m.setUniform4f("opacities",this.defaultOptions.haloOpacity,this.defaultOptions.haloOpacityOccluded,
- this.defaultOptions.fillOpacity,this.defaultOptions.fillOpacityOccluded);k.drawArrays(q,0,n.vertexCount(p,"geometry"));k.bindVAO(null);k.setDepthWriteEnabled(!0);k.setDepthTestEnabled(!0);k.setBlendingEnabled(!1)};g.prototype.setDefaultOptions=function(a){this.defaultOptions=a};g.loadShaders=function(a,b,c){a._parse(f);for(var d=0,g=["3","5","7","9"];d<g.length;d++){var k=g[d];b.add("highlight-blur-"+k,new p(c,a.vsHighlightBlurFastGaussian,a.fsHighlightBlurFastGaussian,e.Default3D,{GAUSSIAN_SAMPLES:k}));
- b.add("highlight-blur-grid-"+k,new p(c,a.vsHighlightBlurFastGaussian,a.fsHighlightBlurFastGaussian,e.Default3D,{GAUSSIAN_SAMPLES:k,GRID_OPTIMIZATION:"true"}))}b.add("highlight-apply",new p(c,a.vsHighlightApply,a.fsHighlightApply,e.Default3D));b.add("highlight-apply-grid",new p(c,a.vsHighlightApply,a.fsHighlightApply,e.Default3D,["GRID_OPTIMIZATION"]));b.add("highlight-apply-grid-debug",new p(c,a.vsHighlightApply,a.fsHighlightApply,e.Default3D,["GRID_OPTIMIZATION","GRID_DEBUG"]));b.add("conservative-downsample",
- new p(c,a.vsConservativeDownsample,a.fsConservativeDownsample,e.Default3D))};return g}()})},"esri/views/3d/webgl-engine/lib/ProgramRepository":function(){define(["require","exports","./Util"],function(r,h,f){return function(){function a(){this.shaderVariators={};this._nextId=0;this._programsByName={};this._namesById=[];this._programRefCount=[];this._commonUniforms={model:[],modelNormal:[],lightDirection:[],proj:[],shadowMapDistance:[],viewportPixelSz:[],lightingMainDirection:[]}}a.prototype.dispose=
- function(){for(var a in this._programsByName)this._programsByName[a].dispose();this._programRefCount=this._namesById=this._programsByName=null};a.prototype.add=function(a,c){f.assert(null==this._programsByName[a]);this._programsByName[a]=c;this._namesById[c.id]=a};a.prototype.get=function(a){return this._programsByName[a]};a.prototype.addShaderVariations=function(a,c){this.shaderVariators[a]=c};a.prototype.getShaderVariations=function(a){return this.shaderVariators[a]};a.prototype.getShaderVariationsProgram=
- function(a,c,g,d,b){return(a=this.getShaderVariations(a))&&a.getProgram(c,g,d,b)};a.prototype.getProgramsUsingUniform=function(a){return this._commonUniforms[a]||[]};a.prototype.increaseRefCount=function(a){var c=a.id;this._programRefCount[c]?this._programRefCount[c]++:(this._programRefCount[c]=1,this._findCommonUniforms(a))};a.prototype.decreaseRefCount=function(a){var c=a.id;1<this._programRefCount[c]?this._programRefCount[c]--:(this._forgetCommonUniforms(a),this._programRefCount[c]=0)};a.prototype._getNextId=
- function(){return this._nextId++};a.prototype._findCommonUniforms=function(a){for(var c in this._commonUniforms)a.hasUniform(c)&&(f.assert(-1===this._commonUniforms[c].indexOf(a),"common uniforms of program have already been determined"),this._commonUniforms[c].push(a))};a.prototype._forgetCommonUniforms=function(a){for(var c in this._commonUniforms){var e=this._commonUniforms[c],d=e.indexOf(a);-1<d&&(e[d]=e[e.length-1],e.pop())}};return a}()})},"esri/views/3d/webgl-engine/lib/RenderOccludedHelper":function(){define("require exports dojo/text!../materials/internal/occluded.xml ./DefaultVertexAttributeLocations ./gl-matrix ./glUtil3D ./Util ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){var l=e.vec4d;return function(){function e(a,b,c){this._quadVAO=null;this._rctx=c;this._colorFBO=void 0;this._viewportToRestore=l.create();this.programRep=a}Object.defineProperty(e.prototype,"colorFBO",{get:function(){return this._colorFBO},enumerable:!0,configurable:!0});e.prototype.setEnableState=function(a){a?this.enable():this.disable()};e.prototype.getEnableState=function(){return void 0!==this._colorFBO};e.prototype.enable=function(){this._quadVAO=c.createQuadVAO(this._rctx);
- this._colorFBO=d.createWithAttachments(this._rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:0,height:0},{colorTarget:0,depthStencilTarget:1})};e.prototype.disable=function(){this.getEnableState()&&(this._quadVAO.dispose(!0),this._quadVAO=void 0,this._colorFBO.dispose(),this._colorFBO=void 0)};e.prototype.setupFBOs=function(a){g.assert(this.getEnableState());this._viewportToRestore=a=a.fullViewport;this._width=a[2];this._height=a[3];this._rctx.setViewport(0,
- 0,this._width,this._height)};e.prototype.prepareColorPass=function(){g.assert(this.getEnableState());var a=this._rctx,b=a.gl;this._colorFBO.resize(this._width,this._height);a.bindFramebuffer(this._colorFBO);a.setClearColor(0,0,0,0);a.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};e.prototype.finish=function(a){var b=this._rctx;b.bindFramebuffer(a);b.setViewport(this._viewportToRestore[0],this._viewportToRestore[1],this._viewportToRestore[2],this._viewportToRestore[3])};e.prototype.apply=function(){var a=
- this._rctx,b=this.programRep.get("render-occluded-apply");a.bindProgram(b);a.bindVAO(this._quadVAO);a.bindTexture(this._colorFBO.colorTexture,0);b.setUniform1i("occludedColorMap",0);a.setDepthWriteEnabled(!1);a.setDepthTestEnabled(!1);a.setBlendingEnabled(!0);a.setBlendFunction(770,771);a.drawArrays(5,0,k.vertexCount(this._quadVAO,"geometry"));a.bindVAO(null);a.setDepthWriteEnabled(!0);a.setDepthTestEnabled(!0);a.setBlendingEnabled(!1)};e.loadShaders=function(c,d,e){c._parse(f);d.add("render-occluded-apply",
- new b(e,c.vsRenderOccludedApply,c.fsRenderOccludedApply,a.Default3D))};return e}()})},"esri/views/3d/webgl-engine/lib/ShaderSnippets":function(){define(["require","exports","dojox/xml/parser","./Util"],function(r,h,f,a){return function(){function e(c){var e=a.VertexAttrConstants,d;for(d in e)this[e[d]]=a.VertexAttrConstants[d];if(c)for(var b in c)this[b]=c[b]}e.prototype._parse=function(c){c=f.parse(c).getElementsByTagName("snippet");for(var e=/\$[a-zA-Z0-9_]+[ \t]*/,d=/[\$\s]+/g,b=0;b<c.length;b++){var k=
- c[b].getAttribute("name");a.assert(null==this[k]);for(var l=c[b].textContent;;){var p=l.match(e);if(null==p)break;var n=this[p[0].replace(d,"")];a.assert(void 0!==n);l=l.replace(p[0],n)}this[k]=l}};return e}()})},"dojox/xml/parser":function(){define(["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/window","dojo/_base/sniff"],function(r){r.getObject("xml.parser",!0,dojox);dojox.xml.parser.parse=function(h,f){var a=r.doc,e;f=f||"text/xml";if(h&&r.trim(h)&&"DOMParser"in r.global){e=
- (new DOMParser).parseFromString(h,f);h=e.documentElement;if("parsererror"==h.nodeName&&"http://www.mozilla.org/newlayout/xml/parsererror.xml"==h.namespaceURI){if(a=h.getElementsByTagNameNS("http://www.mozilla.org/newlayout/xml/parsererror.xml","sourcetext")[0])a=a.firstChild.data;throw Error("Error parsing text "+h.firstChild.data+" \n"+a);}return e}if("ActiveXObject"in r.global){a=function(a){return"MSXML"+a+".DOMDocument"};a=["Microsoft.XMLDOM",a(6),a(4),a(3),a(2)];r.some(a,function(a){try{e=new ActiveXObject(a)}catch(d){return!1}return!0});
- if(h&&e&&(e.async=!1,e.loadXML(h),h=e.parseError,0!==h.errorCode))throw Error("Line: "+h.line+"\nCol: "+h.linepos+"\nReason: "+h.reason+"\nError Code: "+h.errorCode+"\nSource: "+h.srcText);if(e)return e}else if(a.implementation&&a.implementation.createDocument){if(h&&r.trim(h)&&a.createElement){f=a.createElement("xml");f.innerHTML=h;var c=a.implementation.createDocument("foo","",null);r.forEach(f.childNodes,function(a){c.importNode(a,!0)});return c}return a.implementation.createDocument("","",null)}return null};
- dojox.xml.parser.textContent=function(h,f){if(1<arguments.length)return dojox.xml.parser.replaceChildren(h,(h.ownerDocument||r.doc).createTextNode(f)),f;if(void 0!==h.textContent)return h.textContent;var a="";h&&r.forEach(h.childNodes,function(e){switch(e.nodeType){case 1:case 5:a+=dojox.xml.parser.textContent(e);break;case 3:case 2:case 4:a+=e.nodeValue}});return a};dojox.xml.parser.replaceChildren=function(h,f){var a=[];r.isIE&&r.forEach(h.childNodes,function(e){a.push(e)});dojox.xml.parser.removeChildren(h);
- r.forEach(a,r.destroy);r.isArray(f)?r.forEach(f,function(a){h.appendChild(a)}):h.appendChild(f)};dojox.xml.parser.removeChildren=function(h){for(var f=h.childNodes.length;h.hasChildNodes();)h.removeChild(h.firstChild);return f};dojox.xml.parser.innerXML=function(h){return h.innerXML?h.innerXML:h.xml?h.xml:"undefined"!=typeof XMLSerializer?(new XMLSerializer).serializeToString(h):null};return dojox.xml.parser})},"esri/views/3d/webgl-engine/lib/SSAOHelperObscurance":function(){define("require exports dojo/text!../materials/internal/ssao.xml ../../../../core/Logger ../../support/imageUtils ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ./gl-matrix ./glUtil3D ./Util ../../../webgl/BufferObject ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/Texture ../../../webgl/Util ../../../webgl/VertexArrayObject".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){var v=d.vec3d,x=d.vec4d,m=a.getLogger("esri.views.3d.webgl-engine.lib.SSAOHelperObscurance");r=function(){function a(a,c,d,e){this._enabled=!1;this._BLUR_F=2;this._attenuation=.5;this._radius=3;this._samples=16;this._viewportToRestore=x.create();this._rctx=d;this._programRep=a;this._requestRender=e;this._emptyTexture=b.createEmptyTexture(d)}a.prototype.dispose=function(){this._emptyTexture.dispose();this._emptyTexture=null};a.prototype.getIsSupported=function(){var a=
- this._rctx,b=-1!==a.parameters.versionString.indexOf("WebGL 0.93"),c=-1!==a.parameters.versionString.indexOf("WebGL 0.94");return a.capabilities.standardDerivatives&&!(b||c)};a.prototype.setEnableState=function(a){a?this.enable():this.disable()};a.prototype.getEnableState=function(){return this._enabled};a.prototype.enable=function(){var a=this;if(!this.getEnableState())if(this.getIsSupported()){this._enabled=!0;var b={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:0,
- height:0},c={colorTarget:0,depthStencilTarget:0};this._ssaoFBO=p.createWithAttachments(this._rctx,b,c);this._blur0FBO=p.createWithAttachments(this._rctx,b,c);this._blur1FBO=p.createWithAttachments(this._rctx,b,c);e.requestImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAqf0lEQVR42gTBB5ydB2EY8G/v8b7v7Xnv9mmcdFp3WpasZUuWFzZgDJgkhgwoSdM2JbTNjzZA06ZNgaRJWtKSEgjDGNuA8UYeWpZkbZ10uj3efu977317j/7/4De/8ef9vCow2VUGGHzRhuQ+t08GvhZb+jy85wOu/68JzwtQSCZedpsvC8SL6NJNNwZoHMaZiMoCrjrPATpGJFxvRCYMKqTCBsyVw8h5B6ROArU3+8HOGLe3Ay+UABow3D4wEcfOakDbjh2h594mikMNcI62ISNzIius0bfeN+QHrv+L7M53FHq1XC29breFgmCjwPHQ/fo88OIg9kvDdQPhB93G8yk6DtRYFT64fR/jQn0NIcIgYHylyFjVHPBboCB7HQ5sXuoZqQCHqKUjtvKNpvxkivqlZe514DOA/Keethib6OkOw204MMTjY3HX8VIGFeITgBEApGRFY3hyKyPeRWK/NNa2huJeLKzBJAimiY7ZQbAh0HwPEP9jxHhs6he37z8+KWqdeD7TCttNwgHftJpfzCq/iOJbKrxap2Ymet8zwVEoNReE7T4aI6t2mBuO4Meyh3vHAeK2+KvLzWHEgSCJpgR5EvP7QPFLyeDWWrqc1iVz6LwPI7GEpOEExCwzVZwtKtDGyzRW5tGyz5WA7HLtfrOIHp9T9kXQB1z7E10eYMytTs5QOuci8E+YIk9W/roj5nxvjVVLaM+30x/09CPGIdQlfsOe/WqxoS9Sf5bVv+drIqyP6uNrQMxFGDPSt1PurVE/UcuV9ci35bmCPTiIjsuZZjZCePj01iMbKBYa7UyVIDI+MDMSAV7sw6CSjKEG0IqwXhEkVtFwFJQ9D3q9q2RE8xEzuxvCN0Bq0pAFH7IMZEW3/zQU6rQ8Dw1bqPE2XCxtht8B/Hsg/yzu3CUcGdb6PW6QCVRs7bYKDwDQfYefmmJO2O/d4LyOzns2kA3kt7Bxrn1ZZ4hlYFs+uYpAnNDyDI36VE+6wLadkEwTwQIdYovCIM8SEVS24D+ktuqjWIT4yWFEN/zEfsqIWkFfKQsW8DNVyLEDKWwZ6ew8x5ojpAmh7DbTuiCGFcW/DXl5hO7Y/BztDCbwqtMaxcanBq59oBYuVIAM2o2twXHduUpDjChd7xinXHoB5OKsvd/jlrN+SnHoir0dn1hWWSbrDzj0Nd6x3PUb1LYyVIpv9AHW9sPW+aEhU8peULyaAG12TddDnq0zVg5S+vfnVLQBwjt3PcU9k0feDfAkCjohqkfBRgeVfcx1xYcTzRYoNbVPbCQ/mmC66x3pMpN7IPDeT7a2+TYYDYj41QNoEoGVQhPLlIPb8k2yMZlM2gNIiEu4nfIZFKeDW08qY9ds2wLoLWIt2yJuYrXnWhNbytRVs1sHIw6qhoE/sYJsJArzFLNdUzxalSOyF3oIBU2ttqZFumoEj6XoZVOHKWSJDoGe+WGZmObQuA4f+uap/u15hOEW1LveusgkSWNvivQRRg7bAQWcd+wUcmN/DTkr6XeHmX/pVnYkebSt/RBNP8PhsXnqFhfUu/ozIH++g98KYa+EnqoRZtFucB/WVPy5MoJEyH+RgSeFoTuDS3Rjpi7Iog/+N2aD7N9oJkprVsWpNOqZ5JsMfDKSID//tUCyQrANUm4Q/czDP1mKVTo2lrM6uuJh9RV3pMc1ylB/5zpYs3EWgR87+hDYZY06VIzFYd+HxTY9FyARG0RytMQAJujsU3Pz/qPlwVVI99+KBosYv4qQOzQP4WWCfPVd5eSjvPMmAkY0LFL9lX5vMfDKgtMADu3pCrNLctVht8XYBr6KRvBkWte8jafxscvmLE7tITB4IxDf4GJ/7YdtklZdgOO6z62Bj4ADitP0UfcQAiwSnoEgw44j+mCCpjb7zL2IcBSOYLS5ArdRgU/EJrsgnLhuAgv6ylO+fTYJZMPiFVUt4bafDNpq8gW2/+Wc1LSVejMjel0a5Yg2kUT1DzSmbB3aGVsieORVfXAq7vYkeQUZKUHxZlufMOFKsneeaJYoxjH4j6q2BObSoPx+o2RkzKti/lyb2uC7h60bB4z9maJ4tnFpvw/fQ8zfJ3IAAiSE6G2X40l/PFI+xGgcAjM+/31BL8p1KGRn8kFaztzEFxsAfOxjR910VTxaqsh6/z5RGNebzyWtoossscYHUPKL91d9BhtQTclREMGf6PoMnmDJ6orHxKl7RZO9DwAIBqRCqlbTHs8hf0fa/1ZcPuxk/I42xYnbafCqgGGatSnGPUaE/1azHhdzw/rok76dX+vslH00lkxaRKfW/wwn3mJTQOH5bu/vzgMJNnTuAvJMFL3p9f90ttxSrfnxNusCI0spKhX0O7XBAHcouivCT56YhuFE+A4vrQr7VfSfeXbsbpt4rbhpwuNPNBagcd8A6DO4PgSzeDQ6lGlIevQ2yGyG3fn49mPgnTNJZqVuLwC8E3FFyBozgL47rtOWlrXOd1s/dRPjgYmLAzl2dWFOGk+bW+PStap2Xm/ERvzJdDYd4fd16N3x3ooL/FzJ8PEPT4H4WRk5ygiRK97yrjHU5p/69gdFfUdLiDlYG0NeFYyjRmZNdLM6mDPgwceejmpR8ek2Pm02WQ3ZqW5nCDTpL9931LtJdladOI0oZjCwoGICD1xZV4cYZxIgzhjekCf9wh4+jDU5IjvsdEm/12T6e0aJ5YqnS7ROWkWBX3FAnboqd7c6kAcAxZwBS3bSAZcH0F6pV/7AkfvSEzW3fzrp1VvQjkL3wetuK7N/CV692ve/zNVq5KYktPLl/CMDhNzFjT6ZOIK3RgxqBaLxgL8Aoc+F8MeP7gFuRpXbCDtlAbL10NvMh/tsocPBVQx9SFIIiN0CNzcipYWwz5GmjGWiarABr7U30U+uUNtF9/saPWDaKnox3JOtzsKvq1INHtwgug+a9C8U+XIiPGGIWaCNg7RE1WFxot+t3g22M6JFGzGOpSzmpS+ODP4Q6RwuwVKDW0f8olQHYv4Iwf51NAr0mmJoXL1TpxX/Jwq9m3b+wiCKtLfiNrWV4I/5xBkDPvnpZ+Q8EN/Czdf1bA+T5A6JpRxP74kwUm8y12j7Jd+fsDMtag5nJvLUigJjbnooZikOBpxD6T+Nk7Ln0kFZlhujYcHz/L1UK05AHRt+gErP4E4f5gKsX+O8TCsbUG1hHj2+vX3Ng7bL0R3a5KytLaPmeay0xND+gBfUj9Phq/2xfYKS87H3ta1Qso4H9Ca6X0hoMdy/IXM7QuhIVg9ZbI2oBRhk6xpX8qoHNrL9POGnrNERY9igV1x61qKLAvFcGoiRcch1N+k7LK/5D0D3eIobCG4s2iADwB67+vJqtk0Tc1TMkgQLKKRG4Bl48I3u2FQq/lO3XbK9g21Br2Wrcyobb2DqyLVhQbWbiwX3JdQGgLjIbjStUiveYGF6IpjdMZj6eyO1pSwXCSByV38TzEY2/VEpeAXdtABk0qq9aZB+cGf+ukGgq26f4iAJfso+9b38L3dfnIImHIwH4TRyf4e78yxS+Uxq6TugN4xw5XDxOoluqXYDJhgyxre24BJr10njnXjpWcTtWbdv4aXNbXQq03s36vFSR1oz9oxk321YuwoQdbNCsfy3tHAmMcnpdcCnnvFu3ffTYs/Ph90bPfqToDdPLPaNcCKivoo0Rwkqbsk1bPVbJpYxGIKUfXH4pK6H8fghaPY13icA4JO+NLuCpoYlHDM9EB75+kNH/n6o9zE+TRnBkkL8xiqWY+Q9ZzaAg4+fLzZjhNfw3w/gUQRFiPz+fPeS0b8aFIJGPC+rr24QY6gIO9YVpEO6A2aaeyYdXRMVVLdKluURo78cBmBt9EtRzeNaKwWKt2E84X3D5pkIp/iAp5BlCgOpbCJAGniU3QBwNA46JmID4zirCmjDcPth6PehZa+zDdAvOqltgXj53q4T5ealBjQn4yoLHxl7ENmhUxeNvsVRYwtikoW6UeUxgr9EMFvwiR9UeuVRYKur4GLqMtLds4H9c7GxNSJGLKubjwZ8TGOXLmgCr4e5uEw7XWCj+lNk1wMUOZOC/mXXfhLtvOu24Kyd7Rq3dEnkuAFo8DA4pyLpJ0zioo44oRxXdESQO1rq81ulq3WDJXbt3ADVNIjWg2a/R+JYnI2PeepVLB6LPzi5eMUa2/jvGWrYA0pIsd2Ax6mPHbLgJuQbN3uQNGGu19WDg/3b6lAnBRn9N3KlQsrLj5LkBOCnwk7P3pLX1ljdnh8cnPPerTvbJmSkWHISCPCTNYii/Dg4JrjaCNS+3DAPRwm9DyJkalkLQz4YsGNLFveiCyw6cE4MzvjUgRAl0jAQclYHdAaYaFVABepI4sP/oeepxPi9oGlSi3tpWIX0FzAOuE71y02MAmdQrbkGPmClGtJGKw+fOHi4cTrPd5qF/4KGkWmwqPqRP9fyB03ZL2FMBtc/W3/43eT17zGJUY+tBegRFjLJktlYf8TKpkmzJai8GvczudWw+UeEPcTZGuLLoFGDpv5YDH7ZFo4P1jmZ3TCjEotNcBqm155Pjm3NzFEKWKF7KcVY72eG4IF507vbNnbj9CwxsimhPW5KBT/cwpfvy/YzvJdcA+6n/B0d85Em9Jpj0SJ6LewBcL7Fw//+NzPSGw1uSqy9jfTmcJuyMzyA57DcJ7BZOkbPIcUXsDPjoMXY/keYYLd0Rax9ZOgJqJzTsb8onXqy1r3kKf8mbdIKVceTSXiiGi4/HR7Pt5tt27+BzW2VM1tj6lqIToB4087XR9bgOfSFKyGf5eeM2J0YhpmrH9/Uu2+28qDSL1av08BUz/i2dTounIci36M4SXJfQvpHifh6TOnD1lTMejVlfZUXf66md5FwdmEaOG1150HxOMK+gQNbgOZs0N1/lb7CJLdA8ILbK7RYCYPhDrXAb+xLMG4f8mFkDpBeyS5+tXLxfxPxJxjk++79i5TfpbnAivqN+HcMfaKsuVEQwkWRTQ6/a5BboYuIP2CsCo3BHucNjYkXfHt7YLxqKU/w4c/bdMrAM0RpawTOtWVdL3+l+Mr9a6KGHjzCdL+Pcs82YJuhXDZ2rh2NZcStekK3eqM4bjnwp/7yMa1OFl1OV3t6QPCo35w0tr2V7Copy7J1Es2x8Vv/HFIPufBxivtOv7nfIH2UelqlYzTdYMRhlOaizWtwONQqix3wIN5egwKRjEqW/h7rM7j0/YG2BRMfQkYeQJUQeo9nCmVps09F9focPDhOOXQUQMjU5dVeslBdgwfdev4kpssy+ovCLglTwJ6SUOXLRMTn3S0pz10x5bTC15u11cl30Nk9Jrzr0xP8nKHV48h0J54cVJqaeI9qlm1gjOB1k0QhXwFP2ObcgC+t0r1ti6P/KzA/SXo/IN0SMFjq9ZuIrLr9A1akw429QOUM5B5UEmUvRmTAe60bM1yWrYMPpCFXI/q4RWB0CWq9rGRvUP6uaKQ/IG34bkpJkt3ViM6N0IEnJx4orp2D+v9I4duJatlZ7BHsJdqYiWJ5E3tNwoeEVCoY2xmtrCoYT1IXAPjUwBP+UKQvs1zFNa06XEMiWsMnUtTlALgZWDlM1hWo28GbMfiUPvgdt/o7pfRflcM/cqANpekRiR1c1GDZum7sabObAKJGAiHtLqegHQC9DUL/UQuHsMQHtHGasfv6lruN/s+g4LNBZ8IJFEA+CQPYmvAjW3wuu8Em2BOLwXwZlFGfMPA9gYvg7ivh8mmQV+jMZCwMKS/nJW8SwW8HazdipRdLct7AJkj40MeOWg3QPwIrXSSc0ovjYScZv/py9VCo137HQyowz7J1BdefseFZXLWQTNmHRNUYHKOArrc1Ld3Tuhw9+iusRlGgUILvkENzEP00tfai71AkRVocwA0+urjxvsVO2au4HpYHBLzTXC5UGH9S7qA+0j8DO6I9fVCSn0La27FII/Qbem53DIga6BQMqMD2zzG2vQobkLxi4skm+av45lv9+w+7UIYVvifAu/74qdQWePGbEC300M0D1rtJrtekESHiIQhLqFk1c20F3oyQ/1MLh3NF2TCvWlpMoB11+RF/m885P9EFQfa2INC4bf0oSDykNB1c7ThJKog6qH/NiRykcxtxc2BiNWPBGQs03Gqy95X23pK3XS3Id6JoO1j/fb+rDEHXOWYCdF5p3D/MD/9Mrf9+0tmM5+43b29zk5/TG88Wc7/BuItg64CzAGDFRsPDYMwC4GPHTsRewpMoEvw7U5wNabW1NhdM5YstTBJvmeCl7EufAXYGheRUrgK3lAcnaBjUtvX7A1YCYrVzG4BI+Fs3u211IAOjITr3qxz1iQhYAzxcC97nqQcC/gNJ/ksGu21JMSvl4BgZhY+tDS2kbAZC/0+j2RmMSIBqxviUr8mBMw5m0irMJ0A6wqp4q7OS54rtv3SYfwE31V4hYBefEWo9yP7E3S6Ry/zAdvd68APdrcHzIBj1kQVNtfTmSN4Y1lvHcX/BxRMGVgizNziT1a+NL4f1ZGrBBLkAbTppStCqqHPLZhyPiDx3SKmtw205TO2WxMEQqkULr7vCn91BzmndvbHWFAu8GiSrgAZyZNMScbS5iAArlhrh5G4HedwL/wH2E6v+bbD1O455A4uBvlNoAUNKwqPsjk9+loTuhkiXwuigelze5UHCb/AJNKw2cc+G4CfE/Z0ZwVsDXSAOfr9R/gpL/ghGMJOL8BA2mOuKNInxFF6AW/7uErMW8sNkEBOBtXXXEbm30CCTJbxe6EOIbec+RTjqvdUflOP7AfgnkC8nhSIm3neEOmts61kCO/o2RP02eqWjJjzYn3A/WgFSoyAwj64gKr0H3nFCK7pZt2FDmwwcSqB3YBMgY3HXWDAoBqr9PHSGIeh/l/QZXZpL2wpO7AylAwZ87Pce3z6xUVvn4SNt0I8zpte4alIJpNWn8cjfSE4UKTvooupk8qPXRvFrmj6smvX17qSIX9baO7HYIjg6IqOvJIEg3tVQ9qyR25F2fx7JpzrMHwCdjgkYRexElPxR1RDICwMQssAVuoCZADE5CJ9ZJS8LV/rUdEFDlFhrI1yQ+/EEZmII9DDLO54bQvrj5cmbQPfa7cH/UOQXdKzucZ2IOklamgTnaRQuwQ/+x1PS39leFqUqIMbQ9x6YH8xs9TiGTviU6lvwehYNuM1i85I+gNg8DiEuTIIk2iOce93t0LQ0udyF6JpSw2dw9G1nJVmKfxT36xJryH6PzgQR9qRD1Mm5e37Mygzm/LbTyeGse9tUbxKBlqB2FtLmQgRT0XuwlEeSNxcWvzw98AE28vXwWr2FlIrAWsXu9Qf2Q3c/wgIo6RZJ5GQlejmceYZfebOaO8nDj/iTnf8s2C9IEEsxD0K57+JXP2Utf9NInQAnGuzKs458w4LXRbgQ9GaWxz4G11+LwAVYeMNM7iHu6gv4qVhtn2OYKeKRJRdJHF61unu1ms8j/2aR7OYTz6aWX1mXRDFnB7aepsLG4BHvkkwVYqa/DYsRNiB3CDPZ2q5Kr5L8oC6j5ULS3/jzu6tf88tQ1tTXmBhfdwgUwXDbbt33gD8woaq7sVQiLnSMXLTtZzY89fkny98x1N8pSu8ETpNAIhg/T8GIQvlae9NA9hx0Nc/krzNurU+PlTodk7+HO9MBugPzcYk8hFtQfN/X7klPxXMLqKf25wcIYKZhb/Htf+L1Uc18kw5jZOGML5c98ZDc5yHfzmVjvWqAh2URb7rTpwH7Z5Z+n7SJeCIdOVzgdwzy80P8Hd9okBHiZ/rd9S+Vrvw4zFlirKiTK6TcVpw1zP5HqVhBXt6RhPfu3IsNMMHfNPSZVSonE3UuRpsMiGM3OJSv93QnDntYsYtdGVuljAmJA47Bndeazv44WQHWORbVjGCIspejDdhnQEoI5OYlcXg5yt52/BHhWJF2Rgxn5H7RStg/JEAf9XnV5j1UAfm2Iy+qgJmEmxTPRFm9jxx0wK5FwlHNEHBPdTZ53Mfs/p00dG2Ren4MbqsBCHPX40CcaD98IfZyAX/LGkYN+CRygtyrER/0WGlb84sVrjlknK7HuCRx0us3BOkONLiBYUCABPNb+cChaP1nBEzlW6DhhQp4wS7EaP8jKzkYuZbKviVem6ZHQsCk7QpfziL22v/or/9J1/1wUns39AYhbg+CwWbwRuSzsQTe07J0eMfvMWHVtaiDsBwCaUJapcqMVu/+bgG9YOOvJ0rvKPZQBrhYhc4Z5hMKxupj1xvFyWmg1W5N56lDJHzoDx/cuAshRzC4RgMiLb4Q2pN8r9bnJc+XUvwe3YZ5fcMVHyusfcuXdpv27i51WA0lbuZsfK3s5de9lWW9zXCCmTWIWhI18QtJZ9RNj1RbAC/ACLbCUo/Cit3JZCjjtKR+f5zdBJtOH2uWGr47tDtauNpKbom3Vu6n4oxtJhFDmzaT2pc62ZPu0gKZ4cnId/Bp195CRRtJRKMX3+4KNbD9NDEARUw+Dj82NV0k8VggVL8EZM8rwKmwWWb4ZiA9mmtNR/6rbulcqybAyYcAajMrvmsCHZJlu0CItUtWhsU38uDA04ET8wqzujLFgSgRRzt+kXEaAKwDm59pL/0Y4byu6kKl7cTK+UR9vb7pvG1tF02qxaRg1uiHnx+g7wOFJdw86CMbIvQEdeeHfeLxFBSPJn5VXZvyXLVsJVZjFpf/G5N9TGEn4xIAIx1aZlnqNx48+fxpszhYt1rUyHKHyqS/reuRCO8KEKE/+p90d4cP7dOZGBZrAe4Q2Cr6VoWFGp7KU8jzB6QbTf++mX28Qt7b0RpHxG638hMdZDlOSXXCsLeIhHkEgDBnDc48xzage9HPIxbGocP0yslbVL0Ed92bnx3d/O9vKImgbfPx20LzQCP7f6r+b/H2tmDTlvc+6g0PHKeaeAe5lUU2I63NVlYI5Hba+5RBXfNRT+s/tQ4/PTEt6013TMhfYY1q4O1CPEUaPZSt/QOqj9rMG3KYH1yhRG/UXcb6yZcW8U+k+wPZPCgBlgpNu8Kf+VLERKyNT9vbszywFAMfMpx9lkOsgwtg4j67egVCDgb+ZEV+Y3qxbUuniUxWX3sxPzIPegZS/ka7kue5Y0IwTZu5WqyB9RSCfE3Uwk57704/vV7o8av3lyOVAoQ+jppahwoMNvpxOGpVqrkEMMvAXy4/1nLZ7CXbF+Kq4DobenxfVH8/pClZz8kcJjJSt/V/IWS/l38JjraIQDwVzDZtH9eDrv81QfiKDZ1jLt12E1ftzmRWhx30rpGsWMCynxugBxI8c3BRcxANJ0r34OFhMkV49Gt40u53T1vkZujkMataE3APzs1g0F8IXsmQDntQsdKFNf6iGH8VLQGmiW3JPBuidQduZTq7OqgW5JykjNnmiYjhbLj8+P7cqCWZYZRrkQTaRDf45QL5RUW9XKQDYn5MF6gY8ryV/nXW3qQrGXcQEKwbvgo4z6HJe/l20BOgwI4GgQJQVMNVFiLM3ZsX3olzj1B2we3+Guo/EO8csQZWY33MdXWPW08uYR5nM+10sH+4/+NzncE/GNbn6voapCiKV4hwCWxfwQ78q7g/B6aP81fbEJ+wCzml/1fZcKYdX5lgUa+LB/huzhEU6bsC/HuPnLhb8Wg6ni/HtV9Ygzwe4IyOGaVdivTDbEOW8wcpQLHx/7eC3Zi8sy8oXu5DhE+kw1u06LV7AqFiBTzxumkfMOCJAaDW1i2H8GXwYpRK1uBaofc2xGWoiG1SfQOZZd0xdeJz8d58GK/YijySB0J9Q+cPTWd/fav6mWhmSO8Q1NbxYhNAcb578XuSsC1uvGTGXkoqnwE2LrPE4WXsNmR+dr37NhPqTXwkhI99/qiruLWDhPRfke3BzfdO0Ym4QFzArH8aMPeu75kh1CseVwnsv8eZgrp91VD2VNU2J07EI+ZuhsZro1D0FpfMsrN9T7l9p9GKTy9r7nBy5t7G3PJk57ic3KRV0fbnLkfXYjF0cMEtFJzX6tUctEsk76FuiYm6EKzekXpHANhG2gts8KgF2qDT9Ady9p3FJLXcvD25D//CQrhEA4ctzFtu/O1u7KgeZ1Lgehq0AnjThaOUIIg7oyTm6DQFQGxYkfvTSD5z57MAe02y8MhnHbc3kWCVWgQS5KFidDa1hijkDgK9HylNiIkH7XUrO8mGx+CxPLJ6RBdr/s20MPBsaIkt9iU5tym3LEP0dJx732kMJwDPoVwVGRLds0r/XgQ5tHsywG8kAgXM0DB7PeFzbWyWa93IoiNSjCBLB+zoOu2+108JuNch6SnYLid74PzEj7llBoIHpx7hDqyxHrF/GasXOcNsJUiWOCPPptVgZcrbrM+/gYSTsRQGWXfwbi+2QpryYDX91ZRFe+c74jbKkPWQeYJdeasX+669/9kssmTPRZwQeXKLpE1E+wMyRDnkcUh+wZGLtPCR7U1wokVAtb7GMvgxlM9qyhlaafSIiZSV2vD+PkAeQIjhlvNRwBAevJgfJOo8qbpPQ2lV3ymUV1TQolwR8JBjKHETgw/91SRAJYKWvUwY46fq3dmcPUTKvlFYHq4cWmVrkV/zqAmy8WLPDahcp4/cpPwdQXMEimgoAXgeHsB/4wcD4WgpYL2kvse//ZIdm06Q86YrrHN/K2SfRJ33m8q3c8ZOC98HW3tg6JanGyYpF7dQgLGiKVfQ9BSfnsWrmyqiJkSrmImzcgVGKVKYrTVWN7tf6d09g6JtyFuSLqhgFsKE9Fy0wFs608u58BMfHhXUar/Ce5muvzisF6JoXe2fcbJTln4mpowiRCwa1bKE6YQTUT9l2z2PjQjcg7OFOC2z8RtLwKey7nwpOL7UIOmIcqMA0iv93CeLhhdhHK4m+WVcKc6sqRqPbXLI16EKsbTpOrc4BMRmvPYq2zwSQVf6zmEllfa8DyVodxwKuwDoOxBniJSY0GaSTDsOqaQq/TpWPIHx64a5xoLT7VUtdG8H8OA3t0HiED0CijKwqttKb740UfZbUfUqGDsNpefiSl7rr/f83Q50h3RzmP+FgiNLqYstIw1HsxCxO+NEcqIwD1RLyafv9PRS1ILpg6J3x9QLGncu4++SB34Fv9pKDJ2lVkflsOoIdszZhLGgK6yT3sT6qIAYAGSBuEik+gu6XOLEgRo4G9MPE8n3jPXHO7aczYZ1+58G+f9MLf5MHd1ldxDeLWLZJoN9pgofnfxs6YhJmWY95DHASjIJ7z4lgpx/SPVFkL0J+49CDoRHdmCHKHKzSLUtPev6OAMuUMQEEHouvSjVNk/k3u7co8aJ+6ADVeEupccQgcHC7UHvmhdNBOLdkMUixyPyK5y5ExMa1LU8oJ3sOnIx+RekN9rAOLaHYPY+Mg+Y7XM8dkgU5p0NAOF36Npi5F2nrS0C9fUadVLAZStsYtK4z94LmF/r8P5vHAT/Fou9Tm8cbjNGvPSpfGe9jhgGmhEpo965JlCczvY8rexaSSe7OVjwZnN2Ob0XkI0+vIwpbCs8lTFWA3WPBZ+j2YdrQXUIbCB4f3E+ES1oGFtWgKXRWKbVP8KnH6tCcoS3ie6H7TTq8e/HEl2l9buU/IptFZByo+5URfMLrQ3UGn29p2sMOyh5u9PYYuA+tOC9Dtsn0O61GrW8Vd1aH6ESfgC5Jg/P8EeGoNSrO1RuOKZ6QOKuKyDdGpj3XS1dR40xjXig7TSGmF9BUEK49IG27ZCocDx5yYHgIKBh8yjbftWO9QPkIibON4Mkgr6TQvea8SNccZVMwuqhXXh1GcPOknL/us4J3nxgC/7gSJD6ZPnuEYD5h5xabgNFEADolRV4z8cp5UeJB0vLK0bCTjKuGoBUQPwToZ9JDn5+w5NxIp4QtgLQBtgfDq1Oc+biHviY+Jm56YXtd9rtk2tlOP76Fb93EUwCcuET2W7HdYPAfxuz11rhA9bgJiSxErg86pGuTrrkL8nelqi1o1VcikcTFPFpXBsQkF9hrfTG5MedxuuME2ltj2r/X8zXK+ZOiW1l5EdKm0wYA6zzCzH/b+cGOyASKNKByGzhU+dk/DSiX2v6GbD0sUznKsJdgSIpDB5vsOUmpSXMKxhQJdBh2zQB9Uga2d7mF1i5Z8Pb/mg0GVkuNZFeFdf6/sQsRJ50cShX0xvFi14EdTAyK5xklct0uG9dU9Ly1BB7e4OdFA2kzjJ4+m4cGSTZsV7nWyCf6oBZWxqinVt+YsTvf6sQA1rUNjuKCtq0KP8EGoOrnXterJwiZH5WDOMJ9wiaTF4E1V6uuU/1KwyzJ+H1nMWLaG9MzrZDB0QJOUnUSxKEth9LU1tb7gYILPvJutypcbbUg/cb8KOPnEjRaCOkwJVQYECuiICK6u6V6FnMA4Qdf4LKiO9CPrEHjf0QCB60rN/YDmrSfSJweSDouFYaper4DVl9KMj8Qq4nhIkrzSCV1VtB8Pv6oXTxphryWz16RTVKqPbbKq9zbQasDtcKWRE9WvP3FNcsICp2kRWQCpSzS+z4+Er1rJgNglbTAWRqrATd8ElRNLkfMfFJWHPwNMPW7vUSOpc9im7UGfizlYOdvT787XWsxMF36s1xPyQov0uMDNuh7HVeyHWziyzKJnJFH1zyJG7twS5yiydQvr+9XtYK/mjNWUEdhgM3TJsWQEK3aaE+HqwUhLE1b65h42a1E3HMqoXuC4BzlnNuEIgryVdgYucd4NsTHd+tf+jBWV+6h6kT2CgOBmdI7gEfBrIYkOCO9tZGY+K770tcEjoG+l/rLT2tDByN06xhRUokM4Ltw8U/fNh/ydTjO4JddSFJ0n6Z9SMiz3lreKURYDM2Z+Szp9+zXvKr6SE29NRrJAGbmRjkSxi3sOErHFrB10tJ2uuT+/tem+j2qexl1P1B2DlgxMa8kS4WHKFWv0vqTQxY7YqnQN8jE+lmv3woeUknMmJciOh8HaLQ2A4uHN+oXYqBkyrckpNz2iLo5vZD/nuEEs/JWzZsCcp2U8YtsPcGQNdIOqvcZRD40+RjBs4WmDr7pU77XhyaIrC93dqsR+qa8BHQOWj4Bu7/Ha59bpCbhRoXY5nTHcgXGvNW2VGXpouirMtJDL3cggbY4AV6rYdtSbnCb2FR0Z3oEVYPa38SZH/o+79XTKl48AVc9BeBWAJbggJXJboVa3PUkSLquk/t1LtVD19MizUfx5LVJ+bJeSq5krVfq1glKB5TIifOV/Do4YI96WDkPPZoWbriIDEdfqy828yhXsnn3/Q6xwJvxVRu4ckHYGnN8zaBRAdlIQwaphWujvdJ4yQCnsPlge7wXDKQuPB5N5wTIyBk/4aw/x/R8SmxQAIM6p4hOxgaYEqGMRpnHcImrDOAMzoXe5VuTKeSPwTmd9FAoKsDOcbGwJsRslfufhCPDSOeWxn4MGty5kg1UIKiP9KtE0xsFPeMLKY0a93YsRVF6su0Tt99uEIYYhogYODAIeFhKqEoyScLyLpjtsnsKTisrwea2HklEPbCjoHgxYi/aPGvA4ZvW8U1dmnMPBgKzwPWT0KUDrRhLPZrT5vB4pMbfon/pNjubIqSAql2YwbQQ66PYVPKvacgMpbKeSS7HSboMBqsLqOFLRlY6bT9QfjaHB7bGfcHQrij1HeGzjphnmbYO359jhvWcLnotM4nsaKU84N3l6nyqRVAQ2K1lrzE659W4Y8ff/hhirkxkgauyvgHNf5Azu8xxk+geLrsjEjx7wK9Z5DodQgqFhp5dO0L4xmvV4M0Y0SFL0OEAVJhhZCKKOnUEM+8TXV/ijaeWGRfwFcNXeQQ4Y7jPytH+ZKzujr6KtApadQaVPlBtAUtg9thT+0kGoo/CvMwOHLTWLuQAvZKzCXc2eFg388gR0yblNUY5JXJ0oFq8N6Et7LKFG367qbWxTUnt3vgemDfAeCT3iMX9+ixihTYoJQGQduFd2K61cIwIDy42PwyyfBAlB69X7pGJWNsTubeIzIBLt1b4a6OQB8ptWFIGIquvVlHu0wqhWx6QJPCQW+8z2h0mDaBT+D9Wddq+oAV60yhIgprTSh7klj8n15U6kkIEZluuJjvLpLZU1QoduLnoIodg37XTJlN/Y0gfKIMzYFZ03d5Wt7iluXVifzY6pDCEoLJ9wOz5Hy6CR/+zuPZFZd4t60NpSxXp6rd3nWq2NfD+YRwSdCNRPK6Lu8LkjZpvlgn+wl0xjLLDD1ixtN0kEMsMAhr8NFsCh6wXAOvrUOc0oEDDrlq9fZH0o8qXnYcv+cXGJweDpW6T2+Lt5q9nFKfv5/JnuxsfcdFm4RMa+wwv/5WLaaPCuv93AxVUQE4R4hKhMQ0H+TkXrcoWciBXUUSWJatVI4SzzvRkzb5PRI+wBz2lOju72rUh1j7mdyWptDkPB/q48dgfBzSCRDyLK/iwy+4+Ndx/I5XmXXV5dlkcnObFaHFJvI5aKgJzGYQ6qpcZ4zooB37BkE9QnAQ5rfxPDVE0hJ2oN6rBryoUXU3OiuuHV/IygkyxwkqeK+YUcsBo5CdWKXw1IC1oZd3U4uKEx93sE1J80d0cKwYmHeqt4jBHVC3p84ObsRrrlbAlJtJcKYXRdj/HwATFUYLcKM1oAAAAABJRU5ErkJggg\x3d\x3d").then(function(b){a._noiseTexture=
- new t(a._rctx,{target:3553,pixelFormat:6408,dataType:5121,hasMipmap:!0,width:E,height:E},b);a._requestRender()})}else m.warn("SSAO is not supported for this browser or hardware")};a.prototype.disable=function(){this.getEnableState()&&(this._enabled=!1,this._quadVAO&&this._quadVAO.dispose(!0),this._noiseTexture&&this._noiseTexture.dispose(),this._blur1FBO.dispose(),this._blur0FBO.dispose(),this._ssaoFBO.dispose(),this._ssaoFBO=this._blur0FBO=this._blur1FBO=this._noiseTexture=this._quadVAO=null)};a.prototype.setAttenuation=
- function(a){this._attenuation=a};a.prototype.getAttenuation=function(){return this._attenuation};a.prototype.setRadius=function(a){this._radius=a};a.prototype.getRadius=function(){return this._radius};a.prototype.getFilterRadius=function(){return 4};a.prototype.setSamples=function(a){this._samples=a};a.prototype.getSamples=function(){return this._samples};a.prototype.computeSSAO=function(a,c,d,e){if(this._noiseTexture){k.assert(this.getEnableState());var g=this._rctx,f=d.width,l=d.height,m=f/this._BLUR_F,
- p=l/this._BLUR_F;this._ssaoFBO.resize(f,l);this._blur0FBO.resize(m,p);this._blur1FBO.resize(m,p);m=1*f;p=1*l;g.bindFramebuffer(this._ssaoFBO);x.set(a.fullViewport,this._viewportToRestore);g.setViewport(0,0,f,l);var n=this._programRep.get(8>=this._samples?"ssao8":16>=this._samples?"ssao16":32>=this._samples?"ssao32":"ssao64"),q=this._programRep.get("blur"),h=a.projectionMatrix;B[0]=-2/(m*h[0]);B[1]=-2/(p*h[5]);B[2]=(1-h[2])/h[0];B[3]=(1+h[6])/h[5];h=0===h[11];n.setUniform2f("rnmScale",f/E,l/E);n.setUniform3fv("pSphere",
- 8>=this._samples?z:16>=this._samples?C:32>=this._samples?A:D);g.bindProgram(n);n.setUniform1f("numSpiralTurns",this._samples<F.length?F[this._samples]:5779);n.setUniform4fv("projInfo",new Float32Array(B));f=1/a.computePixelSizeAtDist(1);n.setUniform1f("projScale",1*f);n.setUniform2f("screenDimensions",m,p);h?(n.setUniform2f("nearFar",a.near,a.far),n.setUniform2f("zScale",0,-1)):(n.setUniform2f("nearFar",a.near,a.far),n.setUniform2f("zScale",1,0));var t=2*this._radius,l=v.dist(a.eye,a.center),t=20*
- a.computePixelSizeAtDist(l),t=Math.max(.1,t);n.setUniform1f("radius",t);n.setUniform1f("intensity",4*this._attenuation/Math.pow(t,6));n.setUniform1i("rnm",0);n.setUniform1i("normalMap",1);n.setUniform1i("depthMap",2);g.bindTexture(this._noiseTexture,0);g.bindTexture(e.colorTexture,1);g.bindTexture(d.colorTexture,2);d=b.createQuadVAO(this._rctx);g.bindVAO(d);g.drawArrays(5,0,u.vertexCount(d,"geometry"));g.bindTexture(this._ssaoFBO.colorTexture,0);g.setViewport(0,0,m/this._BLUR_F,p/this._BLUR_F);g.bindFramebuffer(this._blur0FBO);
- q.setUniform2f("screenDimensions",m,p);q.setUniform1i("tex",0);q.setUniform1i("normalMap",1);q.setUniform1i("depthMap",2);q.setUniform2f("blurSize",0,1*this._BLUR_F/p);q.setUniform1i("radius",4);q.setUniform1f("g_BlurFalloff",.08);q.setUniform2f("nearFar",a.near,a.far);5E4<l&&(f=Math.max(0,f-(l-5E4)));q.setUniform1f("projScale",f);h?q.setUniform2f("zScale",0,-1):q.setUniform2f("zScale",1,0);g.drawArrays(5,0,u.vertexCount(d,"geometry"));q.setUniform2f("blurSize",1*this._BLUR_F/m,0);g.bindFramebuffer(this._blur1FBO);
- g.bindTexture(this._blur0FBO.colorTexture,0);g.drawArrays(5,0,u.vertexCount(d,"geometry"));g.bindFramebuffer(c);g.setViewport(this._viewportToRestore[0],this._viewportToRestore[1],this._viewportToRestore[2],this._viewportToRestore[3])}};a.prototype.setUniforms=function(a){var b=this.getEnableState()&&this._noiseTexture,c=this._rctx;c.bindTexture(b?this._blur1FBO.colorTexture:this._emptyTexture,6);c.setActiveTexture(0);a.setUniform1i("ssaoTex",6);b?a.setUniform4f("viewportPixelSz",this._viewportToRestore[0],
- this._viewportToRestore[1],1/this._ssaoFBO.width,1/this._ssaoFBO.height):a.setUniform4f("viewportPixelSz",-1,-1,-1,-1)};a.prototype.bindAll=function(a){a=a.getProgramsUsingUniform("viewportPixelSz");for(var b=0;b<a.length;b++)this.setUniforms(a[b])};a.prototype.drawQuad=function(a){k.assert(this.getEnableState());var b=this._programRep.get("showDepth");this._debugQuadVAO||(this._debugQuadVAO=new q(this._rctx,c.Default3D,{geometry:g.Pos2Tex},{geometry:l.createVertex(this._rctx,35044,I)}));var d=this._rctx;
- d.setDepthTestEnabled(!1);b.setUniformMatrix4fv("proj",new Float32Array(a));b.setUniform1i("depthTex",0);d.bindTexture(this._ssaoFBO.colorTexture,0);d.bindVAO(this._debugQuadVAO);d.drawArrays(5,0,u.vertexCount(this._debugQuadVAO,"geometry"));d.setDepthTestEnabled(!0)};a.loadShaders=function(a,b,d){k.assert(null==a.samples);a._parse(f);var e=new n(d,a.vertexShaderShowDepth,a.fragmentShaderShowDepth,c.Default3D),g=a.createFsSSAOSrcObscurance,l=new n(d,a.vsUVQuad,g,c.Default3D,{NUM_TAP_SAMPLES:"8"}),
- m=new n(d,a.vsUVQuad,g,c.Default3D,{NUM_TAP_SAMPLES:"16"}),p=new n(d,a.vsUVQuad,g,c.Default3D,{NUM_TAP_SAMPLES:"32"}),g=new n(d,a.vsUVQuad,g,c.Default3D,{NUM_TAP_SAMPLES:"64"});a=new n(d,a.vsUVQuad,a.fsBlurEdgeAware,c.Default3D,{RADIUS:(4).toString()});b.add("showDepth",e);b.add("ssao8",l);b.add("ssao16",m);b.add("ssao32",p);b.add("ssao64",g);b.add("blur",a)};return a}();var B=x.create(),z=new Float32Array([.186937,0,0,.677503,0,0,-.782832,.128424,.557187,.248064,.460317,-.659755,.062892,.918659,
- .312829,-.241031,-.814826,.224206,-.642866,.132138,-.45016,.145727,-.590568,-.626141,.005017,-.002234,.012668]),C=new Float32Array([.186937,0,0,.700542,0,0,-.864858,-.481795,-.111713,-.624773,.102853,-.730153,-.387172,.260319,.007229,-.222367,-.642631,-.707697,-.01336,-.014956,.169662,.122575,.1544,-.456944,-.177141,.85997,-.42346,-.131631,.814545,.524355,-.779469,.007991,.624833,.308092,.209288,.35969,.359331,-.184533,-.377458,.192633,-.482999,-.065284,.233538,.293706,-.055139,.417709,-.386701,.442449,
- -.301656,-.836426,.408344]),A=new Float32Array([.837372,0,0,.723531,-.467287,.034157,.169582,-.31169,-.881801,.696236,.455215,-.204568,-.304514,.528086,.626381,-.053116,.222507,.037523,.199755,.311291,.916799,-.681552,-.516264,.501792,-.37127,.021088,.737477,-.029503,.209188,-.95298,-.573731,.009962,-.154202,-.257345,-.905958,.282747,.370779,.527867,-.669424,-.601758,-.191278,-.708243,.271796,.782684,.535565,-.006867,-.015312,-.017276,.419958,.265628,.233036,-.543898,.554747,-.174055,-.079242,.053475,
- -.099539,.372042,-.339267,-.357362,.015781,-.011352,.042707,-.340564,-.272507,-.067725,.799249,-.127948,.586808,.450015,.01965,-.416454,-.506524,.323229,.206546,-.087316,-.311097,.466049,.146374,-.34528,-.045904,-.152614,-.926686,-.287529,-.665726,-.032904,.246643,.248703,.637193,-.062541,-.073706,.495925,-.315143,.05946,-.116042,.075586]),D=new Float32Array([.186937,0,0,.605726,-.313457,-.097616,.003541,.781245,.283011,-.225029,-.373279,.274442,-.047511,.04992,-.226365,.627629,-.623617,-.463628,
- .133094,-.318299,.528128,.262035,.100234,-.09012,.178335,-.426972,-.666048,-.27306,-.207352,.05514,-.613649,-.063395,.060608,-.283391,-.41382,-.087565,.136768,.506126,.484137,-.593808,-.344603,.453164,.675326,.124799,-.697865,-.33502,.411337,-.09337,-.15271,.002908,-.063582,.366733,-.699739,.401148,-.519536,-.585625,-.508413,.106482,-.428709,-.260221,.012847,-.118806,.016962,-.188182,.49945,.452364,.586617,.722539,-.23302,.111295,.202827,.066695,-.036503,.315842,.896467,-.039109,-.270116,-.080062,
- .613435,.508787,.538656,-.352275,.566869,-.666275,.887876,-.138341,-.434135,-.444711,.269156,.119506,-.029457,-.077316,.754474,.274125,-.13876,-.37082,-.73268,.332723,.568545,-.203992,.878922,-.430778,.541154,-.546752,.11786,-3.93E-4,-.083318,.059333,-.341406,-.117017,-.318568,-.262425,-.457913,.848753,.89229,-.30157,.322416,.742328,.032262,.643827,.048091,-.078044,-.49908,.064858,.549944,-.796252,-.230688,.88978,-.010153,.397241,-.27645,.405666,-.46593,.131187,-.600166,.333834,-.078219,.73837,-.870169,
- -.411658,-.222175,-.492421,.741454,.293757,-.591244,.389112,-.388324,.792346,.578552,.088459,-.121858,-.437241,-.472535,-.374835,.302427,.721264,.057485,.204085,-.126575,.510325,.481492,-.579888,-.29411,-.82136,.156404,-.819717,-.042466,.456573,.079884,.07019,.179002,.220279,.970222,-.088025,-.299911,-.234627,-.820794,.912112,.243306,.317869,.241336,.161841,-.721568,.301135,-.635993,-.0939,-.514731,-.089673,.850964,-.905087,.314604,-.098397]),E=64,F=[1,1,1,2,3,2,5,2,3,2,3,3,5,5,3,4,7,5,5,7,9,8,5,
- 5,7,7,7,8,5,8,11,12,7,10,13,8,11,8,7,14,11,11,13,12,13,19,17,13,11,18,19,11,11,14,17,21,15,16,17,18,13,17,11,17,19,18,25,18,19,19,29,21,19,27,31,29,21,18,17,29,31,31,23,18,25,26,25,23,19,34,19,27,21,25,39,29,17,21,27,29],I=new Float32Array([0,0,0,0,512,0,1,0,0,512,0,1,512,512,1,1]);return r})},"esri/views/3d/webgl-engine/lib/TextureRenderer":function(){define("require exports ../../support/debugFlags ./Camera ./ComponentUtils ./DefaultVertexBufferLayouts ./gl-matrix ./glUtil3D ./HighlightUtils ./Renderer ./RenderPass ./Util ../lighting/Lightsources ../materials/internal/TexOnlyGLMaterial ../../../webgl/FramebufferObject ../../../webgl/Texture ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){var x=g.vec3d,m=g.vec4d,B=g.mat4d;r=function(){function a(a,b,c,d,e,g){var f=this;this._acquiredTextures={};this._clearColor=m.createFrom(0,0,0,0);this._id2origin={};this._uniqueIdx=0;this._rctx=a;this._canvas=b;this._programRep=c;this._textureRep=e;this._modelDirtySet=g;this._renderer=new k(c,d,e,this._rctx,!0);this._renderer.onHasHighlightsChanged=function(a){if(f.onHasHighlightsChanged)f.onHasHighlightsChanged(a)};this._renderer.setLighting({lights:[new n.AmbientLight(x.createFrom(1,
- 1,1))],groundLightingFactor:1,globalFactor:0})}a.prototype.dispose=function(){for(var a in this._acquiredTextures)this._acquiredTextures[a].fbo.dispose(),this._textureRep.release(a);this._acquiredTextures=null;this._renderer.dispose();this._renderer=null};a.prototype.addRenderGeometries=function(a){var b=this;a.forEach(function(a){null==a.origin&&(a.origin=b.getOrigin(a.center,a.bsRadius));a.idx=b._uniqueIdx++});this._renderer.modify(a,[])};a.prototype.removeRenderGeometries=function(a){this._renderer.modify([],
- a)};a.prototype.updateRenderGeometries=function(a,b){a=a.map(function(a){return{renderGeometry:a,updateType:b}});this._renderer.modify([],[],a,{})};a.prototype.updateRenderOrder=function(a){0<Object.keys(a).length&&this._renderer.modifyRenderOrder(a)};a.prototype.setBackgroundColor=function(a){this._clearColor=a};a.prototype.addRenderGeometryHighlight=function(a,c){var d=a.instanceParameters,g=b.generateHighlightId();d.componentHighlights=e.addHighlight(d.componentHighlights,null,c,g);this.updateRenderGeometries([a],
- 32);return g};a.prototype.removeRenderGeometryHighlight=function(a,b){var c=a.instanceParameters;c.componentHighlights=e.removeHighlight(c.componentHighlights,b);this.updateRenderGeometries([a],32)};a.prototype.isEmpty=function(){return this._renderer.isEmpty()};a.prototype.processDirtyMaterials=function(){var a=this._modelDirtySet.getDirtyMaterials();a&&this._renderer.modify([],[],[],a);this._modelDirtySet.clearDirtyMaterials()};Object.defineProperty(a.prototype,"hasHighlights",{get:function(){return this._renderer.hasHighlights},
- enumerable:!0,configurable:!0});a.prototype.draw=function(a,b){return this.drawPass(l.MATERIAL,a,b)};a.prototype.drawHighlights=function(a,b){return this.drawPass(l.MATERIAL_HIGHLIGHT,a,b)};a.prototype.drawPass=function(a,b,c){if(this.isEmpty()&&!f.OVERLAY_DRAW_TEST_TEXTURE)return!1;this.processDirtyMaterials();if(a===l.MATERIAL_HIGHLIGHT&&!this.hasHighlights||!c.views.some(function(a){return a.extent[0]!==a.extent[2]&&a.extent[1]!==a.extent[3]}))return!1;var d=b.id,e,g=this._rctx,k=g.gl;if(this._acquiredTextures[d])e=
- this._acquiredTextures[d].fbo;else{e=this._textureRep.aquire(d).getGLTexture();e=u.createWithAttachments(this._rctx,e,{colorTarget:0,depthStencilTarget:0});var m=Object.keys(this._acquiredTextures).length;this._acquiredTextures[d]={texture:b,fbo:e,idx:m}}b=c.width;m=c.height;if(e.width!==b||e.height!==m)e.resize(b,m),e.colorTexture.setSamplingMode(9729);C.near=1;C.far=1E4;g.bindFramebuffer(e);g.setDepthTestEnabled(!1);g.setBlendFunctionSeparate(770,771,1,771);g.setClearColor.apply(g,this._clearColor);
- g.clear(k.COLOR_BUFFER_BIT);this._renderer.setPixelRatio(c.pixelRatio||1);for(k=0;k<c.views.length;k++)e=c.views[k],C.viewport=e.viewport,B.ortho(0,e.extent[2]-e.extent[0],0,e.extent[3]-e.extent[1],C.near,C.far,C.projectionMatrix),B.identity(C.viewMatrix),B.translate(C.viewMatrix,[-e.extent[0],-e.extent[1],0]),C.setGLViewport(this._rctx),f.OVERLAY_DRAW_TEST_TEXTURE&&this._drawTestTexture(b,m,z[this._acquiredTextures[d].idx%z.length]),this._renderer.renderGeometryPass(a,C);g.setDepthTestEnabled(!0);
- g.setBlendFunctionSeparate(770,771,1,771);g.bindFramebuffer(null);g.setViewport(0,0,this._canvas.width,this._canvas.height);return!0};a.prototype._drawTestTexture=function(a,b,e){var g=this._rctx,f=g.gl;if(!this._testPatternMat){for(var k=new Uint8Array(a*b*4),l=0,m=0;m<b;m++)for(var p=0;p<a;p++){var n=Math.floor(p/10),h=Math.floor(m/10);2>n||2>h||10*n>a-20||10*h>b-20?(k[l++]=255,k[l++]=255,k[l++]=255,k[l++]=255):(k[l++]=255,k[l++]=255,k[l++]=255,n&1&&h&1?k[l++]=p&1^m&1?0:255:k[l++]=n&1^h&1?0:128)}a=
- new q(g,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:a,height:b},k);this._testPatternMat=new t(this._programRep,a,[1,1,1,1],!0,f.ALWAYS);this._testPatternBindParams={proj:B.identity(),view:B.identity(),nearFar:[-1,1],origin:[0,0,0],viewInvTransp:null,viewport:null,lightingData:null,fovY:0};this._quadVAO=d.createQuadVAO(g,c.Pos3Tex)}this._testPatternMat.setColor([e[0],e[1],e[2],1]);this._testPatternMat.bind(g,this._testPatternBindParams);this._testPatternMat.bindView(g,this._testPatternBindParams);
- g.bindVAO(this._quadVAO);g.drawArrays(5,0,v.vertexCount(this._quadVAO,"geometry"));this._testPatternMat.release(g)};a.prototype.getOrigin=function(a,b){var c=0;b=10*b/1E4;1<b&&(c=Math.ceil(p.logWithBase(b,2)));b=1E4*Math.pow(2,c);var d=Math.round(a[0]/b),e=Math.round(a[1]/b);a=Math.round(a[2]/b);var c=c+"_"+d+"_"+e+"_"+a,g=this._id2origin[c];null==g&&(g={vec3:x.createFrom(d*b,e*b,a*b),id:c},this._id2origin[c]=g);return g};return a}();var z=[[1,.5,.5],[.5,.5,1],[.5,1,.5]],C=new a;return r})},"esri/views/3d/webgl-engine/lib/Renderer":function(){define("require exports ./ComponentUtils ./DefaultVertexAttributeLocations ./ExternalRendererContainer ./Float32ArrayList ./FxaaRenderPass ./gl-matrix ./HighlightTextureHelper ./InstanceBufferData ./IntervalUtilities ./LinearDepthTextureHelper ./NormalTextureHelper ./RenderContext ./RenderPass ./RenderSlot ./SmaaRenderPass ./StencilRenderingHelper ./Util ./edgeRendering/EdgeView ../lighting/SceneLighting ../materials/HUDMaterial ../../../webgl/BufferObject ../../../webgl/Profiling ../../../webgl/Texture ../../../webgl/Util ../../../webgl/VertexArrayObject".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I){function P(a){return a.instanceParameters.hidden?[]:f.generateVisibleIndexRanges(a.instanceParameters.componentVisibilities,a.componentOffsets)}function G(a,b,c){var d=a.origin.vec3;S(V,-d[0],-d[1],-d[2]);R.multiply(V,a.transformation,b);R.inverse(b,c);R.transpose(c)}function M(a,b,c){for(var d in a){var e=a[d];b(d,e);for(var g in e.origin2data)c(g,e.origin2data[g])}}function H(a){return!1===a.preinterleaved?N(a.indices).length:a.indexCount}
- var J=m.assert,O=m.objectEmpty,N=m.getFirstObjectValue,S=m.setMatrixTranslation3;r=d.vec2d;var R=d.mat4d,Y=R.identity();d=function(){function d(a,c,d,f,k){this._lighting=new z.SceneLighting;this._mat2DataMerged={};this._mat2DataInstanced={};this._mat2DataPreinterleaved={};this._renderOrder=[];this._externalRenderers=new e;this._renderContext=new t;this._isRendering=!1;this._highlights=[];this._pixelRatio=1;this._threshold=1535;this._needsRender=!0;this._fallbackDepthStencilTexture=null;this._stats=
- new X;this._edgeView=void 0;this.ssaoEnabled=!1;this.renderOptions={antialiasing:"smaa",earlyOcclusionPixelDraw:!1};this._programRep=a;this._materialRep=c;this._orderedRendering=k;this._rctx=f;this._fxaaPass=new g(f);this._smaaPass=new v(f);this._renderContext.lightingData=this._lighting.getOld();f.setDepthTestEnabled(!0);f.setFaceCullingEnabled(!0);f.setBlendingEnabled(!1);f.setBlendFunctionSeparate(770,771,1,771);this._bindParameters={view:null,proj:null,viewInvTransp:null,fovY:0,nearFar:null,lightingData:null,
- viewport:null,framebufferTex:null,shadowMappingEnabled:!1,ssaoEnabled:!1,origin:null,pixelRatio:null,instanceParameters:null,depthFBO:null,normalFBO:null};this._linearDepthTextureHelper=new p(f);this._normalTextureHelper=new n(f);this._highlightTextureHelper=new b(f);this._stencilRenderingHelper=new x(f);this._initializeFramebufferTexture()}d.prototype._initializeFramebufferTexture=function(){var a=this._rctx.gl,a=this._rctx.contextAttributes.alpha?a.RGBA:a.RGB,b=new E(this._rctx,{target:3553,pixelFormat:a,
- dataType:5121,samplingMode:9728,wrapMode:33071,width:4,height:4});this._framebuffer={format:a,texture:b}};d.prototype.dispose=function(){var a=this,b=function(b){a._releaseMaterials(b)},c=function(a,b){if(b.type===K.Preinterleaved)for(var c in b.instances)b.instances[c].vao.dispose(!0);else b.vao.dispose(!0)};M(this._mat2DataMerged,b,c);M(this._mat2DataInstanced,b,c);M(this._mat2DataPreinterleaved,b,c);this._mat2DataPreinterleaved=this._mat2DataInstanced=this._mat2DataMerged=null;this._framebuffer.texture.dispose();
- this._framebuffer.texture=null;this._linearDepthTextureHelper.getEnableState()&&this._linearDepthTextureHelper.disable();this._normalTextureHelper.getEnableState()&&this._normalTextureHelper.disable();this._highlightTextureHelper.getEnableState()&&this._highlightTextureHelper.setEnableState(!1);this._stencilRenderingHelper.getEnableState()&&this._stencilRenderingHelper.setEnableState(!1);this._fallbackDepthStencilTexture&&(this._fallbackDepthStencilTexture.dispose(),this._fallbackDepthStencilTexture=
- null)};Object.defineProperty(d.prototype,"isLoadingResources",{get:function(){return"smaa"===this.renderOptions.antialiasing&&this._smaaPass.isLoadingResources},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"edgeView",{get:function(){void 0===this._edgeView&&(this._edgeView=B.EdgeView.isSupported(this._rctx)?new B.EdgeView(this._rctx,this._programRep):null);return this._edgeView},enumerable:!0,configurable:!0});d.prototype.setLighting=function(a){this._lighting.set(a)};d.prototype.setPixelRatio=
- function(a){this._pixelRatio=a;this._needsRender=!0};d.prototype.getPixelRatio=function(){return this._pixelRatio};d.prototype.addExternalRenderer=function(a,b){this._externalRenderers.addRenderer(a,b);return!0};d.prototype.removeExternalRenderer=function(a){this._externalRenderers.removeRenderer(a);return!0};d.prototype.getExternalRenderers=function(){return this._externalRenderers};d.prototype.resetNeedsRender=function(){this._needsRender=!1;this._externalRenderers.resetNeedsRender()};d.prototype.needsRender=
- function(){return this._needsRender||this._externalRenderers.needsRender()};d.prototype.getCombinedStats=function(){var a=this;this._stats.VBOallocatedSize=0;this._stats.VBOoptimalSize=0;this._stats.VBOusedSize=0;var b=function(){},c=function(b,c){if(c.type===K.Preinterleaved)for(var d in c.instances)b=c.instances[d].vao.size,a._stats.VBOallocatedSize+=b/4,a._stats.VBOusedSize+=b/4,a._stats.VBOoptimalSize+=b/4;else a._stats.VBOallocatedSize+=c.buffer.getArray().length,a._stats.VBOusedSize+=c.buffer.getSize(),
- a._stats.VBOoptimalSize+=c.optimalCount};M(this._mat2DataMerged,b,c);M(this._mat2DataInstanced,b,c);M(this._mat2DataPreinterleaved,b,c);this._stats.VBOallocatedSize*=.00390625;this._stats.VBOusedSize*=.00390625;this._stats.VBOoptimalSize*=.00390625;return this._stats};d.prototype._addHighlight=function(a){var b=this._getInstance(a);if(null===b)console.error("No instance found for RenderGeometry {name: '"+a.name+"', uniqueName: '"+a.uniqueName+"'}");else if(this._highlights.push(b),this._orderedRendering&&
- this._sortHighlightsByRenderOrder(),this._needsRender=!0,this.onHasHighlightsChanged)this.onHasHighlightsChanged(this.hasHighlights)};d.prototype._removeHighlight=function(a){var b=this._highlights.length;this._highlights=this._highlights.filter(function(b){return b.uniqueName!==a.uniqueName});if(b!==this._highlights.length){if(this.onHasHighlightsChanged)this.onHasHighlightsChanged(this.hasHighlights);this._needsRender=!0}};Object.defineProperty(d.prototype,"hasHighlights",{get:function(){return 0<
- this._highlights.length},enumerable:!0,configurable:!0});d.prototype._renderHUDVisibility=function(a){var b=this,c=C.shouldRenderVisibilityDuringRenderPass(a.pass),d=a.offscreenRenderingHelper&&a.offscreenRenderingHelper.getEnableState();c&&d&&a.offscreenRenderingHelper.renderHUDVisibility(function(){b._renderInternalSlot(q.OCCLUSION_PIXELS,a)})};d.prototype.renderGeometrySlotsPt1=function(a){this._externalRenderers.render(q.INTERNAL_MATERIAL,a);this._renderInternalSlot(q.STENCIL_MATERIAL,a);this._externalRenderers.render(q.OPAQUE_TERRAIN,
- a);this._renderInternalSlot(q.OPAQUE_MATERIAL,a);this._externalRenderers.render(q.OPAQUE_EXTERNAL,a);a.ssaoHelper&&a.ssaoHelper.bindAll(this._programRep);this._externalRenderers.render(q.POSTPROCESSING_ATMOSPHERE_OPAQUE,this._renderContext);this._renderInternalSlot(q.TRANSPARENT_MATERIAL,a);this.renderOptions.earlyOcclusionPixelDraw&&(this._renderHUDVisibility(a),this._renderInternalSlot(q.LINE_CALLOUTS,this._renderContext));this._externalRenderers.render(q.TRANSPARENT_EXTERNAL,a);a.ssaoHelper&&a.ssaoHelper.bindAll(this._programRep)};
- d.prototype.renderGeometrySlotsPt2=function(a){this._externalRenderers.render(q.TRANSPARENT_TERRAIN,a)};d.prototype.renderGeometrySlots=function(a){this.renderGeometrySlotsPt1(a);this.renderGeometrySlotsPt2(a)};d.prototype._renderHighlights=function(a,b,c){var d=!!c&&c.getEnableState()&&(this.hasHighlights||this._externalRenderers.needsHighlight());this._highlightTextureHelper.setEnableState(d);if(d){d=null;c.profilingCallback&&(d=D.startMeasurement(this._renderContext.rctx));this._highlightTextureHelper.setupFBOs(a);
- this._highlightTextureHelper.prepareHighlightPass();this.renderGeometryPass(u.MATERIAL_HIGHLIGHT,a,null,null);this._rctx.clear(this._rctx.gl.DEPTH_BUFFER_BIT);this._renderInternalSlot(q.LINE_CALLOUTS_HUD_DEPTH,this._renderContext);this._renderInternalSlot(q.HUDMATERIAL1,this._renderContext);this._renderInternalSlot(q.HUDMATERIAL2,this._renderContext);this._highlightTextureHelper.finish(b);var e=this._highlightTextureHelper.getHighlightFBO();c.render(a,b,e);null!==d&&c.profilingCallback&&d.stop(function(a){c.profilingCallback&&
- c.profilingCallback(a)})}};d.prototype._needsRenderOccluded=function(a){for(var b in this._mat2DataInstanced){var c=this._mat2DataInstanced[b][0];if(c&&c.renderOccluded&&c.beginSlot(a)&&c.isVisible())return!0}return!1};d.prototype._renderOccluded=function(a,b,c){if(b&&c&&c.getEnableState()){var d=this._needsRenderOccluded(q.OPAQUE_MATERIAL)||this._needsRenderOccluded(q.TRANSPARENT_MATERIAL);d!==b.getEnableState()&&b.setEnableState(d);d&&(d=this._renderContext,b.setupFBOs(a),b.prepareColorPass(),d.pass=
- u.MATERIAL,d.renderOccludedOnly=!0,this._renderInternalSlot(q.OPAQUE_MATERIAL,d),this._renderInternalSlot(q.TRANSPARENT_MATERIAL,d),d.renderOccludedOnly=!1,b.finish(c.getFramebuffer()),b.apply())}};d.prototype._renderUnordered=function(a,b,c,d){var e=this,g=this._rctx;this._isRendering=!0;this._stats.reset();this._updateGlobalUniforms(a.projectionMatrix);this._renderContext.pass=u.MATERIAL;this._renderContext.camera=a;this._renderContext.shadowMap=b;this._renderContext.ssaoHelper=d.ssao;this._renderContext.offscreenRenderingHelper=
- d.offscreenRendering;this._renderContext.stencilRenderingHelper=this._stencilRenderingHelper;this._renderContext.depth=this._linearDepthTextureHelper.getDepthFBO();this._renderContext.normals=this._normalTextureHelper.getNormalFBO();this._renderContext.highlight=this._highlightTextureHelper.getHighlightFBO();this._renderContext.options=this.renderOptions;this._renderContext.rctx=this._rctx;this._renderContext.lightingData=this._lighting.getOld();d.offscreenRendering.setEnableState(!0);d.offscreenRendering.initializeFrame(a);
- this._externalRenderers.render(q.BACKGROUND,this._renderContext);this.renderGeometrySlotsPt1(this._renderContext);this._edgeView&&(b=null,this._edgeView.profilingCallback&&(b=D.startMeasurement(this._renderContext.rctx)),d.offscreenRendering.renderSeparateAndComposite(function(){e._edgeView.render(a,e._bindParameters)},void 0,this._edgeView.compositingMode),b&&b.stop(function(a){e._edgeView&&e._edgeView.profilingCallback&&e._edgeView.profilingCallback(a)}));this.renderGeometrySlotsPt2(this._renderContext);
- this._externalRenderers.render(q.POSTPROCESSING_ATMOSPHERE_TRANSPARENT,this._renderContext);this._externalRenderers.render(q.POSTPROCESSING_EXTERNAL,this._renderContext);this.renderOptions.earlyOcclusionPixelDraw||(this._renderHUDVisibility(this._renderContext),this._renderInternalSlot(q.LINE_CALLOUTS,this._renderContext));this._renderOccluded(a,d.renderOccluded,d.offscreenRendering);b=this.renderOptions.antialiasing;"smaa"===b&&this._smaaPass.loadResources(function(){e._needsRender=!0});"smaa"===
- b&&this._smaaPass.enable()?(this._fxaaPass.disable(),this._smaaPass.render({colorTexture:d.offscreenRendering.getColorTexture()},null)):"fxaa"===b&&this._fxaaPass.enable()?(this._smaaPass.disable(),this._fxaaPass.render({colorTexture:d.offscreenRendering.getColorTexture()},null)):(d.offscreenRendering.composite(),this._fxaaPass.disable(),this._smaaPass.disable());g.bindFramebuffer(null);this._renderContext.framebufferTex=d.offscreenRendering.getColorTexture();this._renderInternalSlot(q.LINE_CALLOUTS_HUD_DEPTH,
- this._renderContext);this._renderInternalSlot(q.HUDMATERIAL1,this._renderContext);this._renderInternalSlot(q.HUDMATERIAL2,this._renderContext);this._renderHighlights(a,c,d.highlight);this._isRendering=!1};d.prototype._renderGeometryPassOrderedHighlight=function(a){this._renderInternalHighlights(this._highlights)};d.prototype._renderGeometryPassOrderedMaterial=function(a){for(var b=null,c=0;c<this._renderOrder.length;c++){var d=this._renderOrder[c][1];if(d.instanced){var e=d.instanced||d.merged,g=
- e[a.pass];g&&g.isVisible()&&(this._renderInternalInstanced(e,g,this._bindParameters,Infinity),b=null)}d.merged&&(e=d.merged,(g=e[a.pass])&&g.isVisible()&&(d=g.getProgram(),d!==b&&(d.setUniformMatrix4fv("model",Y),d.hasUniform("modelNormal")&&d.setUniformMatrix4fv("modelNormal",Y)),b=d,this._renderInternalMerged(e,g,this._bindParameters,Infinity)))}};d.prototype._renderGeometryPassOrdered=function(a){var b=a.camera;this._bindParameters.view=b.viewMatrix;this._bindParameters.proj=b.projectionMatrix;
- this._bindParameters.viewInvTransp=b.viewInverseTransposeMatrix;L[0]=b.near;L[1]=b.far;this._bindParameters.nearFar=L;this._bindParameters.lightingData=this._lighting.getOld();this._bindParameters.viewport=b.fullViewport;this._bindParameters.framebufferTex=this._framebuffer.texture;this._bindParameters.pixelRatio=this._pixelRatio;this._bindParameters.instanceParameters=void 0;this._bindParameters.depthFBO=this._linearDepthTextureHelper.getDepthFBO();this._bindParameters.normalFBO=this._normalTextureHelper.getNormalFBO();
- a.isHighlightPass?this._renderGeometryPassOrderedHighlight(a):this._renderGeometryPassOrderedMaterial(a)};d.prototype._renderOrdered=function(a,b){this._stats.reset();this.renderGeometryPass(a,b)};d.prototype.render=function(a,b,c){this._orderedRendering?this._renderOrdered(u.MATERIAL,a):this._renderUnordered(a,c.shadowMap,b,c)};d.prototype.renderAuxiliaryBuffers=function(a,b,c){var d=c.ssao;c=c.shadowMap;var e=this.ssaoEnabled||this._externalRenderers.needsLinearDepth();this._linearDepthTextureHelper.setEnableState(e);
- e&&(this._linearDepthTextureHelper.setupFBOs(a),this._linearDepthTextureHelper.prepareDepthPass(),this.renderGeometryPass(u.MATERIAL_DEPTH,a,c,d),this._linearDepthTextureHelper.finish(b));this._normalTextureHelper.setEnableState(this.ssaoEnabled);this.ssaoEnabled&&(this._normalTextureHelper.setupFBOs(a),this._normalTextureHelper.prepareNormalPass(),this.renderGeometryPass(u.MATERIAL_NORMAL,a,c,d),this._normalTextureHelper.finish(b));this.ssaoEnabled&&d.computeSSAO(a,b,this._linearDepthTextureHelper.getDepthFBO(),
- this._normalTextureHelper.getNormalFBO());d.bindAll(this._programRep)};d.prototype.renderGeometryPass=function(a,b,c,d){this._isRendering=!0;this._updateGlobalUniforms(b.projectionMatrix);this._renderContext.pass=a;this._renderContext.camera=b;this._renderContext.shadowMap=c;this._renderContext.ssaoHelper=d;this._renderContext.depth=this._linearDepthTextureHelper.getDepthFBO();this._renderContext.normals=this._normalTextureHelper.getNormalFBO();this._renderContext.rctx=this._rctx;this._orderedRendering?
- this._renderGeometryPassOrdered(this._renderContext):this._renderGeometryPassUnordered(this._renderContext);this._isRendering=!1};d.prototype._renderGeometryPassUnordered=function(a){this.renderGeometrySlots(a)};d.prototype._renderInternalHighlights=function(a,b){void 0===b&&(b=null);for(var c=0;c<a.length;++c){var d=a[c],e=d.matData[u.MATERIAL_HIGHLIGHT];e&&(null===b||e.beginSlot(b))&&e.isVisible()&&this._renderInternalHighlight(d,this._bindParameters,u.MATERIAL_HIGHLIGHT)}};d.prototype._renderInternalSlotOccluded=
- function(a,b){for(var c in this._mat2DataInstanced){var d=this._mat2DataInstanced[c],e=d[b.pass];e&&e.renderOccluded&&e.beginSlot(a)&&e.isVisible()&&this._renderInternalInstanced(d,e,this._bindParameters,a)}};d.prototype._renderInternalSlotMaterial=function(a,b){for(var c in this._mat2DataInstanced){var d=this._mat2DataInstanced[c],e=d[b.pass];e&&e.beginSlot(a)&&e.isVisible()&&this._renderInternalInstanced(d,e,this._bindParameters,a)}for(var d=this._programRep.getProgramsUsingUniform("model"),e=this._programRep.getProgramsUsingUniform("modelNormal"),
- g=0;g<d.length;g++){var f=d[g];f.setUniformMatrix4fv("model",Y);-1<e.indexOf(f)&&f.setUniformMatrix4fv("modelNormal",Y)}for(c in this._mat2DataMerged)d=this._mat2DataMerged[c],(e=d[b.pass])&&e.beginSlot(a)&&e.isVisible()&&this._renderInternalMerged(d,e,this._bindParameters,a);for(c in this._mat2DataPreinterleaved)d=this._mat2DataPreinterleaved[c],(e=d[b.pass])&&e.beginSlot(a)&&e.isVisible()&&this._renderInternalPreinterleaved(d,e,this._bindParameters,a);a===q.STENCIL_MATERIAL&&this._stencilRenderingHelper.finish()};
- d.prototype._renderInternalSlotHighlights=function(a,b){this._renderInternalHighlights(this._highlights,a)};d.prototype._renderInternalSlot=function(a,b){this._bindParameters.view=b.camera.viewMatrix;this._bindParameters.proj=b.camera.projectionMatrix;this._bindParameters.viewInvTransp=b.camera.viewInverseTransposeMatrix;this._bindParameters.cameraAboveGround=b.camera.aboveGround;this._bindParameters.fovY=b.camera.fovY;this._bindParameters.poiDistance=b.camera.distance;L[0]=b.camera.near;L[1]=b.camera.far;
- var c=this._renderContext.offscreenRenderingHelper;this._bindParameters.nearFar=L;this._bindParameters.lightingData=this._lighting.getOld();this._bindParameters.viewport=b.camera.fullViewport;this._bindParameters.framebufferTex=c?c.getColorTexture():null;this._bindParameters.shadowMap=b.shadowMap;this._bindParameters.shadowMappingEnabled=!!b.shadowMap&&b.shadowMap.getEnableState();this._bindParameters.ssaoEnabled=!!b.ssaoHelper&&b.ssaoHelper.getEnableState();this._bindParameters.pixelRatio=this._pixelRatio;
- this._bindParameters.instanceParameters=void 0;this._bindParameters.depthFBO=this._linearDepthTextureHelper.getDepthFBO();this._bindParameters.hudVisibilityTexture=c?c.getHUDVisibilityTexture():null;b.isHighlightPass?this._renderInternalSlotHighlights(a,b):b.renderOccludedOnly?this._renderInternalSlotOccluded(a,b):this._renderInternalSlotMaterial(a,b)};d.prototype._renderInternalInstanced=function(a,b,c,d){var e=this._rctx,g=e.gl,f=!1,k=b.getDrawMode(e),l=e.capabilities.instancing,m;for(m in a.origin2data){var p=
- a.origin2data[m];c.origin=p.origin;d===q.STENCIL_MATERIAL&&(this._stencilRenderingHelper.setEnableState(!0),this._stencilRenderingHelper.prepareStencilWritePass());var n=!1;if(b.instanced)for(var h in p.perGeometryDataInfo){var t=p.perGeometryDataInfo[h];f||(b.bind(e,c),f=!0);e.bindVAO(t.vao);var u=b.getProgram();F.assertCompatibleVertexAttributeLocations(t.vao,u);n||(b.bindView(e,c),n=!0);var u=t.to-t.from,v=t.refCount;k===g.TRIANGLES&&(this._stats.trianglesRendered+=v*u/3);l.drawArraysInstanced(k,
- t.from,u,v);this._stats.drawCallsAngleInstanced++;this._stats.instancesDrawnAngle+=v}else{var t=p.instances,z;for(z in t)u=t[z],v=u.displayedIndexRange,v&&0===v.length||(f||(b.bind(e,c),f=!0),n||(e.bindVAO(p.vao),b.bindView(e,c),n=!0),b.bindInstance(e,u),this._stats.drawCallsInstanced++,k===g.TRIANGLES&&(this._stats.trianglesRendered+=(u.to-u.from)/3),v?this._drawArraysFaceRange(v,u.from,k):e.drawArrays(k,u.from,u.to-u.from))}}e.bindVAO(null);f&&b.release(e,c)};d.prototype._renderInternalHighlight=
- function(a,b,c){var d=this._rctx,e=d.gl;c=a.matData[c];var g=c.getDrawMode(d),f=a.instance,k=f.highlightedIndexRange,l=this._renderContext.offscreenRenderingHelper,l=(l?l.getDepthTexture():null)||this._getFallbackDepthTexture(),m=c.getProgram(),p=d.capabilities.instancing;b.origin=a.originData.origin;if(c.instanced&&a.type===K.Instanced)for(a=a.instancedVAO,c.bind(d,b),d.bindVAO(a),F.assertCompatibleVertexAttributeLocations(a,m),c.bindView(d,b),a=0;a<k.length;a++){var n=k[a],q=n.range?n.range[0]+
- f.from:f.from,n=n.range?n.range[1]-n.range[0]+1:f.to-f.from;d.bindTexture(l,5);m.setUniform1i("depthTex",5);m.setUniform4f("highlightViewportPixelSz",0,0,1/this._bindParameters.viewport[2],1/this._bindParameters.viewport[3]);p.drawArraysInstanced(g,q,n,1);g===e.TRIANGLES&&(this._stats.trianglesRendered+=1*n/3);this._stats.drawCallsHighlight++}else if(a.type===K.Instanced&&c.instanced)console.error("_renderInternalHighlight: incompatible instance type");else{c.bind(d,b);c.bindView(d,b);p=null;switch(a.type){case K.Merged:q=
- a.originData;d.bindVAO(q.vao);m.setUniformMatrix4fv("model",Y);break;case K.Instanced:q=a.originData;d.bindVAO(q.vao);c.bindInstance(d,f);break;case K.Preinterleaved:q=a.originData,a=q.instances[a.uniqueName].vao,d.bindVAO(a),c.bindInstance(d,f),p=a.indexBuffer&&a.indexBuffer.indexType}for(a=0;a<k.length;a++){n=k[a];q=n.range?n.range[0]+f.from:f.from;n=n.range?n.range[1]-n.range[0]+1:f.to-f.from;d.bindTexture(l,5);c.getProgram().setUniform1i("depthTex",5);m.setUniform4f("highlightViewportPixelSz",
- 0,0,1/this._bindParameters.viewport[2],1/this._bindParameters.viewport[3]);if(p){var h=F.getBytesPerElement(p);d.drawElements(g,n,p,q*h)}else d.drawArrays(g,q,n);g===e.TRIANGLES&&(this._stats.trianglesRendered+=n/3);this._stats.drawCallsHighlight++}}d.bindVAO(null);c.release(d,b)};d.prototype._drawArraysFaceRange=function(a,b,c){for(var d=this._rctx,e=0;e<a.length;e++){var g=a[e];d.drawArrays(c,g[0]+b,g[1]-g[0]+1)}this._stats.drawCallsFragmented+=a.length-1};d.prototype._drawElementsFaceRange=function(a,
- b,c,d){for(var e=this._rctx,g=F.getBytesPerElement(d),f=0;f<a.length;f++){var k=a[f];e.drawElements(c,k[1]-k[0]+1,d,(k[0]+b)*g)}this._stats.drawCallsFragmented+=a.length-1};d.prototype._renderInternalMerged=function(a,b,c,d){var e=this._rctx,g=e.gl,f=!1,k;for(k in a.origin2data){var l=a.origin2data[k];c.origin=l.origin;d===q.STENCIL_MATERIAL&&(this._stencilRenderingHelper.setEnableState(!0),this._stencilRenderingHelper.prepareStencilWritePass());if(!l.displayedIndexRange||0!==l.displayedIndexRange.length){f||
- (b.bind(e,c),f=!0);var m=b.getProgram();e.bindVAO(l.vao);F.assertCompatibleVertexAttributeLocations(l.vao,m);b.bindView(e,c);this._stats.drawCallsMerged++;m=b.getDrawMode(e);m===g.TRIANGLES&&(this._stats.trianglesRendered+=l.vao.vertexBuffers.geometry.size/3);l.displayedIndexRange?this._drawArraysFaceRange(l.displayedIndexRange,0,m):e.drawArrays(m,0,F.vertexCount(l.vao,"geometry"))}}f&&b.release(e,c)};d.prototype._renderInternalPreinterleaved=function(a,b,c,d){var e=this._rctx,g=e.gl,f=!1,k=b.getDrawMode(e),
- l;for(l in a.origin2data){var m=a.origin2data[l];c.origin=m.origin;var p=!1;d===q.STENCIL_MATERIAL&&(this._stencilRenderingHelper.setEnableState(!0),this._stencilRenderingHelper.prepareStencilWritePass());for(var n in m.instances){var h=m.instances[n],t=h.instance,u=h.vao,h=t.displayedIndexRange;if(!h||0!==h.length){f||(b.bind(e,c),f=!0);var v=b.getProgram();F.assertCompatibleVertexAttributeLocations(u,v);e.bindVAO(u);p||(b.bindView(e,c),p=!0);b.bindInstance(e,t);this._stats.drawCallsPreinterleaved++;
- k===g.TRIANGLES&&(this._stats.trianglesRendered+=(t.to-t.from)/3);u=u.indexBuffer&&u.indexBuffer.indexType;h?u?this._drawElementsFaceRange(h,t.from,k,u):this._drawArraysFaceRange(h,t.from,k):u?(h=F.getBytesPerElement(u),e.drawElements(k,t.to-t.from,u,t.from*h)):e.drawArrays(k,t.from,t.to-t.from)}}}e.bindVAO(null);f&&b.release(e,c)};d.prototype._updateGlobalUniforms=function(a){for(var b=this._programRep.getProgramsUsingUniform("proj"),c=0;c<b.length;c++)b[c].setUniformMatrix4fv("proj",a);if(this._lighting){b=
- this._programRep.getProgramsUsingUniform("lightingMainDirection");for(c=0;c<b.length;c++)this._lighting.setUniforms(b[c]);b=this._programRep.getProgramsUsingUniform("lightDirection");for(c=0;c<b.length;c++)this._lighting.setUniforms(b[c])}};d.prototype.print=function(){var a=Object.keys(this._mat2DataMerged).length,b=Object.keys(this._mat2DataInstanced).length,c=Object.keys(this._mat2DataPreinterleaved).length;console.log("number of materials (merged/instanced/preinterleaved): "+a+"/"+b+"/"+c);var d=
- 0;M(this._mat2DataMerged,function(){},function(a,b){d+=Object.keys(b.instances).length});var e=0;M(this._mat2DataInstanced,function(){},function(a,b){e+=Object.keys(b.instances).length});var g=0;M(this._mat2DataPreinterleaved,function(){},function(a,b){g+=Object.keys(b.instances).length});console.log("number of instances (merged/instanced/preinterleaved): "+d+"/"+e+"/"+g)};d.prototype.isEmpty=function(){for(var a in this._mat2DataInstanced){var b=this._mat2DataInstanced[a],c;for(c in b.origin2data)if(!O(b.origin2data[c].instances))return!1}for(a in this._mat2DataMerged)for(c in b=
- this._mat2DataMerged[a],b.origin2data)if(!O(b.origin2data[c].instances))return!1;for(a in this._mat2DataPreinterleaved)for(c in b=this._mat2DataPreinterleaved[a],b.origin2data)if(!O(b.origin2data[c].instances))return!1;return!0};d.prototype.modify=function(a,b,c,d){this._isRendering&&console.warn("Renderer.modify called while rendering");var e=[],g=[],f=[];this._classifyRenderGeometry(a,e,g,f);a=[];var k=[],l=[];this._classifyRenderGeometry(b,a,k,l);var m={};c&&this._performUpdates(c,m);c=[];this._modifyMerged(e,
- a,c,m);this._modifyInstanced(g,k,c);this._modifyPreinterleaved(f,l,c);this._updateMergedFaceranges(m);this._releaseMaterials(c);e=this._highlights.length;if(b&&0<b.length&&0<e&&(this._highlights=this._highlights.filter(function(a){return!b.some(function(b){return b.uniqueName===a.uniqueName})}),e!==this._highlights.length&&this.onHasHighlightsChanged))this.onHasHighlightsChanged(this.hasHighlights);this._updateHighlightVAOs();this._modifyMaterials(d);this._needsRender=!0};d.prototype._classifyRenderGeometry=
- function(a,b,c,d){for(var e=0;e<a.length;e++){var g=a[e];if(1<=H(g.data))switch(this._getType(g)){case K.Merged:b.push(g);break;case K.Instanced:c.push(g);break;case K.Preinterleaved:d.push(g)}}};d.prototype._performUpdates=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],e=d.updateType,d=d.renderGeometry,g=this._getType(d)===K.Merged;if(1<=H(d.data)){e&2&&this._updateFaceranges(d,b);if(e&32){var f=this._getInstance(d);f&&this._updateHighlightFaceranges(d,f.instance)}e&4||g&&e&16?this._updateVertexAttributes(d,
- !g):!g&&e&16&&this._updateInstanceTransformation(d)}}};d.prototype._updateFaceranges=function(a,b){var c=a.material.id,d=a.origin.id,e=this._getType(a),g;if(e===K.Preinterleaved){var f=this._getOriginData(e,c,d);g=f.instances[a.uniqueName].instance}else f=this._getOriginData(e,c,d),(g=f.instances[a.uniqueName])&&e===K.Merged&&(b[this._modifiedMergedFacerangesKey(c,d)]=f);g&&(g.displayedIndexRange=P(a),this._updateHighlightFaceranges(a,g))};d.prototype._updateHighlightFaceranges=function(a,b){if(b){var c=
- b.highlightedIndexRange,d;d=a.instanceParameters.hidden?[]:f.generateHighlightedIndexRanges(a.instanceParameters.componentVisibilities,a.instanceParameters.componentHighlights,a.componentOffsets);(b.highlightedIndexRange=d)&&!c?this._addHighlight(a):!d&&c&&this._removeHighlight(a)}};d.prototype._updateMergedFaceranges=function(a){for(var b in a){var c=a[b];c.displayedIndexRange=[];var d=c.instances,e=!0,g;for(g in d){var f=d[g];f.displayedIndexRange?(c.displayedIndexRange.push.apply(c.displayedIndexRange,
- l.offsetIntervals(f.displayedIndexRange,f.from)),e=!1):c.displayedIndexRange.push([f.from,f.to-1])}c.displayedIndexRange=e?null:l.mergeIntervals(c.displayedIndexRange)}};d.prototype._updateVertexAttributes=function(a,b){var c=a.material,d=c.id,e=a.origin.id,g=F.getStride(c.getVertexBufferLayout())/4,f=this._getType(a);if(f===K.Preinterleaved)console.error("Updating Preinterleaved geometry not supported");else{var f=this._getOriginData(f,d,e),d=f.instances[a.uniqueName],e=f.buffer.getArray(),f=f.vao,
- k,l;b||(G(a,U,ca),k=U,l=ca);c.fillInterleaved(a.data,k,l,a.instanceParameters,e,d.from*g);J(d.from+c.getOutputAmount(H(a.data))/g===d.to,"material VBO layout has changed");f.vertexBuffers.geometry.setSubData(e,d.from*g*4,d.from*g*4,d.to*g*4)}};d.prototype._updateInstanceTransformation=function(a){var b=this._getType(a),c=a.material.id,d=a.origin.id;b===K.Preinterleaved?(b=this._getOriginData(b,c,d),d=b.instances[a.uniqueName].instance,G(a,d.transformation,d.transformationNormal)):(b=this._getOriginData(b,
- c,d),d=b.instances[a.uniqueName],b=b.perGeometryDataInfo[a.data.id],c=b.instanceBufferData,G(a,d.transformation,d.transformationNormal),c&&(a=c.getSlot(a.idx),c.fill(a,0,d.transformation),c.fill(a,16,d.transformationNormal),a=4*c.getOffset(a),d=F.getStride(b.vao.layout.instance),b.vao.vertexBuffers.instance.setSubData(c.getArray(),a,a,a+d)))};d.prototype._modifyMerged=function(b,d,e,g){var f=this._rctx,k=K.Merged;b=this._compMat2delta(b,d,k);d=this._mat2DataMerged;for(var l in b){var m=b[l],p;for(p in m){var n=
- m[p],q=n.optimalCount,h=n.material,t=h.getVertexBufferLayout(),u=F.getStride(t)/4,v=d[l];if(null==v){J(0<q);var z=h.renderPriority,v=this._initializeMatData(h);d[l]=v;this._orderedRendering&&this._insertIntoRenderOrder(v,z,"merged")}z=v.origin2data[p];null==z&&(J(0<q),z={type:k,instances:{},vao:new I(f,a.Default3D,{geometry:t},{geometry:A.createVertex(f,35044)}),buffer:new c(q),optimalCount:0,origin:n.origin},v.origin2data[p]=z);if(0<q){var t=z.buffer.getSize(),B=z.buffer.getArray(),v=q<n.sparseCount/
- 2,x=z.buffer.resize(v?q:n.sparseCount),C=n.toRemove;if(v||x){for(var t=0,D=z.buffer.getArray(),v=0;v<C.length;++v)x=z.instances[C[v].uniqueName],z.optimalCount-=(x.to-x.from)*u,delete z.instances[C[v].uniqueName];var v={},r;for(r in z.instances)x=z.instances[r],J(null==v[x.from]),v[x.from]=x;for(var E in v){var x=v[E],L=x.from*u,da=x.to*u;D.set(B.subarray(L,da),t);x.from=t/u;t+=da-L;x.to=t/u}J(t===z.optimalCount)}else for(v=0;v<C.length;++v)x=C[v].uniqueName,J(void 0!==z.instances[x]),L=z.instances[x].from*
- u,da=z.instances[x].to*u,z.buffer.erase(L,da),delete z.instances[x],z.optimalCount-=da-L;S(V,-n.origin[0],-n.origin[1],-n.origin[2]);B=n.toAdd;n=!1;for(v=0;v<B.length;++v)C=B[v],L=C.data,R.multiply(V,C.transformation,U),R.inverse(U,ca),R.transpose(ca),x=t,h.fillInterleaved(L,U,ca,C.instanceParameters,z.buffer.getArray(),t),L=h.getOutputAmount(H(L)),D=x+L,J(null==z.instances[C.uniqueName]),da=P(C),x=new Q(C.name,x/u,D/u,da,void 0,void 0,C.idx),z.instances[C.uniqueName]=x,this._updateHighlightFaceranges(C,
- x),da&&(n=!0),z.optimalCount+=L,t+=L;J(z.optimalCount===q);q=new Float32Array(z.buffer.getArray().buffer,0,z.buffer.getSize());z.vao.vertexBuffers.geometry.setData(q);if(n||z.displayedIndexRange)g[this._modifiedMergedFacerangesKey(l,p)]=z}else J(0===q),z.vao.dispose(!0),z.vao=null,delete v.origin2data[p],0===Object.keys(v.origin2data).length&&(e.push(l),delete d[l],this._orderedRendering&&this._removeFromRenderOrder(v,"merged"))}}};d.prototype._modifyInstanced=function(b,d,e){var g=this._rctx,f=K.Instanced;
- b=this._compMat2delta(b,d,f);d=this._mat2DataInstanced;for(var l in b){var m=b[l],n;for(n in m){var p=m[n];if(0===p.optimalCount)p=d[l],p.origin2data[n].vao.dispose(!0),delete p.origin2data[n],0===Object.keys(p.origin2data).length&&(e.push(l),delete d[l],this._orderedRendering&&this._removeFromRenderOrder(p,"instanced"));else{var q=p.material,h=d[l];if(null==h){var t=q.renderPriority,h=this._initializeMatData(q);d[l]=h;this._orderedRendering&&this._insertIntoRenderOrder(h,t,"instanced")}var v=q.getVertexBufferLayout(),
- z=h[u.MATERIAL].instanced?q.getInstanceBufferLayout():void 0,B=z&&F.findAttribute(z,"instanceColor"),x=z&&F.findAttribute(z,"instanceFeatureAttribute"),C=F.getStride(v)/4,t=h.origin2data[n];null==t&&(t={type:f,instances:{},vao:new I(g,a.Default3D,{geometry:v},{geometry:A.createVertex(g,35044)}),buffer:new c(p.optimalCount),optimalCount:0,perGeometryDataInfo:{},origin:p.origin},h.origin2data[n]=t);var h=t.buffer.getSize(),D=t.buffer.getArray(),r=p.optimalCount<p.sparseCount/2,E=t.buffer.resize(r?p.optimalCount:
- p.sparseCount),L;for(L in p.perGeometryDelta){var U=t.perGeometryDataInfo[L];if(U&&U.instanceBufferData){var ca=p.perGeometryDelta[L].removeCount;0<ca&&U.instanceBufferData.prepareFree(ca)}}var da=p.toRemove;if(r||E){for(r=0;r<da.length;++r){E=da[r];delete t.instances[E.uniqueName];L=E.data.id;var ga=U=t.perGeometryDataInfo[L];0===--ga.refCount&&null==p.dataId2refCount[L]?(t.optimalCount-=(ga.to-ga.from)*C,delete t.perGeometryDataInfo[L]):U.instanceBufferData&&U.instanceBufferData.free(E.idx)}var h=
- 0,r=t.buffer.getArray(),E={},ka;for(ka in t.perGeometryDataInfo)ga=t.perGeometryDataInfo[ka],J(null==E[ga.from]),E[ga.from]=ga;for(var N in E)ga=E[N],ca=ga.from*C,U=ga.to*C,r.set(D.subarray(ca,U),h),ga.from=h/C,h+=U-ca,ga.to=h/C;for(var G in t.instances)ca=t.instances[G],ca.from=t.perGeometryDataInfo[ca.dataId].from,ca.to=t.perGeometryDataInfo[ca.dataId].to}else for(r=0;r<da.length;++r)E=da[r],delete t.instances[E.uniqueName],L=E.data.id,U=t.perGeometryDataInfo[L],0===--U.refCount&&null==p.dataId2refCount[L]?
- (ca=U.from*C,U=U.to*C,t.buffer.erase(ca,U),t.optimalCount-=U-ca,delete t.perGeometryDataInfo[L]):U.instanceBufferData&&U.instanceBufferData.free(E.idx);S(V,-p.origin[0],-p.origin[1],-p.origin[2]);for(L in p.perGeometryDelta)(U=t.perGeometryDataInfo[L])&&U.instanceBufferData&&(r=p.perGeometryDelta[L].addCount,0<r&&U.instanceBufferData.prepareAllocate(r));D=p.toAdd;for(r=0;r<D.length;++r)if(E=D[r],ca=E.data,L=ca.id,U=t.perGeometryDataInfo[L],null==U?(q.fillInterleaved(ca,void 0,void 0,void 0,t.buffer.getArray(),
- h),da=q.getOutputAmount(H(ca)),ca=h/C,h+=da,U=h/C,t.optimalCount+=da,U={refCount:1,from:ca,to:U,vao:null,instanceBufferData:null},z&&(ca=F.getStride(z)/4,U.vao=new I(g,a.Default3D,{geometry:v,instance:z},{geometry:t.vao.vertexBuffers.geometry,instance:A.createVertex(g,35044)}),U.instanceBufferData=new k(ca,p.perGeometryDelta[L].addCount)),t.perGeometryDataInfo[L]=U):++U.refCount,J(U.from*C<=t.buffer.getSize()&&U.to*C<=t.buffer.getSize()),ca=R.create(),R.multiply(V,E.transformation,ca),da=P(E),ca=
- new Q(E.name,U.from,U.to,da,ca,E.instanceParameters,E.idx,L),t.instances[E.uniqueName]=ca,this._updateHighlightFaceranges(E,ca),U=U.instanceBufferData)da=U.allocate(E.idx),U.fill(da,0,ca.transformation),U.fill(da,16,ca.transformationNormal),B&&U.fill(da,B.offset/4,E.instanceParameters.color),x&&U.fill(da,x.offset/4,E.instanceParameters.featureAttribute);J(t.optimalCount===p.optimalCount);q=new Float32Array(t.buffer.getArray().buffer,0,t.buffer.getSize());t.vao.vertexBuffers.geometry.setData(q);for(L in t.perGeometryDataInfo)if(v=
- t.perGeometryDataInfo[L],v.vao&&(q=v.vao.vertexBuffers.instance))z=p.perGeometryDelta[L],0<z.addCount+z.removeCount&&(v=v.instanceBufferData.compact(),q.setData(v))}}}};d.prototype._modifyPreinterleaved=function(b,c,d){for(var e=this._rctx,g=K.Preinterleaved,f=this._mat2DataPreinterleaved,k=0;k<b.length;k++){var l=b[k],m=l.material,p=m.id,n=l.origin.id,q=l.origin.vec3,t=f[p];null==t&&(t=this._initializeMatData(m),f[p]=t);p=t.origin2data[n];null==p&&(p={type:g,origin:q,count:0,instances:{}},t.origin2data[n]=
- p);S(V,-q[0],-q[1],-q[2]);t=R.create();R.multiply(V,l.transformation,t);q=P(l);n=l.data;n.preinterleaved?null==n.vertexData?J(!1,"Trying to re-add preinterleaved geometry data which is no longer available."):(t=new Q(l.name,0,n.indexCount,q,t,l.instanceParameters,l.idx,n.id),q=n.indexData?A.createIndex(e,35044,n.indexData):null,m=m.getVertexBufferLayout(),m=new I(e,a.Default3D,{geometry:m},{geometry:A.createVertex(e,35044)},q),m.vertexBuffers.geometry.setData(n.vertexData),n.vertexData=null,p.count+=
- 1,p.instances[l.uniqueName]={instance:t,vao:m},this._updateHighlightFaceranges(l,t)):J(!1,"Non-interleaved render geometry processed as pre-interleaved")}for(b=0;b<c.length;b++)l=c[b],q=l.origin,m=l.material,p=m.id,n=q.id,l=l.uniqueName,t=f[p],e=t.origin2data[n],e.instances[l].vao.dispose(),delete e.instances[l],--e.count,0===e.count&&delete t.origin2data[n],0===Object.keys(t.origin2data).length&&(d.push(p),delete f[p])};d.prototype._compMat2delta=function(a,b,c){var d={};this._updateMat2delta(a,
- !0,c,d);this._updateMat2delta(b,!1,c,d);return d};d.prototype._updateMat2delta=function(a,b,c,d){c=c===K.Instanced;for(var e=0;e<a.length;e++){var g=a[e],f=g.origin,k=g.material,l=k.id,m=c?this._mat2DataInstanced[l]:this._mat2DataMerged[l],m=m&&m.origin2data[f.id],p=d[l];null==p&&(p={},d[l]=p);l=p[f.id];if(null==l){l={optimalCount:null==m?0:m.optimalCount,sparseCount:null==m?0:m.buffer.getSize(),material:k,toAdd:[],toRemove:[],perGeometryDelta:null,origin:f.vec3};if(c){var n={};if(void 0!==m)for(var q in m.perGeometryDataInfo)n[q]=
- m.perGeometryDataInfo[q].refCount;l.dataId2refCount=n;l.perGeometryDelta={}}p[f.id]=l}f=k.getOutputAmount(H(g.data));c?(k=g.data.id,m=l.perGeometryDelta[k],m||(m={addCount:0,removeCount:0},l.perGeometryDelta[k]=m),b?(m.addCount++,null==l.dataId2refCount[k]&&(l.dataId2refCount[k]=0),1===++l.dataId2refCount[k]&&(l.optimalCount+=f,l.sparseCount+=f),l.toAdd.push(g)):(m.removeCount++,0===--l.dataId2refCount[k]&&(delete l.dataId2refCount[k],l.optimalCount-=f),l.toRemove.push(g))):b?(l.optimalCount+=f,l.sparseCount+=
- f,l.toAdd.push(g)):(l.optimalCount-=f,l.toRemove.push(g))}};d.prototype._getType=function(a){if(a.data.preinterleaved)return K.Preinterleaved;var b=!1,c=H(a.data),b=(b=(b=b||!1===a.material.canBeMerged)||a.material.instanced)||!0===a.material.renderOccluded;a.singleUse||(b=b||c>this._threshold);return b?K.Instanced:K.Merged};d.prototype._getTargetMat2Data=function(a){switch(a){case K.Merged:return this._mat2DataMerged;case K.Instanced:return this._mat2DataInstanced;case K.Preinterleaved:return this._mat2DataPreinterleaved}};
- d.prototype._getOriginData=function(a,b,c){return this._getTargetMat2Data(a)[b].origin2data[c]};d.prototype._modifiedMergedFacerangesKey=function(a,b){return a+"_"+b};d.prototype._insertIntoRenderOrder=function(a,b,c){for(var d=a[u.MATERIAL].materialId,e=this._renderOrder.length,g=0;g<e&&this._renderOrder[g][0]>=b;){var f=this._renderOrder[g][1];if(f.id===d){J(!f[c],"matData for type already exists");f[c]=a;return}g++}d={id:d,instanced:null,merged:null};d[c]=a;this._renderOrder.splice(g,0,[b,d])};
- d.prototype._removeFromRenderOrder=function(a,b){var c=a[u.MATERIAL].materialId;for(a=0;this._renderOrder[a][1].id!==c;)a++;c=this._renderOrder[a][1];c[b]=null;c.instanced||c.merged||this._renderOrder.splice(a,1)};d.prototype._sortHighlightsByRenderOrder=function(){this._highlights.sort(function(a,b){a=a.matData[u.MATERIAL].renderPriority;b=b.matData[u.MATERIAL].renderPriority;return a>b?-1:b>a?1:0})};d.prototype._updateRenderOrder=function(a,b){for(var c=b.length,d=0;d<c&&b[d][1].id!==a;)d++;if(d<
- c){a=b[d][1];a=(a.merged||a.instanced)[u.MATERIAL].renderPriority;var e=b[d][0];if(a!==b[d][0])for(b[d][0]=a,e=a>e?-1:1,d+=e;-1<d&&d<c&&e*b[d][0]>e*a;){var g=b[d];b[d]=b[d-e];b[d-e]=g;d+=e}}};d.prototype._modifyMaterials=function(a){for(var b in a)this._materialRep.updateMaterialParameters(b)};d.prototype.modifyRenderOrder=function(a){if(this._orderedRendering){for(var b in a)this._updateRenderOrder(b,this._renderOrder);this._sortHighlightsByRenderOrder();this._needsRender=!0}};d.prototype._initializeMatData=
- function(a){var b={origin2data:{}};b[u.MATERIAL]=this._materialRep.aquire(a);b[u.MATERIAL_DEPTH_SHADOWMAP]=this._materialRep.aquireDepthShadowMap(a);b[u.MATERIAL_NORMAL]=this._materialRep.aquireNormal(a);b[u.MATERIAL_DEPTH]=this._materialRep.aquireDepth(a);b[u.MATERIAL_HIGHLIGHT]=this._materialRep.aquireHighlight(a);return b};d.prototype._releaseMaterials=function(a){if(Array.isArray(a))for(var b=0;b<a.length;b++)this._materialRep.release(a[b]),this._materialRep.releaseDepthShadowMap(a[b]),this._materialRep.releaseNormal(a[b]),
- this._materialRep.releaseDepth(a[b]),this._materialRep.releaseHighlight(a[b]);else this._materialRep.release(a),this._materialRep.releaseDepthShadowMap(a),this._materialRep.releaseNormal(a),this._materialRep.releaseDepth(a),this._materialRep.releaseHighlight(a)};d.prototype._getInstance=function(a){var b=a.uniqueName,c=a.material.id,d=this._getType(a),c=this._getTargetMat2Data(d)[c];if(!c)return null;a=c.origin2data[a.origin.id];if(!a)return null;var e;return(e=a.type===K.Preinterleaved?a.instances[b].instance:
- a.instances[b])?{type:d,uniqueName:b,instance:e,matData:c,originData:a,instancedVAO:null,instancedVAOBaseInstance:null}:null};d.prototype._createBaseInstanceVAO=function(a){var b=this._rctx,c=a.instance,d=a.originData;if(a.type===K.Instanced&&d.perGeometryDataInfo){var d=d.perGeometryDataInfo[c.dataId],e=d.instanceBufferData;e&&(d=d.vao,c=e.getSlot(c.idx),a.instancedVAOBaseInstance!==c&&(e=F.setBaseInstanceOffset(d.layout,c),a.instancedVAO=new I(b,d.locations,e,d.vertexBuffers,d.indexBuffer),a.instancedVAOBaseInstance=
- c))}};d.prototype._updateHighlightVAOs=function(){for(var a=0;a<this._highlights.length;++a)this._createBaseInstanceVAO(this._highlights[a])};d.prototype._getFallbackDepthTexture=function(){this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=new E(this._rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,width:1,height:1},new Uint8Array([255,255,255,255])));return this._fallbackDepthStencilTexture};return d}();var X=function(){function a(){this.reset()}a.prototype.reset=
- function(){this.VBOusedSize=this.VBOoptimalSize=this.VBOallocatedSize=this.instancesDrawnAngle=this.drawCallsHighlight=this.drawCallsFragmented=this.drawCallsPreinterleaved=this.drawCallsMerged=this.drawCallsAngleInstanced=this.drawCallsInstanced=this.trianglesRendered=0};return a}(),Q=function(){return function(a,b,c,d,e,g,f,k){this.name=a;this.from=b;this.to=c;this.displayedIndexRange=d;this.transformation=e;this.instanceParameters=g;this.idx=f;this.dataId=k;null!=e&&(this.transformationNormal=
- R.create(),R.set(e,this.transformationNormal),R.inverse(this.transformationNormal,this.transformationNormal),R.transpose(this.transformationNormal,this.transformationNormal))}}(),K;(function(a){a[a.Merged=0]="Merged";a[a.Instanced=1]="Instanced";a[a.Preinterleaved=2]="Preinterleaved"})(K||(K={}));var L=r.create(),V=R.identity(),U=R.create(),ca=R.create();return d})},"esri/views/3d/webgl-engine/lib/ExternalRendererContainer":function(){define(["require","exports","./RenderSlot"],function(r,h,f){return function(){function a(){this.renderersChanged=
- !1;this.renderers=[];this.slots=[];for(var a=0;a<f.MAX_SLOTS;++a)this.slots[a]=[]}a.prototype.addRenderer=function(a,c){this.renderers.push(c);for(var e=0;e<a.length;++e)this.slots[a[e]].push(c);this.renderersChanged=!0};a.prototype.removeRenderer=function(a){this.renderers=this.renderers.filter(function(c){return c!==a});for(var c=0;c<this.slots.length;++c)this.slots[c]=this.slots[c].filter(function(c){return c!==a});this.renderersChanged=!0};a.prototype.render=function(a,c){c.slot=a;var e=0;for(a=
- this.slots[a];e<a.length;e++){var d=a[e];d.render(c)&&(d.didRender=!0)}};a.prototype.needsRender=function(){if(this.renderersChanged)return!0;for(var a=0,c=this.renderers;a<c.length;a++)if(c[a].needsRender)return!0;return!1};a.prototype.needsHighlight=function(){for(var a=0,c=this.renderers;a<c.length;a++)if(c[a].needsHighlight)return!0;return!1};a.prototype.needsLinearDepth=function(){for(var a=0,c=this.renderers;a<c.length;a++)if(c[a].needsLinearDepth)return!0;return!1};a.prototype.resetNeedsRender=
- function(){this.renderersChanged=!1;for(var a=0,c=this.renderers;a<c.length;a++){var g=c[a];g.resetNeedsRender?g.resetNeedsRender():g.didRender&&(g.needsRender=!1,g.didRender=!1)}};return a}()})},"esri/views/3d/webgl-engine/lib/Float32ArrayList":function(){define(["require","exports","./Util"],function(r,h,f){return function(){function a(a){null==a?a=16:65536>a&&(a=f.nextHighestPowerOfTwo(a));this.array=new Float32Array(a);this.size=0}a.prototype.resize=function(a,c){void 0===c&&(c=!1);this.size=
- a;var e;if(this.size>this.array.length){for(a=this.array.length||1;a<this.size;)a*=2;e=new Float32Array(a);c&&e.set(this.array);this.array=e;return!0}if(this.size<=this.array.length/2){a=this.array.length;for(e=2*this.size;a>=e;)a=Math.floor(a/2);e=new Float32Array(a);c&&e.set(this.array.subarray(0,a));this.array=e;return!0}return!1};a.prototype.append=function(a){var c=this.size;this.resize(this.size+a.length,!0);this.array.set(a,c)};a.prototype.erase=function(a,c){for(;a<c;++a)this.array[a]=0};
- a.prototype.getArray=function(){return this.array};a.prototype.getSize=function(){return this.size};return a}()})},"esri/views/3d/webgl-engine/lib/FxaaRenderPass":function(){define(["require","exports","../../../webgl/BufferObject","../../../webgl/Program","../../../webgl/VertexArrayObject"],function(r,h,f,a,e){return function(){function c(a){this.isEnabled=!1;this.vertexAttributeLocations={position:0};this.vertexBufferLayout=[{name:"position",count:2,type:5126,offset:0,stride:8,normalized:!1}];this.rctx=
- a}c.prototype.enable=function(){if(!this.isEnabled){var c=this.rctx;this.program=new a(c,"\n #version 100\n precision highp float;\n\n attribute vec2 position;\n\n varying vec2 fCoordinate;\n\n void main() {\n fCoordinate \x3d (position + 1.0 ) * 0.5;\n gl_Position \x3d vec4(position, -1, 1);\n }","\n #version 100\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n /**\n * @license\n * Copyright (c) 2011 NVIDIA Corporation. All rights reserved.\n *\n * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED\n * *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS\n * OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA\n * OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT, OR\n * CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS\n * OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY\n * OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,\n * EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n */\n\n #define FXAA_EDGE_THRESHOLD (1.0/8.0)\n #define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n #define FXAA_SEARCH_STEPS 16\n #define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n #define FXAA_SUBPIX_CAP (3.0/4.0)\n #define FXAA_SUBPIX_TRIM (1.0/4.0)\n #define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\n\n uniform vec2 uRcpFrameDimension;\n uniform sampler2D uColorTexture;\n varying vec2 fCoordinate;\n\n // Return the luma, the estimation of luminance from rgb inputs.\n // This approximates luma using one FMA instruction,\n // skipping normalization and tossing out blue.\n // FxaaLuma() will range 0.0 to 2.963210702.\n float FxaaLuma(vec3 rgb) {\n return rgb.y * (0.587 / 0.299) + rgb.x;\n }\n vec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {\n return (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);\n }\n vec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\n float x \x3d pos.x + float(off.x) * rcpFrame.x;\n float y \x3d pos.y + float(off.y) * rcpFrame.y;\n return texture2D(tex, vec2(x, y));\n }\n\n // pos is the output of FxaaVertexShader interpolated across screen.\n // xy -\x3e actual texture position {0.0 to 1.0}\n // rcpFrame should be a uniform equal to {1.0/frameWidth, 1.0/frameHeight}\n vec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame) {\n vec3 rgbN \x3d FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;\n vec3 rgbW \x3d FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;\n vec3 rgbM \x3d FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;\n vec3 rgbE \x3d FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;\n vec3 rgbS \x3d FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;\n float lumaN \x3d FxaaLuma(rgbN);\n float lumaW \x3d FxaaLuma(rgbW);\n float lumaM \x3d FxaaLuma(rgbM);\n float lumaE \x3d FxaaLuma(rgbE);\n float lumaS \x3d FxaaLuma(rgbS);\n float rangeMin \x3d min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\n float rangeMax \x3d max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\n float range \x3d rangeMax - rangeMin;\n if (range \x3c max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD)) {\n return rgbM;\n }\n vec3 rgbL \x3d rgbN + rgbW + rgbM + rgbE + rgbS;\n float lumaL \x3d (lumaN + lumaW + lumaE + lumaS) * 0.25;\n float rangeL \x3d abs(lumaL - lumaM);\n float blendL \x3d max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\n blendL \x3d min(FXAA_SUBPIX_CAP, blendL);\n vec3 rgbNW \x3d FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;\n vec3 rgbNE \x3d FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;\n vec3 rgbSW \x3d FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;\n vec3 rgbSE \x3d FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;\n rgbL +\x3d (rgbNW + rgbNE + rgbSW + rgbSE);\n rgbL *\x3d vec3(1.0/9.0);\n float lumaNW \x3d FxaaLuma(rgbNW);\n float lumaNE \x3d FxaaLuma(rgbNE);\n float lumaSW \x3d FxaaLuma(rgbSW);\n float lumaSE \x3d FxaaLuma(rgbSE);\n float edgeVert \x3d\n abs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\n abs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\n abs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\n float edgeHorz \x3d\n abs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\n abs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\n abs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\n bool horzSpan \x3d edgeHorz \x3e\x3d edgeVert;\n float lengthSign \x3d horzSpan ? -rcpFrame.y : -rcpFrame.x;\n if(!horzSpan) {\n lumaN \x3d lumaW;\n lumaS \x3d lumaE;\n }\n float gradientN \x3d abs(lumaN - lumaM);\n float gradientS \x3d abs(lumaS - lumaM);\n lumaN \x3d (lumaN + lumaM) * 0.5;\n lumaS \x3d (lumaS + lumaM) * 0.5;\n if (gradientN \x3c gradientS)\n {\n lumaN \x3d lumaS;\n lumaN \x3d lumaS;\n gradientN \x3d gradientS;\n lengthSign *\x3d -1.0;\n }\n vec2 posN;\n posN.x \x3d pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\n posN.y \x3d pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\n gradientN *\x3d FXAA_SEARCH_THRESHOLD;\n vec2 posP \x3d posN;\n vec2 offNP \x3d horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\n float lumaEndN \x3d lumaN;\n float lumaEndP \x3d lumaN;\n bool doneN \x3d false;\n bool doneP \x3d false;\n posN +\x3d offNP * vec2(-1.0, -1.0);\n posP +\x3d offNP * vec2( 1.0, 1.0);\n for(int i \x3d 0; i \x3c FXAA_SEARCH_STEPS; i++) {\n if(!doneN) {\n lumaEndN \x3d FxaaLuma(texture2D(tex, posN.xy).xyz);\n }\n if(!doneP) {\n lumaEndP \x3d FxaaLuma(texture2D(tex, posP.xy).xyz);\n }\n doneN \x3d doneN || (abs(lumaEndN - lumaN) \x3e\x3d gradientN);\n doneP \x3d doneP || (abs(lumaEndP - lumaN) \x3e\x3d gradientN);\n if(doneN \x26\x26 doneP) { break; }\n if(!doneN) {\n posN -\x3d offNP;\n }\n if(!doneP) {\n posP +\x3d offNP;\n }\n }\n float dstN \x3d horzSpan ? pos.x - posN.x : pos.y - posN.y;\n float dstP \x3d horzSpan ? posP.x - pos.x : posP.y - pos.y;\n bool directionN \x3d dstN \x3c dstP;\n lumaEndN \x3d directionN ? lumaEndN : lumaEndP;\n if(((lumaM - lumaN) \x3c 0.0) \x3d\x3d ((lumaEndN - lumaN) \x3c 0.0)) {\n lengthSign \x3d 0.0;\n }\n float spanLength \x3d (dstP + dstN);\n dstN \x3d directionN ? dstN : dstP;\n float subPixelOffset \x3d (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\n vec3 rgbF \x3d texture2D(tex, vec2(\n pos.x + (horzSpan ? 0.0 : subPixelOffset),\n pos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\n return FxaaLerp3(rgbL, rgbF, blendL);\n }\n\n void main() {\n vec4 color;\n vec2 screenCoord \x3d fCoordinate;\n // if (screenCoord.x \x3c 0.5) {\n color.rgb \x3d FxaaPixelShader(screenCoord, uColorTexture, uRcpFrameDimension);\n // } else if (screenCoord.x \x3c 0.501 \x26\x26 screenCoord.x \x3e 0.499) {\n // color.rgb \x3d vec3(1,0,0);\n // } else {\n // color \x3d texture2D(uColorTexture, fCoordinate);\n // }\n color.a \x3d 1.0;\n gl_FragColor \x3d color;\n }",
- this.vertexAttributeLocations);var d=new Float32Array([-1,-1,3,-1,-1,3]);this.vao=new e(c,this.vertexAttributeLocations,{geometry:this.vertexBufferLayout},{geometry:new f(c,34962,35044,d)});this.isEnabled=!0}};c.prototype.disable=function(){this.isEnabled&&(this.program.dispose(),this.program=null,this.vao.dispose(),this.vao=null,this.isEnabled=!1)};c.prototype.render=function(a,c){this.enable();var b=this.rctx;b.bindVAO(this.vao);b.bindFramebuffer(c);var d=0,e=0;null!=c?(d=c.descriptor.width,e=c.descriptor.height):
- (d=b.gl.canvas.width,e=b.gl.canvas.height);b.bindProgram(this.program);b.bindTexture(a.colorTexture,0);this.program.setUniform1i("uColorTexture",0);this.program.setUniform2f("uRcpFrameDimension",1/d,1/e);b.setFaceCullingEnabled(!1);b.drawArrays(4,0,3)};return c}()})},"esri/views/3d/webgl-engine/lib/HighlightTextureHelper":function(){define(["require","exports","./Util","../../../webgl/FramebufferObject"],function(r,h,f,a){return function(){function e(a){this._rctx=a;this.height=this.width=this.viewportToRestore=
- this.fbo2=this.fbo=null}e.prototype.setEnableState=function(a){a!==this.getEnableState()&&(a?this.enable():this.disable())};e.prototype.getEnableState=function(){return null!==this.fbo};e.prototype.getHighlightFBO=function(){return this.fbo};e.prototype.getBlurFBO=function(){return this.fbo2};e.prototype.enable=function(){f.assert(!this.getEnableState());this.fbo=a.createWithAttachments(this._rctx,{target:3553,pixelFormat:6408,dataType:32819,samplingMode:9729,wrapMode:33071,width:0,height:0},{colorTarget:0,
- depthStencilTarget:1})};e.prototype.disable=function(){f.assert(this.getEnableState());this.fbo.dispose();this.fbo=null};e.prototype.setupFBOs=function(a){f.assert(this.getEnableState());this.viewportToRestore=a=a.fullViewport;this.width=a[2];this.height=a[3];this._rctx.setViewport(0,0,this.width,this.height)};e.prototype.prepareHighlightPass=function(){f.assert(this.getEnableState());var a=this._rctx,e=a.gl;this.fbo.resize(this.width,this.height);a.bindFramebuffer(this.fbo);a.setClearColor(0,0,0,
- 0);a.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)};e.prototype.finish=function(a){var c=this._rctx;c.bindFramebuffer(a);c.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],this.viewportToRestore[2],this.viewportToRestore[3])};return e}()})},"esri/views/3d/webgl-engine/lib/InstanceBufferData":function(){define(["require","exports","./Util"],function(r,h,f){return function(){function a(a,c){null==c&&(c=4);var e=f.nextHighestPowerOfTwo(c*a);this.array=new Float32Array(e);this.zeroItem=
- new Float32Array(a);this.endSlot=0;this.perInstanceDataSize=a;this.emptySlots=[];this.emptySlotsIdx=0;this.id2slot={};this.slot2id=Array(c)}a.prototype.prepareFree=function(a){this.emptySlots.length+=a};a.prototype.free=function(a){a=this.id2slot[a];null!=a&&(this.emptySlots[this.emptySlotsIdx++]=a,this.slot2id[a]=void 0)};a.prototype.prepareAllocate=function(a){a-=this.emptySlotsIdx;0<a&&this._resizeArray((this.endSlot+a)*this.perInstanceDataSize)};a.prototype.allocate=function(a){var c;c=0<this.emptySlotsIdx?
- this.emptySlots[--this.emptySlotsIdx]:this.endSlot++;this.id2slot[a]=c;this.slot2id[c]=a;return c};a.prototype.getSlot=function(a){return this.id2slot[a]};a.prototype.getOffset=function(a){return a*this.perInstanceDataSize};a.prototype.getArray=function(){return this.array};a.prototype.fill=function(a,c,g){this.array.set(g,a*this.perInstanceDataSize+c)};a.prototype.compact=function(){if(0<this.emptySlotsIdx){this.emptySlots.length=this.emptySlotsIdx;for(this.emptySlots.sort(function(a,c){return a-
- c});0<this.emptySlotsIdx&&this.emptySlots[this.emptySlotsIdx-1]===this.endSlot;)this.emptySlotsIdx--,this.endSlot--;for(;0<this.emptySlotsIdx;){this.emptySlotsIdx--;var a=this.endSlot-1,c=this.emptySlots[this.emptySlotsIdx],g=a*this.perInstanceDataSize,d=c*this.perInstanceDataSize;this.array.set(this.array.subarray(g,g+this.perInstanceDataSize),d);this.array.set(this.zeroItem,g);g=this.slot2id[a];this.slot2id[a]=void 0;this.slot2id[c]=g;this.id2slot[g]=c;this.endSlot--}}this._resizeArray(this.endSlot*
- this.perInstanceDataSize);this.emptySlots.length=0;return this.array};a.prototype._resizeArray=function(a){var c;if(a>this.array.length){for(c=this.array.length||1;c<a;)c*=2;a=new Float32Array(c);a.set(this.array);this.array=a}else if(a<=this.array.length/2){c=this.array.length;for(a*=2;c>=a;)c/=2;a=new Float32Array(c);a.set(this.array.subarray(0,c));this.array=a}};return a}()})},"esri/views/3d/webgl-engine/lib/IntervalUtilities":function(){define(["require","exports"],function(r,h){return function(){function f(){}
- f.copyIntervals=function(a){for(var e=[],c=0;c<a.length;c++){var g=a[c];e.push([g[0],g[1]])}return e};f.convertFaceToIndexRange=function(a,e){for(var c=0;c<a.length;c++){var g=a[c];g[0]*=e;g[1]=g[1]*e+(e-1)}};f.sortIntervals=function(a){return a.sort(function(a,c){return a[0]===c[0]?a[1]>c[1]?1:a[1]<c[1]?-1:0:a[0]>c[0]?1:a[0]<c[0]?-1:0})};f.intersectIntervals=function(a,e){if(0>=a.length)return[];for(var c=[],g=0;g<a.length;g++){var d=a[g];d[1]<e[0]||d[0]>e[1]||(d=[d[0],d[1]],d[0]<e[0]&&(d[0]=e[0]),
- d[1]>e[1]&&(d[1]=e[1]),c.push(d))}return c};f.mergeIntervals=function(a){if(0>=a.length)return[];var e=[];a=this.sortIntervals(a);e.push(a[0]);for(var c=1;c<a.length;c++){var g=e[e.length-1];g[1]+1<a[c][0]?e.push(a[c]):g[1]<a[c][1]&&(g[1]=a[c][1],e.pop(),e.push(g))}return e};f.invertIntervals=function(a,e){for(var c=[],g=0,d=0;d<a.length;d++){var b=a[d];b[0]>g&&c.push([g,b[0]-1]);g=b[1]+1}g<=e&&c.push([g,e]);return c};f.offsetIntervals=function(a,e){for(var c=[],g=0;g<a.length;g++){var d=a[g];c.push([d[0]+
- e,d[1]+e])}return c};return f}()})},"esri/views/3d/webgl-engine/lib/LinearDepthTextureHelper":function(){define(["require","exports","./Util","../../../webgl/FramebufferObject"],function(r,h,f,a){return function(){function e(a){this._rctx=a;this._depthFBO=void 0;this.height=this.width=this.viewportToRestore=null}e.prototype.setEnableState=function(a){a!==this.getEnableState()&&(a?this.enable():this.disable())};e.prototype.getEnableState=function(){return void 0!==this._depthFBO};e.prototype.getDepthFBO=
- function(){return this._depthFBO};e.prototype.enable=function(){f.assert(!this.getEnableState());this._depthFBO=a.createWithAttachments(this._rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:0,height:0},{colorTarget:0,depthStencilTarget:3})};e.prototype.disable=function(){f.assert(this.getEnableState());this._depthFBO.dispose();this._depthFBO=void 0};e.prototype.setupFBOs=function(a){f.assert(this.getEnableState());this.viewportToRestore=a=a.fullViewport;this.width=
- a[2];this.height=a[3];this._rctx.setViewport(0,0,this.width,this.height)};e.prototype.prepareDepthPass=function(){f.assert(this.getEnableState());var a=this._rctx,e=a.gl;this._depthFBO.resize(this.width,this.height);a.bindFramebuffer(this._depthFBO);a.setClearStencil(0);a.setClearColor(0,0,0,0);a.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT);a.setBlendingEnabled(!1)};e.prototype.finish=function(a){var c=this._rctx;c.bindFramebuffer(a);c.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],
- this.viewportToRestore[2],this.viewportToRestore[3])};return e}()})},"esri/views/3d/webgl-engine/lib/NormalTextureHelper":function(){define(["require","exports","./Util","../../../webgl/FramebufferObject"],function(r,h,f,a){return function(){function e(a){this.rctx=a;this.normalFBO=void 0;this.height=this.width=this.viewportToRestore=null}e.prototype.setEnableState=function(a){a!==this.getEnableState()&&(a?this.enable():this.disable())};e.prototype.getEnableState=function(){return void 0!==this.normalFBO};
- e.prototype.getNormalFBO=function(){return this.normalFBO};e.prototype.enable=function(){f.assert(!this.getEnableState());this.normalFBO=a.createWithAttachments(this.rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:0,height:0},{colorTarget:0,depthStencilTarget:1})};e.prototype.disable=function(){f.assert(this.getEnableState());this.normalFBO.dispose();this.normalFBO=void 0};e.prototype.setupFBOs=function(a){f.assert(this.getEnableState());this.viewportToRestore=
- a=a.viewport;this.width=a[2];this.height=a[3];this.rctx.setViewport(0,0,this.width,this.height)};e.prototype.prepareNormalPass=function(){f.assert(this.getEnableState());var a=this.rctx,e=a.gl;this.normalFBO.resize(this.width,this.height);a.bindFramebuffer(this.normalFBO);a.setClearColor(0,0,0,0);a.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)};e.prototype.finish=function(a){var c=this.rctx;c.bindFramebuffer(a);c.setViewport(this.viewportToRestore[0],this.viewportToRestore[1],this.viewportToRestore[2],
- this.viewportToRestore[3])};return e}()})},"esri/views/3d/webgl-engine/lib/RenderContext":function(){define(["require","exports","./RenderPass","./RenderSlot"],function(r,h,f,a){return function(){function e(){this.normals=this.lightingData=this.highlight=this.depth=this.camera=null;this.pass=f.MATERIAL;this.shadowMap=null;this.slot=a.BACKGROUND;this.options=this.rctx=this.framebufferTex=this.stencilRenderingHelper=this.offscreenRenderingHelper=this.ssaoHelper=null;this.renderOccludedOnly=!1}Object.defineProperty(e.prototype,
- "isHighlightPass",{get:function(){return this.pass===f.MATERIAL_HIGHLIGHT},enumerable:!0,configurable:!0});return e}()})},"esri/views/3d/webgl-engine/lib/SmaaRenderPass":function(){define("require exports ../../support/imageUtils ../../../webgl/BufferObject ../../../webgl/FramebufferObject ../../../webgl/Program ../../../webgl/Texture ../../../webgl/VertexArrayObject".split(" "),function(r,h,f,a,e,c,g,d){var b=null;return function(){function k(a){this.isEnabled=this._isLoadingResources=!1;this.vertexAttributeLocations=
- {vPosition:0};this.vertexBufferLayout=[{name:"vPosition",count:2,type:5126,offset:0,stride:8,normalized:!1}];this.rctx=a}k.prototype.loadResources=function(a){var c=this;return b?!0:(this._isLoadingResources=!0,r(["./SmaaRenderPassData"],function(d){b=d;c._isLoadingResources=!1;a&&a()}),!1)};Object.defineProperty(k.prototype,"isLoadingResources",{get:function(){return this._isLoadingResources},enumerable:!0,configurable:!0});k.prototype.enable=function(){if(this.isEnabled)return!0;if(!this.loadResources())return!1;
- var g=this.rctx;this.programEdgeDetect=new c(g,b.edgeDetectShader.vertex,b.edgeDetectShader.fragment,this.vertexAttributeLocations);this.programBlendWeights=new c(g,b.blendWeightShader.vertex,b.blendWeightShader.fragment,this.vertexAttributeLocations);this.programBlur=new c(g,b.blurShader.vertex,b.blurShader.fragment,this.vertexAttributeLocations);var f=new Float32Array([-1,-1,3,-1,-1,3]);this.vao=new d(g,this.vertexAttributeLocations,{geometry:this.vertexBufferLayout},{geometry:new a(g,34962,35044,
- f)});this.tmpFramebufferEdges=e.createWithAttachments(this.rctx,{target:3553,pixelFormat:6407,dataType:5121,samplingMode:9729,wrapMode:33071,width:4,height:4},{colorTarget:0,depthStencilTarget:0});this.tmpFramebufferBlend=e.createWithAttachments(this.rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9729,wrapMode:33071,width:4,height:4},{colorTarget:0,depthStencilTarget:0});this.textureArea=this.loadTextureFromBase64(b.areaTexture,9729,6407);this.textureSearch=this.loadTextureFromBase64(b.searchTexure,
- 9728,6409);return this.isEnabled=!0};k.prototype.disable=function(){this.isEnabled&&(this.programEdgeDetect.dispose(),this.programEdgeDetect=null,this.programBlendWeights.dispose(),this.programBlendWeights=null,this.programBlur.dispose(),this.programBlur=null,this.vao.dispose(),this.vao=null,this.textureArea.dispose(),this.textureArea=null,this.textureSearch.dispose(),this.textureSearch=null,this.tmpFramebufferBlend.dispose(),this.tmpFramebufferBlend=null,this.tmpFramebufferEdges.dispose(),this.tmpFramebufferEdges=
- null,this.isEnabled=!1)};k.prototype.render=function(a,b){this.enable();var c=this.rctx,d=0,e=0;null!=b?(d=b.descriptor.width,e=b.descriptor.height):(d=c.gl.canvas.width,e=c.gl.canvas.height);c.bindVAO(this.vao);c.setFaceCullingEnabled(!0);c.setCullFace(1029);c.setFrontFace(2305);c.setBlendingEnabled(!1);c.setDepthTestEnabled(!1);c.setViewport(0,0,d,e);this.tmpFramebufferEdges.resize(d,e);c.bindFramebuffer(this.tmpFramebufferEdges);c.setClearColor(0,0,0,1);c.clear(c.gl.COLOR_BUFFER_BIT);c.bindProgram(this.programEdgeDetect);
- c.bindTexture(a.colorTexture,0);this.programEdgeDetect.setUniform1i("tColor",0);this.programEdgeDetect.setUniform4f("uResolution",1/d,1/e,d,e);c.drawArrays(4,0,3);this.tmpFramebufferBlend.resize(d,e);c.bindFramebuffer(this.tmpFramebufferBlend);c.setClearColor(0,0,1,1);c.clear(c.gl.COLOR_BUFFER_BIT);c.bindProgram(this.programBlendWeights);this.programBlendWeights.setUniform4f("uResolution",1/d,1/e,d,e);c.bindTexture(this.textureSearch,1);this.programBlendWeights.setUniform1i("tSearch",1);c.bindTexture(this.textureArea,
- 2);this.programBlendWeights.setUniform1i("tArea",2);c.bindTexture(this.tmpFramebufferEdges.colorTexture,3);this.programBlendWeights.setUniform1i("tEdges",3);c.drawArrays(4,0,3);c.bindFramebuffer(b);c.setClearColor(0,1,0,1);c.clear(c.gl.COLOR_BUFFER_BIT);c.bindProgram(this.programBlur);this.programBlur.setUniform4f("uResolution",1/d,1/e,d,e);c.bindTexture(a.colorTexture,0);this.programBlur.setUniform1i("tColor",0);c.bindTexture(this.tmpFramebufferBlend.colorTexture,1);this.programBlur.setUniform1i("tBlendWeights",
- 1);c.drawArrays(4,0,3);c.setDepthTestEnabled(!0)};k.prototype.loadTextureFromBase64=function(a,b,c){var d=new g(this.rctx,{pixelFormat:c,dataType:5121,wrapMode:33071,samplingMode:b},null);f.requestImage(a).then(function(a){d.resize(a.width,a.height);d.setData(a)});return d};return k}()})},"esri/views/3d/webgl-engine/lib/StencilRenderingHelper":function(){define(["require","exports","./Util"],function(r,h,f){return function(){function a(a){this._enabled=!1;this._rctx=a}a.prototype.enable=function(){this._enabled=
- !0;this._rctx.setStencilTestEnabled(!0)};a.prototype.disable=function(){this._enabled=!1;this._rctx.setStencilTestEnabled(!1)};a.prototype.getIsSupported=function(){return!!this._rctx.contextAttributes.stencil};a.prototype.setEnableState=function(a){a?this.enable():this.disable()};a.prototype.getEnableState=function(){return this._enabled};a.prototype.prepareStencilWritePass=function(){f.assert(this.getEnableState());var a=this._rctx;a.setStencilFunction(519,1,255);a.setStencilOp(7680,7680,7681);
- a.setStencilWriteMask(255)};a.prototype.finish=function(){if(this.getEnableState()){var a=this._rctx;a.setStencilFunction(519,0,0);a.setStencilOp(7680,7680,7680)}};a.prototype.enableStencilRead=function(){this.getEnableState()&&this._rctx.setStencilFunction(517,1,255)};a.prototype.disableStencilRead=function(){this.getEnableState()&&this._rctx.setStencilFunction(519,0,0)};return a}()})},"esri/views/3d/webgl-engine/lib/edgeRendering/EdgeView":function(){define("require exports ../../../../../core/tsSupport/assignHelper ../../../../../core/arrayUtils ../../../lib/glMatrix ../../../support/meshProcessing ../../../support/buffer/BufferView ../../../support/buffer/InterleavedLayout ../../../support/buffer/typedArrayUtil ../localOriginHelper ../LocalOriginManager ../PreinterleavedGeometryData ../RegularGridLocalOriginFactory ../Util ../TextureBackedBuffer/BufferManager ./EdgeRenderer ./RibbonEdgeRenderer ./strokes".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function d(a,b){this.rctx=a;this.programRepository=b;this.debugSettings={antialiasing:!0,receiveShadows:!0};this.profilingCallback=null;this.gpuMemoryUsage=0;this.geometries=new Map;this.renderers=new Map;this.localOrigins=new l.LocalOriginManager(new n(1E4));this.tmpModelPosition=e.vec3d.create();this.tmpCameraPosition=e.vec3d.create();this.componentColorManager=new u.BufferManager(this.rctx)}
- d.isSupported=function(a){return!!a.capabilities.instancing};d.prototype.computeModelTransformWithLocalOrigin=function(a,b,c){a.getCombinedStaticTransformation(b,c);b.origin?this.localOrigins.register(b.origin):(a=e.vec3d.set3(c[12],c[13],c[14],this.tmpModelPosition),b.origin=this.localOrigins.aquire(a));k.applyToModelMatrix(b.origin.vec3,c);return c};d.prototype.selectIndexData=function(a,c){if(c){c=b.slice(c);for(var d=0;d<c.length;d++)c[d]=a[c[d]];return c}return a};d.prototype.assignPerComponentAttributes=
- function(a,b,c,d){for(var e=[],g=this.componentColorManager.getBuffer(b.length),f=!1,k=null,l=null,m=null,p=0;p<b.length;p++){var n=b[p],q=n.color,t=255*q[0],h=255*q[1],u=255*q[2],v=255*q[3],q=g.aquireIndex();e.push({index:q,material:n});g.textureBuffer.setData(q,t,h,u,v);h=c[p];t=c[p+1];null!=k&&k!==n.size&&(f=!0);null!=m&&m!==n.extensionLength&&(f=!0);null!=l&&l!==n.type&&(f=!0);k=n.size;l=n.type;m=n.extensionLength;n=void 0;switch(l){case "solid":n=0;break;case "sketch":n=1}if(d)for(;h<t;h++)u=
- d[h],a.colorIndexBuffer.set(u,q),a.lineWidthBuffer.set(u,k),a.extensionsBuffer.set(u,m),a.typeBuffer.set(u,n);else for(;h<t;h++)a.colorIndexBuffer.set(h,q),a.lineWidthBuffer.set(h,k),a.extensionsBuffer.set(h,m),a.typeBuffer.set(h,n)}return{components:e,componentColorBuffer:g,requiresUberRenderer:f}};d.prototype.extractEdgeInformation=function(a,b){a=c.deduplicate(a.buffer,a.stride/4);b=this.selectIndexData(a.indices,b);var d=c.computeNeighbors(b,a.uniqueCount);return{faces:b,neighbors:d,vertices:m.createView(a.buffer)}};
- d.prototype.addGeometryNonPreinterleaved=function(a,b,c,d,g){var f=c.getAttribute("position"),k=this.computeModelTransformWithLocalOrigin(a,d,e.mat4d.create());d=d.origin;c={position:f,indices:c.getIndices("position"),modelTransform:k,origin:d};a=this.addNonPreinterleaved(a,c,g);this.geometries.set(b,a)};d.prototype.addNonPreinterleaved=function(a,b,c){for(var d=b.position,e=d.data.length/d.strideIdx,f=new g.BufferViewVec3f64((new Float64Array(3*e)).buffer),k=0;k<e;k++)f.set(k,0,d.data[d.offsetIdx+
- k*d.strideIdx+0]),f.set(k,1,d.data[d.offsetIdx+k*d.strideIdx+1]),f.set(k,2,d.data[d.offsetIdx+k*d.strideIdx+2]);d=m.createBuffer(f.count);for(k=0;k<f.count;k++)d.position.set(k,0,f.get(k,0)),d.position.set(k,1,f.get(k,1)),d.position.set(k,2,f.get(k,2));var k=this.assignPerComponentAttributes({colorIndexBuffer:d.componentIndex,lineWidthBuffer:d.lineWidth,typeBuffer:d.type,extensionsBuffer:d.extensions},[c],[0,d.componentIndex.count]),f=k.components,k=k.componentColorBuffer,e=this.extractEdgeInformation(d,
- b.indices),l={modelTransform:b.modelTransform,origin:b.origin,componentBuffer:k};b=this.getRendererInfo(c);d=b.renderer;c=d.createInstance(l,e,c);a={renderInstance:c,object:a,visible:!0,components:f,componentColorBuffer:k,distanceToCamera:0};this.gpuMemoryUsage+=c.gpuMemoryUsage;b.objects.add(a);return{objectData:a,renderer:d}};d.prototype.addGeometryPreinterleaved=function(a,b,c,d,f){var k=c.getAttribute("position");if(k&&k.data instanceof Float32Array){for(var l=this.computeModelTransformWithLocalOrigin(a,
- d,e.mat4d.create()),p=d.origin,n=c.getIndices("position"),k=new g.BufferViewVec3f(k.data.buffer,4*k.offsetIdx,4*k.strideIdx),q=m.createBuffer(k.count),h=0;h<k.count;h++)q.position.set(h,0,k.get(h,0)),q.position.set(h,1,k.get(h,1)),q.position.set(h,2,k.get(h,2));h=this.assignPerComponentAttributes({colorIndexBuffer:q.componentIndex,lineWidthBuffer:q.lineWidth,extensionsBuffer:q.extensions,typeBuffer:q.type},f,c.componentOffsets,n);c=h.components;k=h.componentColorBuffer;h=h.requiresUberRenderer;n=
- this.extractEdgeInformation(q,n);l={modelTransform:l,origin:p,componentBuffer:k};q=h?null:f[0];f=this.getRendererInfo(q);p=f.renderer;l=p.createInstance(l,n,q);a={renderInstance:l,object:a,visible:!a.isHidden(d),components:c,componentColorBuffer:k,distanceToCamera:0};this.gpuMemoryUsage+=l.gpuMemoryUsage;this.geometries.set(b,{renderer:p,objectData:a});f.objects.add(a)}else console.warn("Geometry has no float32 `position` attribute, skipping it.")};d.prototype.addObject=function(a,b,c){if(c&&c.mergeGeometries&&
- 1<a.geometries.length)this.addObjectMergedGeometries(a,b);else for(c=0;c<a.geometries.length;c++){var d=a.geometries[c],e=a.geometryRecords[c];e.materials[0].supportsEdges&&(d.data instanceof p?this.addGeometryPreinterleaved(a,d,d.data,e,b):this.addGeometryNonPreinterleaved(a,d,d.data,e,b[0]))}};d.prototype.addObjectMergedGeometries=function(a,b){for(var c=new Map,d=0,g=null,f=null,k=null,l=0;l<a.geometries.length;l++){var m=a.geometries[l],n=a.geometryRecords[l],q=n.materials[0];if(q.supportsEdges){if(m.data instanceof
- p)return console.error("Cannot merge geometries with pre interleaved geometry data"),this.addObject(a,b);if(!f)f=n.transformation;else if(!t.arraysEqual(f,n.transformation))return console.error("Cannot merge geometries with differing geometry transforms"),this.addObject(a,b);if(!k&&n.origin)k=n;else if(k&&n.origin&&k.origin.id!==n.origin.id)return console.error("Cannot merge geometries with differing origins"),this.addObject(a,b);m=m.data.getIndices("position");d+=m?m.length:0;if(m&&null==g||g===
- Uint16Array)g=m instanceof Uint16Array?Uint16Array:Uint32Array}}d=d?new g(d):null;g=[];for(l=f=0;l<a.geometries.length;l++)if(m=a.geometries[l],q=a.geometryRecords[l].materials[0],q.supportsEdges){q=m.data.getAttribute("position");m=m.data.getIndices("position");n=c.get(q.data);if(null==n){for(var n=g.length/3,h=q.offsetIdx;h<q.data.length;h+=q.strideIdx)g.push(q.data[h+0]),g.push(q.data[h+1]),g.push(q.data[h+2]);c.set(q.data,n)}if(m)for(q=0;q<m.length;q++)d[f++]=n+m[q]}l=k||a.geometryRecords[0];
- c=this.computeModelTransformWithLocalOrigin(a,l,e.mat4d.create());k=l.origin;for(l=0;l<a.geometryRecords.length;l++)a.geometryRecords[l].origin=k;b=this.addNonPreinterleaved(a,{position:{data:g,offsetIdx:0,strideIdx:3},indices:d,modelTransform:c,origin:k},b[0]);this.geometries.set(a.geometries[0],b)};d.prototype.hasObject=function(a){return this.geometries.has(a.geometries[0])};d.prototype.updateComponentColor=function(a,b,c){for(var d=0;d<a.geometries.length;d++){var e=this.geometries.get(a.geometries[d]);
- if(!e)break;e=e.objectData;e.componentColorBuffer.textureBuffer.setData(e.components[b].index,255*c[0],255*c[1],255*c[2],255*c[3])}};d.prototype.updateComponentOpacity=function(a,b,c){for(var d=0;d<a.geometries.length;d++){var e=this.geometries.get(a.geometries[d]);if(!e)break;e=e.objectData;e.componentColorBuffer.textureBuffer.setDataElement(e.components[b].index,3,255*c)}};d.prototype.updateObjectVisibility=function(a,b){for(var c=0;c<a.geometries.length;c++){var d=this.geometries.get(a.geometries[c]);
- if(!d)break;d.objectData.visible=b}};d.prototype.getComponentMaterial=function(a,b){if(a=this.geometries.get(a.geometries[0]))return a.objectData.components[b].material};d.prototype.removeObject=function(a){for(var b=0;b<a.geometries.length;b++){var c=a.geometries[b],d=this.geometries.get(c);d&&(this.removeGeometry(d),this.geometries.delete(c))}};d.prototype.removeGeometry=function(a){var b=a.objectData,c=this.renderers.get(a.renderer.key);c.objects.delete(a.objectData);this.localOrigins.release(b.renderInstance.origin);
- a.renderer.disposeInstance(b.renderInstance);this.gpuMemoryUsage-=b.renderInstance.gpuMemoryUsage;for(var d=0,e=b.components;d<e.length;d++)b.componentColorBuffer.releaseIndex(e[d].index);0===c.objects.size&&(this.renderers.delete(c.renderer.key),a.renderer.dispose())};d.prototype.removeAll=function(){var a=this;this.geometries.forEach(function(b){a.removeGeometry(b)});this.geometries.clear()};d.prototype.createSolidEdgeMaterial=function(a){return f({},B,a,{type:"solid"})};d.prototype.createSketchEdgeMaterial=
- function(a){return f({},z,a,{type:"sketch"})};d.prototype.estimateLengthAtDistance=function(a,b,c){return c/a.fullWidth*b*2*Math.tan(.5*a.fovX)};d.prototype.render=function(a,b){var c=this;this.localOrigins.updateViewMatrices(b.view);this.componentColorManager.garbageCollect();this.componentColorManager.updateTextures();var d=b.view,e=0;this.geometries.forEach(function(a){e+=a.objectData.renderInstance.averageEdgeLength});var g={distanceFalloffFactor:e/this.geometries.size*40,minimumEdgeLength:this.estimateLengthAtDistance(a,
- 1,3.5)};(a=this.rctx.capabilities.blendMinMax)?(this.rctx.setDepthWriteEnabled(!1),this.rctx.setBlendingEnabled(!0),this.rctx.setBlendEquationSeparate(32774,a.MAX),this.rctx.setBlendFunctionSeparate(1,0,1,1)):(this.rctx.setDepthWriteEnabled(!0),this.rctx.setBlendingEnabled(!1));this.rctx.setDepthTestEnabled(!0);this.rctx.setDepthFunction(515);this.updateObjectCameraDistances(b);this.renderers.forEach(function(a){var d=a.renderer;a=a.objects;d.begin(b);c.renderEdges(d,a,b,g);c.renderSilhouettes(d,
- a,b,g);d.end(b)});this.rctx.setDepthWriteEnabled(!0);this.rctx.setDepthFunction(513);this.rctx.setBlendEquationSeparate(32774,32774);this.rctx.setBlendFunctionSeparate(1,0,1,1);b.view=d};Object.defineProperty(d.prototype,"compositingMode",{get:function(){return"alpha"},enumerable:!0,configurable:!0});d.prototype.updateObjectCameraDistances=function(a){var b=this;a=a.viewInvTransp;e.vec3d.set3(a[3],a[7],a[11],this.tmpCameraPosition);this.renderers.forEach(function(a){a.objects.forEach(function(a){a.distanceToCamera=
- e.vec3d.dist(a.object.getCenter(),b.tmpCameraPosition)})})};d.prototype.findLowerBoundIndex=function(b,c){var d=a.binaryIndexOf(b,c,!0);return-1===d?c<b[0]?0:b.length:d};d.prototype.computeEdgeCount=function(a,b,c){return a.length-this.findLowerBoundIndex(a,b*c.minimumEdgeLength)};d.prototype.renderEdges=function(a,b,c,d){var e=this;a.bindEdges(c,d);b.forEach(function(b){if(b.visible){var g=e.computeEdgeCount(b.renderInstance.edgeLoD.lengths,b.distanceToCamera,d);c.view=e.localOrigins.getViewMatrix(b.renderInstance.origin);
- a.renderEdges(b.renderInstance,c,g)}})};d.prototype.renderSilhouettes=function(a,b,c,d){var e=this;a.bindSilhouettes(c,d);b.forEach(function(b){if(b.visible){var g=e.computeEdgeCount(b.renderInstance.silhouetteLoD.lengths,b.distanceToCamera,d);c.view=e.localOrigins.getViewMatrix(b.renderInstance.origin);a.renderSilhouettes(b.renderInstance,c,g)}})};d.prototype.rendererClassCreator=function(a){var b=this.debugSettings,c=b.antialiasing,b=b.receiveShadows;this.strokesTexture||(this.strokesTexture=x.generateStrokesTexture(this.rctx));
- var d={antialiasing:c,receiveShadows:b,strokesTexture:this.strokesTexture};return a?{create:function(a,b,c){return new v.default(a,b,c,f({},d,{uber:!1}))},key:v.default.getKey(a)}:{create:function(a,b,c){return new v.default(a,b,null,f({},d,{uber:!0}))},key:v.default.getKey(a)}};d.prototype.getRendererInfo=function(a){var b=this.rendererClassCreator(a),c=this.renderers.get(b.key);if(c)return c;a=b.create(this.rctx,this.programRepository,a);c=new Set;a={renderer:a,objects:c};this.renderers.set(b.key,
- a);return a};d.loadShaders=function(a,b,c){q.default.loadShaders(a,b,c);v.default.loadShaders(a,b,c)};d.prototype.getGpuMemoryUsage=function(){return this.gpuMemoryUsage/1048576};return d}();h.EdgeView=r;var m=d.newLayout().vec3f("position").u16("componentIndex").u8("lineWidth").u8("type").i8("extensions").vec2u8("_padding",{glPadding:!0}).u8("_padding2",{glPadding:!0}),B={color:e.vec4d.createFrom(0,0,0,.2),size:1,extensionLength:0},z={color:e.vec4d.createFrom(0,0,0,.2),size:1,extensionLength:0}})},
- "esri/views/3d/support/meshProcessing":function(){define(["require","exports","../webgl-engine/lib/Util"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.computeNeighbors=function(a,c){for(var e=a.length/3,d=new Uint32Array(c+1),b=new Uint32Array(c+1),f=function(a,c){a<c?d[a+1]++:b[c+1]++},l=0;l<e;l++){var p=a[3*l],n=a[3*l+1],h=a[3*l+2];f(p,n);f(n,h);f(h,p)}for(l=n=p=0;l<c;l++)h=d[l+1],f=b[l+1],d[l+1]=p,b[l+1]=n,p+=h,n+=f;for(var u=new Uint32Array(6*e),q=d[c],f=function(a,c,e){if(a<
- c){var g=d[a+1]++;u[2*g]=c;u[2*g+1]=e}else g=b[c+1]++,u[2*q+2*g]=a,u[2*q+2*g+1]=e},l=0;l<e;l++)p=a[3*l],n=a[3*l+1],h=a[3*l+2],f(p,n,l),f(n,h,l),f(h,p,l);p=function(a,b){var c=2*a;a=b-a;for(b=1;b<a;b++){var d=u[c+2*b],e=u[c+2*b+1],g=b-1;for(g;0<=g&&u[c+2*g]>d;g--)u[c+2*g+2]=u[c+2*g],u[c+2*g+3]=u[c+2*g+1];u[c+2*g+2]=d;u[c+2*g+3]=e}};for(l=0;l<c;l++)p(d[l],d[l+1]),p(q+b[l],q+b[l+1]);for(var v=new Int32Array(3*e),x=function(b,c){return b===a[3*c]?0:b===a[3*c+1]?1:b===a[3*c+2]?2:-1},e=function(a,b){a=
- x(a,b);v[3*b+a]=-1},p=function(a,b,c,d){a=x(a,b);v[3*b+a]=d;c=x(c,d);v[3*d+c]=b},l=0;l<c;l++){for(var n=d[l],h=d[l+1],f=b[l],m=b[l+1];n<h&&f<m;){var B=u[2*n],z=u[2*q+2*f];B===z?(p(l,u[2*n+1],z,u[2*q+2*f+1]),n++,f++):B<z?(e(l,u[2*n+1]),n++):(e(z,u[2*q+2*f+1]),f++)}for(;n<h;)e(l,u[2*n+1]),n++;for(;f<m;)z=u[2*q+2*f],e(z,u[2*q+2*f+1]),f++}return v};var a=null;h.deduplicate=function(e,c,g,d,b){void 0===g&&(g=0);void 0===d&&(d=0);void 0===b&&(b=e.byteLength/(4*c));e=new Uint32Array(e,d,b*c);d=new Uint32Array(b);
- var k=Math.floor(1.1*b)+1;if(null==a||a.length<2*k)a=new Uint32Array(f.nextHighestPowerOfTwo(2*k));for(var l=0;l<2*k;l++)a[l]=0;for(var p=0,n=0!==g?Math.ceil(7.84*1.96/(g*g)*g*(1-g)):b,l=0;l<b;l++){if(l===n){var h=1-p/l;if(h+1.96*Math.sqrt(h*(1-h)/l)<g)return null;n*=2}for(var h=l*c,u,q=u=0;q<c;q++)u=e[h+q]+u|0,u=u+(u<<11)+(u>>>2)|0;u>>>=0;for(var q=u%k,v=p;0!==a[2*q+1];){if(a[2*q]===u){var x=a[2*q+1]-1,m=x*c;a:{for(var B=0;B<c;B++)if(e[h+B]!==e[m+B]){m=!1;break a}m=!0}if(m){v=d[x];break}}q++;q>=
- k&&(q-=k)}v===p&&(a[2*q]=u,a[2*q+1]=l+1,p++);d[l]=v}if(0!==g&&1-p/b<g)return null;g=new Uint32Array(c*p);for(l=p=0;l<b;l++)if(d[l]===p){k=e;n=l*c;h=g;u=p*c;q=c;for(v=0;v<q;v++)h[u+v]=k[n+v];p++}return{buffer:g.buffer,indices:d,uniqueCount:p}}})},"esri/views/3d/support/buffer/BufferView":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./internals/Mat4 ./internals/Single ./internals/Vec2 ./internals/Vec3 ./internals/Vec4".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,
- "__esModule",{value:!0});r=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float32Array,b,c,d)||this}f(b,a);b.ElementType="f32";return b}(e.BufferViewSingle);h.BufferViewFloat=r;r=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float32Array,b,c,d)||this}f(b,a);b.ElementType="f32";return b}(c.BufferViewVec2);h.BufferViewVec2f=r;r=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float32Array,b,c,d)||this}f(b,a);b.ElementType="f32";return b}(g.BufferViewVec3);
- h.BufferViewVec3f=r;r=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float32Array,b,c,d)||this}f(b,a);b.ElementType="f32";return b}(d.BufferViewVec4);h.BufferViewVec4f=r;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float32Array,b,c,d)||this}f(b,a);b.ElementType="f32";return b}(a.BufferViewMat4);h.BufferViewMat4f=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float64Array,b,c,d)||this}f(b,a);b.ElementType="f64";return b}(e.BufferViewSingle);
- h.BufferViewFloat64=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float64Array,b,c,d)||this}f(b,a);b.ElementType="f64";return b}(c.BufferViewVec2);h.BufferViewVec2f64=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float64Array,b,c,d)||this}f(b,a);b.ElementType="f64";return b}(g.BufferViewVec3);h.BufferViewVec3f64=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Float64Array,b,c,d)||this}f(b,a);b.ElementType="f64";return b}(d.BufferViewVec4);
- h.BufferViewVec4f64=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint8Array,b,c,d)||this}f(b,a);b.ElementType="u8";return b}(e.BufferViewSingle);h.BufferViewUint8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint8Array,b,c,d)||this}f(b,a);b.ElementType="u8";return b}(c.BufferViewVec2);h.BufferViewVec2u8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint8Array,b,c,d)||this}f(b,a);b.ElementType="u8";return b}(g.BufferViewVec3);
- h.BufferViewVec3u8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint8Array,b,c,d)||this}f(b,a);b.ElementType="u8";return b}(d.BufferViewVec4);h.BufferViewVec4u8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint16Array,b,c,d)||this}f(b,a);b.ElementType="u16";return b}(e.BufferViewSingle);h.BufferViewUint16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint16Array,b,c,d)||this}f(b,a);b.ElementType="u16";return b}(c.BufferViewVec2);
- h.BufferViewVec2u16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint16Array,b,c,d)||this}f(b,a);b.ElementType="u16";return b}(g.BufferViewVec3);h.BufferViewVec3u16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint16Array,b,c,d)||this}f(b,a);b.ElementType="u16";return b}(d.BufferViewVec4);h.BufferViewVec4u16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint32Array,b,c,d)||this}f(b,a);b.ElementType="u32";return b}(e.BufferViewSingle);
- h.BufferViewUint32=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint32Array,b,c,d)||this}f(b,a);b.ElementType="u32";return b}(c.BufferViewVec2);h.BufferViewVec2u32=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint32Array,b,c,d)||this}f(b,a);b.ElementType="u32";return b}(g.BufferViewVec3);h.BufferViewVec3u32=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Uint32Array,b,c,d)||this}f(b,a);b.ElementType="u32";return b}(d.BufferViewVec4);
- h.BufferViewVec4u32=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int8Array,b,c,d)||this}f(b,a);b.ElementType="i8";return b}(e.BufferViewSingle);h.BufferViewInt8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int8Array,b,c,d)||this}f(b,a);b.ElementType="i8";return b}(c.BufferViewVec2);h.BufferViewVec2i8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int8Array,b,c,d)||this}f(b,a);b.ElementType="i8";return b}(g.BufferViewVec3);
- h.BufferViewVec3i8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int8Array,b,c,d)||this}f(b,a);b.ElementType="i8";return b}(d.BufferViewVec4);h.BufferViewVec4i8=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int16Array,b,c,d)||this}f(b,a);b.ElementType="i16";return b}(e.BufferViewSingle);h.BufferViewInt16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int16Array,b,c,d)||this}f(b,a);b.ElementType="i16";return b}(c.BufferViewVec2);
- h.BufferViewVec2i16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int16Array,b,c,d)||this}f(b,a);b.ElementType="i16";return b}(g.BufferViewVec3);h.BufferViewVec3i16=a;a=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int16Array,b,c,d)||this}f(b,a);b.ElementType="i16";return b}(d.BufferViewVec4);h.BufferViewVec4i16=a;e=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int32Array,b,c,d)||this}f(b,a);b.ElementType="i32";return b}(e.BufferViewSingle);
- h.BufferViewInt32=e;c=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int32Array,b,c,d)||this}f(b,a);b.ElementType="i32";return b}(c.BufferViewVec2);h.BufferViewVec2i32=c;g=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int32Array,b,c,d)||this}f(b,a);b.ElementType="i32";return b}(g.BufferViewVec3);h.BufferViewVec3i32=g;d=function(a){function b(b,c,d){void 0===c&&(c=0);return a.call(this,Int32Array,b,c,d)||this}f(b,a);b.ElementType="i32";return b}(d.BufferViewVec4);
- h.BufferViewVec4i32=d})},"esri/views/3d/support/buffer/internals/Mat4":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a,e,c,g){void 0===c&&(c=0);a=this.TypedArrayConstructor=a;void 0===g&&(g=4*a.BYTES_PER_ELEMENT);this.data=new a(e,0===e.byteLength?0:c);this.elementStride=g/a.BYTES_PER_ELEMENT}f.prototype.getMat=function(a,e){a*=this.elementStride;for(var c=0;16>c;c++)e[c]=this.data[a+c];return e};f.prototype.setMat=function(a,
- e){a*=this.elementStride;for(var c=0;16>c;c++)this.data[a+c]=e[c]};f.prototype.get=function(a,e){return this.data[a*this.elementStride+e]};f.prototype.set=function(a,e,c){this.data[a*this.elementStride+e]=c};Object.defineProperty(f.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,
- "typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});f.ElementCount=16;return f}();h.BufferViewMat4=r})},"esri/views/3d/support/buffer/internals/Single":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a,e,c,g){void 0===c&&(c=0);a=this.TypedArrayConstructor=
- a;void 0===g&&(g=a.BYTES_PER_ELEMENT);this.data=new a(e,0===e.byteLength?0:c);this.elementStride=g/a.BYTES_PER_ELEMENT}f.prototype.get=function(a){return this.data[a*this.elementStride]};f.prototype.set=function(a,e){this.data[a*this.elementStride]=e};Object.defineProperty(f.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});
- Object.defineProperty(f.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});f.ElementCount=1;return f}();h.BufferViewSingle=r})},"esri/views/3d/support/buffer/internals/Vec2":function(){define(["require","exports","../../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});
- r=function(){function a(a,c,g,d){void 0===g&&(g=0);a=this.TypedArrayConstructor=a;void 0===d&&(d=2*a.BYTES_PER_ELEMENT);this.data=new a(c,0===c.byteLength?0:g);this.elementStride=d/a.BYTES_PER_ELEMENT}a.prototype.getVec=function(a,c){return f.vec2d.set2(this.data[a*this.elementStride],this.data[a*this.elementStride+1],c)};a.prototype.setVec=function(a,c){this.data[a*this.elementStride]=c[0];this.data[a*this.elementStride+1]=c[1]};a.prototype.get=function(a,c){return this.data[a*this.elementStride+
- c]};a.prototype.set=function(a,c,g){this.data[a*this.elementStride+c]=g};Object.defineProperty(a.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stride",{get:function(){return this.elementStride*
- this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});a.ElementCount=2;return a}();h.BufferViewVec2=r})},"esri/views/3d/support/buffer/internals/Vec3":function(){define(["require","exports","../../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a,c,g,d){void 0===g&&(g=0);a=this.TypedArrayConstructor=a;void 0===d&&(d=3*a.BYTES_PER_ELEMENT);this.data=new a(c,0===c.byteLength?0:g);this.elementStride=d/a.BYTES_PER_ELEMENT}
- a.prototype.getVec=function(a,c){return f.vec3d.set3(this.data[a*this.elementStride],this.data[a*this.elementStride+1],this.data[a*this.elementStride+2],c)};a.prototype.setVec=function(a,c){this.data[a*this.elementStride]=c[0];this.data[a*this.elementStride+1]=c[1];this.data[a*this.elementStride+2]=c[2]};a.prototype.get=function(a,c){return this.data[a*this.elementStride+c]};a.prototype.set=function(a,c,g){this.data[a*this.elementStride+c]=g};Object.defineProperty(a.prototype,"count",{get:function(){return Math.ceil(this.data.length/
- this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});a.ElementCount=3;return a}();h.BufferViewVec3=r})},"esri/views/3d/support/buffer/internals/Vec4":function(){define(["require",
- "exports","../../../lib/glMatrix"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a,c,g,d){void 0===g&&(g=0);a=this.TypedArrayConstructor=a;void 0===d&&(d=4*a.BYTES_PER_ELEMENT);this.data=new a(c,0===c.byteLength?0:g);this.elementStride=d/a.BYTES_PER_ELEMENT}a.prototype.getVec=function(a,c){return f.vec4d.set4(this.data[a*this.elementStride],this.data[a*this.elementStride+1],this.data[a*this.elementStride+2],this.data[a*this.elementStride+3],c)};a.prototype.setVec=
- function(a,c){this.data[a*this.elementStride]=c[0];this.data[a*this.elementStride+1]=c[1];this.data[a*this.elementStride+2]=c[2];this.data[a*this.elementStride+3]=c[3]};a.prototype.get=function(a,c){return this.data[a*this.elementStride+c]};a.prototype.set=function(a,c,g){this.data[a*this.elementStride+c]=g};Object.defineProperty(a.prototype,"count",{get:function(){return Math.ceil(this.data.length/this.elementStride)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return this.data.buffer},
- enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"typedBuffer",{get:function(){return this.data},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"stride",{get:function(){return this.elementStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT},enumerable:!0,configurable:!0});a.ElementCount=4;return a}();h.BufferViewVec4=r})},"esri/views/3d/support/buffer/InterleavedLayout":function(){define(["require","exports","./BufferView"],function(r,h,f){Object.defineProperty(h,
- "__esModule",{value:!0});var a=function(){function a(a,c){this.layout=a;this.buffer="number"===typeof c?new ArrayBuffer(c*a.stride):c;c=0;for(var b=a.fieldNames;c<b.length;c++){var d=b[c],e=a.fields.get(d);this[d]=new e.constructor(this.buffer,e.offset,this.stride)}}Object.defineProperty(a.prototype,"stride",{get:function(){return this.layout.stride},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"count",{get:function(){return this.buffer.byteLength/this.stride},enumerable:!0,configurable:!0});
- a.prototype.slice=function(c,d){return new a(this.layout,this.buffer.slice(c*this.stride,d*this.stride))};return a}(),e=function(){function c(){this.stride=0;this.fields=new Map;this.fieldNames=[]}c.prototype.vec2f=function(a,c){this.fields.set(a,{size:8,constructor:f.BufferViewVec2f,offset:this.stride,optional:c});this.stride+=8;this.fieldNames.push(a);return this};c.prototype.vec3f=function(a,c){this.fields.set(a,{size:12,constructor:f.BufferViewVec3f,offset:this.stride,optional:c});this.stride+=
- 12;this.fieldNames.push(a);return this};c.prototype.vec4f=function(a,c){this.fields.set(a,{size:16,constructor:f.BufferViewVec4f,offset:this.stride,optional:c});this.stride+=16;this.fieldNames.push(a);return this};c.prototype.mat4f=function(a,c){this.fields.set(a,{size:64,constructor:f.BufferViewMat4f,offset:this.stride,optional:c});this.stride+=64;this.fieldNames.push(a);return this};c.prototype.vec4u8=function(a,c){this.fields.set(a,{offset:this.stride,size:4,optional:c,constructor:f.BufferViewVec4u8});
- this.stride+=4;this.fieldNames.push(a);return this};c.prototype.u8=function(a,c){this.fields.set(a,{offset:this.stride,size:1,optional:c,constructor:f.BufferViewUint8});this.stride+=1;this.fieldNames.push(a);return this};c.prototype.u16=function(a,c){this.fields.set(a,{offset:this.stride,size:2,optional:c,constructor:f.BufferViewUint16});this.stride+=2;this.fieldNames.push(a);return this};c.prototype.i8=function(a,c){this.fields.set(a,{offset:this.stride,size:1,optional:c,constructor:f.BufferViewInt8});
- this.stride+=1;this.fieldNames.push(a);return this};c.prototype.vec2i8=function(a,c){this.fields.set(a,{offset:this.stride,size:2,optional:c,constructor:f.BufferViewVec2i8});this.stride+=2;this.fieldNames.push(a);return this};c.prototype.vec2i16=function(a,c){this.fields.set(a,{offset:this.stride,size:4,optional:c,constructor:f.BufferViewVec2i16});this.stride+=4;this.fieldNames.push(a);return this};c.prototype.vec2u8=function(a,c){this.fields.set(a,{offset:this.stride,size:2,optional:c,constructor:f.BufferViewVec2u8});
- this.stride+=2;this.fieldNames.push(a);return this};c.prototype.vec4u16=function(a,c){this.fields.set(a,{offset:this.stride,size:8,optional:c,constructor:f.BufferViewVec4u16});this.stride+=8;this.fieldNames.push(a);return this};c.prototype.u32=function(a,c){this.fields.set(a,{offset:this.stride,size:4,optional:c,constructor:f.BufferViewUint32});this.stride+=4;this.fieldNames.push(a);return this};c.prototype.createBuffer=function(c){return new a(this,c)};c.prototype.createView=function(c){return new a(this,
- c)};c.prototype.clone=function(){var a=new c;a.stride=this.stride;a.fields=new Map;this.fields.forEach(function(c,b){return a.fields.set(b,c)});a.fieldNames=this.fieldNames.slice();a.BufferType=this.BufferType;return a};return c}();h.InterleavedLayout=e;h.newLayout=function(){return new e}})},"esri/views/3d/support/buffer/typedArrayUtil":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.forEach=function(f,a){if(f.forEach)f.forEach(a);else for(var e=
- 0;e<f.length;e++)a(f[e],e,f)};h.slice=function(f,a,e){if(f.slice)return f.slice(a,e);void 0===a?a=0:(0>a&&(a+=f.length),a=Math.min(f.length,Math.max(0,a)));void 0===e?e=f.length:(0>e&&(e+=f.length),e=Math.min(f.length,Math.max(0,e)));e=Math.max(0,e-a);for(var c=new f.constructor(e),g=0;g<e;g++)c[g]=f[a+g];return c}})},"esri/views/3d/webgl-engine/lib/localOriginHelper":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.applyToModelMatrix=function(f,
- a){var e=-f[0],c=-f[1];f=-f[2];var g=a[3],d=a[7],b=a[11],k=a[15];a[0]+=g*e;a[1]+=g*c;a[2]+=g*f;a[4]+=d*e;a[5]+=d*c;a[6]+=d*f;a[8]+=b*e;a[9]+=b*c;a[10]+=b*f;a[12]+=k*e;a[13]+=k*c;a[14]+=k*f};h.applyToViewMatrix=function(f,a){var e=f[0],c=f[1];f=f[2];a[12]+=e*a[0]+c*a[4]+f*a[8];a[13]+=e*a[1]+c*a[5]+f*a[9];a[14]+=e*a[2]+c*a[6]+f*a[10];a[14]+=e*a[3]+c*a[7]+f*a[11]}})},"esri/views/3d/webgl-engine/lib/LocalOriginManager":function(){define(["require","exports","./gl-matrix","./localOriginHelper"],function(r,
- h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function e(a){this.factory=a;this.originData=new Map}e.prototype.aquire=function(a){return this.register(this.factory.getOrigin(a))};e.prototype.register=function(a){var c=this.originData.get(a.id);if(c)return c.refCount++,c.origin;this.originData.set(a.id,{refCount:1,viewMatrix:f.mat4d.identity(),origin:a});return a};e.prototype.release=function(a){var c=this.originData.get(a.id);c&&(c.refCount--,0===c.refCount&&this.originData.delete(a.id))};
- e.prototype.updateViewMatrices=function(c){this.originData.forEach(function(e){f.mat4d.set(c,e.viewMatrix);a.applyToViewMatrix(e.origin.vec3,e.viewMatrix)})};e.prototype.getViewMatrix=function(a){return this.originData.get(a.id).viewMatrix};return e}();h.LocalOriginManager=r})},"esri/views/3d/webgl-engine/lib/PreinterleavedGeometryData":function(){define(["require","exports","./ComponentUtils","./geometryDataUtils","../../../webgl/Util"],function(r,h,f,a,e){function c(a){switch(a){case 5120:return Int8Array;
- case 5126:return Float32Array;case 5124:return Int32Array;case 5122:return Int16Array;case 5121:return Uint8Array;case 5125:return Uint32Array;case 5123:return Uint16Array}throw Error("Unhandled data type: "+a);}return function(){function g(d,b,k,l,h){void 0===k&&(k=null);void 0===l&&(l=g.DefaultOffsets);void 0===h&&(h=g.DefaultIndices);this.preinterleaved=!0;this.primitiveType="triangle";this._positionData=null;var n=e.getStride(b)/4,n=d.length/n;(this._hasDefaultIndices=h===g.DefaultIndices)&&(h=
- a.generateDefaultIndexArray(n));for(var n={},p=0;p<b.length;p++){var u=b[p],q=new (c(u.type))(d.buffer),v=e.getBytesPerElement(u.type);n[u.name]={data:q,size:u.count,offsetIdx:u.offset/v,strideIdx:u.stride/v}}k&&(this._positionData=k,n.position={data:k.data,size:3,offsetIdx:0,strideIdx:3});this._id=a.getNewId();this._vertexData=d;this._vertexAttributes=n;this._layout=b;this._indexData=h;this._componentOffsets=f.createOffsets(l);this._gpuMemoryUsage=d.byteLength+(this._hasDefaultIndices?0:h.byteLength)}
- Object.defineProperty(g.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"layout",{get:function(){return this._layout},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"componentOffsets",{get:function(){return this._componentOffsets},enumerable:!0,configurable:!0});g.prototype.toRenderData=function(){var a={id:this._id.toString(),preinterleaved:!0,indexData:this._hasDefaultIndices?null:this._indexData,indexCount:this._indexData.length,
- vertexData:this._vertexData,layout:this._layout};this._indexData=this._vertexData=null;this._vertexAttributes={position:this._vertexAttributes.position};return a};g.prototype.getIndices=function(a){return"position"===a&&this._positionData?this._positionData.indices:this._indexData};g.prototype.getAttribute=function(a){return this._vertexAttributes[a]};g.prototype.estimateGpuMemoryUsage=function(){return this._gpuMemoryUsage};g.DefaultOffsets=new Uint32Array(0);g.DefaultIndices=new Uint32Array(0);
- return g}()})},"esri/views/3d/webgl-engine/lib/RegularGridLocalOriginFactory":function(){define(["require","exports"],function(r,h){return function(){function f(a){this._gridSize=a;this._origins={}}f.prototype.getOrigin=function(a){var e=this._gridSize,c=Math.round(a[0]/e),g=Math.round(a[1]/e);a=Math.round(a[2]/e);var e=""+f.ORIGIN_PREFIX+c+"/"+g+"/"+a,d=this._origins[e];if(!d){var d=this._gridSize,b=f.OFFSET,d={id:e,vec3:[c*d+b,g*d+b,a*d+b]};this._origins[e]=d}return d};f.ORIGIN_PREFIX="rg_";f.OFFSET=
- 1.11;return f}()})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager":function(){define(["require","exports","./ManagedTextureBackedBuffer"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a){this.rctx=a;this.buffers=[]}a.prototype.garbageCollect=function(){this.buffers=this.buffers.filter(function(a){return 0===a.activeCount?(a.dispose(),!1):!0})};a.prototype.getBuffer=function(a){for(var c=0,e=this.buffers;c<e.length;c++){var d=e[c];if(d.availableCount>=
- a)return d}if(!(a>f.MAX_INDEX_COUNT))return a=new f.ManagedTextureBackedBuffer(this.rctx),this.buffers.push(a),a};a.prototype.updateTextures=function(){for(var a=0,c=this.buffers;a<c.length;a++)c[a].textureBuffer.updateTexture()};return a}();h.BufferManager=r})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer":function(){define(["require","exports","./SimpleIndexManager","./TextureBackedBuffer"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.MAX_INDEX_COUNT=
- 65536;r=function(){function e(c){this.indexManager=new f.SimpleIndexManager(h.MAX_INDEX_COUNT);this.textureBuffer=new a.TextureBackedBuffer(c)}e.prototype.dispose=function(){this.textureBuffer.dispose();this.textureBuffer=void 0};Object.defineProperty(e.prototype,"availableCount",{get:function(){return this.indexManager.availableCount},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"activeCount",{get:function(){return this.indexManager.activeCount},enumerable:!0,configurable:!0});
- e.prototype.aquireIndex=function(){var a=this.indexManager.aquire();this.textureBuffer.resizeToFit(a);return a};e.prototype.releaseIndex=function(a){this.indexManager.release(a)};return e}();h.ManagedTextureBackedBuffer=r})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/SimpleIndexManager":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a){this.maxCount=a;this._nextIndex=0;this.recycledIndices=[]}Object.defineProperty(f.prototype,
- "activeCount",{get:function(){return this._nextIndex-this.recycledIndices.length},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"availableCount",{get:function(){return this.recycledIndices.length+this.maxCount-this._nextIndex},enumerable:!0,configurable:!0});f.prototype.aquire=function(){if(0<this.recycledIndices.length)return this.recycledIndices.pop();if(this.availableCount)return this._nextIndex++};f.prototype.release=function(a){this.recycledIndices.push(a)};return f}();h.SimpleIndexManager=
- r})},"esri/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer":function(){define(["require","exports","../../../support/buffer/BufferView","../../../../webgl/Texture"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function e(c){this.rctx=c;this.textureWidth=4096;this.dirty=!0;this.texture=new a(this.rctx,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:this.textureWidth,height:1,flipped:!1});this.data=new f.BufferViewVec4u8(new ArrayBuffer(4*
- this.textureWidth))}e.prototype.dispose=function(){this.texture.dispose();this.data=this.texture=void 0};e.prototype.setData=function(a,e,d,b,f){this.dirty=!0;this.data.set(a,0,e);this.data.set(a,1,d);this.data.set(a,2,b);this.data.set(a,3,f)};e.prototype.setDataElement=function(a,e,d){this.dirty=!0;this.data.set(a,e,d)};e.prototype.resizeToFit=function(a){a>=this.data.count&&(a=new f.BufferViewVec4u8(new ArrayBuffer(Math.ceil((a+1)/this.textureWidth)*this.textureWidth*4)),a.typedBuffer.set(this.data.typedBuffer),
- this.data=a)};e.prototype.updateTexture=function(){if(this.dirty){var a=this.texture.descriptor.width;this.data.count>a*this.texture.descriptor.height&&this.texture.resize(a,this.data.count/a);this.texture.setData(this.data.typedBuffer);this.dirty=!1}};e.prototype.bind=function(a,e){this.rctx.bindTexture(this.texture,e.unit);a.setUniform1i(e.tex,e.unit);a.setUniform2f(e.invDim,1/this.texture.descriptor.width,1/this.texture.descriptor.height)};return e}();h.TextureBackedBuffer=r})},"esri/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer":function(){define("require exports ../../../../../core/tsSupport/assignHelper dojo/text!./EdgeRendererUtils.xml ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ./edgePreprocessing ../../../../webgl/BufferObject ../../../../webgl/VertexArrayObject".split(" "),
- function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});var k=c.newLayout().vec2u8("sidenessAtt");h.glVertexLayout=e.glLayout(k);r=function(){function c(a,b,c){this.rctx=a;this.programRepository=b;this.key=c;this.depthBiasZ=-4E-4;this.depthBiasXY=.5;a=k.createBuffer(4);for(b=0;4>b;b++)a.sidenessAtt.set(b,0,0===b||3===b?0:1),a.sidenessAtt.set(b,1,0===b||1===b?0:1);this.verticesBufferObject=d.createVertex(this.rctx,35044,a.buffer)}c.prototype.dispose=function(){for(var a in this.programs){var b=
- this.programs[a];b&&(this.programRepository.decreaseRefCount(b),this.programs[a]=null)}this.verticesBufferObject&&(this.verticesBufferObject.dispose(),this.verticesBufferObject=null)};c.prototype.createInstance=function(a,c,e){c=g.extractEdges(c,this.edgeBufferWriters.default.writer,this.edgeBufferWriters.silhouette.writer);var k=c.averageEdgeLength,l=null,n=null,p=0;0<c.edge.lodInfo.lengths.length&&(l=new b(this.rctx,h.attributeLocations,{vertices:h.glVertexLayout,instances:this.edgeBufferWriters.default.glLayout},
- {vertices:this.verticesBufferObject,instances:d.createVertex(this.rctx,35044,c.edge.instancesData.buffer)}),p+=l.size);0<c.silhouette.lodInfo.lengths.length&&(n=new b(this.rctx,h.attributeLocations,{vertices:h.glVertexLayout,instances:this.edgeBufferWriters.silhouette.glLayout},{vertices:this.verticesBufferObject,instances:d.createVertex(this.rctx,35044,c.silhouette.instancesData.buffer)}),p+=n.size);return f({},a,{edgeVAO:l,silhouetteVAO:n,material:e,averageEdgeLength:k,gpuMemoryUsage:p,edgeLoD:c.edge.lodInfo,
- silhouetteLoD:c.silhouette.lodInfo})};c.prototype.disposeInstance=function(a){a.edgeVAO&&(a.edgeVAO.vertexBuffers.instances.dispose(),a.edgeVAO.dispose(!1),a.edgeVAO=null);a.silhouetteVAO&&(a.silhouetteVAO.vertexBuffers.instances.dispose(),a.silhouetteVAO.dispose(!1),a.silhouetteVAO=null)};c.prototype.addProgram=function(a,b){this.programs||(this.programs={});this.programs[a]=b;this.programRepository.increaseRefCount(b)};c.loadShaders=function(b,c,d){b.EdgeRendererUtils_readComponentColor||b._parse(a)};
- return c}();h.EdgeRenderer=r;h.attributeLocations={position0:0,componentIndex:1,position1:2,packedAttributes:3,normalA:4,normalB:5,normal:6,variantOffset:7,variantStroke:8,variantExtension:9,extensionDirection:10,sidenessAtt:11};h.componentColorBindParameters={tex:"uComponentColorTex",invDim:"uComponentColorTexInvDim",unit:2};h.default=r})},"esri/views/3d/support/buffer/glUtil":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.glLayout=function(a,
- e){void 0===e&&(e=0);var c=a.stride;return a.fieldNames.filter(function(c){c=a.fields.get(c).optional;return!(c&&c.glPadding)}).map(function(g){var d=a.fields.get(g),b=d.constructor.ElementCount;var k=f[d.constructor.ElementType];if(!k)throw Error("BufferType not supported in WebGL");return{name:g,stride:c,count:b,type:k,offset:d.offset,normalized:d.optional&&!!d.optional.glNormalized,divisor:e}})};var f={u8:5121,u16:5123,u32:5125,i8:5120,i16:5122,i32:5124,f32:5126}})},"esri/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing":function(){define("require exports ../../../../../core/arrayUtils ../../../lib/glMatrix ../../../support/mathUtils ../../../support/buffer/typedArrayUtil".split(" "),
- function(r,h,f,a,e,c){function g(b,c){var d=Math.acos(b.cosAngle),e=k.fwd,f=k.ortho;a.vec3d.normalize(a.vec3d.direction(b.position0,b.position1,e));b=0<a.vec3d.dot(a.vec3d.cross(b.faceNormal0,b.faceNormal1,f),e)?-1:1;return d*b>c}function d(a){var b=a.faces.length/3,c=a.faces;a=a.neighbors;for(var d=0,e=0;e<b;e++)var f=a[3*e+0],g=a[3*e+1],k=a[3*e+2],l=c[3*e+0],h=c[3*e+1],n=c[3*e+2],d=d+(-1===f||l<h?1:0),d=d+(-1===g||h<n?1:0),d=d+(-1===k||n<l?1:0);for(var d=new Uint32Array(4*d),p=0,e=0;e<b;e++){f=
- a[3*e+0];g=a[3*e+1];k=a[3*e+2];l=c[3*e+0];h=c[3*e+1];n=c[3*e+2];if(-1===f||l<h)d[p++]=l,d[p++]=h,d[p++]=e,d[p++]=f;if(-1===g||h<n)d[p++]=h,d[p++]=n,d[p++]=e,d[p++]=g;if(-1===k||n<l)d[p++]=n,d[p++]=l,d[p++]=e,d[p++]=k}return d}function b(b){var c=b.faces.length/3,d=b.vertices.position;b=b.faces;for(var e=l.v0,f=l.v1,g=l.v2,k=new Float32Array(3*c),h=0;h<c;h++){var n=b[3*h+1],p=b[3*h+2];d.getVec(b[3*h+0],e);d.getVec(n,f);d.getVec(p,g);a.vec3d.subtract(f,e);a.vec3d.subtract(g,e);a.vec3d.normalize(a.vec3d.cross(f,
- g,e));k[3*h+0]=e[0];k[3*h+1]=e[1];k[3*h+2]=e[2]}return k}Object.defineProperty(h,"__esModule",{value:!0});h.extractEdges=function(l,h,u,q){void 0===q&&(q=p);var n=l.vertices.position,t=l.vertices.componentIndex,m=l.vertices.lineWidth,B=l.vertices.type,z=l.vertices.extensions,C=e.deg2rad(q.anglePlanar);q=e.deg2rad(q.angleSignificantEdge);q=Math.cos(q);var A=Math.cos(C),r=k.edge,E=r.position0,F=r.position1,I=r.faceNormal0,P=r.faceNormal1,G=b(l),M=d(l);l=M.length/4;var H=h.allocate(l),J=0,O=u.allocate(l),
- N=0,S=0,R=0,Y=f.range(0,l),X=new Float32Array(l);c.forEach(X,function(b,c,d){n.getVec(M[4*c+0],E);n.getVec(M[4*c+1],F);d[c]=a.vec3d.dist(E,F)});Y.sort(function(a,b){return X[b]-X[a]});for(var Q=[],K=[],L=0;L<l;L++){var V=Y[L],U=X[V],ca=M[4*V+0],ga=M[4*V+1],da=M[4*V+2],V=M[4*V+3],ka=4294967295===V;n.getVec(ca,E);n.getVec(ga,F);if(ka)a.vec3d.set3(G[3*da+0],G[3*da+1],G[3*da+2],I),a.vec3d.set(I,P),r.componentIndex=t.get(ca),r.cosAngle=a.vec3d.dot(I,P),r.lineWidth=m.get(ca),r.type=B.get(ca),r.extensions=
- z.get(ca);else if(a.vec3d.set3(G[3*da+0],G[3*da+1],G[3*da+2],I),a.vec3d.set3(G[3*V+0],G[3*V+1],G[3*V+2],P),r.componentIndex=t.get(ca),r.cosAngle=a.vec3d.dot(I,P),r.lineWidth=m.get(ca),r.type=B.get(ca),r.extensions=z.get(ca),r.cosAngle>A)continue;S+=U;R++;ka||r.cosAngle<q?(h.write(H,J++,r),Q.push(U)):g(r,C)&&(u.write(O,N++,r),K.push(U))}return{edge:{instancesData:h.trim(H,J),lodInfo:{lengths:Q.reverse()}},silhouette:{instancesData:u.trim(O,N),lodInfo:{lengths:K.reverse()}},averageEdgeLength:S/R}};
- var k={edge:{position0:a.vec3d.create(),position1:a.vec3d.create(),faceNormal0:a.vec3d.create(),faceNormal1:a.vec3d.create(),componentIndex:0,cosAngle:0,lineWidth:0,type:0,extensions:0},ortho:a.vec3d.create(),fwd:a.vec3d.create()},l={v0:a.vec3d.create(),v1:a.vec3d.create(),v2:a.vec3d.create()},p={anglePlanar:4,angleSignificantEdge:35}})},"esri/views/3d/webgl-engine/lib/edgeRendering/RibbonEdgeRenderer":function(){define("require exports ../../../../../core/tsSupport/assignHelper ../../../../../core/tsSupport/extendsHelper dojo/text!./RibbonEdgeRenderer.xml ../../../lib/glMatrix ../../../support/mathUtils ../ShaderVariations ../Util ./EdgeRenderer ./ribbonEdgeBufferWriters".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){Object.defineProperty(h,"__esModule",{value:!0});r=function(h){function t(a,b,d,e){a=h.call(this,a,b,t.getKey(d))||this;a.tmpViewToWorldNormalMatrix=c.mat3d.create();b=e.strokesTexture.variants;a.settings=f({},n,t.materialSettings(d),e);d=f({},a.settings,{variants:b});a.edgeBufferWriters={default:{writer:new l.RibbonDefaultEdgeBufferWriter(d),glLayout:l.RibbonDefaultEdgeBufferWriter.glLayout},silhouette:{writer:new l.RibbonSilhouetteBufferWriter(d),glLayout:l.RibbonSilhouetteBufferWriter.glLayout}};
- a.createPrograms();return a}a(t,h);t.prototype.begin=function(a){};t.prototype.bindEdges=function(a,b){this.bind(this.programs.edge,a,b)};t.prototype.bindSilhouettes=function(a,b){this.bind(this.programs.silhouette,a,b)};t.prototype.bind=function(a,b,c){this.rctx.bindProgram(a);a.setUniformMatrix4fv("uProj",b.proj);a.setUniform2f("uDepthBias",this.depthBiasXY,this.depthBiasZ);a.setUniform2f("uPixelToNDC",2/b.viewport[2],2/b.viewport[3]);a.setUniform2f("uNDCToPixel",b.viewport[2]/2,b.viewport[3]/2);
- a.setUniform1f("uDistanceFalloffFactor",c.distanceFalloffFactor);a.setUniform2f("uViewportDimInv",1/b.viewport[2],1/b.viewport[3])};t.prototype.renderEdges=function(a,b,c){this.render(this.programs.edge,a,a.edgeVAO,b,c)};t.prototype.renderSilhouettes=function(a,b,c){this.render(this.programs.silhouette,a,a.silhouetteVAO,b,c)};t.prototype.numberOfPrimitives=function(a){return a.edgeLoD.lengths.length+(a.silhouetteLoD?a.silhouetteLoD.lengths.length:0)};t.prototype.render=function(a,b,c,d,e){c&&(this.setUniforms(a,
- b,d),a=this.rctx,a.bindVAO(c),a.capabilities.instancing.drawArraysInstanced(6,0,4,e))};t.prototype.setUniforms=function(a,d,e){d.componentBuffer.textureBuffer.bind(a,k.componentColorBindParameters);a.setUniformMatrix4fv("uView",e.view);a.setUniformMatrix4fv("uModel",d.modelTransform);var f=e.viewInvTransp,g=c.mat4d.toMat3(f,this.tmpViewToWorldNormalMatrix);a.setUniform3f("uCameraPosition",f[3],f[7],f[11]);a.setUniformMatrix3fv("uViewToWorldNormalMatrix",g);this.settings.uber||(a.setUniform1i("uLineWidth",
- Math.round(d.material.size)),a.setUniform1i("uExtensionLength",Math.round(b.clamp(d.material.extensionLength,0,255))));(this.settings.uber||"sketch"===d.material.type)&&this.setSketchUniforms(a);a.setUniform1f("uWorldLineRadiusPerDistance",Math.tan(e.fovY/2)/(e.viewport[3]/2));a.setUniform3fv("uLocalOrigin",d.origin.vec3);this.shadowsEnabled&&e.shadowMappingEnabled&&e.shadowMap.bindView(a,d.origin.vec3)};t.prototype.setSketchUniforms=function(a){var b=this.settings.strokesTexture,c=b.texture;this.rctx.bindTexture(c,
- 0);a.setUniform1i("uStrokesTexture",0);a.setUniform2f("uStrokesTextureScale",1/c.descriptor.width,1/c.descriptor.height);a.setUniform1f("uStrokesLog2Resolution",g.log2(b.resolution));a.setUniform1f("uStrokesNormalizationScale",b.normalizationScale);a.setUniform1f("uStrokesAmplitude",b.amplitude);a.setUniform1f("uStrokeVariants",b.variants)};Object.defineProperty(t.prototype,"shadowsEnabled",{get:function(){var a="smooth"===this.settings.lighting||"flat"===this.settings.lighting;return this.settings.receiveShadows&&
- (this.settings.uber||a)},enumerable:!0,configurable:!0});Object.defineProperty(t.prototype,"ssaoEnabled",{get:function(){var a="smooth"===this.settings.lighting||"flat"===this.settings.lighting;return this.settings.receiveSSAO&&(this.settings.uber||a)},enumerable:!0,configurable:!0});t.prototype.end=function(a){};t.prototype.getDefines=function(a){return[a.silhouette,this.settings.antialiasing&&!!this.rctx.capabilities.blendMinMax,this.shadowsEnabled,this.ssaoEnabled,"smooth"===this.settings.lighting&&
- !this.settings.uber,"flat"===this.settings.lighting&&!this.settings.uber,"emissive"===this.settings.lighting&&!this.settings.uber,"sketch"===this.settings.lighting&&!this.settings.uber,this.settings.pressure,this.settings.uber]};t.prototype.createPrograms=function(){this.addProgram("edge",this.programRepository.getShaderVariationsProgram(p,this.getDefines({silhouette:!1}),void 0,void 0,k.attributeLocations));this.addProgram("silhouette",this.programRepository.getShaderVariationsProgram(p,this.getDefines({silhouette:!0}),
- void 0,void 0,k.attributeLocations))};t.materialSettings=function(a){return a?"solid"===a.type?{lighting:"emissive"}:"sketch"===a.type?{lighting:"sketch"}:{lighting:"smooth"}:{}};t.loadShaders=function(a,b,c){a.fsRibbonEdge||a._parse(e);b.getShaderVariations(p)||(a=new d("ribbonEdge",["vsRibbonEdge","fsRibbonEdge"],null,b,a,c),a.addDefine("Silhouette","SILHOUETTE"),a.addDefine("AntiAliasing","ANTIALIASING"),a.addDefine("ReceiveShadows","RECEIVE_SHADOWS"),a.addDefine("AmbientOcclusion","RECEIVE_SSAO"),
- a.addDefine("SmoothLighting","SMOOTH_LIGHTING"),a.addDefine("FlatLighting","FLAT_LIGHTING"),a.addDefine("EmissiveLighting","EMISSIVE_LIGHTING"),a.addDefine("Sketch","SKETCH"),a.addDefine("Pressure","PRESSURE"),a.addDefine("Uber","UBER"),b.addShaderVariations(p,a))};t.getKey=function(a,b){if(!a)return"ribbon-uber";b=f({},n,this.materialSettings(a),b);return"ribbon-s:"+a.size+"-e:"+a.extensionLength+"-aa:"+b.antialiasing+"-sh:"+b.receiveShadows+"-l:"+b.lighting};return t}(k.EdgeRenderer);h.RibbonEdgeRenderer=
- r;var p="ribbon-edge-shader-variations",n={antialiasing:!0,lighting:"smooth",receiveShadows:!0,receiveSSAO:!0,uber:!0,pressure:!0,strokesTexture:null};h.default=r})},"esri/views/3d/webgl-engine/lib/ShaderVariations":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/_base/lang ./DefaultVertexAttributeLocations ./Util ../../../webgl/Program".split(" "),function(r,h,f,a,e,c,g){return function(){function d(a,d,e,f,g,h){this.variables=[];this.sealed=!1;this.programCache=
- {};c.assert(2===d.length,"you must specify shader snippet prefixes for vertex and fragment shaders");this.programNamePrefix=a;this.shaderSnippetPrefixes=d;this.baseDefines=e;this.programRep=f;this.snippets=g;this.rctx=h;this.baseDefines=e?e.slice():[]}d.prototype.addDefine=function(a,d,e,f){c.assert(!this.sealed,"you cannot add another variable after the first program has been generated");c.assert(!!a,"you must specify a program name suffix");this.variables.push({programNameSuffixes:["",a],shaderNameSuffixes:f||
- a,defineStr:d,affectsShaderTypes:e||[!0,!0]})};d.prototype.addBinaryShaderSnippetSuffix=function(a,d,e){c.assert(!this.sealed,"you cannot add another variable after the first program has been generated");c.assert(!!a,"you must specify a program name suffix");this.variables.push({programNameSuffixes:["",a],shaderSnippetSuffixes:["",d],affectsShaderTypes:e||[!0,!0]})};d.prototype.addNaryShaderSnippetSuffix=function(a,d){c.assert(!this.sealed,"you cannot add another variable after the first program has been generated");
- var b=a.map(function(a){c.assert(null!=a.value,"value must always be specified");return a.value});this.variables.push({values:b,programNameSuffixes:a.map(function(a,c){return null!=a.programNameSuffix?a.programNameSuffix:b[c]}),shaderSnippetSuffixes:a.map(function(a,c){return null!=a.shaderSnippetSuffix?a.shaderSnippetSuffix:b[c]}),affectsShaderTypes:d||[!0,!0]})};d.prototype.getShaderVariation=function(b){c.assert(b.length===this.variables.length,"you must specify a value for each variable");for(var d=
- this.programNamePrefix,e=a.clone(this.shaderSnippetPrefixes),f=a.clone(this.shaderSnippetPrefixes),g=a.clone(this.baseDefines),h=0;h<this.variables.length;h++){var u=this.variables[h],q=b[h],v=void 0;u.values?(v=u.values.indexOf(q.toString()),c.assert(0<=v,"invalid value "+q+" for variable "+h)):v=q?1:0;d+=u.programNameSuffixes[v];for(q=0;2>q;q++)u.affectsShaderTypes[q]&&(u.shaderSnippetSuffixes&&(e[q]+=u.shaderSnippetSuffixes[v],f[q]+=u.shaderSnippetSuffixes[v]),u.defineStr&&v&&(g.push(u.defineStr),
- f[q]+=u.shaderNameSuffixes))}return{programName:d,shaderSnippetNames:e,shaderNames:f,defines:g}};d.prototype.getProgram=function(a,d,f,h){void 0===d&&(d=this.snippets);void 0===f&&(f=this.rctx);void 0===h&&(h=e.Default3D);this.sealed=!0;var b=a.reduce(function(a,b){return a+b.toString()},"");if(this.programCache[b])return this.programCache[b];a=this.getShaderVariation(a);var k=this.programRep.get(a.programName);if(k)return k;var l=a.shaderSnippetNames[0],k=d[l];c.assert(null!=k,"shader snippet '"+
- l+"' does not exist");l=a.shaderSnippetNames[1];d=d[l];c.assert(null!=d,"shader snippet '"+l+"' does not exist");k=new g(f,k,d,h,a.defines);this.programCache[b]=k;this.programRep.add(a.programName,k);return k};return d}()})},"esri/views/3d/webgl-engine/lib/edgeRendering/ribbonEdgeBufferWriters":function(){define("require exports ../../../../../core/tsSupport/assignHelper ../../../../../core/tsSupport/extendsHelper ../../../lib/glMatrix ../../../support/buffer/glUtil ../../../support/buffer/InterleavedLayout ../Util".split(" "),
- function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=g.newLayout().vec3f("position0").vec3f("position1").u16("componentIndex").vec2u8("packedAttributes").u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).u8("_padding",{glPadding:!0});var b=function(){function a(a){this.settings=a}a.prototype.write=function(a,b,c){var e=k;e[0]=c.position0[0];e[1]=c.position0[1];e[2]=c.position0[2];e[3]=c.position1[0];e[4]=c.position1[1];e[5]=
- c.position1[2];p[0]=5381;for(e=0;e<l.length;e++)p[0]=31*p[0]+l[e];n.reseed(p[0]);var e=n.randomRangeInt(0,255),f=n.randomRangeInt(0,this.settings.variants-1),g=n.randomFloat(),g=-(1-Math.min(g/.7,1))+Math.max(0,g-.7)/(1-.7),g=255*(Math.pow(Math.abs(g),1.2)*(0>g?-1:1)*.5+.5);a.position0.setVec(b,c.position0);a.position1.setVec(b,c.position1);a.componentIndex.set(b,c.componentIndex);if(this.settings.uber){var m=c.type|d.clamp(c.lineWidth,0,127)<<1;a.packedAttributes.set(b,0,m);a.packedAttributes.set(b,
- 1,Math.round(d.clamp(c.extensions,0,255)))}a.variantOffset.set(b,e);a.variantStroke.set(b,f);a.variantExtension.set(b,g)};a.prototype.trim=function(a,b){return a.slice(0,b)};return a}();h.RibbonCommonBufferWriter=b;var k=new Float32Array(6),l=new Uint32Array(k.buffer),p=new Uint32Array(1),n=new (function(){function a(a){void 0===a&&(a=1);this.seed=a}a.prototype.randomFloat=function(){return this.step()/a.LARGE_PRIME};a.prototype.randomRangeInt=function(a,b){b-=a;return Math.round(a+this.randomFloat()*
- b)};a.prototype.reseed=function(a){this.seed=a};a.prototype.step=function(){return this.seed=this.seed*a.SMALL_PRIME%a.LARGE_PRIME};a.LARGE_PRIME=2147483647;a.SMALL_PRIME=16807;return a}()),t=r.clone().vec3f("normal");f=function(){function a(a){this.commonWriter=new b(a)}a.prototype.allocate=function(a){return t.createBuffer(a)};a.prototype.write=function(a,b,c){this.commonWriter.write(a,b,c);c=e.vec3d.normalize(e.vec3d.add(c.faceNormal0,c.faceNormal1,q));a.normal.setVec(b,c)};a.prototype.trim=function(a,
- b){return this.commonWriter.trim(a,b)};a.Layout=t;a.glLayout=c.glLayout(t,1);return a}();h.RibbonDefaultEdgeBufferWriter=f;var u=r.clone().vec3f("normalA").vec3f("normalB");r=function(){function a(a){this.commonWriter=new b(a)}a.prototype.allocate=function(a){return u.createBuffer(a)};a.prototype.write=function(a,b,c){this.commonWriter.write(a,b,c);a.normalA.setVec(b,c.faceNormal0);a.normalB.setVec(b,c.faceNormal1)};a.prototype.trim=function(a,b){return this.commonWriter.trim(a,b)};a.Layout=u;a.glLayout=
- c.glLayout(u,1);return a}();h.RibbonSilhouetteBufferWriter=r;var q=e.vec3d.create()})},"esri/views/3d/webgl-engine/lib/edgeRendering/strokes":function(){define("require exports ../../../../../core/tsSupport/assignHelper ../../../support/mathUtils ../Util ../../../../webgl/Texture".split(" "),function(r,h,f,a,e,c){function g(a,c){if(!a)return null;var e=a.length/2,f=d*e,e=Array(e),g=0;c=1===c;for(var k=0;k<a.length;k+=2){var l=(a[k]+a[k+1])/2;c?e[g++]=Math.min(f,1-(1-l)*b):e[g++]=Math.min(f,l*b)}return e}
- Object.defineProperty(h,"__esModule",{value:!0});h.generateStrokesTexture=function(b){for(var d=h.strokesDefinition.resolution,f=d/2,k=new Uint8Array(4*d*d),t=4*d*f,f=h.strokesDefinition.amplitude,u=2*f,q=4*d,v=a.log2(d)+1,x=h.strokesDefinition.strokes.length,m=(v-1)*x*q,B=0,z=h.strokesDefinition.strokes;B<z.length;B++){for(var C=z[B],A=C.distance,C=C.pressure,r=m,E=0;E<v;E++){0!==E&&(A=g(A,0),C=g(C,1));for(var F=0;F<h.strokesDefinition.resolution;F++){var I=C?C[F%C.length]:1;e.packFloatRGBA((A?A[F%
- A.length]/u:0)+.5,k,r);e.packFloatRGBA(I,k,r+t);r+=4}r-=q*(x+1)}m+=q}b=new c(b,{pixelFormat:6408,dataType:5121,hasMipmap:!1,samplingMode:9729,width:d,height:d,wrapMode:10497},k);return{resolution:d,texture:b,normalizationScale:u,amplitude:f,variants:x}};var d=.1,b=.8;h.strokesDefinition={amplitude:3,resolution:256,strokes:[{distance:[-.6961162015478699,-.7508257847868736,-.7997644035343595,-.8411953082523799,-.8738519340397198,-.8970963967771677,-.9109829928296007,-.9162137655979228,-.913998038008873,
- -.9058487287407682,-.8933444036444794,-.8779096104840396,-.8607330031871834,-.8427618841891984,-.8247524699147402,-.8073531358680022,-.7909248019784956,-.7753873769984032,-.7603079682885866,-.7451570753750201,-.72953628421473,-.7132936332651814,-.6966376038276425,-.6801873579730909,-.6651646885582179,-.6530405721292875,-.6448456493620996,-.6407587649558054,-.6402752648324058,-.6426081247616191,-.6467892798861155,-.6517876939017704,-.6564214500631184,-.6591297660130438,-.6582403353507722,-.6522943079243422,
- -.6402700413580501,-.6217439483799877,-.5969540879850209,-.5667516958600565,-.532453359664937,-.4956433568176743,-.457950808711389,-.4208098420413061,-.385385346003145,-.35260172580383686,-.3232107010185183,-.2978725847118794,-.27695918418612697,-.2603742018803116,-.24761539682660305,-.23801550870761135,-.23096639865977125,-.22604102685851557,-.2231257623245813,-.22249840660465858,-.22504735531166142,-.23191379259836598,-.24379727533380569,-.26054572309090623,-.2813232462004144,-.30502450536082876,
- -.3303821728839333,-.3560779043522023,-.3806373872247088,-.40221418490478766,-.4188817061374711,-.42895905137743484,-.43123200771248316,-.42511170718063274,-.4106982730549805,-.38873650627114026,-.36047554335439197,-.3274652362197369,-.29131817559902384,-.25348989183393966,-.2151967327092758,-.17741004903599694,-.14090600412037024,-.1063483412587225,-.07410945698001503,-.044118672378244295,-.015951099802502755,.010916444965542782,.036881001419378445,.06209865148024396,.08636830862208067,.10907947425703635,
- .12901871699286838,.14472203031677566,.15516376054503545,.16016796069700223,.16024043344463235,.15616832699447325,.14891983390619146,.13952736031983337,.12917678206927985,.11943678255476131,.11199277019987819,.10832294498072548,.10947497269773176,.11590526964669157,.12741565312832392,.1432015951821991,.16199958190938568,.18228404326135772,.2024891641459956,.2212474437606281,.23746248517494073,.2502786934217669,.25901191840777127,.2630673564983701,.26213870969785813,.2563886366292518,.24638587024246705,
- .23286356337725955,.2164954355478299,.19777489460206799,.17688213870073688,.15360524289480804,.12712029173231887,.09634872305394937,.06065157497048401,.020239655196603645,-.023993780563490774,-.07088653441845982,-.11911374654625106,-.16729782788434266,-.2139057379918765,-.25703537703294804,-.2947077940399854,-.3251929968609723,-.3472308364514586,-.36018951030215973,-.3641290709261046,-.3597570023428457,-.34828776327813316,-.33123911449904375,-.31019418136319715,-.2865817993289998,-.2615946482489633,
- -.236183803676154,-.21110900989582898,-.1870219308461114,-.16428653929977188,-.14282556286393555,-.12220869293612036,-.10190877484399907,-.08152949600121595,-.06092074311674489,-.04029258092423649,-.0202654757895524,-.0020622288080149875,.01284549065262186,.023426686103591887,.02950251759971534,.03157802975241231,.03044104788586144,.0270607962339795,.022469648631901595,.01785097108069833,.014767085199741903,.014891906511742548,.019685945554555384,.03017254034261918,.046777105129965024,.06926392424437611,
- .09678469158407277,.12802621522941338,.1614079614984547,.19530479015696733,.2282866912633974,.2591929358812741,.28710324103959806,.3112699010512504,.33103644973510993,.34603471296276767,.35636437310942437,.362530784932968,.3652040405981043,.3649948293009557,.3623324709082918,.35733262748293093,.3497193102271303,.33860575693216766,.3228522838378354,.3017607540301376,.27548464510364956,.24486128262301665,.21099754465555753,.17516246604681074,.1386763324211321,.10301569615294226,.07002959461759928,.04164763973142238,
- .019554226087304727,.004967585130847052,-.0015188321151153872,0,.008784976417960721,.02359322574150391,.04288175239902803,.06504542598599172,.08863678394498675,.11244814794441083,.1355174234048041,.157078266314284,.17647728358407044,.19335291971807023,.2077871380480143,.22021649994825387,.2311761926611775,.24107552293526968,.2500830349230496,.25801022680133956,.26425923237356896,.26762922426256575,.26666869526022685,.26036431068946286,.2485521884467231,.2317498736859337,.21075600008193984,.18655025769644473,
- .16017660860078986,.13283250636119293,.10609819612543658,.08167059416898725,.06103931684347108,.045263318072760184,.034810138919663,.029492576130770387,.028517094314567948,.030631217840932812,.03432041281838627,.03802985073949838,.040402923307320426,.04035399127997508,.03703804637367447,.029781323276349858,.017999176314233978,.0013952203182848733,-.019858229550996698,-.04518304361893244,-.07383692764322247,-.10513726324072648,-.13858196496366015,-.17398234851501582,-.21154200587882066,-.25207662611112647,
- -.2966565969366647,-.3459126955910849,-.39962585029709197,-.4568943864055129,-.5165475064143137,-.5772518620346987,-.6376217091435763],pressure:[.996633071726222,.9947738679099977,.9928798384595328,.9909563560792033,.9890090717800587,.9870438806476063,.9850668842305685,.9830843499300339,.9811026678233311,.9791283054057823,.9771677607751055,.9752275148166334,.9733139829718654,.971433467187512,.9695921086466863,.9677958418780128,.9660503508221645,.9643610274089325,.9627329331618455,.9611707643022523,
- .9596788207715574,.9582609795299922,.9569206724241511,.955660868844833,.9544840633229551,.9533922681359144,.9523870109212649,.9514693372204399,.9506398178039001,.9498985605618655,.9492452266829126,.9486790507872501,.9481988646333425,.9478031239764171,.9474899381258253,.9472570986220648,.9471020701670287,.9470219856643075,.9470136989277632,.9470738439147639,.9471988931026557,.9473852147599654,.9476291286519952,.9479269594850699,.9482750871694335,.9486699928008218,.949108299154246,.9495868044731994,
- .9501025084375019,.9506526294076754,.9512346123669349,.9518461312352751,.9524851878533398,.9531502812428171,.9538403701147599,.9545547774554046,.9552930880906448,.9560550443879164,.9568404449513421,.9576490507814228,.9584805027958907,.9593342538703069,.9602095176899668,.9611052357493661,.96202006283709,.9629523703503057,.9639002658422147,.9648616263640609,.9658341424626808,.9668153690243617,.9678027764396628,.968793799667633,.9697858863592619,.9707765370643373,.9717633337940663,.9727439546733231,
- .9737161733133598,.9746778425338373,.9756268631116501,.9765611456037372,.9774786948426197,.9783778139471927,.9792571749849625,.9801158915714986,.9809537691466981,.9817713582682308,.9825698003727413,.9833506594657514,.9841157534292189,.9848669889577633,.9856062039798974,.9863350212867441,.987054716954081,.9877661069736776,.9884694552730791,.9891644059664273,.989849942214706,.9905243734627036,.99118535205457,.9918299193166491,.9924545801569844,.9930554041330952,.9936281539388622,.9941684440642525,.9946719022057059,
- .9951343307940307,.995551868254632,.9959211428189224,.9962394115456439,.9965046775758727,.9967157792012401,.996872372748931,.9969745803042854,.9970227561810501,.997017419542337,.9969591942466283,.9968487544532554,.996686780775214,.9964739316491749,.9962108342152981,.9958980983522688,.9955363565985895,.9951263315271344,.9946689307594084,.9941653682573589,.9936173088767006,.9930270314793629,.9923975647360177,.9917325035342212,.9910357753101586,.990311602972271,.9895644802700436,.98879914350209,.988020539788174,
- .9872337921904392,.9864441620266478,.9856570087714055,.9848777479889387,.984111807781895,.9833645842738553,.9826413966679451,.981947442439469,.9812877532263828,.9806671519774584,.9800902119041126,.9795612177583292,.9790841299262595,.9786625517856397,.9782997007258958,.9779983831737636,.9777609739055654,.977589399861252,.9774851286062997,.9774491615169585,.9774820316936363,.9775838065377626,.9777540948606951,.9779920584725561,.9782964342776146,.9786655707198935,.9790974582949677,.9795897593834183,
- .9801398405016262,.980744803388273,.9814014780720497,.9821064251759908,.9828560098326315,.9836464661523481,.9844739509252712,.9853345957618281,.9862245574637764,.9871400659674667,.988077468976114,.9890332722172925,.9900041741548722,.9909870939738691,.9919791917563586,.9929778799809873,.9939808258015823,.9949859478135121,.9959915096394044,.9969962839745582,.9979995100966227,.9990007937017172,1,.9990028547396802,.9980077083105606,.9970145498547733,.9960235053933111,.995034908416511,.9940493532219995,
- .9930677296452887,.9920912388299182,.9911213906813999,.9901599845940833,.9892090758861786,.9882709310834514,.9873479757207249,.9864427386546457,.985557796983226,.9846957255402645,.9838590545801073,.9830502387059289,.9822716393493677,.9815255222173065,.9808140701275083,.9801394106095564,.97950365028055,.9789087864554966,.9783564992098928,.9778480768189026,.9773843393478058,.9769653847136214,.9765905319353396,.9762584721775238,.9759674341784768,.9757153504222335,.9755000200869989,.975319264952099,.9751710745735805,
- .9750537374008981,.9749659649086903,.9749070112676386,.9748767505277215,.9748757203652921,.9749051372958465,.9749668823592721,.9750634571484471,.9751979110920252,.9753737420321358,.9755947733071422,.9758650116970392,.9761884916455175,.9765691120661909,.9770104727009618,.9775157173632646,.9780873914176021,.9787273204859289,.9794365168199681,.9802151913589024,.9810631004790579,.9819797735574649,.982964573982656,.9840167525792434,.9851354949571217,.986319958047006,.9875692912061472,.9888826376592722,
- .9902591126906825,.9916977559212371,.9931974561710386,.9947568487918733,.996374186906707,.998047193478224,.9997729175820746,.99845238604403]},{distance:[2.1145614822294623,2.070562918356685,2.0218767812691407,1.9687733534728056,1.911604058107433,1.8507954929128902,1.786840343814669,1.7202855030586606,1.651717892836639,1.5817486426851746,1.5109963752359716,1.4400704110842164,1.369554704827077,1.2999932706802666,1.2318777522505837,1.165637646036529,1.101633514376288,1.0401533352375323,.981410195568371,
- .925527087450261,.8725412431220276,.8224383399025108,.7751799441066878,.7307185912833756,.6890015307639337,.6499665941471815,.613533878907834,.5795845237307394,.5479449254894699,.5184026399518129,.49073167000363277,.4647196761640856,.4401928976306203,.41703518211444257,.395198669310002,.37470486599841246,.3556343362568435,.33810892702421547,.322271195359932,.3082598525301872,.29618341890479705,.2861031594845781,.27802902933708495,.271932214676766,.26774003052938,.2653154113209759,.26445140329011474,
- .2648815948915828,.26630253196207343,.26840207518687986,.2708868127181926,.27350208500612627,.27603857819693856,.278323781912714,.2802030193956061,.2815120370209969,.28205222057498724,.2816056543108775,.27995099239182275,.2768586446486144,.2720905052330951,.26540953674983514,.25660173865117974,.24551084500063003,.2320791618693705,.2163514214333464,.19845637698094842,.17860525243506453,.15708898093078927,.1342719978573279,.11058251106628747,.08649976396542125,.06253927824915773,.03923642417284168,
- .01712903029783097,-.003260133335663773,-.02144016439649188,-.03696735044413535,-.04945832954707441,-.058600517946845176,-.06415861814021095,-.06597715277806249,-.06398243213580723,-.0581968915158213,-.048731134608650195,-.0357483236994961,-.01943766508657596,0,.022355693718919878,.04740836354074229,.07491718881745024,.10460137488518428,.13612572964402603,.16911819165863062,.20319692639083042,.23799942848634015,.27320931665666426,.3085771178448735,.34393248898526374,.3791867035939803,.41432553147861517,
- .44939364346239363,.48447220339158453,.5196515254698639,.5550019886770884,.5905542960386785,.6262927601009005,.6621652837088728,.6980758764572166,.7338620148107312,.7692873210137101,.8040515274929081,.8378168350653944,.8702385657461855,.9009926212411425,.929795532302007,.9564125080707929,.9806514375271693,1.002343860524502,1.0213169040780101,1.037367950617396,1.0502793389270608,1.0598341418138895,1.0658115821903422,1.0679873557875803,1.0661441881599507,1.060095142177868,1.0497194506110186,1.0350004114883102,
- 1.0160258495747416,.9929691812072535,.9660877368827762,.9357200551591125,.9022799159548959,.866247248049862,.8281562358984907,.788581126924277,.7481203878404024,.7073799648692163,.6669564589471636,.6274210283072403,.589304777201376,.5530862857045759,.5191817905416575,.4879383530252971,.45963016186647376,.43445617793757707,.41252488058202497,.3938585518831832,.37842743025350123,.3661771027618108,.3570435338400524,.35095675866333276,.3478367011258692,.34758480789245705,.3500627754175405,.35507672014041225,
- .36239303576095727,.37176370848155016,.38295366522291197,.39576572995204384,.41005965345674544,.4257628010771272,.44287123701065007,.4614394297813891,.4815626149033538,.5033566695535229,.5269336777784737,.5523755098022484,.5797166869547387,.6089402670569886,.639990336830911,.6727668729287217,.707105208397686,.7427705137717541,.7794682290687314,.8168664933932096,.8546245294373293,.8924200953119759,.9299695601882063,.9670345593678915,1.0034135237192656,1.038922790451041,1.0733692811028857,1.1065258129188178,
- 1.1381462583028654,1.167981520578999,1.195774826546591,1.2212615629393615,1.2441789678810773,1.2642882046349608,1.2814091612828138,1.2954613851665742,1.3064680277816199,1.314537523024402,1.3198621111769684,1.3227151420495775,1.323444935080515,1.322465346927112,1.3202433918579701,1.317284439220649,1.3141156611224223,1.311268510084795,1.3092610620718441,1.3085810605154589,1.3096704421152081,1.3129120203689344,1.3186188996038541,1.3270278074855764,1.3382964019204509,1.3525011458687421,1.3696228149336247,
- 1.3895543028743584,1.4121360852785658,1.4371825940927923,1.464496493731233,1.4938720544531006,1.52509109826322,1.5579151992129157,1.5920653817619899,1.627207617802154,1.662970515070472,1.6989729353772778,1.7348532315482172,1.7702960336151463,1.8050530236326685,1.8389551483426692,1.8719150968833491,1.903920171890729,1.935016686707291,1.9652876406442996,1.994825702911334,2.0237042293009395,2.051957478794356,2.079573852784881,2.1065058303327806,2.1326624410678834,2.1578865849899262,2.181947675521755,
- 2.2045515737176036,2.2253669230725945,2.2440557867784925,2.260301099454599,2.2738267193469195,2.2844054907926727,2.2918532695700176,2.296009928946292,2.29671134222448,2.293764108435334,2.286960321625104,2.2760934272936013,2.260953726972252,2.241328798196994,2.2170140748107823,2.187835706340252,2.15368604200145],pressure:[.9866018149203939,.9891496105622892,.9917450254304312,.994380728144874,.997049007868631,.9997418209453748,.9975491578601124,.9948324800354412,.992116864499552,.9894111359450569,.9867241610586309,
- .9840647833795766,.9814417575898498,.9788636840487775,.9763389443918268,.9738756390047715,.9714815271624753,.9691639705855494,.9669298811190113,.9647856731756599,.9627372215144043,.9607898248416784,.9589481756339813,.9572163364833446,.9555977231670616,.9540950945403603,.9527105492478817,.9514455291488751,.9503008292538646,.9492766138790013,.9483724386400609,.9475872778325141,.9469195566785281,.946367187867121,.945927611770684,.9455978576161193,.9453748262934796,.9452555159667924,.9452368966618673,
- .9453157618049671,.945488608939161,.9457515554370848,.9461002923865536,.9465300772037712,.9470357630747104,.9476118611694557,.9482526298227899,.9489521836028577,.9497046144412692,.9505041167815508,.9513451089949079,.952222338833685,.9531308281820547,.9540656897072954,.9550221915745875,.9559958687853909,.956982615159602,.9579787540708916,.9589810878267332,.9599869269549192,.9609941017137626,.9620009588385185,.9630063468583004,.9640095932833449,.9650104766171781,.9660091955604136,.9670063370273939,
- .9680028437875745,.9689999817653555,.9699993072443971,.9710026477622776,.9720120843481687,.9730299038045503,.9740585412971816,.9751005173499331,.9761583697984022,.9772345821570197,.9783315107943619,.9794513141888807,.980595883943932,.9817666973874425,.9829646078829425,.9841897438661644,.9854414656074116,.9867184375831489,.9880186519169296,.9893393924438391,.9906772241255606,.9920280112958411,.9933869630498338,.994748703313429,.9961073624343546,.9974566865277754,.9987901602895227,.9998988614327514,
- .9986170183352492,.9973708108378998,.9961664730185051,.9950098574651497,.9939063369277107,.9928607271737389,.9918772348189594,.9909594387944449,.9901103171200186,.9893322890498594,.9886272768436233,.9879967939533503,.9874420559769108,.9869641090387211,.9865639688825478,.986242762505089,.98600176423896,.9858420100272737,.9857641009517827,.9857682511817658,.9858543525456029,.9860220408360633,.9862707566331871,.9865997932012541,.9870083242926067,.9874954054928327,.9880599440582666,.9887006339834253,
- .9894158552155466,.9902035383986648,.991060999148639,.9919847484854623,.9929703324246981,.9940125294289117,.9951056125575274,.9962433980651921,.9974192816246905,.9986262798407575,.9998570767097921,.9988959254022277,.9976405507696177,.9963847918828266,.9951367482328917,.9939045630024187,.9926963584057241,.9915201704538491,.9903838839406923,.9892951684538845,.9882614162079131,.9872896824773426,.9863866293750465,.985558473674694,.984810939319179,.9841492151883344,.983577918621467,.9831010651045374,.9827220444398878,
- .982443603620109,.9822678365288552,.9821961804920624,.9822294196050328,.9823676946660356,.9826105193577241,.9829567979888036,.9834048417805731,.9839523970962888,.9845966807308286,.9853344191161331,.9861619087304412,.9870752984376677,.988070817501658,.9891446598093735,.9902928384076222,.9915110651862782,.9927946658762894,.9941385336388945,.9955371217973742,.9969844738046907,.9984742863809899,1,.9984450903713243,.9968677121270904,.9952744875371956,.9936718096996381,.9920657341886374,.9904620311699777,
- .9888663654132979,.9872842280734382,.9857208217175755,.9841809646163039,.9826690162289506,.9811888240324205,.9797436904734493,.978336357769347,.9769690075873053,.9756432723106258,.9743602546343546,.973120552577456,.9719242875854831,.970771134141817,.9696603501130615,.9685908078301525,.9675610265631437,.9665692075105425,.9656132726398041,.9646909086550918,.9637996170298007,.9629367704503152,.9620996752254871,.9612856382968633,.9604920365276005,.9597163850525094,.9589564050463465,.9582101711019176,
- .9574763220889313,.9567541644578996,.9560437189485653,.9553456527608639,.9546612616523787,.953992512315859,.9533420602024139,.9527132391897694,.9521100246493983,.9515369722336489,.9509991353902433,.9505019648931585,.9500511800084429,.9496526079574786,.9493120452984944,.9490351304446004,.9488272231801915,.948693296156923,.9486378431343829,.9486648082553625,.9487775399697185,.9489787723424316,.9492706354090938,.9496546949961987,.9501320210378708,.9507032819418675,.9513688610450911,.952128989722337,
- .9529838903492442,.9539339208784796,.9549796128832014,.9561212867711385,.9573588552085929,.958691869915316,.9601195840424478,.96164101527107,.9632550024576982,.9649602484409767,.9667553419146738,.9686387520874259,.970608791178629,.9726635415977706,.9748007468438836,.9770176676381271,.979310911748267,.9816762653393807,.9841085488280269]},{distance:[-.5230021157043929,-.5245024963030356,-.5252482392394429,-.5252224060435445,-.5244111493860191,-.5228039092809582,-.5203935828442765,-.5171766647283622,
- -.5131533557072674,-.5083276372945535,-.5027073107312092,-.49630399917593304,-.48913311245561186,-.4812137742802222,-.4725687123831397,-.4632241126041283,-.4532094384770349,-.44255721840658213,-.4313028030081218,-.41948409563096856,-.4071412594810413,-.39431640509422633,-.3810532621816436,-.3673968400668945,-.3533930810599513,-.33908851116092603,-.3245298924594718,-.3097638814936703,-.29483669765918563,-.2797938055200011,-.2646796145722719,-.24953719966009036,-.23440804484447297,-.21933181309374522,
- -.2043461437041973,-.18948635949607937,-.17478373259298494,-.16026411922971517,-.14594894022940763,-.13185636374865378,-.11800235378287921,-.10440155000676468,-.09106795686850047,-.07801543196184502,-.0652579750323369,-.05280982907344697,-.04068541347947299,-.028899115901942912,-.017464974176693265,-.006396282430014749,.004294843687151301,.014597880420145315,.02450350794366568,.034002592837129086,.043086560543327046,.051748060735316403,.059981555596032465,.06778380432267,.07515422577395736,.08209512882223552,
- .08861180724474077,.09471250262190112,.10040824451189068,.10571258202125366,.11064122474019633,.11521161386461554,.11944244623553868,.12335317506953591,.12696351142333373,.130292958879218,.13336055573481959,.1361847358653384,.13878302130536557,.1411717762630611,.1433660804959504,.14537973255524822,.1472253891202342,.14891484181355907,.1504594275027359,.15187049257328689,.1531585077289891,.15433092239584728,.1553915155824131,.15634035494621257,.15717478588044176,.15788962845973276,.1584765887223744,
- .15892385881330218,.15921598078641408,.15933398609998167,.15925580599478978,.15895693155867752,.15841128727698334,.15759226908479146,.15647388808154217,.1550319546792952,.15324523537183338,.15109651565550714,.1485735078052315,.14566955089659128,.14238406215840704,.13872271241212042,.13469726632194218,.130325010714683,.12562804274741163,.12063241122008023,.11536708395993156,.10986279781508967,.10415085634263166,.09826194355932832,.09222502311592012,.08606692168271418,.07981430657634309,.07349475835825003,
- .06713662375829427,.06076884890214029,.05442083672669851,.048122325062597227,.04190328018443651,.0357937997708771,.029824019210239416,.024024015988190983,.01842370838397589,.013052746699166562,.007940397518807485,.003115423800601008,-.0013940343657616594,-.005560625432242117,-.009358366464557288,-.012763237007910877,-.015753471952247217,-.018309816401984202,-.02041576146555374,-.02205775727056919,-.023225399743714015,-.023911587992750505,-.024112649487433163,-.023828430651235633,-.02306235094002873,
- -.021821418989192154,-.020116209948220554,-.01796080368183528,-.015372684088500038,-.012372600360217229,-.008984391570597994,-.005234776520604251,-.0011531112826504153,.0032288826458526376,.007877416247791147,.012756953255624703,.017830548790608636,.023060202147690778,.028407219343962453,.033832580964865966,.03929731083303928,.04476284108819312,.05019136939978286,.05554620178941827,.06079196972625234,.06589464921370536,.0708217208022332,.07554236755981908,.08002764748630703,.08425075820616851,.08818874571388213,
- .09182388786148654,.0951428413756783,.09813546909062548,.10079373215553605,.10311075415553106,.10508008157252507,.10669515118698736,.10794896358461115,.10883395172180982,.10934202487772016,.10946476152228007,.10919371979023917,.10852083139087054,.10743884382593671,.10594174840781045,.10402441363610238,.10168159526381704,.09890834200277265,.09570069911940748,.09205633917977918,.08797509244997215,.08345935801651405,.07851438430060997,.07314841489142226,.06737270224974173,.06120139764131999,.054651330529839226,
- .0477416945416923,.04049366001438237,.0329299351071356,.02507429856452753,.016951127572997826,.00858494382659547,0,-.008780072629196445,-.017732536628801754,-.026835724611088074,-.03606910583433229,-.04541323336583333,-.054849566033077335,-.06436016402945485,-.07392726223744317,-.08353280066729643,-.0931593151615562,-.10279209882606705,-.11241987671519085,-.12203488125814421,-.13163190572052036,-.14120815685849314,-.15076389919051802,-.16030291518899406,-.16983270536403366,-.17936441493991118,-.1889124906522445,
- -.19849408758283069,-.20812825832602494,-.21783485267957758,-.22763312055109808,-.23754048409021172,-.24757141530277327,-.25773640844148665,-.2680411073844964,-.2784856401232931,-.2890642008264259,-.2997649059624766,-.3105699354550246,-.3214559536849835,-.33239478926366123,-.3433543377644385,-.3542996388432084,-.3651940691031959,-.37600058522020424,-.3866829486082416,-.39720686195915,-.40754041860827417,-.41765215447999626,-.427510001708245,-.4370814584440855,-.44633377477477887,-.45523411080817866,
- -.46374967041431403,-.4718478158245648,-.4794961691756422,-.48666270711806536,-.49331585383227317,-.4994245763284779,-.5049584839305334,-.5098879315942181,-.5141841325569381,-.5178193144018676,-.5207669075813892],pressure:[.8306272633087632,.8228571076572637,.8153000224609548,.8079838851020156,.8009361011210492,.7941833830030056,.7877515296677573,.7816652094740008,.7759477495699525,.770620934400103,.7657048161032419,.7612175394133187,.7571751835028695,.7535916229911725,.7504784100796043,.7478446794793895,
- .7456970774675764,.7440397160518524,.7428741528506376,.7421993969091074,.7420119402820105,.7423058148281223,.7430726732865105,.7443018933488548,.7459807031117409,.7480943259943952,.7506261429462197,.7535578695493137,.7568697454475048,.7605407334077464,.7645487252435035,.7688707518031628,.773483194248789,.7783619939197723,.7834828581892628,.7888215304941855,.7943549265743916,.8000620814033437,.8059237261051776,.8119217425461789,.8180386863267316,.8242573930286576,.8305606774466032,.8369311306465468,
- .8433510151811057,.8498022547502866,.8562665110903451,.8627253379330171,.86916039950769,.875553739247583,.8818880830851048,.888147146963997,.8943155601410728,.9003784870642859,.906321946820671,.9121332794798509,.917801568611746,.9233179989843753,.9286761324324326,.9338720889876022,.9389046249045825,.9437751040577974,.948487364168275,.9530474842850134,.9574634647204375,.961744835051232,.9659022096695618,.9699468135356936,.9738900030821558,.9777428123469353,.9815156165956411,.9852178918578764,.9888579607190948,
- .9924428357365057,.995978194502314,.9994684956769921,.9970827613929034,.9936726382119915,.990298232296132,.9869561038487373,.9836428333808174,.9803566647105523,.9770979520563435,.9738692042943523,.9706746158528428,.967519989315871,.9644130463294933,.9613636424985745,.958383848866657,.9554878937203887,.9526919668010134,.950013896122789,.9474727150342134,.9450881434969897,.942880012449173,.9408676632967224,.9390693558740655,.9375017175690735,.9361792637708016,.9351140155256978,.9343152345329298,.9337892888355972,
- .9335396722537141,.9335672049097944,.9338703131806108,.9344453870349423,.9352872185553254,.9363894937495745,.9377453058507775,.9393476567947157,.9411899131910545,.9432659202313483,.9455689250834624,.9480909497750494,.9508227710608106,.953753912461762,.9568726280109225,.9601658808296828,.9636193205125501,.9672172637207003,.9709426823589302,.974777203257478,.9787011224579527,.9826934361013292,.986731888650128,.9907930378761077,.9948523348446512,.9988842427262797,.9971374225691321,.9932391289602219,
- .9894473986087092,.985788582057273,.9822886274699182,.9789728478327465,.9758656890951467,.9729905023065344,.9703693228289245,.9680226596788103,.965969297972104,.9642261173135049,.9628079287879259,.9617273329790645,.9609946011624249,.9606175815017696,.960601631724653,.9609495793707947,.9616617103036402,.962735785758106,.9641670877741124,.9659484924440864,.9680705699911336,.9705217103007491,.9732882721600339,.9763547541210889,.9797039846054822,.9833173286094813,.9871749081591465,.991255832021221,.995538366239873,
- 1,.9953823887447714,.990632331010032,.9857735678303545,.9808297866037201,.9758234904977154,.9707750414591048,.9657030337020568,.9606248326143578,.9555570707824004,.9505160598642948,.9455181077348077,.9405797358369736,.9357177962251985,.9309494918645408,.9262923072972971,.9217638597699658,.9173816833253194,.9131629602176328,.9091242153260362,.9052810040381926,.9016479821690183,.898239275300488,.8950681487540328,.8921465291037196,.889484568210462,.8870902710510747,.8849692046475397,.8831243013132237,
- .8815557648966109,.8802610838639934,.8792351500750384,.8784704771324049,.877957507398665,.8776849923449298,.8776404270004013,.8778105160806752,.8781816470445274,.8787403440060298,.8794736762277192,.8803695959244717,.8814171823588509,.882606772701165,.8839299648017747,.8853794827626573,.8869489028248166,.8886322443763066,.8904234385493537,.892315752238722,.8943023468485682,.8963779260282129,.8985391908846717,.9007848954710846,.903115391711105,.9055325684849259,.9080401810946777,.9106440863994827,.913352345798788,
- .9161751893819156,.9191248428992848,.9222152273307168,.9254615473053227,.9288797483724874,.9324858479253182,.9362953179043332,.9403225047148771,.9445800909584874,.9490786287629377,.9538261704339563,.958828016403189,.9640865935518256,.9696014693451538,.9753694992576356,.9813850971534366,.9876406110557286,.9941267804963657,.9991667532650987,.9922509161551649,.9851366828333391,.9778346047329646,.9703546813166875,.9627074231467382,.9549044669023731,.9469585849692052,.9388836845154047,.9306948166066128,
- .9224081923039349,.9140412018176374,.9056124323475037,.8971416802470795,.8886499535820267,.8801594619544029,.8716935915448706,.8632768645673531,.8549348806500352,.84669422767966,.8385823593736481]},{distance:[.21608462359966324,.17985330091326251,.1429808911510531,.1055608990485295,.06769156195654308,.029475280704593432,-.008982005424617745,-.047571493378292584,-.08618223354200721,-.12470188153971729,-.1630174760080388,-.20101623317870315,-.2385863487024183,-.2756177969056899,-.31200311759671007,
- -.3476381806309835,-.3824229187118804,-.4162620193320637,-.44906556735114994,-.48074963044202146,-.5112367805085022,-.5404565451633492,-.5683457844378438,-.5948489890507773,-.619918497772055,-.643514632650122,-.665605752108519,-.6861682231307964,-.70518631492145,-.7226520175316642,-.7385647899524452,-.7529312430867978,-.7657647638020963,-.7770850869221135,-.7869178225367683,-.7952939971772472,-.8022502122394455,-.8078287345280064,-.8120766422715775,-.8150448636826926,-.8167872288550904,-.8173595390451198,
- -.81681866085376,-.8152216566815507,-.8126249665022558,-.8090836589496726,-.8046507714578934,-.7993767593673089,-.7933090722746143,-.7864918723943664,-.7789659044125087,-.7707685823365151,-.7619359573027238,-.7525061070713175,-.7425193689295806,-.732017792798141,-.7210445760669126,-.7096434845647199,-.6978582556269457,-.685731975053429,-.673306418356378,-.6606213483983281,-.6477137663261998,-.6346171203247604,-.6213604865557256,-.6079677478792072,-.5944568075410152,-.580838885803034,-.5671179563140921,
- -.553290388400328,-.5393449229148207,-.5252630013680049,-.5110193736805249,-.4965831081546308,-.4819190417830187,-.4669896684107442,-.4517574362126394,-.4361873981165894,-.4202501308146268,-.4039247081139521,-.3871995180761134,-.3700708828387643,-.3525435277375217,-.33463059852258953,-.3163502735491748,-.2977250417422422,-.2787837773898456,-.259563427582968,-.24011009760771904,-.22047950695166404,-.20073682053411152,-.18095589025687436,-.1612179697354456,-.14160998899735625,-.12222249509890584,-.1031473783061852,
- -.08447551124382408,-.06629443001995244,-.048686181827635566,-.0317254531885488,-.015478077363084652,0,.01466313784540868,.028475593171839897,.04141083932028716,.05345054509250119,.06458310555448282,.07480180109961787,.0841026869190254,.09248233273544293,.09993554859570014,.1064544296118029,.11203254886176456,.11666697384081715,.12035745594387859,.12310553585642109,.12491374120552817,.12578495442393156,.12572202689183104,.12472770928386157,.12280495748684922,.1199576585121826,.11619180179215521,.11151709866464038,
- .1059490275090425,.09951125492632196,.09223835574954459,.0841780808626203,.07538839183189922,.065933670167164,.055884138293318064,.04531547788343576,.034308381623327,.022948041762769156,.011323579798992067,-4.725774162141483E-4,-.012345368972990212,-.02419781163259621,-.03593174432104124,-.047448597137837556,-.05865017617908769,-.06943945516265232,-.0797213646793401,-.08940356988195652,-.09839722756470104,-.10661771387604857,-.11398531434302797,-.12042586845442393,-.1258713617426863,-.13026045910428968,
- -.13353897398873252,-.13566026904831816,-.13658558485386701,-.136284294324511,-.13473408157132083,-.13192104489366646,-.12783972467375893,-.12249305432276139,-.11589208023247813,-.10805535065778654,-.09900847495407356,-.08878371714322564,-.07741954142734969,-.06496016708152436,-.05145573470319331,-.03696226299295097,-.02154029857174805,-.005253841370568668,.011830485494478571,.02964425365619322,.0481180343547038,.06718217994575687,.08676756790637752,.10680629002676473,.12723226751806904,.1479817723795876,
- .16899383679035246,.19021053559210227,.21157713201511702,.23304202057988294,.25455480246749224,.27606295170998013,.29751164940360025,.31884440793147434,.3400037223243753,.3609317429035745,.381570971700728,.4018649892531914,.421759219717264,.4412017405140038,.46014413790951464,.4785424023284142,.4963578473908506,.5135580254874752,.5301176011938449,.5460191331241753,.5612537061136926,.5758213500175187,.5897311798885712,.6030011955778347,.6156576873120798,.6277342076130861,.6392700887085987,.6503085076385513,
- .6608941275040408,.671070371347884,.6808764133574914,.6903441021856163,.6994970277017785,.7083517732497631,.7169173079648041,.7251948217177246,.7331809573465766,.7408683710764379,.7482434919176353,.755284666191498,.7619609039446538,.7682312567322345,.7740448243515958,.7793413576435593,.7840524024957969,.788103161637089,.7914151123452815,.793908384586598,.7955040592806892,.7961264260628995,.7957050782852255,.7941767320993252,.7914866720894065,.7875897461129868,.7824508558575007,.7760449160827012,.7683562834439595,
- .7593776839731985,.7491086955134583,.7375538664737085,.7247205740833951,.7106167428901842,.6952485600257388,.6786195206915735,.6607346334622037,.6416024610005504,.6212343456855973,.5996435628623165,.5768445777136231,.5528524831738091,.5276826942395836,.5013509677300951,.4738738058283361,.4452692866492523,.415558345913795,.38476651110671806,.3529260639940504,.3200784847008931,.28627663451335467,.25158659508755604],pressure:[.5691853069271902,.5761598493086387,.5836549660102934,.5916573520448034,.6001508826342608,
- .6091166464253608,.6185330073048972,.6283756948595924,.6386179231004783,.6492305366430691,.6601821831086752,.671439510097985,.6829673846938752,.6947291330845184,.7066867975679297,.7188014079121487,.7310332638074759,.7433422249637005,.7556880052800675,.7680304674515567,.7803299143732598,.7925473737652676,.8046448725621459,.8165856977910675,.828334640897044,.8398582227573012,.8511248969535365,.8621052292335775,.87277205148512,.8831005889556311,.8930685598756851,.9026562470694923,.9118465415578232,.9206249585669208,
- .9289796267448683,.9369012645105497,.9443832946275551,.9514219246086814,.958015972695876,.9641666500055281,.969877329688016,.9751533048305506,.980001537895476,.9844304056209323,.9884494443726087,.9920691017867442,.9953005010651146,.9981552243794061,.9993548785423636,.9972178514572466,.99542175843976,.993954758638614,.9928047095247959,.9919584127707295,.9914016519524977,.9911194238220511,.9910961708694461,.9913160132529906,.9917629804187322,.992421243901537,.9932753532695826,.9943104768616842,.9955126478674181,
- .9968690144860597,.99836809051787,1,.9982432933421748,.9963677837106009,.994377261967434,.9922732115434169,.9900547878881953,.9877188896460122,.9852603133654619,.982672015266634,.9799454878291936,.9770712502891903,.974039445602097,.9708405294543054,.9674660298926003,.9639093235251687,.9601658726706248,.9562329129523883,.9521096083055939,.9477975472265934,.9433024760349076,.9386346992408013,.9338081018429565,.9288391328799878,.9237458494286502,.9185470488941134,.9132615110442585,.9079073650469085,
- .9025015909919765,.8970596601641208,.8915953137503946,.8861204757339449,.8806452924004764,.8751782880941458,.8697266245092423,.8642964487958301,.8588933140065609,.8535226539865908,.8481903106699366,.8429031227552255,.8376694633048203,.8324997194620253,.8274067193710991,.8224060852356061,.8175164920651409,.8127598137384923,.8081611402073383,.8037483546257409,.7995503371139331,.7955956688242404,.7919120365365417,.7885256878072128,.7854609327388127,.7827397128947081,.7803812564949162,.7784018369902248,
- .776814649391961,.7756298153176305,.7748545236021089,.7744933085539024,.774548462577634,.7750205740522824,.7759091752015157,.7772132858730902,.7789304463089728,.7810555710203411,.7835808141436744,.7864955405844698,.7897863246004999,.7934369767912894,.7974286000789335,.8017396748609863,.8063461730961242,.8112217006554178,.8163376668445226,.8216634795832819,.8271667643274929,.8328136044410652,.8385688003832349,.8443961447719726,.8502587101275652,.8561191458948828,.8619399811933006,.8676839296526522,
- .8733141926636808,.8787947574026184,.884090686080828,.8891683930196655,.8939959063543419,.8985431114240032,.9027819732028567,.906686735462446,.910234094720982,.9134033468359699,.9161764791106501,.918538190012956,.9204759186558265,.9219798607673199,.923042957079141,.9236608678883123,.9238320850823001,.9235580464146217,.9228430919037494,.9216942669990001,.9201210458884687,.9181350420369514,.9157497106250858,.9129800471956804,.9098422878469173,.9063536171341544,.9025318903324264,.8983953767777635,.8939625305899994,
- .8892517941667604,.8842814384551524,.8790694580084111,.8736339403730646,.8679937957526065,.8621686978158929,.8561788339394514,.8500446571771394,.8437866418716297,.8374250425589985,.8309796546286788,.8244695747146323,.8179129590904861,.8113267794265044,.8047265770669956,.7981262193569987,.7915376642770159,.7849707424754298,.778432968431491,.7719293946406127,.7654625241065128,.7590322968077878,.7526361649951657,.746269270062079,.7399247302972876,.7335940441530112,.7272676079223305,.7209353401843857,
- .7145873983936859,.7082149659703532,.7018110556257644,.6953707730753351,.6888910304064145,.6823707258358536,.6758112634531285,.6692183084851477,.6626022079449607,.6559770312632268,.6493595700087734,.6427683956848932,.6362230032549527,.6297430616751711,.6233477865403865,.6170554432362672,.6108829414420588,.6048454970530781,.5989565028286026,.5932275528905984,.5876685831118744,.5822881146472749,.5770935860664862,.572091757804684,.5672891711020842,.5626926422314712,.5583097716306931,.5541494466226621,
- .5502223158132062,.5465412131295428,.5431215099368856,.5399813748850868,.5371419232114099,.53462723941573,.5324639621775302,.5306794982966765,.5293007393859444,.5283534815866524,.5278618983560898,.5278480623965962,.5283315372279409,.5293290574887453,.5308543149828084,.5329178647334012,.5355271618562389,.5386867359143759,.5423985046099122,.5466622232581835,.5514760418344251,.5568370630070936,.5627418189934147]},{distance:[-.8072011945926201,-.8101781789378402,-.8100819490250073,-.8068201103704006,
- -.8003512140464928,-.7906883987123778,-.7779010417671035,-.7621142552830881,-.7435061846983948,-.7223031977197398,-.6987731775019942,-.6732172479084149,-.645960350480181,-.6173411554857449,-.5877018184805887,-.5573780875782919,-.526690226598082,-.49593514976010367,-.46537804365119384,-.4352270584351285,-.4056279369566598,-.37669273937946207,-.348522922519962,-.3212210129150559,-.29489150970207145,-.2696336152632359,-.24553038230198349,-.22265051570638542,-.20105218147527676,-.18076806436851875,-.16179305459434307,
- -.1440794551992521,-.127539756456013,-.11205567506124686,-.09749124252513666,-.08370707972038513,-.07057107984634275,-.057965643620492946,-.04579234631640394,-.03396953649705481,-.022423779244509112,-.011101963391159542,0,.010841448503387863,.021335982439837753,.03134502423686286,.04068579840257286,.0491534388337459,.05655240185623167,.06273015066584714,.06760549251741227,.07118506251111661,.07356299586868115,.07490372313996857,.07541413209201292,.07530957898235036,.07478588038454065,.07403235446055628,
- .07324823259644742,.0726394241768662,.07241505384851388,.0727845780852549,.0739548725466036,.07612699266769374,.07949209491659132,.08422092934121739,.09045147834372058,.09828144243539738,.1077624602577254,.11889606262702862,.13163186147706374,.1458680190144992,.16145365701790954,.17819342349255163,.19585407920660813,.21417279005106837,.23286671377534418,.25164340056086454,.27021149067883277,.2882910874337047,.30562125900672843,.3219644088236595,.3371133352144283,.35091608420734044,.36328235808398657,
- .3741546225386897,.3834836688869757,.39121584531376796,.3972914386144367,.40165163291010353,.40424945606341767,.405048450361593,.404019667586327,.4011576798743891,.3964941440477321,.3901039357319329,.38210371052571157,.37264409931949904,.36189766528548883,.3500452324275396,.3372632968407081,.323715024240682,.3095468080958761,.2948916053536138,.2798780018221271,.26461813327128325,.2491784738174898,.23358312164573614,.21781145466430096,.20179007666419901,.18539906200816103,.16849313410300432,.15093554128426906,
- .13263274850106388,.1135619109399641,.09378649724284494,.07345632737644492,.0527916992700862,.032054842125519956,.011514798754285627,-.008581591639872599,-.02799750956407243,-.04649042810293991,-.06381584695425035,-.07973106288596343,-.09399817084698497,-.10638691086210977,-.11667774921363519,-.12466627946697867,-.1301739689647381,-.13306024232270192,-.1332296269679238,-.13063713726253068,-.12529193887477036,-.11725902255065579,-.10665872256719783,-.09366403747724183,-.07849584023872902,-.06141619144694904,
- -.04272008314074466,-.02272603249396199,-.0017660074633861211,.019824804455409795,.04171787942038441,.06360042745092942,.08518325418607409,.10620913864717063,.12647814517664635,.1458530010151366,.16423038195203626,.181517846923561,.19762218251474728,.21244852123725444,.22590763553428994,.23792681869999577,.24844811416168222,.25742454060023734,.2648350676970387,.2706968189683444,.2750695182237136,.2780525874551334,.279776064666882,.28038747540225495,.2800375208401146,.27886936097901394,.2770114037568443,
- .2745728074284769,.2716458950912125,.26831463267388334,.2646424472408201,.26064346147994266,.2562867058025856,.25149508263924547,.24613888548594276,.24004374845489818,.23301273328434524,.22485773228142347,.21543315278414576,.20466426425294348,.192563701453918,.17923116509652937,.1648362537031285,.14959066967661555,.13371428137273444,.11740717135402118,.10086273864928852,.08428417480088374,.06788129529518239,.05186714451826968,.03645517983173757,.02185642505113139,.008276294582728938,-.0040894254835193156,
- -.015065029779289918,-.024507205622974648,-.032312504698705335,-.03842308796550048,-.04283075649028967,-.04557896942330786,-.04676265819797182,-.04652577076357878,-.04505661219719492,-.042581178408700515,-.03935479788169144,-.03565249349370575,-.031758545295410945,-.027955771093150228,-.024515146478500616,-.021688310299507796,-.019703215334662738,-.018757102578389917,-.01899169428117753,-.02048684193316075,-.023289485013608058,-.02743816260305254,-.032975862308382564,-.03995172341425801,-.048414166097628386,
- -.05840003427519208,-.06993601381691505,-.08304172081485,-.09771360799493986,-.11391106369447246,-.1315502196486286,-.15050543550985684,-.17061715045152862,-.19170397289165406,-.2135763978002242,-.2360494398435601,-.2589516777952574,-.282128671695019,-.30543942690027237,-.3287472861034805,-.3519320667579203,-.37491933183126214,-.39767716103420836,-.42021854939892794,-.4426095121676621,-.4649628875607328,-.4874172018243828,-.5101028326420941,-.5331073522898042,-.5564480842174437,-.5800565052730963,
- -.6037782284297732,-.6273888918596129,-.6506227164530787,-.6732076294666526,-.6948942829550503,-.7154438664244314,-.734612371720981,-.7521543147253889,-.7678264893053004,-.7813909587774454,-.7926179517339738,-.8012889735871088],pressure:[.9895161204160292,.9840369169707215,.9784068120671994,.9726804932985318,.9669164911941968,.9611756349947668,.9555193564328459,.9500079206353288,.9446986702741492,.939644370359935,.9348917363391005,.9304802176887117,.9264410937819363,.9227969196335665,.919561337761559,
- .9167392505148594,.9143273265177952,.9123147969019898,.9106841387391272,.9094087574718269,.9084538413232024,.9077827245489216,.9073619683549731,.9071641596931399,.9071685358709455,.9073598951494696,.9077266069755795,.9082605244033102,.9089570435873076,.9098118411066024,.9108179720492353,.9119642080127434,.913234664855292,.914609533110812,.9160665605279547,.9175828251774112,.9191360769467644,.9207055714734607,.9222724315523534,.9238188941216838,.9253266137756333,.9267785743666402,.9281647572521012,
- .9294868784873791,.9307576026937193,.9319946677575254,.9332149421956271,.9344292780022139,.9356386786915559,.9368322233052442,.9379870443788852,.939070438451201,.9400440298447089,.9408693957558052,.9415139108562515,.9419559972406757,.942187975041144,.9422110354579915,.9420293359153966,.9416477810073915,.9410708251374598,.940302687590655,.9393494185232419,.9382229203268148,.9369459420711188,.935551295578087,.9340776914349957,.9325684486432844,.9310702853779718,.929631891800105,.9283023269617454,.9271293290111462,
- .9261576614257422,.9254275502768614,.9249732858715628,.9248220581512397,.9249930805897455,.9254970390793739,.9263358819532268,.9275029600636553,.928983761999237,.9307571820364604,.9327963827533055,.935066633375772,.937526566646929,.9401346572009158,.9428541148608053,.9456554682305777,.9485169658472052,.9514232607322315,.9543631975494523,.9573295104039431,.9603186815570695,.9633274970641268,.966349987265947,.9693756358902814,.9723889116051327,.9753699381296339,.9782959545063858,.9811431280128201,.9838882592504097,
- .9865099501789348,.9889888892029551,.9913070325240627,.993445877212312,.9953883812739592,.9971246839684085,.9986569305711684,.9999985986505425,.9988312521944703,.9978137984702864,.9969355924443742,.9961928360206964,.9955937088467133,.9951583924078183,.9949169503663974,.9949052983708871,.9951598157104113,.9957114427543419,.9965802856394443,.9977726000420989,.999285634128917,.9988866672170534,.9967516583028833,.9943170215531937,.9915912161548341,.9885857796289006,.9853195238885313,.9818232308407445,
- .9781384833118625,.9743133849987378,.9704011654247371,.9664588589904201,.9625457650654404,.9587217561753422,.9550455133513582,.951572774723807,.9483546847076008,.9454363263954315,.9428555093092011,.9406418692401979,.9388163177469236,.9373908575079039,.9363687578434029,.9357450640224984,.9355073959954576,.9356366339368338,.9361046023720341,.9368749258471302,.937909392988946,.939173037766169,.9406369381556612,.9422788401478532,.9440820672669532,.9460335292603512,.9481236325255258,.9503463371768919,
- .9526958918631189,.9551639436683559,.9577379114828771,.9604006269972256,.963131069677962,.9659058534180843,.968701003322356,.9714933004649385,.974261126910736,.9769848594942763,.9796461247969585,.9822260955240006,.9847073942749285,.9870797536471962,.9893447450320745,.9915149838875509,.99360824569994,.9956415145232984,.9976258269661501,.9995624313929609,.9985592968380168,.9967618860530656,.9950776662223739,.9935446134195047,.9922007326918585,.9910782210894934,.9901982249679258,.9895679961952346,.9891859254671472,
- .9890474529763778,.9891472927276156,.9894806345549308,.9900429330659372,.9908278449949057,.9918232104795446,.9930060605339519,.9943434021475821,.9957963826908263,.9973215799258396,.9988722101499593,.9996004476445592,.9981454738888434,.9968106513272266,.9956408104786506,.9946762611412829,.9939513891961305,.9934934881368193,.9933218800939079,.9934473628493744,.9938719989790262,.9945892560141427,.9955847426595942,.9968374786035789,.998320759770587,1,.998166008160129,.9962186106712366,.9941943939325292,
- .9921225961716582,.9900247011575644,.9879157485229189,.9858065416151759,.9837039449632268,.9816110215558327,.9795304900171568,.9774678225344304,.9754330461549756,.9734412111372113,.9715117205073772,.9696668693047304,.9679300310447354,.9663239518640189,.9648695816251543,.963585794275754,.9624902291460241,.9616010241710629,.9609348913960201,.9605013915779249,.9602981039288054,.9603112939498704,.9605216574254417,.9609101319272801,.9614630294901548,.9621763031749019,.9630578675480818,.9641276148536168,
- .9654152871560456,.966956437706885,.9687870339401776,.9709375460720899,.9734275428083042,.9762626660438132,.9794394647019092,.9829510898696023,.9867892898877801,.9909453725848987,.9954097538860016,.9998303119388501,.9947949028772902]},{distance:[1.073477664775138,1.0760386269477948,1.0772833751128177,1.077182055008552,1.0757103220196158,1.0728496920663297,1.0685878450185085,1.0629188754607861,1.0558434862729706,1.047369121222384,1.0375100335840224,1.0262872886944052,1.0137286992901509,.9998686934649925,
- .9847481160802282,.9684139654639925,.9509190682143664,.9323216958606523,.9126851280172328,.892077167467664,.8705696133269087,.8482376990329641,.8251595024038415,.8014153353530469,.777087121080172,.7522577666399095,.7270105387426533,.7014284504557945,.675593666162726,.6495869317050148,.6234870360931374,.5973703105358394,.5713101698223575,.5453767003117955,.5196362979569504,.4941513179529629,.46897925735872037,.44417203077689105,.41977605280537106,.395832457432434,.37237736141755995,.34944217185608545,
- .3270539342903352,.3052357135988542,.28400699594592627,.2633840967607714,.2433805574399857,.22400751254003232,.20527400984618582,.18718726793470786,.16975285961011793,.1529747640040181,.13685394023969016,.12138578833698932,.10656018603774664,.0923621790695256,.07877270559615268,.0657693465805469,.05332710081015746,.04141918697099378,.03001787659260957,.019095360660303262,.008624649181414146,-.0014195027723571396,-.011059656581953181,-.0203147618745112,-.029199270292640245,-.037722331299907985,-.04588711687668223,
- -.05369032899632287,-.061121989173093305,-.0681655289555867,-.07479812954966814,-.0809914046471566,-.08671245584433662,-.09192529835658969,-.09659263366536874,-.10067792325750391,-.10414769504127896,-.10697390926022887,-.10913460021148946,-.11061276038654855,-.11139673273861705,-.11148170635688492,-.11087519218784081,-.10959822768357541,-.10768216589748636,-.10516535006240912,-.10208999286932174,-.09849935065248527,-.0944352622283493,-.08993610231163918,-.08503518093188078,-.07975960355702294,-.07412959193437918,
- -.06815825301898237,-.061851772648659264,-.05521000160057432,-.04822739401965692,-.04089425162988636,-.03319822135084727,-.025125989324254916,-.016665186736010473,-.007806573243022363,.0014539779695187383,.011113696912844806,.02116128577619958,.03157550847905055,.04232406828899915,.053362834734053455,.06463547439350137,.07607448788045645,.08760665311560345,.09915686257877021,.11064971573484378,.12201095799094674,.13316878339923716,.14405493994184487,.1546055807672842,.1647618112908522,.17446989071288355,
- .1836810572984311,.1923509596845825,.20043869142813875,.2079054427492103,.21471280160012385,.2208207553130137,.2261860817544602,.23076564817815381,.23452034048065362,.237415799807977,.23942287277794616,.24051802420457175,.2406837056710489,.2399086736837872,.23818825164865703,.23552453053658462,.23192650384028646,.22741013325625553,.22199834244242755,.21572093718664465,.2086144513564886,.20072191906834985,.19209257459273565,.1827814825834171,.1728491022595211,.16236079016214539,.1513862470314593,.13999891518891483,
- .12827533354638532,.1162944579861715,.10413695535183087,.09188447965137991,.07961893929623465,.06742176427888624,.0553731821304011,.04355151129892987,.03203248288794347,.020888714701842392,.01018942157426972,0,-.009618402748752808,-.01860926505337812,-.026921050504776,-.0345080300550179,-.04133117277971943,-.04735866019174506,-.05256577352098524,-.05693443692154365,-.06045270845608064,-.06311423086065249,-.06491765152754303,-.06586602497394378,-.06596621425251437,-.06522830990741912,-.06366508587596909,
- -.061291510985926556,-.058124332338711615,-.05418174297670031,-.049483191704697616,-.04405068269883139,-.03791119965188483,-.031096566090152544,-.02364266455715791,-.015588634033110838,-.006976053892405409,.0021518844065643306,.011751220417819397,.02177808661674485,.0321895921877815,.04294472830872498,.05400528884114275,.06533679283176963,.0769093865970214,.08869869422696575,.10068657702737005,.1128617556661472,.1252202445029662,.13776554653566742,.15050856018293224,.1634671560818184,.17666539326593406,
- .19013235924867744,.20390063709579143,.21800442366713224,.23247734571866824,.24735004316588682,.26264769360639983,.2783892627438348,.29458851506993666,.31125352009545565,.3283850598569682,.34597106207078926,.36398531105903664,.38239058191472075,.40114189782779275,.42018959226718966,.43948208666822564,.4589683146605129,.47859974360795593,.498331966919233,.518126046493839,.5379497108582336,.5577777711811133,.5775919899363193,.597380557959325,.617137220104669,.6368600953435288,.6565502428952157,.6762100311441541,
- .6958413707320056,.7154438772785817,.7350130324878895,.7545384146306895,.7740020701656434,.7933770971207604,.8126265073586739,.8317024286008892,.8505457004681505,.8690868665590787,.8872515624225755,.9049642869252424,.9221499180958745,.938735064773304,.9546492713379788,.9698260145393293,.9842034360856629,.9977247613398907,1.01033836324964,1.021997441582979,1.0326593006238671,1.0422842235935894,1.050833959029148,1.058269936641575,1.0645516720544315,1.0696354598401288],pressure:[.8035566534221908,.8029066234486641,
- .8029630561572387,.803747434752605,.8052691776994239,.807524775309436,.8104974008196729,.8141570351094792,.8184611150124896,.8233556842824448,.828776996058471,.8346534885371322,.8409080336527599,.8474603436052913,.8542294131538002,.8611358770976558,.8681041719412341,.8750644073440443,.8819537806577296,.8887166400509109,.8953046657466505,.9016781592166756,.9078070354637227,.9136713587155069,.9192613452528862,.9245767117028113,.929625483423786,.9344252099227054,.9390034022265139,.9433920112564534,.9476212523629397,
- .9517144701879539,.955684736061796,.9595335160028396,.9632513456662574,.9668200663199139,.9702158202931442,.973412069206184,.976381983633263,.9790995330010462,.9815393460209157,.9836797610987347,.9855087543258854,.9870246509457911,.9882361956939822,.9891627228067309,.9898325999316611,.9902802212790599,.9905421439380419,.9906530831505598,.9906425308626776,.9905327269320474,.9903387908898023,.9900712394096691,.9897401354043482,.9893606841395273,.9889582187865704,.9885646858204582,.9882155460231378,
- .9879519141807018,.9878221920104381,.9878817636644416,.9881899196025524,.9888037215448153,.9897700072594777,.9911236497523962,.9928897650473119,.9950826720020142,.997704811071042,.9992539147598233,.9958163310666864,.9920176819646543,.9879048040659654,.9835348252492453,.9789734495963855,.9742929128497912,.9695697123117857,.9648822274877861,.9603083519919108,.9559232379606738,.9517969546931031,.9479921629172136,.9445625735808956,.9415528947791242,.9389988665277486,.9369261042697703,.9353491364266406,
- .9342709426749365,.9336830739604314,.9335664716029517,.9338928652075635,.9346237956173667,.935710440164409,.9370994125378094,.938739222857091,.9405856941185207,.9426056329635653,.9447784069384256,.9470954825081908,.9495583536497095,.952175568194123,.954959683198473,.9579249122293271,.9610859907813111,.9644582398380019,.9680543998437745,.9718785325373297,.9759250915489013,.9801785956957639,.9846131754861347,.9891938321619427,.9938793223432855,.9986266273294172,.9966047787965038,.9918497228198898,.9871355080698349,
- .9824820087167215,.9779039569590948,.973415315426437,.9690351821277438,.9647930373931517,.9607254218323615,.9568729437841168,.9532824270388266,.9500084469939325,.947112824794365,.9446612523467875,.9427168516945913,.9413324435240579,.9405491292535046,.9403983992868811,.940900930726219,.9420653218140077,.9438872369307152,.9463490265053414,.9494198608653369,.9530563878567624,.9572038931659781,.9617979120602145,.9667662141270245,.9720310606894462,.977511619615681,.9831264153269125,.9887956933180382,.9944435880889297,
- 1,.9945979857230822,.9894060323985937,.9844723682375817,.979836495824286,.9755281996179322,.9715670111580619,.9679622082408038,.964713469709692,.9618120711918576,.9592396747839816,.9569678976930398,.9549638402657756,.9531962490423564,.9516406079347228,.9502825258703004,.9491190655339308,.9481580660399986,.947415905441548,.9469145047253487,.9466783156496014,.9467319533419737,.9470991143888094,.9478027158341983,.9488618451902852,.950285834064939,.9520735494940182,.9542133275520155,.9566828084087643,
- .9594504985528346,.9624787847887566,.9657278060220879,.9691594669703013,.97274082940435,.97644615146003,.9802567670332982,.9841585800139179,.9881379273399028,.9921759953807803,.9962438471234566,.9996940503540469,.9956767139916779,.9917487716399241,.987962082385204,.9843754197683697,.9810513838022367,.978050254610212,.9754219865517988,.9732044575075752,.9714256676158786,.9701026910040449,.969240587516739,.9688317381974026,.9688556581406221,.9692793148837593,.9700579517602642,.9711363857414632,.9724507205973344,
- .9739303910337996,.9755004338812023,.9770838700163186,.9786040764706536,.9799870474381955,.9811637424105402,.982072419973164,.9826601882860277,.9828830685455368,.9827059716144204,.9821038668186322,.9810627574723236,.9795801563131822,.9776649796884477,.9753367429809522,.9726241773936759,.9695662216838756,.9662122107041409,.9626160563816616,.9588297180403401,.9548977727969012,.9508537530988366,.9467185787184169,.9425010286724171,.9381998231089347,.9338066078393872,.9293090099765098,.9246929888417168,
- .9199439339828734,.9150465969777082,.9099882732829045,.90476491636475,.8993820824815684,.893855271904327,.8882103957964731,.8824825291679266,.8767130366040575,.8709451115005371,.8652195144682289,.8595713713094872,.8540283507035986,.848610758108077,.8433338200861042,.8382120513685981,.8332651520021668,.828523244091681,.8240235372628884,.8198073214607214,.8159220980454146,.8124230975690607,.8093727635312831,.8068374215607792,.8048808715632836]}]}})},"esri/views/3d/webgl-engine/lighting/SceneLighting":function(){define(["require",
- "exports","../../lib/glMatrix","./SphericalHarmonics"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=f.vec3d,c=f.vec4d,g=e.create();r=function(){function d(){this._renderLighting={main:{intensity:e.create(),direction:e.createFrom(1,0,0),castShadows:!1},sphericalHarmonics:{sh:{r:[0],g:[0],b:[0]}}};this._shOrder=2;this._oldDirection=e.create();this._oldSpecular=c.create();this._oldDiffuse=c.create();this._oldAmbient=c.create()}d.prototype.setUniforms=function(a,c){void 0===
- c&&(c=!1);c||a.getDefine("GROUND_NORMAL_SHADING")?a.setUniform1f("lightingFixedFactor",(1-this._info.groundLightingFactor)*(1-this._info.globalFactor)):a.setUniform1f("lightingFixedFactor",0);a.setUniform1f("lightingGlobalFactor",this._info.globalFactor);a.setUniform3fv("lightingMainDirection",this._renderLighting.main.direction);a.setUniform3fv("lightingMainIntensity",this._renderLighting.main.intensity);a.setUniform1f("ambientBoostFactor",.4);c=this._renderLighting.sphericalHarmonics.sh;0===this._shOrder?
- a.setUniform3f("lightingAmbientSH0",c.r[0],c.g[0],c.b[0]):1===this._shOrder?(a.setUniform4f("lightingAmbientSH_R",c.r[0],c.r[1],c.r[2],c.r[3]),a.setUniform4f("lightingAmbientSH_G",c.g[0],c.g[1],c.g[2],c.g[3]),a.setUniform4f("lightingAmbientSH_B",c.b[0],c.b[1],c.b[2],c.b[3])):2===this._shOrder&&(a.setUniform3f("lightingAmbientSH0",c.r[0],c.g[0],c.b[0]),a.setUniform4f("lightingAmbientSH_R1",c.r[1],c.r[2],c.r[3],c.r[4]),a.setUniform4f("lightingAmbientSH_G1",c.g[1],c.g[2],c.g[3],c.g[4]),a.setUniform4f("lightingAmbientSH_B1",
- c.b[1],c.b[2],c.b[3],c.b[4]),a.setUniform4f("lightingAmbientSH_R2",c.r[5],c.r[6],c.r[7],c.r[8]),a.setUniform4f("lightingAmbientSH_G2",c.g[5],c.g[6],c.g[7],c.g[8]),a.setUniform4f("lightingAmbientSH_B2",c.b[5],c.b[6],c.b[7],c.b[8]));a.setUniform3fv("lightDirection",this._oldDirection)};d.prototype.set=function(b){this._info=b;a.combineLights(b.lights,this._shOrder,this._renderLighting.main,this._renderLighting.sphericalHarmonics);e.negate(this._renderLighting.main.direction,this._oldDirection);b=1/
- Math.PI;this._oldAmbient[0]=.282095*this._renderLighting.sphericalHarmonics.sh.r[0]*b;this._oldAmbient[1]=.282095*this._renderLighting.sphericalHarmonics.sh.g[0]*b;this._oldAmbient[2]=.282095*this._renderLighting.sphericalHarmonics.sh.b[0]*b;this._oldAmbient[3]=1;this._oldDiffuse[0]=this._renderLighting.main.intensity[0]*b;this._oldDiffuse[1]=this._renderLighting.main.intensity[1]*b;this._oldDiffuse[2]=this._renderLighting.main.intensity[2]*b;this._oldDiffuse[3]=1;b=e.set(this._oldDiffuse,g);e.scale(b,
- .4*this._info.globalFactor);e.add(this._oldAmbient,b)};Object.defineProperty(d.prototype,"globalFactor",{get:function(){return this._info.globalFactor},enumerable:!0,configurable:!0});d.prototype.getOld=function(){return{ambient:this._oldAmbient,diffuse:this._oldDiffuse,specular:this._oldSpecular,direction:this._oldDirection,helper:this}};return d}();h.SceneLighting=r})},"esri/views/3d/webgl-engine/lighting/SphericalHarmonics":function(){define("require exports ../../lib/glMatrix ../../support/mathUtils ../lib/LongVectorMath ./Lightsources".split(" "),
- function(r,h,f,a,e,c){function g(a){return(a+1)*(a+1)}function d(b){return a.clamp(Math.floor(Math.sqrt(b)-1),0,2)}function b(a,b,c){var d=a[0],e=a[1];a=a[2];c=c||[];c.length=g(b);0<=b&&(c[0]=.28209479177);1<=b&&(c[1]=.4886025119*d,c[2]=.4886025119*a,c[3]=.4886025119*e);2<=b&&(c[4]=1.09254843059*d*e,c[5]=1.09254843059*e*a,c[6]=.31539156525*(3*a*a-1),c[7]=1.09254843059*d*a,c[8]=.54627421529*(d*d-e*e));return c}function k(a,b){a=g(a);b=b||{r:[],g:[],b:[]};b.r.length=b.g.length=b.b.length=a;for(var c=
- 0;c<a;c++)b.r[c]=b.g[c]=b.b[c]=0;return b}function l(a,c){for(var f=d(c.r.length),g=0;g<a.length;g++){var k=a[g];n.negate(k.direction,m);b(m,f,v);e.elementwiseProduct(v,B);e.scalarProduct(v,k.intensity[0],x);e.add(c.r,x);e.scalarProduct(v,k.intensity[1],x);e.add(c.g,x);e.scalarProduct(v,k.intensity[2],x);e.add(c.b,x)}return c}function p(a,c){b(m,0,v);for(var d=0;d<a.length;d++){var e=a[d];c.r[0]+=v[0]*B[0]*e.intensity[0]*4*Math.PI;c.g[0]+=v[0]*B[0]*e.intensity[1]*4*Math.PI;c.b[0]+=v[0]*B[0]*e.intensity[2]*
- 4*Math.PI}return c}Object.defineProperty(h,"__esModule",{value:!0});var n=f.vec3d;h.numberOfCoefficients=g;h.numberOfCoefficientsInBand=function(a){return 2*a+1};h.orderFromNumberOfCoefficients=d;h.computeCoefficients=b;h.initSHCoefficients=k;h.projectFillLights=l;h.projectAmbientLights=p;h.combineLights=function(a,b,d,f){k(b,f.sh);n.set3(0,0,0,d.intensity);var g=!1,m=t,h=u;b=q;m.length=0;h.length=0;for(var v=b.length=0;v<a.length;v++){var z=a[v];z instanceof c.MainLight&&!g?(n.set(z.direction,d.direction),
- d.intensity[0]=z.intensity[0],d.intensity[1]=z.intensity[1],d.intensity[2]=z.intensity[2],d.castShadows=z.castShadows,g=!0):z instanceof c.MainLight||z instanceof c.FillLight?m.push(z):z instanceof c.AmbientLight?h.push(z):z instanceof c.SphericalHarmonicsLight&&b.push(z)}l(m,f.sh);p(h,f.sh);for(a=0;a<b.length;a++)z=b[a],e.add(f.sh.r,z.sh.r),e.add(f.sh.g,z.sh.g),e.add(f.sh.b,z.sh.b)};var t=[],u=[],q=[],v=[0],x=[0],m=n.create(),B=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,
- .785398]})},"esri/views/3d/webgl-engine/lib/LongVectorMath":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.dotProduct=function(f,a){for(var e=0,c=0;c<f.length;c++)e+=f[c]*a[c];return e};h.elementwiseProduct=function(f,a,e){e=e||f;e.length=f.length;for(var c=0;c<f.length;c++)e[c]=f[c]*a[c];return e};h.scalarProduct=function(f,a,e){e=e||f;e.length=f.length;for(var c=0;c<f.length;c++)e[c]=f[c]*a;return e};h.add=function(f,a,e){e=e||f;e.length=
- f.length;for(var c=0;c<f.length;c++)e[c]=f[c]+a[c];return e}})},"esri/views/3d/webgl-engine/materials/HUDMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./HUDMaterial.xml ../../support/aaBoundingRect ../lib/ComponentUtils ../lib/gl-matrix ../lib/GLMaterialTexture ../lib/Material ../lib/RenderPass ../lib/RenderSlot ../lib/screenSizePerspectiveUtils ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Util".split(" "),function(r,
- h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){function v(a,b){void 0===b&&(b=P);if(a.textureIsSignedDistanceField){var c=a.anchorPos;a=a.distanceFieldBoundingBox;var d=b;d[0]=c[0]*(a[2]-a[0])+a[0];d[1]=c[1]*(a[3]-a[1])+a[1]}else x.set(a.anchorPos,b);return b}var x=g.vec2d,m=g.vec3d,B=g.mat3d,z=g.mat4d,C={"bottom-left":[0,0],bottom:[.5,0],"bottom-right":[1,0],left:[0,.5],center:[.5,.5],right:[1,.5],"top-left":[0,1],top:[.5,1],"top-right":[1,1]},A=[{name:"position",count:3,type:5126,offset:0,stride:76,normalized:!1},
- {name:"normal",count:3,type:5126,offset:12,stride:76,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:76,normalized:!1},{name:"color",count:4,type:5121,offset:32,stride:76,normalized:!1},{name:"size",count:2,type:5126,offset:36,stride:76,normalized:!1},{name:"auxpos1",count:4,type:5126,offset:44,stride:76,normalized:!1},{name:"auxpos2",count:4,type:5126,offset:60,stride:76,normalized:!1}],D={texCoordScale:[1,1],occlusionTest:!0,binaryHighlightOcclusion:!0,drawInSecondSlot:!1,color:[1,
- 1,1,1],outlineColor:[1,1,1,1],outlineSize:0,textureIsSignedDistanceField:!1,distanceFieldBoundingBox:null,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],screenOffset:[0,0],verticalOffset:null,screenSizePerspective:null,screenSizePerspectiveAlignment:null,anchorPos:C.center,shaderPolygonOffset:1E-5,polygonOffset:!1,
- textureId:null,centerOffsetUnits:"world",debugDrawBorder:!1};r=function(b){function d(a,c){c=b.call(this,c)||this;c._textureDirty=!1;c.params=u.copyParameters(a,D);"string"===typeof c.params.anchorPos&&(c.params.anchorPos=C[c.params.anchorPos]);return c}f(d,b);d.prototype.dispose=function(){};d.prototype.getParameterValues=function(){var a=this.params;return{color:a.color,texCoordScale:a.texCoordScale,polygonOffset:a.polygonOffset,anchorPos:a.anchorPos,screenOffset:a.screenOffset,verticalOffset:a.verticalOffset,
- screenSizePerspective:a.screenSizePerspective,screenSizePerspectiveAlignment:a.screenSizePerspectiveAlignment,shaderPolygonOffset:a.shaderPolygonOffset,textureIsSignedDistanceField:a.textureIsSignedDistanceField,outlineColor:a.outlineColor,outlineSize:a.outlineSize,distanceFieldBoundingBox:a.distanceFieldBoundingBox,vvSizeEnabled:a.vvSizeEnabled,vvSizeMinSize:a.vvSizeMinSize,vvSizeMaxSize:a.vvSizeMaxSize,vvSizeOffset:a.vvSizeOffset,vvSizeFactor:a.vvSizeFactor,vvColorEnabled:a.vvColorEnabled,vvColorValues:a.vvColorValues,
- vvColorColors:a.vvColorColors,textureId:a.textureId,occlusionTest:a.occlusionTest,binaryHighlightOcclusion:a.binaryHighlightOcclusion,centerOffsetUnits:a.centerOffsetUnits,debugDrawBorder:a.debugDrawBorder,drawInSecondSlot:a.drawInSecondSlot}};d.prototype.setParameterValues=function(a){for(var b in a)"textureId"===b&&t.assert(!!this.params.textureId,"Can only change texture of material that already has a texture"),this.params[b]=a[b];this.notifyDirty("matChanged")};d.prototype.getParams=function(){return this.params};
- d.prototype.getOutputAmount=function(a){return 114*a};d.prototype.getInstanceBufferLayout=function(){};d.prototype.getVertexBufferLayout=function(){return A};d.prototype.fillInterleaved=function(a,b,c,d,e,f){var g=4*f,k=a.indices[t.VertexAttrConstants.POSITION],l=a.vertexAttr[t.VertexAttrConstants.POSITION].data,m=f+q.findAttribute(A,t.VertexAttrConstants.POSITION).offset/4;for(d=0;d<k.length;++d){var h=3*k[d];u.fill(l,h,e,m,b,3);m+=19;u.fill(l,h,e,m,b,3);m+=19;u.fill(l,h,e,m,b,3);m+=19;u.fill(l,
- h,e,m,b,3);m+=19;u.fill(l,h,e,m,b,3);m+=19;u.fill(l,h,e,m,b,3);m+=19}b=a.indices[t.VertexAttrConstants.NORMAL];l=a.vertexAttr[t.VertexAttrConstants.NORMAL].data;m=f+q.findAttribute(A,t.VertexAttrConstants.NORMAL).offset/4;for(d=0;d<b.length;++d)h=3*b[d],u.fill(l,h,e,m,c,3),m+=19,u.fill(l,h,e,m,c,3),m+=19,u.fill(l,h,e,m,c,3),m+=19,u.fill(l,h,e,m,c,3),m+=19,u.fill(l,h,e,m,c,3),m+=19,u.fill(l,h,e,m,c,3),m+=19;d=a.vertexAttr[t.VertexAttrConstants.UV0].data;null==d||3>=d.length?(c=h=0,b=this.params.texCoordScale[0],
- l=this.params.texCoordScale[1]):(h=a.vertexAttr[t.VertexAttrConstants.UV0].data[0],c=a.vertexAttr[t.VertexAttrConstants.UV0].data[1],b=a.vertexAttr[t.VertexAttrConstants.UV0].data[2],l=a.vertexAttr[t.VertexAttrConstants.UV0].data[3]);b=Math.min(1.99999,b+1);l=Math.min(1.99999,l+1);m=f+q.findAttribute(A,t.VertexAttrConstants.UV0).offset/4;for(d=0;d<k.length;++d)e[m]=h,e[m+1]=c,m+=19,e[m]=b,e[m+1]=c,m+=19,e[m]=b,e[m+1]=l,m+=19,e[m]=b,e[m+1]=l,m+=19,e[m]=h,e[m+1]=l,m+=19,e[m]=h,e[m+1]=c,m+=19;k=a.indices[t.VertexAttrConstants.COLOR];
- c=a.vertexAttr[t.VertexAttrConstants.COLOR].data;g+=q.findAttribute(A,t.VertexAttrConstants.COLOR).offset;b=new Uint8Array(e.buffer);for(d=0;d<k.length;++d)h=4*k[d],u.fillColor(c,h,b,g,4),g+=76,u.fillColor(c,h,b,g,4),g+=76,u.fillColor(c,h,b,g,4),g+=76,u.fillColor(c,h,b,g,4),g+=76,u.fillColor(c,h,b,g,4),g+=76,u.fillColor(c,h,b,g,4),g+=76;h=a.indices[t.VertexAttrConstants.SIZE];g=a.vertexAttr[t.VertexAttrConstants.SIZE].data;k=f+q.findAttribute(A,t.VertexAttrConstants.SIZE).offset/4;for(d=0;d<h.length;++d)c=
- g[2*h[d]],b=g[2*h[d]+1],e[k]=c,e[k+1]=b,k+=19,e[k]=c,e[k+1]=b,k+=19,e[k]=c,e[k+1]=b,k+=19,e[k]=c,e[k+1]=b,k+=19,e[k]=c,e[k+1]=b,k+=19,e[k]=c,e[k+1]=b,k+=19;if(null!=a.indices[t.VertexAttrConstants.AUXPOS1]&&null!=a.vertexAttr[t.VertexAttrConstants.AUXPOS1])for(g=a.indices[t.VertexAttrConstants.AUXPOS1],k=a.vertexAttr[t.VertexAttrConstants.AUXPOS1].data,c=f+q.findAttribute(A,"auxpos1").offset/4,d=0;d<g.length;++d)h=4*g[d],u.fill(k,h,e,c,null,4),c+=19,u.fill(k,h,e,c,null,4),c+=19,u.fill(k,h,e,c,null,
- 4),c+=19,u.fill(k,h,e,c,null,4),c+=19,u.fill(k,h,e,c,null,4),c+=19,u.fill(k,h,e,c,null,4),c+=19;if(null!=a.indices[t.VertexAttrConstants.AUXPOS2]&&null!=a.vertexAttr[t.VertexAttrConstants.AUXPOS2])for(g=a.indices[t.VertexAttrConstants.AUXPOS2],a=a.vertexAttr[t.VertexAttrConstants.AUXPOS2].data,f+=q.findAttribute(A,"auxpos2").offset/4,d=0;d<g.length;++d)h=4*g[d],u.fill(a,h,e,f,null,4),f+=19,u.fill(a,h,e,f,null,4),f+=19,u.fill(a,h,e,f,null,4),f+=19,u.fill(a,h,e,f,null,4),f+=19,u.fill(a,h,e,f,null,4),
- f+=19,u.fill(a,h,e,f,null,4),f+=19};d.prototype.intersect=function(a,b,d,e,f,g,k,l){if(e.isSelection&&e.enableHUDSelection&&!c.isAllHidden(b.componentVisibilities,a.data.componentOffsets)){var h=a.getData();a=this.params;f=b=1;z.toMat3(d,N);if(l){f=l(Y);b=f[0];f=f[5];l=N;g=l[0];var n=l[1],q=l[2],u=l[3],B=l[4],x=l[5],C=l[6],A=l[7],r=l[8],D=1/Math.sqrt(g*g+n*n+q*q),E=1/Math.sqrt(u*u+B*B+x*x),V=1/Math.sqrt(C*C+A*A+r*r);l[0]=g*D;l[1]=n*D;l[2]=q*D;l[3]=u*E;l[4]=B*E;l[5]=x*E;l[6]=C*V;l[7]=A*V;l[8]=r*V}l=
- h.getVertexAttr()[t.VertexAttrConstants.POSITION];g=h.getVertexAttr()[t.VertexAttrConstants.SIZE];h=h.getVertexAttr()[t.VertexAttrConstants.NORMAL];t.assert(3<=l.size);n=e.point;q=e.camera;u=v(a);for(B=0;B<l.data.length/l.size;B++)x=B*l.size,m.set3(l.data[x],l.data[x+1],l.data[x+2],G),z.multiplyVec3(d,G,G),x=B*g.size,Q[0]=g.data[x]*b,Q[1]=g.data[x+1]*f,z.multiplyVec3(q.viewMatrix,G),x=B*h.size,m.set3(h.data[x],h.data[x+1],h.data[x+2],M),this.applyVerticalOffsetTransformation(G,M,N,q,I),q.applyProjection(G,
- H),-1<H[0]&&(x=Math.floor(H[0]),A=Math.floor(H[1]),p.applyPrecomputedScaleFactorVec2(Q,I.factor,Q),x=x-X-(0<u[0]?Q[0]*u[0]:0),C=x+Q[0]+2*X,A=A-X-(0<u[1]?Q[1]*u[1]:0),r=A+Q[1]+2*X,a.textureIsSignedDistanceField&&(D=a.outlineSize/2,E=a.distanceFieldBoundingBox,x+=Q[0]*E[0],A+=Q[1]*E[1],C-=Q[0]*(1-E[2]),r-=Q[1]*(1-E[3]),x-=D,C+=D,A-=D,r+=D),n[0]>x&&n[0]<C&&n[1]>A&&n[1]<r&&(C=e.p0,A=e.p1,z.multiplyVec3(z.inverse(q.viewMatrix,S),G,O),H[0]=n[0],H[1]=n[1],q.unprojectPoint(H,G),x=m.negate(e.getDirection(),
- m.create()),C=m.dist(C,G)/m.dist(C,A),k(C,x,-1,1,!0,O)))}};d.prototype.normalAndViewAngle=function(a,b,c,d){void 0===d&&(d=R);B.multiplyVec3(b,a,d.normal);z.multiplyVec3(c.viewInverseTransposeMatrix,d.normal);d.cosAngle=m.dot(J,K);return d};d.prototype.updateScaleInfo=function(a,b,c){b=this.params;b.screenSizePerspective?a.factor=p.precomputeScaleFactor(R.cosAngle,c,b.screenSizePerspective,a.factor):(a.factor.scale=1,a.factor.factor=0,a.factor.minPixelSize=0,a.factor.paddingPixels=0);b.screenSizePerspectiveAlignment?
- (a.scaleAlignment=p.precomputeScale(R.cosAngle,c,b.screenSizePerspectiveAlignment),a.minPixelSizeAlignment=b.screenSizePerspectiveAlignment.parameters.minPixelSize):(a.scaleAlignment=a.factor.scale,a.minPixelSizeAlignment=a.factor.minPixelSize)};d.prototype.applyVerticalOffsetTransformation=function(a,b,c,d,e,f){var g=this.params;16===c.length&&(c=z.toMat3(c,N));if(!g.verticalOffset||!g.verticalOffset.screenLength)return e&&(g.screenSizePerspective||g.screenSizePerspectiveAlignment)?(d=this.normalAndViewAngle(b,
- c,d),g=m.length(a),this.updateScaleInfo(e,d.cosAngle,g)):e&&(e.factor.scale=1,e.scaleAlignment=1),f?m.set(a,f):a;b=this.normalAndViewAngle(b,c,d);c=m.length(a);d=u.verticalOffsetAtDistance(d,c,g.verticalOffset,b.cosAngle,g.screenSizePerspectiveAlignment||g.screenSizePerspective);e&&this.updateScaleInfo(e,b.cosAngle,c);return m.add(a,m.scale(b.normal,d),f)};d.prototype.getGLMaterials=function(){return{color:E,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:F}};d.prototype.getAllTextureIds=
- function(){return[this.params.textureId]};d.prototype.setTextureDirty=function(){this._textureDirty=!0};d.prototype.calculateRelativeScreenBounds=function(a,b,c){void 0===c&&(c=e.create());var d=this.params,f=c;void 0===f&&(f=P);x.set(d.anchorPos,f);f[0]*=-a[0];f[1]*=-a[1];f[0]+=d.screenOffset[0]*b;f[1]+=d.screenOffset[1]*b;c[2]=c[0]+a[0];c[3]=c[1]+a[1];return c};d.prototype.calculateAnchorPosForRendering=function(a){return v(this.params,a)};d.loadShaders=function(b,c,d){b._parse(a);var e=function(a){a.addDefine("OcclTest",
- "OCCL_TEST");a.addDefine("SDF","SIGNED_DISTANCE_FIELD");a.addDefine("vvSize","VV_SIZE");a.addDefine("vvColor","VV_COLOR");a.addDefine("verticalOffset","VERTICAL_OFFSET");a.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");a.addDefine("centerOffsetUnitsScreen","CENTER_OFFSET_UNITS_SCREEN")},f=new n("hud",["vertexShaderHUD","fragmentShaderHUD"],null,c,b,d);e(f);f.addDefine("debugDrawBorder","DEBUG_DRAW_BORDER");c.addShaderVariations("hud-material-shader-variations",f);f=new n("hudHighlight",
- ["vertexShaderHUD","fragmentShaderHUDHighlight"],null,c,b,d);e(f);f.addDefine("binaryHighlightOcclusion","BINARY_HIGHLIGHT_OCCLUSION");c.addShaderVariations("hud-material-highlight-shader-variations",f);b=new n("hudOcclusionTestPixel",["vertexShaderOcclusionTestPixel","fragmentShaderSimple"],null,c,b,d);b.addDefine("verticalOffset","VERTICAL_OFFSET");b.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");b.addDefine("centerOffsetUnitsScreen","CENTER_OFFSET_UNITS_SCREEN");c.addShaderVariations("hud-material-occlusion-test-pixel-shader-variations",
- b)};d.shouldRenderVisibilityDuringRenderPass=function(a){return a===k.MATERIAL||k.MATERIAL_HIGHLIGHT};return d}(b);d=function(a){function b(b,c,d){c=a.call(this,b,c,d,b.getParams().textureId)||this;c.params=u.copyParameters(b.getParams());c.selectProgram();c.selectSlot();return c}f(b,a);b.prototype.selectSlot=function(){this.mainSlot=this.params.drawInSecondSlot?l.HUDMATERIAL2:l.HUDMATERIAL1};b.prototype.beginSlot=function(a){return a===this.mainSlot};b.prototype.getProgram=function(){return this.program};
- b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.color=a.color;b.texCoordScale=a.texCoordScale;b.polygonOffset=a.polygonOffset;b.anchorPos=a.anchorPos;b.screenOffset=a.screenOffset;b.verticalOffset=a.verticalOffset;b.screenSizePerspective=a.screenSizePerspective;b.screenSizePerspectiveAlignment=a.screenSizePerspectiveAlignment;b.shaderPolygonOffset=a.shaderPolygonOffset;b.textureIsSignedDistanceField=a.textureIsSignedDistanceField;b.outlineColor=a.outlineColor;
- b.outlineSize=a.outlineSize;b.vvSizeEnabled=a.vvSizeEnabled;b.vvSizeMinSize=a.vvSizeMinSize;b.vvSizeMaxSize=a.vvSizeMaxSize;b.vvSizeOffset=a.vvSizeOffset;b.vvSizeFactor=a.vvSizeFactor;b.vvColorEnabled=a.vvColorEnabled;b.vvColorValues=a.vvColorValues;b.vvColorColors=a.vvColorColors;this.updateTexture(a.textureId);this.selectProgram();this.selectSlot()};b.prototype.bindRender=function(a,b){var c=this.params,d=this.getProgram();this.bindTexture(a,d);d.setUniform1i("hudVisibilityTexture",1);a.bindTexture(b.hudVisibilityTexture,
- 1);a.setActiveTexture(0);d.setUniform4fv("overrideColor",c.color);d.setUniform1f("pixelRatio",b.pixelRatio);c.textureIsSignedDistanceField&&(d.setUniform4fv("outlineColor",c.outlineColor),d.setUniform1f("outlineSize",c.outlineSize));c.vvSizeEnabled&&(d.setUniform3fv("vvSizeMinSize",c.vvSizeMinSize),d.setUniform3fv("vvSizeMaxSize",c.vvSizeMaxSize),d.setUniform3fv("vvSizeOffset",c.vvSizeOffset),d.setUniform3fv("vvSizeFactor",c.vvSizeFactor));c.vvColorEnabled&&(d.setUniform1fv("vvColorValues",c.vvColorValues),
- d.setUniform4fv("vvColorColors",c.vvColorColors));d.setUniform2fv("texScale",c.texCoordScale);d.setUniform2f("screenOffset",2*c.screenOffset[0],2*c.screenOffset[1]);d.setUniform2fv("anchorPos",v(c));c.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-4));a.setBlendingEnabled(!0);a.setBlendFunction(1,771)};b.prototype.bindProjection=function(a,b){this.material._textureDirty&&(this.renderTexture(a),this.material._textureDirty=!1);var c=b.cameraAboveGround?1:-1,d=this.getProgram(),
- e=this.params;a.bindProgram(d);d.setUniform1f("cameraGroundRelative",c);d.setUniform1f("polygonOffset",e.shaderPolygonOffset);d.setUniform4fv("viewport",b.viewport);u.bindVerticalOffset(e.verticalOffset,b,d);d.setUniformMatrix4fv("viewNormal",b.viewInvTransp);e.screenSizePerspective&&(u.bindScreenSizePerspective(e.screenSizePerspective,d,"screenSizePerspective"),u.bindScreenSizePerspective(e.screenSizePerspectiveAlignment||e.screenSizePerspective,d,"screenSizePerspectiveAlignment"))};b.prototype.releaseRender=
- function(a){a.setPolygonOffsetFillEnabled(!1);a.setBlendFunction(770,771);a.setBlendingEnabled(!1)};b.prototype.bindView=function(a,b){a=b.origin;var c=this.getProgram();u.bindView(a,b.view,c);u.bindCamPos(a,b.viewInvTransp,c)};b.prototype.bindInstance=function(a,b){a=this.getProgram();a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(d);var E=function(a){function b(b,c,
- d){b=a.call(this,b,c,d)||this;b.isOcclusionSlot=!1;return b}f(b,a);b.prototype.selectProgram=function(){var a=this.params;this.programOcclusionTestPixel=this.programRep.getShaderVariationsProgram("hud-material-occlusion-test-pixel-shader-variations",[!!a.verticalOffset,!!a.screenSizePerspective,"screen"===a.centerOffsetUnits]);this.program=this.programRep.getShaderVariationsProgram("hud-material-shader-variations",[a.occlusionTest,a.textureIsSignedDistanceField,!!a.vvSizeEnabled,!!a.vvColorEnabled,
- !!a.verticalOffset,!!a.screenSizePerspective,"screen"===a.centerOffsetUnits,!!a.debugDrawBorder])};b.prototype.getDrawMode=function(a){a=a.gl;return this.isOcclusionSlot?a.POINTS:a.TRIANGLES};b.prototype.release=function(a){a.setDepthFunction(a.gl.LESS);this.isOcclusionSlot||this.releaseRender(a)};b.prototype.bind=function(a,b){var c=a.gl;this.bindProjection(a,b);var d=this.getProgram();a.setDepthTestEnabled(!0);a.setDepthFunction(c.LEQUAL);this.isOcclusionSlot?d.setUniform4f("color",1,1,1,1):(this.bindRender(a,
- b),this.bindTexture(a,d))};b.prototype.getProgram=function(){return this.isOcclusionSlot?this.programOcclusionTestPixel:this.program};b.prototype.getPrograms=function(){return[this.programOcclusionTestPixel,this.program]};b.prototype.beginSlot=function(a){if(this.params.occlusionTest)return this.isOcclusionSlot=a===l.OCCLUSION_PIXELS,a===l.OCCLUSION_PIXELS||a===this.mainSlot;this.isOcclusionSlot=!1;return a===this.mainSlot};return b}(d),F=function(a){function b(){return null!==a&&a.apply(this,arguments)||
- this}f(b,a);b.prototype.selectProgram=function(){var a=this.params;this.program=this.programRep.getShaderVariationsProgram("hud-material-highlight-shader-variations",[a.occlusionTest,a.textureIsSignedDistanceField,!!a.vvSizeEnabled,!!a.vvColorEnabled,!!a.verticalOffset,!!a.screenSizePerspective,"screen"===a.centerOffsetUnits,a.binaryHighlightOcclusion])};b.prototype.bind=function(a,b){this.bindProjection(a,b);this.bindRender(a,b)};b.prototype.release=function(a){this.releaseRender(a)};return b}(d),
- I={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},scaleAlignment:0,minPixelSizeAlignment:0},P=[0,0],G=m.create(),M=m.create(),H=m.create(),J=m.create(),O=m.create(),N=B.create(),S=z.create(),R={normal:J,cosAngle:0},Y=z.create();z.identity(Y);var X=1,Q=[0,0],K=[0,0,1];return r})},"esri/views/3d/webgl-engine/lib/GLMaterialTexture":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","./GLMaterial","../materials/internal/MaterialUtil"],function(r,h,f,a,e){return function(a){function c(c,
- b,f,g,h){void 0===h&&(h=!1);c=a.call(this,c,b)||this;c.textureRep=f;c.textureId=g;c.initTransparent=h;c.glTextureRef=e.aquireIfNotUndefined(c.textureId,f,c.initTransparent);return c}f(c,a);c.prototype.dispose=function(){e.releaseIfNotUndefined(this.textureId,this.textureRep)};c.prototype.updateTexture=function(a){a!==this.textureId&&(e.releaseIfNotUndefined(this.textureId,this.textureRep),this.textureId=a,this.glTextureRef=e.aquireIfNotUndefined(this.textureId,this.textureRep,this.initTransparent))};
- c.prototype.renderTexture=function(a){(a=this.textureRep.getTexture(this.textureId))&&a.dirty&&a.redraw&&a.redraw()};c.prototype.bindTexture=function(a,b){null!=this.glTextureRef&&(b.setUniform1i("tex",0),a.bindTexture(this.glTextureRef.getGLTexture()))};c.prototype.bindTextureSize=function(a,b){null!=this.glTextureRef&&(a=this.glTextureRef.getGLTexture(),b.setUniform2f("texSize",a.descriptor.width,a.descriptor.height))};return c}(a)})},"esri/views/3d/webgl-engine/lib/GLMaterial":function(){define(["require",
- "exports"],function(r,h){return function(){function f(a,e){this.material=a;this.programRep=e}f.prototype.dispose=function(){};Object.defineProperty(f.prototype,"materialId",{get:function(){return this.material.id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"renderOccluded",{get:function(){return this.material.renderOccluded},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"renderPriority",{get:function(){return this.material.renderPriority},enumerable:!0,configurable:!0});
- f.prototype.isVisible=function(){return this.material.isVisible()};f.prototype.getPrograms=function(){return[this.getProgram()]};return f}()})},"esri/views/3d/webgl-engine/lib/Material":function(){define(["require","exports","./IdGen","./ModelContentType"],function(r,h,f,a){return function(){function e(a){this._parentStage=null;this._visible=!0;this._renderOccluded=!1;this._renderPriority=0;this.supportsEdges=!1;this.id=e._idGen.gen(a)}Object.defineProperty(e.prototype,"parentStage",{get:function(){return this._parentStage},
- enumerable:!0,configurable:!0});e.prototype.addParentStage=function(a){this._parentStage=a};e.prototype.removeParentStage=function(a){this._parentStage=null};Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(a){a!==this._visible&&(this._visible=a,this.notifyDirty("matChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"renderOccluded",{get:function(){return this._renderOccluded},set:function(a){a!==this._renderOccluded&&(this._renderOccluded=
- a,this.notifyDirty("matChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"renderPriority",{get:function(){return this._renderPriority},set:function(a){a!==this._renderPriority&&(this._renderPriority=a,this.notifyDirty("matChanged"))},enumerable:!0,configurable:!0});e.prototype.isVisible=function(){return this._visible};e.prototype.notifyDirty=function(c){this.parentStage&&this.parentStage.notifyDirty(a.MATERIAL,this,c)};e._idGen=new f;return e}()})},"esri/views/webgl/Profiling":function(){define(["require",
- "exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.startMeasurement=function(a){return(a=a.capabilities.disjointTimerQuery)?new f(a):null};h.getTimestamp=function(a,e,c){void 0===c&&(c=50);var f=a.capabilities.disjointTimerQuery;if(!f||0>=f.timestampBits())return null;var d=f.createQuery();f.createTimestamp(d);var b=function(){var a=f.resultAvailable(d),g=f.disjoint();a&&!g?(a=f.getResult(d),e(a/1E6)):g?e():setTimeout(b,c)};b()};h.supportsTimestamps=function(a){a=a.capabilities.disjointTimerQuery;
- if(!a)return!1;a=a.timestampBits();console.log({bits:a});return 0<a};var f=function(){function a(a){this.timer=a;this.query=a.createQuery();this.timer.beginTimeElapsed(this.query)}a.prototype.stop=function(a,c){void 0===c&&(c=50);this.cb=a;this.checkInterval=c;this.timer.endTimeElapsed();this.checkQueryResult()};a.prototype.checkQueryResult=function(){var a=this.timer.resultAvailable(this.query),c=this.timer.disjoint();a&&!c?(a=this.timer.getResult(this.query),this.cb(a/1E6)):c?this.cb():setTimeout(this.checkQueryResult.bind(this),
- this.checkInterval)};return a}()})},"esri/views/3d/webgl-engine/materials/internal/TexOnlyGLMaterial":function(){define("require exports dojo/text!./TexOnlyGLMaterial.xml ../../lib/DefaultVertexAttributeLocations ../../lib/gl-matrix ../../lib/RenderSlot ./MaterialUtil ../../../../webgl/Program".split(" "),function(r,h,f,a,e,c,g,d){var b=e.vec4d.createFrom(1,1,1,1);return function(){function e(a,b,c,d,e){this.program=a.get("texOnly");this.color=c;this.depthFunc=e;this.blend=d;this.texGLName=b}e.prototype.beginSlot=
- function(a){return a===c.INTERNAL_MATERIAL};e.prototype.getProgram=function(){return this.program};e.prototype.setColor=function(a){this.color=a};e.prototype.bind=function(a,c){a.bindProgram(this.program);this.program.setUniformMatrix4fv("model",g.IDENTITY);this.program.setUniformMatrix4fv("proj",c.proj);this.program.setUniform4fv("color",void 0!==this.color?this.color:b);this.program.setUniform1i("tex",0);a.bindTexture(this.texGLName,0);this.blend&&(a.setBlendingEnabled(!0),a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,
- a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA));a.setDepthTestEnabled(!0);void 0!==this.depthFunc&&a.setDepthFunction(this.depthFunc)};e.prototype.release=function(a){void 0!==this.depthFunc&&a.setDepthFunction(513);this.blend&&a.setBlendingEnabled(!1)};e.prototype.bindView=function(a,b){g.bindView(b.origin,b.view,this.program)};e.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};e.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};
- e.loadShaders=function(b,c,e){b._parse(f);b=new d(e,b.vertexShaderTexOnly,b.fragmentShaderTexOnly,a.Default3D);c.add("texOnly",b)};return e}()})},"esri/views/3d/webgl-engine/lib/tracer":function(){define(["require","exports","./webgl-debug","../../../webgl/capabilities/isWebGL2Context"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=null,c=[];h.enabled=!1;h.begin=function(){h.enabled&&(e=[])};h.trace=function(a){h.enabled&&null!=e&&e.push(a)};h.end=function(){if(h.enabled){var a=
- e;e=null;a&&(c.forEach(function(c){return c(a)}),c.length=0);return a}};h.instrumentContext=function(c){return h.enabled?a.default(c)?(console.warn("WebGL tracer is not supported on a WebGL2 Context"),c):f.makeDebugContext(c,void 0,function(a,b){h.enabled&&e&&e.push("gl."+a+"("+f.glFunctionArgsToString(a,b)+")")}):c};h.request=function(a){c.push(a)}})},"esri/views/3d/webgl-engine/lib/webgl-debug":function(){define([],function(){function r(a){if(null==b){b={};k={};for(var c in a)"number"==typeof a[c]&&
- (b[a[c]]=c,k[c]=a[c])}}function h(){if(null==b)throw"WebGLDebugUtils.init(ctx) not called";}function f(a){h();var c=b[a];return void 0!==c?"gl."+c:"/*UNKNOWN WebGL ENUM*/ 0x"+a.toString(16)+""}function a(a,b,c,e){a=d[a];if(void 0!==a&&(a=a[b],void 0!==a&&a[c])){if("object"===typeof a[c]&&void 0!==a[c].enumBitwiseOr){b=a[c].enumBitwiseOr;c=0;a=[];for(var g=0;g<b.length;++g){var l=k[b[g]];0!==(e&l)&&(c|=l,a.push(f(l)))}return c===e?a.join(" | "):f(e)}return f(e)}return null===e?"null":void 0===e?"undefined":
- e.toString()}function e(a,b,c){a.__defineGetter__(c,function(){return b[c]});a.__defineSetter__(c,function(a){b[c]=a})}function c(b,d,g,k){function l(a,b){return function(){g&&g(b,arguments);var c=a[b].apply(a,arguments),e=k.getError();0!=e&&(h[e]=!0,d(e,b,arguments));return c}}k=k||b;r(b);d=d||function(b,c,d){for(var e="",g=d.length,k=0;k<g;++k)e+=(0==k?"":", ")+a(c,g,k,d[k]);b="WebGL error "+f(b)+" in "+c+"("+e+")";window.console&&window.console.error?window.console.error(b):window.console&&window.console.log&&
- window.console.log(b)};var h={},n={},t;for(t in b)if("function"==typeof b[t])if("getExtension"!=t)n[t]=l(b,t);else{var m=l(b,t);n[t]=function(){var a=m.apply(b,arguments);return c(a,d,g,k)}}else e(n,b,t);n.getError=function(){for(var a in h)if(h.hasOwnProperty(a)&&h[a])return h[a]=!1,a;return b.NO_ERROR};return n}function g(a){var b=a.getParameter(a.MAX_VERTEX_ATTRIBS),c=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,c);for(var d=0;d<b;++d)a.disableVertexAttribArray(d),a.vertexAttribPointer(d,4,a.FLOAT,
- !1,0,0),a.vertexAttrib1f(d,0);a.deleteBuffer(c);b=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);for(d=0;d<b;++d)a.activeTexture(a.TEXTURE0+d),a.bindTexture(a.TEXTURE_CUBE_MAP,null),a.bindTexture(a.TEXTURE_2D,null);a.activeTexture(a.TEXTURE0);a.useProgram(null);a.bindBuffer(a.ARRAY_BUFFER,null);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null);a.bindFramebuffer(a.FRAMEBUFFER,null);a.bindRenderbuffer(a.RENDERBUFFER,null);a.disable(a.BLEND);a.disable(a.CULL_FACE);a.disable(a.DEPTH_TEST);a.disable(a.DITHER);a.disable(a.SCISSOR_TEST);
- a.blendColor(0,0,0,0);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.ONE,a.ZERO);a.clearColor(0,0,0,0);a.clearDepth(1);a.clearStencil(-1);a.colorMask(!0,!0,!0,!0);a.cullFace(a.BACK);a.depthFunc(a.LESS);a.depthMask(!0);a.depthRange(0,1);a.frontFace(a.CCW);a.hint(a.GENERATE_MIPMAP_HINT,a.DONT_CARE);a.lineWidth(1);a.pixelStorei(a.PACK_ALIGNMENT,4);a.pixelStorei(a.UNPACK_ALIGNMENT,4);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);a.UNPACK_COLORSPACE_CONVERSION_WEBGL&&
- a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);a.polygonOffset(0,0);a.sampleCoverage(1,!1);a.scissor(0,0,a.canvas.width,a.canvas.height);a.stencilFunc(a.ALWAYS,0,4294967295);a.stencilMask(4294967295);a.stencilOp(a.KEEP,a.KEEP,a.KEEP);a.viewport(0,0,a.canvas.width,a.canvas.height);for(a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT|a.STENCIL_BUFFER_BIT);a.getError(););}var d={enable:{1:{0:!0}},disable:{1:{0:!0}},getParameter:{1:{0:!0}},drawArrays:{3:{0:!0}},drawElements:{4:{0:!0,
- 2:!0}},createShader:{1:{0:!0}},getShaderParameter:{2:{1:!0}},getProgramParameter:{2:{1:!0}},getShaderPrecisionFormat:{2:{0:!0,1:!0}},getVertexAttrib:{2:{1:!0}},vertexAttribPointer:{6:{2:!0}},bindTexture:{2:{0:!0}},activeTexture:{1:{0:!0}},getTexParameter:{2:{0:!0,1:!0}},texParameterf:{3:{0:!0,1:!0}},texParameteri:{3:{0:!0,1:!0,2:!0}},texImage2D:{9:{0:!0,2:!0,6:!0,7:!0},6:{0:!0,2:!0,3:!0,4:!0}},texSubImage2D:{9:{0:!0,6:!0,7:!0},7:{0:!0,4:!0,5:!0}},copyTexImage2D:{8:{0:!0,2:!0}},copyTexSubImage2D:{8:{0:!0}},
- generateMipmap:{1:{0:!0}},compressedTexImage2D:{7:{0:!0,2:!0}},compressedTexSubImage2D:{8:{0:!0,6:!0}},bindBuffer:{2:{0:!0}},bufferData:{3:{0:!0,2:!0}},bufferSubData:{3:{0:!0}},getBufferParameter:{2:{0:!0,1:!0}},pixelStorei:{2:{0:!0,1:!0}},readPixels:{7:{4:!0,5:!0}},bindRenderbuffer:{2:{0:!0}},bindFramebuffer:{2:{0:!0}},checkFramebufferStatus:{1:{0:!0}},framebufferRenderbuffer:{4:{0:!0,1:!0,2:!0}},framebufferTexture2D:{5:{0:!0,1:!0,2:!0}},getFramebufferAttachmentParameter:{3:{0:!0,1:!0,2:!0}},getRenderbufferParameter:{2:{0:!0,
- 1:!0}},renderbufferStorage:{4:{0:!0,1:!0}},clear:{1:{0:{enumBitwiseOr:["COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","STENCIL_BUFFER_BIT"]}}},depthFunc:{1:{0:!0}},blendFunc:{2:{0:!0,1:!0}},blendFuncSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},blendEquation:{1:{0:!0}},blendEquationSeparate:{2:{0:!0,1:!0}},stencilFunc:{3:{0:!0}},stencilFuncSeparate:{4:{0:!0,1:!0}},stencilMaskSeparate:{2:{0:!0}},stencilOp:{3:{0:!0,1:!0,2:!0}},stencilOpSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},cullFace:{1:{0:!0}},frontFace:{1:{0:!0}},drawArraysInstancedANGLE:{4:{0:!0}},
- drawElementsInstancedANGLE:{5:{0:!0,2:!0}},blendEquationEXT:{1:{0:!0}}},b=null,k=null;return{init:r,mightBeEnum:function(a){h();return void 0!==b[a]},glEnumToString:f,glFunctionArgToString:a,glFunctionArgsToString:function(b,c){for(var d="",e=c.length,f=0;f<e;++f)d+=(0==f?"":", ")+a(b,e,f,c[f]);return d},makeDebugContext:c,makeLostContextSimulatingCanvas:function(a){function b(a){return"function"==typeof a?a:function(b){a.handleEvent(b)}}function c(){for(var a=Object.keys(G),b=0;b<a.length;++b)delete G[a]}
- function d(){++F;A||E==F&&a.loseContext()}function f(a,b){var c=a[b];return function(){d();if(!A)return c.apply(a,arguments)}}function k(a){return{statusMessage:a,preventDefault:function(){I=!0}}}function l(a){for(var b in a)"function"==typeof a[b]?m[b]=f(a,b):e(m,a,b);m.getError=function(){d();if(!A)for(var a;a=h.getError();)G[a]=!0;for(a in G)if(G[a])return delete G[a],a;return m.NO_ERROR};var c="createBuffer createFramebuffer createProgram createRenderbuffer createShader createTexture".split(" ");
- for(b=0;b<c.length;++b){var g=c[b];m[g]=function(b){return function(){d();if(A)return null;var c=b.apply(a,arguments);c.__webglDebugContextLostId__=C;r.push(c);return c}}(a[g])}c="getActiveAttrib getActiveUniform getBufferParameter getContextAttributes getAttachedShaders getFramebufferAttachmentParameter getParameter getProgramParameter getProgramInfoLog getRenderbufferParameter getShaderParameter getShaderInfoLog getShaderSource getTexParameter getUniform getUniformLocation getVertexAttrib".split(" ");
- for(b=0;b<c.length;++b)g=c[b],m[g]=function(b){return function(){d();return A?null:b.apply(a,arguments)}}(m[g]);c="isBuffer isEnabled isFramebuffer isProgram isRenderbuffer isShader isTexture".split(" ");for(b=0;b<c.length;++b)g=c[b],m[g]=function(b){return function(){d();return A?!1:b.apply(a,arguments)}}(m[g]);m.checkFramebufferStatus=function(b){return function(){d();return A?m.FRAMEBUFFER_UNSUPPORTED:b.apply(a,arguments)}}(m.checkFramebufferStatus);m.getAttribLocation=function(b){return function(){d();
- return A?-1:b.apply(a,arguments)}}(m.getAttribLocation);m.getVertexAttribOffset=function(b){return function(){d();return A?0:b.apply(a,arguments)}}(m.getVertexAttribOffset);m.isContextLost=function(){return A};return m}var h,m,B=[],z=[];m={};var C=1,A=!1,r=[],E=0,F=0,I=!1,P=0,G={};a.getContext=function(b){return function(){var c=b.apply(a,arguments);if(c instanceof WebGLRenderingContext){if(c!=h){if(h)throw"got different context";h=c;m=l(h)}return m}return c}}(a.getContext);(function(a){var c=a.addEventListener;
- a.addEventListener=function(d,e,f){switch(d){case "webglcontextlost":B.push(b(e));break;case "webglcontextrestored":z.push(b(e));break;default:c.apply(a,arguments)}}})(a);a.loseContext=function(){if(!A){A=!0;E=0;for(++C;h.getError(););c();G[h.CONTEXT_LOST_WEBGL]=!0;var b=k("context lost"),d=B.slice();setTimeout(function(){for(var c=0;c<d.length;++c)d[c](b);0<=P&&setTimeout(function(){a.restoreContext()},P)},0)}};a.restoreContext=function(){A&&z.length&&setTimeout(function(){if(!I)throw"can not restore. webglcontestlost listener did not call event.preventDefault";
- for(var a=0;a<r.length;++a){var b=r[a];b instanceof WebGLBuffer?h.deleteBuffer(b):b instanceof WebGLFramebuffer?h.deleteFramebuffer(b):b instanceof WebGLProgram?h.deleteProgram(b):b instanceof WebGLRenderbuffer?h.deleteRenderbuffer(b):b instanceof WebGLShader?h.deleteShader(b):b instanceof WebGLTexture&&h.deleteTexture(b)}g(h);A=!1;F=0;I=!1;for(var a=z.slice(),b=k("context restored"),c=0;c<a.length;++c)a[c](b)},0)};a.loseContextInNCalls=function(a){if(A)throw"You can not ask a lost contet to be lost";
- E=F+a};a.getNumCalls=function(){return F};a.setRestoreTimeout=function(a){P=a};return a},resetToInitialState:g}})},"esri/views/webgl/capabilities/isWebGL2Context":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.default=function(f){return window.WebGL2RenderingContext&&f instanceof WebGL2RenderingContext}})},"esri/views/3d/webgl-engine/materials/repository":function(){define("require exports dojo/text!./internal/hud.xml dojo/text!./internal/util.xml ../lib/edgeRendering/EdgeView ./CheckerBoardMaterial ./ColorMaterial ./DefaultMaterial ./HUDMaterial ./LineCalloutMaterial ./MeasurementArrowMaterial ./RibbonLineMaterial ./internal/BlendLayers ./internal/SimpleGLMaterial ./internal/TexOnlyGLMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){Object.defineProperty(h,"__esModule",{value:!0});h.initializeShaders=function(h,v,x){h._parse(a);h._parse(f);t.loadShaders(h,v,x);u.loadShaders(h,v,x);d.loadShaders(h,v,x);b.loadShaders(h,v,x);k.loadShaders(h,v,x);p.loadShaders(h,v,x);n.loadShaders(h,v,x);g.loadShaders(h,v,x);l.loadShaders(h,v,x);e.EdgeView.loadShaders(h,v,x);c.loadShaders(h,v,x)}})},"esri/views/3d/webgl-engine/materials/CheckerBoardMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./CheckerBoardMaterial.xml ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ./internal/MaterialUtil".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){var p=[{name:b.VertexAttrConstants.POSITION,count:3,type:5126,offset:0,stride:20,normalized:!1},{name:b.VertexAttrConstants.UV0,count:2,type:5126,offset:12,stride:20,normalized:!1}],n={size:[1,1],color1:[.75,.75,.75,1],color2:[.5,.5,.5,1],transparent:!1,polygonOffset:!1};r=function(b){function c(a,c){c=b.call(this,c)||this;c.canBeMerged=!1;c.params=k.copyParameters(a,n);return c}f(c,b);c.prototype.dispose=function(){};c.prototype.getParameterValues=function(){var a=
- this.params;return{size:a.size,color1:a.color1,color2:a.color2,transparent:a.transparent,polygonOffset:a.polygonOffset}};c.prototype.setParameterValues=function(a){k.updateParameters(this.params,a)&&this.notifyDirty("matChanged")};c.prototype.getParams=function(){return this.params};c.prototype.getOutputAmount=function(a){return 5*a};c.prototype.getInstanceBufferLayout=function(){};c.prototype.getVertexBufferLayout=function(){return p};c.prototype.fillInterleaved=function(a,b,c,d,e,f){l.fillInterleaved(a,
- b,c,d,p,e,f)};c.prototype.intersect=function(a,b,c,d,e,f,g,k){return l.intersectTriangleGeometry(a,b,c,d,e,f,g)};c.prototype.getGLMaterials=function(){return{color:t,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:void 0}};c.prototype.getAllTextureIds=function(){return[]};c.loadShaders=function(b,c,e){b._parse(a);b=new d("checker-board",["vsCheckerBoard","fsCheckerBoard"],null,c,b,e);c.addShaderVariations("checker-board-material-shader-variations",b)};return c}(c);var t=function(a){function b(b,
- c,d){d=a.call(this,b,c)||this;d.programRep=c;d.params=k.copyParameters(b.getParams());d.selectProgram();return d}f(b,a);b.prototype.selectProgram=function(){this.program=this.programRep.getShaderVariationsProgram("checker-board-material-shader-variations",[])};b.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};b.prototype.beginSlot=function(a){return a===(this.params.transparent?g.TRANSPARENT_MATERIAL:g.OPAQUE_MATERIAL)};b.prototype.getProgram=
- function(){return this.program};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};b.prototype.bind=function(a,b){b=this.program;a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!1);a.setFaceCullingEnabled(!1);this.params.transparent&&(a.setBlendingEnabled(!0),a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA));this.params.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-25));a.bindProgram(b);b.setUniform2fv("size",
- this.params.size);b.setUniform4fv("color1",this.params.color1);b.setUniform4fv("color2",this.params.color2)};b.prototype.bindView=function(a,b){a=b.origin;var c=this.getProgram();k.bindView(a,b.view,c)};b.prototype.bindInstance=function(a,b){this.getProgram().setUniformMatrix4fv("model",b.transformation)};b.prototype.release=function(a){a.setDepthWriteEnabled(!0);this.params.transparent&&a.setBlendingEnabled(!1);this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1)};return b}(e);return r})},
- "esri/views/3d/webgl-engine/materials/ColorMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./ColorMaterial.xml ../lib/DefaultVertexBufferLayouts ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Util".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p){var n=e.Pos3Col,t=p.getStride(n)/4,u={color:[1,1,1,1],transparent:!1,vertexColors:!1,polygonOffset:!1};r=function(c){function d(a,
- b){b=c.call(this,b)||this;b.supportsEdges=!0;b.params=l.copyParameters(a,u);return b}f(d,c);d.prototype.getParams=function(){return this.params};d.prototype.getParameterValues=function(){return l.copyParameters(this.params)};d.prototype.setColor=function(a){this.params.color=a;this.notifyDirty("matChanged")};d.prototype.getColor=function(){return this.params.color};d.prototype.setTransparent=function(a){this.params.transparent=a;this.notifyDirty("matChanged")};d.prototype.getTransparent=function(){return this.params.transparent};
- d.prototype.getOutputAmount=function(a){return a*t*1};d.prototype.getVertexBufferLayout=function(){return n};d.prototype.getInstanceBufferLayout=function(){};d.prototype.fillInterleaved=function(a,b,c,d,e,f,g){l.fillInterleaved(a,b,c,d,n,e,f,g)};d.prototype.intersect=function(a,b,c,d,e,f,g,k){l.intersectTriangleGeometry(a,b,c,d,e,f,g)};d.prototype.getGLMaterials=function(){return{color:q,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:v}};d.prototype.getAllTextureIds=function(){return[]};
- d.loadShaders=function(c,d,e){c._parse(a);c=new b("colorMaterial",["vertexShaderColorMaterial","fragmentShaderColorMaterial"],null,d,c,e);c.addDefine("Color","VERTEXCOLORS");d.addShaderVariations("colorMaterial",c)};return d}(g);var q=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.updateParameters();return b}f(b,a);b.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};b.prototype.selectProgram=function(){this.program=this.programRep.getShaderVariationsProgram("colorMaterial",
- [this.params.vertexColors])};b.prototype.beginSlot=function(a){return a===(1>this.params.color[3]?d.TRANSPARENT_MATERIAL:d.OPAQUE_MATERIAL)};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){b=this.program;var c=this.params;a.bindProgram(b);b.setUniform4fv("eColor",c.color);a.setFaceCullingEnabled(!1);c.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(1,1));c.transparent&&(a.setBlendingEnabled(!0),a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,
- a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA));a.setDepthTestEnabled(!0)};b.prototype.release=function(a){var b=this.params;a.setPolygonOffsetFillEnabled(!1);b.transparent&&a.setBlendingEnabled(!1)};b.prototype.bindView=function(a,b){l.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(c),v=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.updateParameters();
- return b}f(b,a);b.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};b.prototype.selectProgram=function(){this.program=this.programRep.getShaderVariationsProgram("colorMaterial",[this.params.vertexColors])};b.prototype.beginSlot=function(a){return a===d.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){b=this.program;var c=this.params;a.bindProgram(b);b.setUniform4fv("eColor",c.color);a.setFaceCullingEnabled(!1);
- c.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(1,1))};b.prototype.release=function(a){a.setPolygonOffsetFillEnabled(!1)};b.prototype.bindView=function(a,b){l.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(c);return r})},"esri/views/3d/webgl-engine/materials/DefaultMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./DefaultMaterial.xml ../../layers/graphics/graphicUtils ../../support/buffer/glUtil ../../support/buffer/InterleavedLayout ../lib/DefaultVertexAttributeLocations ../lib/gl-matrix ../lib/GLMaterialTexture ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Program ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){function x(a,b){var c=a.gl;(b.cullFace?"none"===b.cullFace:b.transparent)?a.setFaceCullingEnabled(!1):(a.setFaceCullingEnabled(!0),"front"===b.cullFace&&a.setCullFace(c.FRONT))}function m(a,b){var c=a.gl;(b.cullFace?"none"===b.cullFace:b.transparent)?a.setFaceCullingEnabled(!0):(a.setFaceCullingEnabled(!1),"front"===b.cullFace&&a.setCullFace(c.BACK))}function B(a,b){return a?p.TRANSPARENT_MATERIAL:b?p.STENCIL_MATERIAL:p.OPAQUE_MATERIAL}function z(a,b){var c=
- b.vvSizeEnabled;b.vvSizeEnabled?(a.setUniform3fv("vvSizeMinSize",b.vvSizeMinSize),a.setUniform3fv("vvSizeMaxSize",b.vvSizeMaxSize),a.setUniform3fv("vvSizeOffset",b.vvSizeOffset),a.setUniform3fv("vvSizeFactor",b.vvSizeFactor)):c&&a.setUniform3fv("vvSizeValue",b.vvSizeValue);c&&(a.setUniform3fv("vvSymbolAnchor",b.vvSymbolAnchor),e.computeObjectRotation(b.vvSymbolRotation[2],b.vvSymbolRotation[0],b.vvSymbolRotation[1],F.identity(L)),a.setUniformMatrix3fv("vvSymbolRotation",F.toMat3(L,K)));b.vvColorEnabled&&
- (a.setUniform1fv("vvColorValues",b.vvColorValues),a.setUniform4fv("vvColorColors",b.vvColorColors))}function C(a,b){a.vvSizeEnabled=b.vvSizeEnabled;a.vvSizeMinSize=b.vvSizeMinSize;a.vvSizeMaxSize=b.vvSizeMaxSize;a.vvSizeOffset=b.vvSizeOffset;a.vvSizeFactor=b.vvSizeFactor;a.vvSizeValue=b.vvSizeValue;a.vvSymbolAnchor=b.vvSymbolAnchor;a.vvSymbolRotation=b.vvSymbolRotation}var A=b.vec3d,D=b.vec4d,E=b.mat3d,F=b.mat4d,I=t.assert;r=function(b){function e(a,c){c=b.call(this,c)||this;c.supportsEdges=!0;c.params=
- u.copyParameters(a,O);c.instanced=!!a.instanced;c.vertexBufferLayout=e.getVertexBufferLayout(c.params);c.instanceBufferLayout=c.instanced?e.getInstanceBufferLayout(c.params):null;return c}f(e,b);e.prototype.isVisible=function(){var a=this.params;if(!b.prototype.isVisible.call(this)||0===a.layerOpacity)return!1;var c=N&&a.instanced,d=a.vertexColors,e=a.symbolColors,c=!!c&&-1<c.indexOf("color"),f=a.vvColorEnabled,g="replace"===a.colorMixMode,k=0<a.opacity,a=a.externalColor&&0<a.externalColor[3];return d&&
- (c||f||e)?g?!0:k:d?g?a:k:c||f||e?g?!0:k:g?a:k};e.prototype.getParams=function(){return this.params};e.prototype.getParameterValues=function(){var a=this.params;return{textureId:a.textureId,ambient:a.ambient,diffuse:a.diffuse,specular:a.specular,externalColor:a.externalColor,colorMixMode:a.colorMixMode,opacity:a.opacity,layerOpacity:a.layerOpacity,transparent:a.transparent,polygonOffset:a.polygonOffset,atlasRegions:a.atlasRegions,flipV:a.flipV,doubleSided:a.doubleSided,doubleSidedType:a.doubleSidedType,
- cullFace:a.cullFace,writeStencil:a.writeStencil,receiveSSAO:a.receiveSSAO,castShadows:a.castShadows,verticalOffset:a.verticalOffset,screenSizePerspective:a.screenSizePerspective,vvSizeEnabled:a.vvSizeEnabled,vvSizeMinSize:a.vvSizeMinSize,vvSizeMaxSize:a.vvSizeMaxSize,vvSizeOffset:a.vvSizeOffset,vvSizeFactor:a.vvSizeFactor,vvSizeValue:a.vvSizeValue,vvColorEnabled:a.vvColorEnabled,vvColorValues:a.vvColorValues,vvColorColors:a.vvColorColors,compressedNormals:a.compressedNormals,groundNormalShading:a.groundNormalShading,
- vvSymbolAnchor:a.vvSymbolAnchor,vvSymbolRotation:a.vvSymbolRotation}};e.prototype.setParameterValues=function(a){var b=this.params,c;for(c in a)"textureId"===c&&I(b.textureId,"Can only change texture of material that already has a texture"),"castShadows"===c&&I(a.castShadows===b.castShadows,"Can not change shadow casting behavior."),b[c]=a[c];this.notifyDirty("matChanged")};e.prototype.getOutputAmount=function(a){var b=v.getStride(this.vertexBufferLayout)/4;return a*b};e.prototype.getVertexBufferLayout=
- function(){return this.vertexBufferLayout};e.prototype.getInstanceBufferLayout=function(){return this.instanceBufferLayout};e.prototype.fillInterleaved=function(a,b,c,d,e,f,g){u.fillInterleaved(a,b,c,d,this.vertexBufferLayout,e,f,g)};e.prototype.intersect=function(a,b,c,d,e,f,g,k){if(null!==this.params.verticalOffset){k=d.camera;A.set3(c[12],c[13],c[14],ka);var l=A.subtract(ka,k.eye,Z),m=A.length(l),h=A.scale(l,1/m),n=null,l=null;switch(d.viewingMode){case "global":l=A.normalize(ka,ga);break;case "local":l=
- A.set(ca,ga)}this.params.screenSizePerspective&&(n=A.dot(l,h));k=u.verticalOffsetAtDistance(k,m,this.params.verticalOffset,n,this.params.screenSizePerspective);A.scale(l,k);E.multiplyVec3(d.transformInverseRotation,l,da);e=A.subtract(e,da,V);f=A.subtract(f,da,U)}u.intersectTriangleGeometry(a,b,c,d,e,f,g)};e.prototype.getGLMaterials=function(){return{color:P,depthShadowMap:this.params.castShadows?M:null,normal:H,depth:G,highlight:J}};e.prototype.getAllTextureIds=function(){var a=this.params,b=[];a.textureId&&
- b.push(a.textureId);return b};e.loadShaders=function(b,c,e){b._parse(a);N=null!==e.capabilities.instancing;var f=new n("phong",["vsPhong","fsPhong"],null,c,b,e);f.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);f.addDefine("Color","VERTEXCOLORS");f.addDefine("symbolColor","SYMBOLVERTEXCOLORS");f.addDefine("FlipV","FLIPV");f.addDefine("DoubleSided","DOUBLESIDED");f.addDefine("WindingOrderDoubleSided","WINDINGORDERDOUBLESIDED");
- f.addDefine("Instanced","INSTANCED");f.addDefine("InstColor","INSTANCEDCOLOR");f.addDefine("ReceiveShadows","RECEIVE_SHADOWS");f.addDefine("ReceiveSSAO","RECEIVE_SSAO");f.addDefine("vvSize","VV_SIZE");f.addDefine("vvColor","VV_COLOR");f.addDefine("VerticalOffset","VERTICAL_OFFSET");f.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");f.addDefine("groundNormalShading","GROUND_NORMAL_SHADING");f.addDefine("compressedNormals","COMPRESSED_NORMALS");f.addDefine("componentColor","COMPONENTCOLORS");
- c.addShaderVariations(S,f);f=new n("depth",["vsDepth","fsDepth"],null,c,b,e);f.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);f.addDefine("FlipV","FLIPV");f.addDefine("Instanced","INSTANCED");f.addDefine("ShadowMap","BIAS_SHADOWMAP");f.addDefine("vvSize","VV_SIZE");f.addDefine("VerticalOffset","VERTICAL_OFFSET");f.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");c.addShaderVariations(R,f);f=new n("normal",
- ["vsNormal","fsNormal"],null,c,b,e);f.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);f.addDefine("FlipV","FLIPV");f.addDefine("Instanced","INSTANCED");f.addDefine("vvSize","VV_SIZE");f.addDefine("VerticalOffset","VERTICAL_OFFSET");f.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");f.addDefine("compressedNormals","COMPRESSED_NORMALS");c.addShaderVariations(Y,f);f=new n("highlight",["vsHighlight","fsHighlight"],
- null,c,b,e);f.addNaryShaderSnippetSuffix([{value:"none",programNameSuffix:"",shaderSnippetSuffix:""},{value:"Textured"},{value:"AtlasTextured"}]);f.addDefine("FlipV","FLIPV");f.addDefine("Instanced","INSTANCED");f.addDefine("vvSize","VV_SIZE");f.addDefine("VerticalOffset","VERTICAL_OFFSET");f.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");c.addShaderVariations(X,f);var f=new q(e,b.vsDepth,b.fsDepth,d.Default3D,["BIAS_SHADOWMAP 1"]),g=new q(e,b.vsDepthTextured,b.fsDepthTextured,d.Default3D,
- ["BIAS_SHADOWMAP 1"]),k=new q(e,b.vsDepth,b.fsDepth,d.Default3D),l=new q(e,b.vsDepthTextured,b.fsDepthTextured,d.Default3D),m=new q(e,b.vsNormal,b.fsNormal,d.Default3D),h=new q(e,b.vsNormalTextured,b.fsNormalTextured,d.Default3D),t=new q(e,b.vsHighlight,b.fsHighlight,d.Default3D);b=new q(e,b.vsHighlightTextured,b.fsHighlightTextured,d.Default3D);c.add("depthShadowMap",f);c.add("depthTexturedShadowMap",g);c.add("depth",k);c.add("depthTextured",l);c.add("normal",m);c.add("normalTextured",h);c.add("highlight",
- t);c.add("highlightTextured",b)};e.getVertexBufferLayout=function(a){var b=g.newLayout().vec3f("position");a.groundNormalShading||(b=a.compressedNormals?b.vec2i16("normalCompressed",{glNormalized:!0}):b.vec3f("normal"));a.textureId&&(b=b.vec2f("uv0"),a.atlasRegions&&(b=b.vec4u16("region")));a.vertexColors&&(b=b.vec4u8("color"));a.symbolColors&&(b=b.vec4u8("symbolColor"));a.componentIndices&&(b=b.u16("componentIndex").u16("_padding",{glPadding:!0}));return c.glLayout(b)};e.getInstanceBufferLayout=
- function(a){var b=g.newLayout().mat4f("model").mat4f("modelNormal");a.instanced&&-1<a.instanced.indexOf("color")&&(b=b.vec4f("instanceColor"));a.instanced&&-1<a.instanced.indexOf("featureAttribute")&&(b=b.vec4f("instanceFeatureAttribute"));return c.glLayout(b,1)};return e}(l);var P=function(a){function b(b,c,d){c=a.call(this,b,c,d,b.getParams().textureId)||this;c.programs=[[null,null],[null,null]];c.params=u.copyParameters(b.getParams());c.slot=B(c.params.transparent,c.params.writeStencil);b=c.params;
- c.texturing=b.textureId?b.atlasRegions?"AtlasTextured":"Textured":"none";d=N&&b.instanced;c.instanced=!!d;c.instancedColor=!!d&&-1<d.indexOf("color");c.pseudoInstancedColor=!N&&b.instanced&&-1<b.instanced.indexOf("color");c._loadPrograms();return c}f(b,a);b.prototype._loadPrograms=function(){this.programs[0][0]=this._loadProgram(!1,!1);this.programs[1][0]=this._loadProgram(!0,!1);this.params.receiveSSAO?(this.programs[0][1]=this._loadProgram(!1,!0),this.programs[1][1]=this._loadProgram(!0,!0),this.allPrograms=
- this.programs[0].concat(this.programs[1])):(this.programs[0][1]=this.programs[0][0],this.programs[1][1]=this.programs[1][0],this.allPrograms=[this.programs[0][0],this.programs[1][0]])};b.prototype._loadProgram=function(a,b){var c=this.params;return this.programRep.getShaderVariationsProgram(S,[this.texturing,c.vertexColors,c.symbolColors,c.flipV,c.doubleSided&&"normal"===c.doubleSidedType,c.doubleSided&&"winding-order"===c.doubleSidedType,!!this.instanced,this.instancedColor,a,b,c.vvSizeEnabled,c.vvColorEnabled,
- null!==c.verticalOffset,null!==c.screenSizePerspective,c.groundNormalShading,c.compressedNormals,null!=c.componentColorBuffer])};b.prototype.beginSlot=function(a){return a===this.slot};b.prototype.getProgram=function(){return this.program||this.programs[0][0]};b.prototype.getPrograms=function(){return this.allPrograms};b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.ambient=a.ambient;b.diffuse=a.diffuse;b.specular=a.specular;b.externalColor=a.externalColor;
- b.colorMixMode=a.colorMixMode;b.opacity=a.opacity;b.layerOpacity=a.layerOpacity;b.polygonOffset=a.polygonOffset;b.flipV=a.flipV;b.doubleSided=a.doubleSided;b.doubleSidedType=a.doubleSidedType;b.cullFace=a.cullFace;b.receiveSSAO=a.receiveSSAO;b.castShadows=a.castShadows;b.verticalOffset=a.verticalOffset;b.screenSizePerspective=a.screenSizePerspective;C(b,a);b.vvColorEnabled=a.vvColorEnabled;b.vvColorValues=a.vvColorValues;b.vvColorColors=a.vvColorColors;b.transparent!==a.transparent&&(this.slot=B(a.transparent,
- a.writeStencil),b.transparent=a.transparent);b.compressedNormals=a.compressedNormals;b.groundNormalShading=a.groundNormalShading;this.updateTexture(a.textureId);a.atlasRegions&&(b.atlasRegions=a.atlasRegions);b.blendModeOneOne=a.blendModeOneOne;b.inverseWindingOrder=a.inverseWindingOrder;this._loadPrograms()};b.prototype.bind=function(a,b){var c=a.gl,d=this.params,e=this.program=this.programs[b.shadowMappingEnabled?1:0][b.ssaoEnabled?1:0];a.bindProgram(e);e.setUniform3fv("ambient",d.ambient);e.setUniform3fv("diffuse",
- d.diffuse);e.setUniform3fv("specular",d.specular);e.setUniform4fv("externalColor",d.externalColor);e.setUniform1i("colorMixMode",u.colorMixModes[d.colorMixMode]);e.setUniform1f("opacity",d.opacity);e.setUniform1f("layerOpacity",d.layerOpacity);u.bindVerticalOffset(d.verticalOffset,b,e);u.bindScreenSizePerspective(d.screenSizePerspective,e);z(e,d);this.bindTexture(a,e);"AtlasTextured"===this.texturing&&this.bindTextureSize(a,e);a.setBlendFunctionSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);
- d.inverseWindingOrder&&a.setFrontFace(c.CW);d.transparent?(a.setBlendingEnabled(!0),d.blendModeOneOne?(a.setBlendFunction(c.ONE,c.ONE),a.setDepthWriteEnabled(!1)):a.setBlendFunctionSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA)):a.setBlendingEnabled(!1);d.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(2,2));x(a,d);a.setDepthTestEnabled(!0);d.componentIndices&&d.componentColorBuffer&&(d.componentColorBuffer.updateTexture(),d.componentColorBuffer.bind(e,
- {tex:"uComponentColorTex",invDim:"uComponentColorTexInvDim",unit:1}))};b.prototype.release=function(a,b){b=a.gl;a.setPolygonOffsetFillEnabled(!1);m(a,this.params);a.setBlendingEnabled(!1);a.setBlendFunctionSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA);a.setDepthWriteEnabled(!0);a.setFrontFace(b.CCW)};b.prototype.bindView=function(a,b){a=this.program=this.programs[b.shadowMappingEnabled?1:0][b.ssaoEnabled?1:0];var c=b.origin;u.bindView(c,b.view,a);u.bindCamPos(c,b.viewInvTransp,
- a);b.shadowMappingEnabled&&b.shadowMap.bindView(a,c)};b.prototype.bindInstance=function(a,b){a=this.program;a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal);b.instanceParameters&&this.pseudoInstancedColor&&(b=b.instanceParameters.color)&&(D.multiply(b,this.params.externalColor,Q),a.setUniform4fv("externalColor",Q))};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(k),G=function(a){function b(b,c,d,e){void 0===e&&(e=!1);
- d=a.call(this,b,c,d,b.getParams().textureId)||this;d.params=u.copyParameters(b.getParams());d.instanced=N&&!!d.params.instanced;d.texturing=v.hasAttribute(b.getVertexBufferLayout(),"uv0")?"Textured":"none";d.program=c.getShaderVariationsProgram(R,[d.texturing,d.params.flipV,d.instanced,e,d.params.vvSizeEnabled,null!==d.params.verticalOffset,null!==d.params.screenSizePerspective]);d.slot=B(d.params.transparent,d.params.writeStencil);return d}f(b,a);b.prototype.beginSlot=function(a){return a===this.slot};
- b.prototype.getProgram=function(){return this.program};b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.cullFace=a.cullFace;b.inverseWindingOrder=a.inverseWindingOrder;b.flipV=a.flipV;C(b,a);this.updateTexture(a.textureId)};b.prototype.bind=function(a,b){var c=a.gl,d=this.program,e=this.params;a.bindProgram(d);d.setUniform2fv("nearFar",b.nearFar);e.inverseWindingOrder&&a.setFrontFace(c.CW);u.bindVerticalOffset(e.verticalOffset,b,d);u.bindScreenSizePerspective(e.screenSizePerspective,
- d);z(d,e);this.bindTexture(a,d);x(a,e);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){var b=a.gl,c=this.params;m(a,c);c.inverseWindingOrder&&a.setFrontFace(b.CCW)};b.prototype.bindView=function(a,b){a=this.program;var c=this.params;u.bindView(b.origin,b.view,a);c.screenSizePerspective&&u.bindCamPos(b.origin,b.viewInvTransp,a)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(k),
- M=function(a){function b(b,c,d){return a.call(this,b,c,d,!0)||this}f(b,a);return b}(G),H=function(a){function b(b,c,d,e){void 0===e&&(e=!1);d=a.call(this,b,c,d,b.getParams().textureId)||this;d.params=u.copyParameters(b.getParams());d.instanced=N&&!!d.params.instanced;d.texturing=v.hasAttribute(b.getVertexBufferLayout(),"uv0")?"Textured":"none";d.program=c.getShaderVariationsProgram(Y,[d.texturing,d.params.flipV,d.instanced,d.params.vvSizeEnabled,null!==d.params.verticalOffset,null!==d.params.screenSizePerspective,
- d.params.compressedNormals]);d.slot=B(d.params.transparent,d.params.writeStencil);return d}f(b,a);b.prototype.beginSlot=function(a){return a===this.slot};b.prototype.getProgram=function(){return this.program};b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.cullFace=a.cullFace;b.inverseWindingOrder=a.inverseWindingOrder;b.flipV=a.flipV;C(b,a);this.updateTexture(a.textureId)};b.prototype.bind=function(a,b){var c=a.gl,d=this.program,e=this.params;a.bindProgram(d);
- this.bindTexture(a,d);d.setUniformMatrix4fv("viewNormal",b.viewInvTransp);u.bindVerticalOffset(e.verticalOffset,b,d);u.bindScreenSizePerspective(e.screenSizePerspective,d);z(d,e);x(a,e);e.inverseWindingOrder&&a.setFrontFace(c.CW);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){var b=a.gl,c=this.params;m(a,c);c.inverseWindingOrder&&a.setFrontFace(b.CCW)};b.prototype.bindView=function(a,b){a=this.program;var c=this.params;u.bindView(b.origin,b.view,a);c.screenSizePerspective&&u.bindCamPos(b.origin,
- b.viewInvTransp,a)};b.prototype.bindInstance=function(a,b){a=this.program;a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(k),J=function(a){function b(b,c,d,e){void 0===e&&(e=!1);d=a.call(this,b,c,d,b.getParams().textureId)||this;d.params=u.copyParameters(b.getParams());d.instanced=N&&!!d.params.instanced;d.texturing=v.hasAttribute(b.getVertexBufferLayout(),"uv0")?"Textured":
- "none";d.program=c.getShaderVariationsProgram(X,[d.texturing,d.params.flipV,d.instanced,d.params.vvSizeEnabled,null!==d.params.verticalOffset,null!==d.params.screenSizePerspective]);d.slot=B(d.params.transparent,d.params.writeStencil);return d}f(b,a);b.prototype.beginSlot=function(a){return a===this.slot};b.prototype.getProgram=function(){return this.program};b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.cullFace=a.cullFace;b.inverseWindingOrder=a.inverseWindingOrder;
- b.flipV=a.flipV;C(b,a);this.updateTexture(a.textureId)};b.prototype.bind=function(a,b){var c=a.gl,d=this.program,e=this.params;a.bindProgram(d);this.bindTexture(a,d);u.bindVerticalOffset(e.verticalOffset,b,d);u.bindScreenSizePerspective(e.screenSizePerspective,d);z(d,e);x(a,e);e.inverseWindingOrder&&a.setFrontFace(c.CW);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){var b=a.gl,c=this.params;m(a,c);c.inverseWindingOrder&&a.setFrontFace(b.CW)};b.prototype.bindView=function(a,b){a=this.program;
- var c=this.params;u.bindView(b.origin,b.view,a);c.screenSizePerspective&&u.bindCamPos(b.origin,b.viewInvTransp,a)};b.prototype.bindInstance=function(a,b){a=this.program;a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};return b}(k),O={textureId:void 0,ambient:[.2,.2,.2],diffuse:[.8,.8,.8],specular:[0,0,0],externalColor:[1,1,1,1],colorMixMode:"multiply",opacity:1,layerOpacity:1,blendModeOneOne:!1,
- inverseWindingOrder:!1,vertexColors:!1,symbolColors:!1,componentIndices:!1,componentColorBuffer:null,flipV:!1,doubleSided:!1,doubleSidedType:"normal",cullFace:void 0,instanced:void 0,compressedNormals:!1,groundNormalShading:!1,writeStencil:!1,receiveSSAO:!0,castShadows:!0,verticalOffset:null,screenSizePerspective:null,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvSizeValue:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,
- 0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],vvSymbolAnchor:[0,0,0],vvSymbolRotation:[0,0,0],transparent:!1,polygonOffset:!1,atlasRegions:!1},N,S="material",R="material-depth",Y="material-normal",X="material-highlight",Q=D.create(),K=E.create(),L=F.create(),V=A.create(),U=A.create(),ca=A.createFrom(0,0,1),ga=A.create(),da=A.create(),ka=A.create(),Z=A.create();return r})},"esri/views/3d/webgl-engine/materials/LineCalloutMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./LineCalloutMaterial.xml ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){function p(a,b,c){3===c.length?a.setUniform4f(b,c[0],c[1],c[2],1):a.setUniform4fv(b,c)}var n=b.VertexAttrConstants,t=[{name:"position",count:3,type:5126,offset:0,stride:48,normalized:!1},{name:"normal",count:3,type:5126,offset:12,stride:48,normalized:!1},{name:"uv0",count:2,type:5126,offset:24,stride:48,normalized:!1},{name:"auxpos1",count:4,type:5126,offset:32,stride:48,normalized:!1}],u={verticalOffset:null,screenSizePerspective:null,screenOffset:[0,0],color:[0,0,
- 0,1],size:1,borderColor:null,occlusionTest:!1,shaderPolygonOffset:1E-5,depthHUDAlignStart:!1,centerOffsetUnits:"world"};r=function(b){function c(a,d){d=b.call(this,d)||this;d.params=k.copyParameters(a,u);d._uniqueMaterialIdentifier=c.uniqueMaterialIdentifier(d.params);return d}f(c,b);Object.defineProperty(c.prototype,"uniqueMaterialIdentifier",{get:function(){return this._uniqueMaterialIdentifier},enumerable:!0,configurable:!0});c.prototype.dispose=function(){};c.prototype.getGLMaterials=function(){return{color:q,
- depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:void 0}};c.prototype.getAllTextureIds=function(){return[]};c.prototype.fillAttributeData=function(a,b,c,d,e,f){var g=a.indices[b];a=a.vertexAttr[b].data;if(g&&a)for(b=c+l.findAttribute(t,b).offset/4,c=0;c<g.length;c++)for(var m=d*g[c],h=0;6>h;h++)k.fill(a,m,f,b,e,d),b+=12};c.prototype.fillInterleaved=function(a,b,c,d,e,f,g){this.fillAttributeData(a,n.POSITION,f,3,b,e);this.fillAttributeData(a,n.NORMAL,f,3,c,e);this.fillAttributeData(a,n.AUXPOS1,
- f,4,null,e);a=f+l.findAttribute(t,n.UV0).offset/4;b=0;for(c=v;b<c.length;b++)d=c[b],e[a+0]=d[0],e[a+1]=d[1],a+=12};c.prototype.getOutputAmount=function(a){return 288*a};c.prototype.getInstanceBufferLayout=function(){};c.prototype.getVertexBufferLayout=function(){return t};c.prototype.intersect=function(a,b,c,d,e,f,g,k){};c.prototype.getParameterValues=function(){var a=this.params;return{verticalOffset:a.verticalOffset,screenSizePerspective:a.screenSizePerspective,screenOffset:a.screenOffset,centerOffsetUnits:a.centerOffsetUnits,
- color:[a.color[0],a.color[1],a.color[2],a.color[3]],size:a.size,borderColor:a.borderColor,occlusionTest:a.occlusionTest,shaderPolygonOffset:a.shaderPolygonOffset,depthHUDAlignStart:a.depthHUDAlignStart}};c.prototype.setParameterValues=function(a){k.updateParameters(this.params,a)&&(this._uniqueMaterialIdentifier=c.uniqueMaterialIdentifier(this.params),this.notifyDirty("matChanged"))};c.uniqueMaterialIdentifier=function(a){return JSON.stringify({screenOffset:a.screenOffset||[0,0],centerOffsetUnits:a.centerOffsetUnits||
- "world"})};c.loadShaders=function(b,c,e){b._parse(a);b=new d("lineCallout",["vertexShaderLineCallout","fragmentShaderLineCallout"],null,c,b,e);b.addDefine("occlTest","OCCL_TEST");b.addDefine("verticalOffset","VERTICAL_OFFSET");b.addDefine("screenSizePerspective","SCREEN_SIZE_PERSPECTIVE");b.addDefine("depthHud","DEPTH_HUD");b.addDefine("depthHudAlignStart","DEPTH_HUD_ALIGN_START");b.addDefine("centerOffsetUnitsScreen","CENTER_OFFSET_UNITS_SCREEN");c.addShaderVariations("line-callout-material-shader-variations",
- b)};return c}(c);var q=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.isRenderSlot=!0;b.updateParameters();return b}f(b,a);b.prototype.updateParameters=function(){this.params=this.material.getParameterValues();this.selectProgram()};b.prototype.selectProgram=function(){var a=this.params;this.renderProgram=this.programRep.getShaderVariationsProgram("line-callout-material-shader-variations",[!!a.occlusionTest,!!a.verticalOffset,!!a.screenSizePerspective,!1,!!a.depthHUDAlignStart,"screen"===
- a.centerOffsetUnits]);this.depthProgram=this.programRep.getShaderVariationsProgram("line-callout-material-shader-variations",[!!a.occlusionTest,!!a.verticalOffset,!!a.screenSizePerspective,!0,!!a.depthHUDAlignStart,"screen"===a.centerOffsetUnits])};b.prototype.beginSlot=function(a){switch(a){case g.LINE_CALLOUTS:return this.isRenderSlot=!0;case g.LINE_CALLOUTS_HUD_DEPTH:return this.isRenderSlot=!1,!0}return!1};Object.defineProperty(b.prototype,"program",{get:function(){return this.isRenderSlot?this.renderProgram:
- this.depthProgram},enumerable:!0,configurable:!0});b.prototype.getProgram=function(){return this.program};b.prototype.getPrograms=function(){return[this.renderProgram,this.depthProgram]};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLES};b.prototype.bind=function(a,b){var c=b.cameraAboveGround?1:-1,d=this.program,e=this.params;a.bindProgram(d);d.setUniform1f("cameraGroundRelative",c);d.setUniform1f("polygonOffset",e.shaderPolygonOffset);d.setUniform4fv("viewport",b.viewport);d.setUniformMatrix4fv("viewNormal",
- b.viewInvTransp);d.setUniform1i("hudVisibilityTexture",0);a.bindTexture(b.hudVisibilityTexture,0);p(d,"color",e.color);d.setUniform2f("screenOffset",e.screenOffset[0],e.screenOffset[1]);this.bindBorder(a,b);k.bindVerticalOffset(e.verticalOffset,b,d);this.bindSizing(a,b);k.bindScreenSizePerspective(e.screenSizePerspective,d);this.isRenderSlot?this.bindRender(a,b):this.bindHUDDepth(a,b)};b.prototype.bindRender=function(a,b){a.setBlendFunctionSeparate(1,771,770,771);a.setBlendingEnabled(!0);a.setDepthWriteEnabled(!1)};
- b.prototype.bindHUDDepth=function(a,b){a.setColorMask(!1,!1,!1,!1);a.setDepthWriteEnabled(!0);a.setBlendingEnabled(!1);a.setDepthTestEnabled(!0)};b.prototype.bindView=function(a,b){a=this.program;k.bindView(b.origin,b.view,a);k.bindCamPos(b.origin,b.viewInvTransp,a)};b.prototype.bindInstance=function(a,b){a=this.program;a.setUniformMatrix4fv("model",b.transformation);a.setUniformMatrix4fv("modelNormal",b.transformationNormal)};b.prototype.release=function(a,b){this.isRenderSlot?this.releaseRender(a,
- b):this.releaseHUDDepth(a,b)};b.prototype.releaseRender=function(a,b){a.setBlendingEnabled(!1);a.setBlendFunction(770,771);a.setDepthWriteEnabled(!0)};b.prototype.releaseHUDDepth=function(a,b){a.setColorMask(!0,!0,!0,!0)};b.prototype.bindSizing=function(a,b){a=this.program;var c=this.params;a.setUniform2f("pixelToNDC",2/b.viewport[2],2/b.viewport[3]);a.setUniform1f("lineSize",Math.ceil(c.size))};b.prototype.bindBorder=function(a,b){a=this.program;b=this.params;null!==b.borderColor?(p(a,"borderColor",
- b.borderColor),a.setUniform1f("borderSize",1)):(a.setUniform4f("borderColor",0,0,0,0),a.setUniform1f("borderSize",0))};return b}(e),v=[[0,0],[1,0],[0,1],[1,0],[1,1],[0,1]];return r})},"esri/views/3d/webgl-engine/materials/MeasurementArrowMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./MeasurementArrowMaterial.xml ../lib/gl-matrix ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){var n=e.vec3d,t=e.mat4d,u=[{name:k.VertexAttrConstants.POSITION,count:3,type:5126,offset:0,stride:36,normalized:!1},{name:k.VertexAttrConstants.NORMAL,count:3,type:5126,offset:12,stride:36,normalized:!1},{name:k.VertexAttrConstants.UV0,count:2,type:5126,offset:24,stride:36,normalized:!1},{name:k.VertexAttrConstants.AUXPOS1,count:1,type:5126,offset:32,stride:36,normalized:!1}],q={width:32,outlineSize:.2,outlineColor:[1,.5,0,1],stripeLength:1,stripeEvenColor:[1,1,1,
- 1],stripeOddColor:[1,.5,0,1],polygonOffset:!1};r=function(c){function d(a,b){b=c.call(this,b)||this;b.params=l.copyParameters(a,q);return b}f(d,c);d.prototype.dispose=function(){};d.prototype.getParameterValues=function(){var a=this.params;return{width:a.width,outlineSize:a.outlineSize,outlineColor:a.outlineColor,stripeLength:a.stripeLength,stripeEvenColor:a.stripeEvenColor,stripeOddColor:a.stripeOddColor,polygonOffset:a.polygonOffset}};d.prototype.setParameterValues=function(a){l.updateParameters(this.params,
- a)&&this.notifyDirty("matChanged")};d.prototype.getParams=function(){return this.params};d.prototype.getOutputAmount=function(a){return 18*(a/2+1)};d.prototype.getInstanceBufferLayout=function(){};d.prototype.getVertexBufferLayout=function(){return u};d.prototype.fillInterleaved=function(a,b,c,d,e,f){d=a.vertexAttr[k.VertexAttrConstants.POSITION].data;var g=a.vertexAttr[k.VertexAttrConstants.NORMAL].data,h=d.length/3;(a=a&&a.indices&&a.indices.position)&&a.length!==2*(h-1)&&console.warn("MeasurementArrowMaterial does not support indices");
- a=f+p.findAttribute(u,k.VertexAttrConstants.POSITION).offset/4;var q=f+p.findAttribute(u,k.VertexAttrConstants.NORMAL).offset/4,v=f+p.findAttribute(u,k.VertexAttrConstants.UV0).offset/4;f+=p.findAttribute(u,k.VertexAttrConstants.AUXPOS1).offset/4;for(var A=x,r=m,D=B,E=z,F=C,K=0,L=0;L<h;++L){var V=3*L;n.set3(d[V],d[V+1],d[V+2],A);L<h-1&&(V=3*(L+1),n.set3(d[V],d[V+1],d[V+2],r),n.set3(g[V],g[V+1],g[V+2],F),n.normalize(F),n.subtract(r,A,D),n.normalize(D),n.cross(F,D,E),n.normalize(E));V=n.dist(A,r);b&&
- c&&(t.multiplyVec3(b,A),t.multiplyVec3(b,r),t.multiplyVec3(c,E));l.fill(A,0,e,a,void 0,3);a+=9;l.fill(A,0,e,a,void 0,3);a+=9;l.fill(E,0,e,q,void 0,3);q+=9;l.fill(E,0,e,q,void 0,3);q+=9;e[v]=K;e[v+1]=-1;v+=9;e[v]=K;e[v+1]=1;v+=9;L<h-1&&(K+=V)}for(L=0;L<h;++L)e[f]=K,f+=9,e[f]=K,f+=9};d.prototype.intersect=function(a,b,c,d,e,f,g,k){};d.prototype.getGLMaterials=function(){return{color:v,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:void 0}};d.prototype.getAllTextureIds=function(){return[]};
- d.loadShaders=function(c,d,e){c._parse(a);c=new b("measurement-arrow",["vsMeasurementArrow","fsMeasurementArrow"],null,d,c,e);d.addShaderVariations("measurement-arrow-material-shader-variations",c)};return d}(g);var v=function(a){function b(b,c,d){c=a.call(this,b,c)||this;c.params=l.copyParameters(b.getParams());c.selectProgram();return c}f(b,a);b.prototype.selectProgram=function(){this.program=this.programRep.getShaderVariationsProgram("measurement-arrow-material-shader-variations",[])};b.prototype.updateParameters=
- function(){this.params=this.material.getParameterValues();this.selectProgram()};b.prototype.beginSlot=function(a){return a===d.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLE_STRIP};b.prototype.bind=function(a,b){b=this.program;a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!0);a.setFaceCullingEnabled(!1);a.setBlendingEnabled(!1);this.params.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-4));
- a.bindProgram(b);b.setUniform1f("width",this.params.width);b.setUniform1f("outlineSize",this.params.outlineSize);b.setUniform4fv("outlineColor",this.params.outlineColor);b.setUniform1f("stripeLength",this.params.stripeLength);b.setUniform4fv("stripeEvenColor",this.params.stripeEvenColor);b.setUniform4fv("stripeOddColor",this.params.stripeOddColor)};b.prototype.bindView=function(a,b){a=b.origin;var c=this.getProgram();l.bindView(a,b.view,c)};b.prototype.bindInstance=function(a,b){this.getProgram().setUniformMatrix4fv("model",
- b.transformation)};b.prototype.release=function(a){a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(!0);a.setBlendingEnabled(!1);this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1)};return b}(c),x=n.create(),m=n.create(),B=n.create(),z=n.create(),C=n.create();c=t.create();t.identity(c);return r})},"esri/views/3d/webgl-engine/materials/RibbonLineMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/text!./RibbonLineMaterial.xml ../../../../core/Logger ../lib/ComponentUtils ../lib/DefaultVertexBufferLayouts ../lib/gl-matrix ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/ShaderVariations ../lib/Util ./internal/MaterialUtil ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q=n.VertexAttrConstants,v=e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial");r=function(b){function e(a,c){c=b.call(this,c)||this;c.params=t.copyParameters(a,Y);"miter"!==c.params.join&&(c.params.miterLimit=0);c.numVertsAtJoin="wall"===c.params.type?2:4;c.numVertsAtCap=2;c.canBeMerged="screen"===c.params.type&&null==c.params.stippleLength;return c}f(e,b);e.prototype.setColor=function(a){this.params.color=a;this.notifyDirty("matChanged")};
- e.prototype.getColor=function(){return this.params.color};e.prototype.dispose=function(){};e.prototype.getParams=function(){return this.params};e.prototype.getParameterValues=function(){var a=this.params;return{color:a.color,width:a.width,type:a.type,join:a.join,polygonOffset:a.polygonOffset,miterLimit:a.miterLimit,stippleLength:a.stippleLength}};e.prototype.setParameterValues=function(a){for(var b in a)n.assert("type"!==b,"RibbonLineMaterial: type cannot be changed after creation"),n.assert("stippleLength"!==
- b||null!=a[b]===(null!=this.params[b]),"RibbonLineMaterial: stippleLength on/off cannot be changed after creation"),this.params[b]=a[b];"miter"!==this.params.join&&(this.params.miterLimit=0);this.notifyDirty("matChanged")};e.prototype.getOutputAmount=function(a){a=(a/2+1-2)*this.numVertsAtJoin+2*this.numVertsAtCap;this.canBeMerged&&(a+=2);return a*u.getStride(Q)/4};e.prototype.getInstanceBufferLayout=function(){};e.prototype.getVertexBufferLayout=function(){return"wall"===this.params.type?X:Q};e.prototype.fillInterleaved=
- function(a,b,c,d,e,f){c=a.vertexAttr[q.POSITION].data;d=a.vertexAttr[q.COLOR]?a.vertexAttr[q.COLOR].data:B;var g=a.vertexAttr[q.SIZE]?a.vertexAttr[q.SIZE].data:z;(a=a.indices&&a.indices[q.POSITION])&&a.length!==2*(c.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");"wall"===this.params.type?this.fillWithoutAuxpos(c,b,e,f):this.fillWithAuxpos(c,d,g,b,e,f)};e.prototype.intersect=function(a,b,e,f,g,k,l,m){if(f.isSelection&&!c.isAllHidden(b.componentVisibilities,a.data.componentOffsets))if(n.isTranslationMatrix(e)){b=
- a.getData();a=b.getVertexAttr()[q.POSITION].data;b=b.getVertexAttr()[q.SIZE];k=f.camera;m=f.point;b=((b&&b.data[0])+this.params.width)/2+4;d.vec3d.set3(m[0]-b,m[1]+b,0,H[0]);d.vec3d.set3(m[0]+b,m[1]+b,0,H[1]);d.vec3d.set3(m[0]+b,m[1]-b,0,H[2]);d.vec3d.set3(m[0]-b,m[1]-b,0,H[3]);for(var h=0;4>h;h++)k.unprojectPoint(H[h],J[h]);n.point2plane(k.eye,J[0],J[1],O);n.point2plane(k.eye,J[1],J[2],N);n.point2plane(k.eye,J[2],J[3],S);n.point2plane(k.eye,J[3],J[0],R);g=Number.MAX_VALUE;for(h=0;h<a.length-5;h+=
- 3)if(C[0]=a[h]+e[12],C[1]=a[h+1]+e[13],C[2]=a[h+2]+e[14],A[0]=a[h+3]+e[12],A[1]=a[h+4]+e[13],A[2]=a[h+5]+e[14],!(0>n.planeDistance(C,O)&&0>n.planeDistance(A,O)||0>n.planeDistance(C,N)&&0>n.planeDistance(A,N)||0>n.planeDistance(C,S)&&0>n.planeDistance(A,S)||0>n.planeDistance(C,R)&&0>n.planeDistance(A,R))){k.projectPoint(C,F);k.projectPoint(A,I);if(0>F[2]&&0<I[2]){d.vec3d.subtract(C,A,D);var t=k.frustumPlanes,p=-(d.vec3d.dot(t[4],C)+t[4][3]),t=p/d.vec3d.dot(D,t[4]);d.vec3d.scale(D,t,D);d.vec3d.add(C,
- D,C);k.projectPoint(C,F)}else if(0<F[2]&&0>I[2])d.vec3d.subtract(A,C,D),t=k.frustumPlanes,p=-(d.vec3d.dot(t[4],A)+t[4][3]),t=p/d.vec3d.dot(D,t[4]),d.vec3d.scale(D,t,D),d.vec3d.add(A,D,A),k.projectPoint(A,I);else if(0>F[2]&&0>I[2])continue;t=n.pointLineSegmentDistanceSquared2D(F,I,m);t<g&&(g=t,d.vec3d.set(C,P),d.vec3d.set(A,G))}e=f.p0;f=f.p1;g<b*b&&(a=n.lineLineDistanceSquared3D(P,G,e,f,M),b=Number.MAX_VALUE,a.success&&(d.vec3d.subtract(a.pa,e,E),a=d.vec3d.length(E),d.vec3d.scale(E,1/a),b=a/d.vec3d.dist(e,
- f)),l(b,E))}else v.error("intersection assumes a translation-only matrix")};e.prototype.getGLMaterials=function(){return{color:x,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:m}};e.prototype.getAllTextureIds=function(){return[]};e.prototype.fillWithAuxpos=function(a,b,c,d,e,f){var g=a.length/3,k=a[0],l=a[1],m=a[2],h=0,n=f,t=u.getStride(this.getVertexBufferLayout())/4;this.canBeMerged&&(f+=t);d&&(k=d[0]*k+d[4]*l+d[8]*m+d[12],l=d[1]*k+d[5]*l+d[9]*m+d[13],m=d[2]*k+d[6]*l+d[10]*m+d[14]);
- var p=k,q=l,v=m,z=a[3],x=a[4],B=a[5];d&&(z=d[0]*z+d[4]*x+d[8]*B+d[12],x=d[1]*z+d[5]*x+d[9]*B+d[13],B=d[2]*z+d[6]*x+d[10]*B+d[14]);for(var C=0;C<g;C++){var A=3*C;C<g-1&&(z=a[A+3],x=a[A+4],B=a[A+5],d&&(z=d[0]*z+d[4]*x+d[8]*B+d[12],x=d[1]*z+d[5]*x+d[9]*B+d[13],B=d[2]*z+d[6]*x+d[10]*B+d[14]));h+=Math.sqrt((p-k)*(p-k)+(q-l)*(q-l)+(v-m)*(v-m));e[f++]=p;e[f++]=q;e[f++]=v;e[f++]=h;e[f++]=0===C?-1.2:-1;e[f++]=k;e[f++]=l;e[f++]=m;e[f++]=z;e[f++]=x;e[f++]=B;e[f++]=b[0];e[f++]=b[1];e[f++]=b[2];e[f++]=b[3];e[f++]=
- c[0];e[f++]=p;e[f++]=q;e[f++]=v;e[f++]=h;e[f++]=0===C?1.2:1;e[f++]=k;e[f++]=l;e[f++]=m;e[f++]=z;e[f++]=x;e[f++]=B;e[f++]=b[0];e[f++]=b[1];e[f++]=b[2];e[f++]=b[3];e[f++]=c[0];0<C&&C<g-1&&(e[f++]=p,e[f++]=q,e[f++]=v,e[f++]=h,e[f++]=-1.2,e[f++]=k,e[f++]=l,e[f++]=m,e[f++]=z,e[f++]=x,e[f++]=B,e[f++]=b[0],e[f++]=b[1],e[f++]=b[2],e[f++]=b[3],e[f++]=c[0],e[f++]=p,e[f++]=q,e[f++]=v,e[f++]=h,e[f++]=1.2,e[f++]=k,e[f++]=l,e[f++]=m,e[f++]=z,e[f++]=x,e[f++]=B,e[f++]=b[0],e[f++]=b[1],e[f++]=b[2],e[f++]=b[3],e[f++]=
- c[0]);k=p;l=q;m=v;p=z;q=x;v=B}if(this.canBeMerged){for(C=n;C<n+t;C++)e[C]=e[C+t];a=f-t;for(C=0;C<t;C++)e[f++]=e[a++]}};e.prototype.fillWithoutAuxpos=function(a,b,c,d){for(var e=a.length/3,f=0,g=a[0],k=a[1],l=a[2],m,h,n,t=0;t<e;t++){var p=3*t;m=g;h=k;n=l;g=a[p];k=a[p+1];l=a[p+2];b&&(g=b[0]*g+b[4]*k+b[8]*l+b[12],k=b[1]*g+b[5]*k+b[9]*l+b[13],l=b[2]*g+b[6]*k+b[10]*l+b[14]);f+=Math.sqrt((g-m)*(g-m)+(k-h)*(k-h)+(l-n)*(l-n));c[d++]=g;c[d++]=k;c[d++]=l;c[d++]=f;c[d++]=-1;c[d++]=g;c[d++]=k;c[d++]=l;c[d++]=
- f;c[d++]=1}};e.loadShaders=function(b,c,d){b._parse(a);var e=function(a){a.addDefine("Screen","SCREENSCALE");a.addDefine("Strip","STRIP");a.addDefine("Wall","WALL");a.addDefine("Stipple","STIPPLE")},f=new p("ribbon-line",["vsRibbonLine","fsRibbonLine"],null,c,b,d);e(f);c.addShaderVariations("ribbon-line-material-shader-variations",f);b=new p("ribbon-line",["vsRibbonLine","fsRibbonLineHighlight"],null,c,b,d);e(b);c.addShaderVariations("ribbon-line-material-highlight-shader-variations",b)};return e}(k);
- var x=function(a){function b(b,c){var d=a.call(this,b,c)||this;d.params=t.copyParameters(b.getParams());delete d.params.join;d.program=c.getShaderVariationsProgram("ribbon-line-material-shader-variations",["screen"===d.params.type,"strip"===d.params.type,"wall"===d.params.type,null!=d.params.stippleLength]);return d}f(b,a);b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.polygonOffset=a.polygonOffset;b.color=a.color;b.width=a.width;b.miterLimit="miter"===a.join?
- a.miterLimit:0;b.stippleLength=a.stippleLength};b.prototype.beginSlot=function(a){return a===l.TRANSPARENT_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){var c=this.program,d=this.params;a.bindProgram(c);c.setUniform4fv("eColor",d.color);c.setUniform1f("miterLimit",d.miterLimit);c.setUniform1f("nearPlane",b.nearFar[0]);"screen"===d.type?(c.setUniform2fv("screenSize",[b.viewport[2],b.viewport[3]]),c.setUniform1f("extLineWidth",d.width*b.pixelRatio)):
- c.setUniform1f("extLineWidth",d.width);null!=d.stippleLength&&c.setUniform1f("stippleLengthDoubleInv",d.stippleLength?1/(2*d.stippleLength):0);d.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,-4));a.setFaceCullingEnabled(!1);a.setBlendingEnabled(!0);a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(1<=d.color[3])};b.prototype.release=function(a){this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1);
- a.setBlendingEnabled(!1);a.setDepthWriteEnabled(!0)};b.prototype.bindView=function(a,b){t.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLE_STRIP};return b}(b),m=function(a){function b(b,c){var d=a.call(this,b,c)||this;d.params=t.copyParameters(b.getParams());delete d.params.join;d.program=c.getShaderVariationsProgram("ribbon-line-material-highlight-shader-variations",
- ["screen"===d.params.type,"strip"===d.params.type,"wall"===d.params.type,null!=d.params.stippleLength]);return d}f(b,a);b.prototype.updateParameters=function(){var a=this.material.getParams(),b=this.params;b.polygonOffset=a.polygonOffset;b.color=a.color;b.width=a.width;b.miterLimit="miter"===a.join?a.miterLimit:0;b.stippleLength=a.stippleLength};b.prototype.beginSlot=function(a){return a===l.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){var c=
- this.program,d=this.params;a.bindProgram(c);c.setUniform4fv("eColor",d.color);c.setUniform1f("miterLimit",d.miterLimit);c.setUniform1f("nearPlane",b.nearFar[0]);"screen"===d.type?(c.setUniform2fv("screenSize",[b.viewport[2],b.viewport[3]]),c.setUniform1f("extLineWidth",d.width*b.pixelRatio)):c.setUniform1f("extLineWidth",d.width);null!=d.stippleLength&&c.setUniform1f("stippleLengthDoubleInv",d.stippleLength?1/(2*d.stippleLength):0);d.polygonOffset&&(a.setPolygonOffsetFillEnabled(!0),a.setPolygonOffset(0,
- -4));a.setFaceCullingEnabled(!1);a.setDepthTestEnabled(!0);a.setDepthWriteEnabled(1<=d.color[3])};b.prototype.release=function(a){this.params.polygonOffset&&a.setPolygonOffsetFillEnabled(!1);a.setDepthWriteEnabled(!0)};b.prototype.bindView=function(a,b){t.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.TRIANGLE_STRIP};return b}(b),B=[255,255,255,255],z=[0,0,0,
- 0],C=d.vec3d.create(),A=d.vec3d.create(),D=d.vec3d.create(),E=d.vec3d.create(),F=d.vec3d.create(),I=d.vec3d.create(),P=d.vec3d.create(),G=d.vec3d.create(),M={success:!1,dist2:0,pa:d.vec3d.create(),pb:d.vec3d.create()},H=[d.vec3d.create(),d.vec3d.create(),d.vec3d.create(),d.vec3d.create()],J=[d.vec3d.create(),d.vec3d.create(),d.vec3d.create(),d.vec3d.create()],O=d.vec4d.create(),N=d.vec4d.create(),S=d.vec4d.create(),R=d.vec4d.create(),Y={color:[1,1,1,1],width:0,type:"screen",join:"miter",miterLimit:5,
- polygonOffset:!1,stippleLength:null},X=g.Pos3Tex,Q=[{name:"position",count:3,type:5126,offset:0,stride:64,normalized:!1},{name:"uv0",count:2,type:5126,offset:12,stride:64,normalized:!1},{name:"auxpos1",count:3,type:5126,offset:20,stride:64,normalized:!1},{name:"auxpos2",count:3,type:5126,offset:32,stride:64,normalized:!1},{name:"color",count:4,type:5126,offset:44,stride:64,normalized:!1},{name:"size",count:1,type:5126,offset:60,stride:64,normalized:!1}];return r})},"esri/views/3d/webgl-engine/materials/internal/BlendLayers":function(){define(["require",
- "exports","dojo/text!./BlendLayers.xml","../../lib/DefaultVertexAttributeLocations","../../../../webgl/Program"],function(r,h,f,a,e){return function(){function c(){}c.loadShaders=function(c,d,b){c._parse(f);c=new e(b,c.vertexShaderBlendLayers,c.fragmentShaderBlendLayers,a.Default3D);d.add("blendLayers",c)};return c}()})},"esri/views/3d/webgl-engine/materials/internal/SimpleGLMaterial":function(){define("require exports dojo/text!./SimpleGLMaterial.xml ../../lib/DefaultVertexAttributeLocations ../../lib/RenderSlot ./MaterialUtil ../../../../webgl/Program".split(" "),
- function(r,h,f,a,e,c,g){return function(){function d(a,c,d,e){void 0===e&&(e=4);this.program=a.get("simple");this.color=c;this.depthFunc=d;this.drawMode=e}d.prototype.beginSlot=function(a){return a===e.INTERNAL_MATERIAL};d.prototype.getProgram=function(){return this.program};d.prototype.bind=function(a,d){a.bindProgram(this.program);this.program.setUniformMatrix4fv("model",c.IDENTITY);this.program.setUniformMatrix4fv("proj",d.proj);this.program.setUniform4fv("color",this.color);a.setBlendingEnabled(!0);
- a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0);void 0!==this.depthFunc&&a.setDepthFunction(this.depthFunc)};d.prototype.release=function(a){void 0!==this.depthFunc&&a.setDepthFunction(513);a.setBlendingEnabled(!1)};d.prototype.bindView=function(a,d){c.bindView(d.origin,d.view,this.program)};d.prototype.bindInstance=function(a,c){this.program.setUniformMatrix4fv("model",c.transformation)};d.prototype.getDrawMode=function(a){return this.drawMode};
- d.loadShaders=function(b,c,d){b._parse(f);b=new g(d,b.vertexShaderSimple,b.fragmentShaderSimple,a.Default3D);c.add("simple",b)};return d}()})},"esri/views/3d/webgl-engine/parts/Viewport":function(){define("require exports dojo/has ../lib/Camera ../lib/gl-matrix ../lib/PerformanceTimer ../lib/Util ./Visualizer".split(" "),function(r,h,f,a,e,c,g,d){var b=e.vec3;r=e.vec4d;var k=e.mat4d,l=[0,0],p=k.create(),n=[r.create(),r.create(),r.create(),r.create(),r.create(),r.create()];return function(){function c(c,
- e,f,g){this._content={};this._frustumCullingEnabled=!0;this._maxFarNearRatio=2E4;this._stats={renderGeometriesTotal:0,renderGeometriesVisible:0,visualizerRenderTimer:null,viewportRenderTimer:null};this._needsRender=!0;this._rctx=g;this._gl=g.gl;this._visualizer=new d(c,e,f,this._rctx);this._camera=new a(b.createFrom(0,100,-100),b.createFrom(0,0,0))}Object.defineProperty(c.prototype,"isLoadingResources",{get:function(){return this._visualizer.isLoadingResources},enumerable:!0,configurable:!0});c.prototype.getCombinedStats=
- function(){var a={},b=this._visualizer.getCombinedStats(),c;for(c in b)a[c]=b[c];a.renderGeometriesTotal=this._stats.renderGeometriesTotal;a.renderGeometriesVisible=this._stats.renderGeometriesVisible;void 0!==this._gl.getUsedTextureMemory&&(a.textureMemory=this._gl.getUsedTextureMemory());void 0!==this._gl.getUsedRenderbufferMemory&&(a.renderbufferMemory=this._gl.getUsedRenderbufferMemory());void 0!==this._gl.getUsedVBOMemory&&(a.VBOMemory=this._gl.getUsedVBOMemory());if(void 0!==this._gl.getUsedTextureMemoryStats){var b=
- this._gl.getUsedTextureMemoryStats(),d;for(d in b)a["texMem type: "+d]=b[d]}return a};c.prototype.dispose=function(){this._visualizer.dispose();this._visualizer=null};c.prototype.setLighting=function(a){this._visualizer.setLighting(a)};c.prototype.getViewParams=function(a){var b=this._visualizer.getViewParams(a);if(!a||a.frustumCullingEnabled)b.frustumCullingEnabled=this._frustumCullingEnabled;if(!a||a.maxFarNearRatio)b.maxFarNearRatio=this._maxFarNearRatio;return b};c.prototype.setViewParams=function(a){void 0!==
- a.frustumCullingEnabled&&(this._frustumCullingEnabled=a.frustumCullingEnabled);void 0!==a.maxFarNearRatio&&(this._maxFarNearRatio=-1===a.maxFarNearRatio?2E4:a.maxFarNearRatio);this._visualizer.setViewParams(a);this._needsRender=!0};c.prototype.setRenderParams=function(a){this._visualizer.setRenderParams(a)};c.prototype.getRenderParams=function(){return this._visualizer.getRenderParams()};c.prototype.getFrustumObjects=function(){var a={},b;for(b in this._content)a[this._content[b].name]=1;return a};
- c.prototype.getEdgeView=function(){return this._visualizer.getEdgeView()};c.prototype.modify=function(a,b,c,d){this._visualizer.modify(a,b,c,d);this._content=this._visualizer.getContent()};c.prototype.getContent=function(){return this._content};c.prototype.setCamera=function(a){this._camera.copyFrom(a);this._updateNearFar();this._needsRender=!0};c.prototype.getCamera=function(){return this._camera};c.prototype.getPickRay=function(a,b,c){return this.pickRayWithBeginPoint(a,void 0,this._camera.viewMatrix,
- b,c)};c.prototype.pickRayWithBeginPoint=function(a,b,c,d,e){return this._visualizer.getPickRay(a,b,this._camera,c,d,e)};c.prototype.addExternalRenderer=function(a,b){return this._visualizer.addExternalRenderer(a,b)};c.prototype.removeExternalRenderer=function(a){return this._visualizer.removeExternalRenderer(a)};c.prototype.getExternalRenderers=function(){return this._visualizer.getExternalRenderers()};c.prototype.render=function(a,b){this._updateNearFar();this._visualizer.render(this._camera,a,b)};
- c.prototype.resetNeedsRender=function(){this._needsRender=!1;this._visualizer.resetNeedsRender()};c.prototype.needsRender=function(){return this._needsRender||this._visualizer.needsRender()};c.prototype._updateNearFar=function(){if(this._frustumCullingEnabled||0<this._maxFarNearRatio)l[1]=0,this._computeFrustumCullingAndNearFar(this._camera.eye,l),0<this._maxFarNearRatio&&0<l[1]&&(this._camera.far=l[1],this._camera.near=Math.max(l[0],this._camera.far/this._maxFarNearRatio))};c.prototype._computeFrustumCullingAndNearFar=
- function(a,b){k.perspective(this._camera.fovY,this._camera.aspect,1,10,p);g.matrix2frustumPlanes(this._camera.viewMatrix,p,n);this._stats.renderGeometriesTotal=0;this._stats.renderGeometriesVisible=0;a=-Number.MAX_VALUE;var c=-Number.MAX_VALUE,d=n[0][0],e=n[0][1],f=n[0][2],l=n[0][3],h=n[1][0],t=n[1][1],q=n[1][2],u=n[1][3],r=n[2][0],I=n[2][1],P=n[2][2],G=n[2][3],M=n[3][0],H=n[3][1],J=n[3][2],O=n[3][3],N=n[4][0],S=n[4][1],R=n[4][2],Y=n[4][3],X=n[5][3],Q;for(Q in this._content){var K=this._content[Q];
- this._stats.renderGeometriesTotal++;var L=K.center,V=L[0],U=L[1],L=L[2],K=K.bsRadius;d*V+e*U+f*L+l>K||h*V+t*U+q*L+u>K||r*V+I*U+P*L+G>K||M*V+H*U+J*L+O>K||(U=N*V+S*U+R*L,V=U+K,U=-U+K,V>a&&(a=V),U>c&&(c=U),this._stats.renderGeometriesVisible++)}Q=a!==-Number.MAX_VALUE;0<this._stats.renderGeometriesVisible&&Q&&(b[0]=.99*Math.max(1-(a+Y),2),b[1]=1.01*Math.max(10+(c+X),b[0]+1))};return c}()})},"esri/views/3d/webgl-engine/parts/Visualizer":function(){define("require exports ../lib/gl-matrix ../lib/HighlightHelper ../lib/NearFarCalc ../lib/OffscreenRenderingHelper ../lib/Renderer ../lib/RenderOccludedHelper ../lib/RenderPass ../lib/ShadowMap ../lib/SSAOHelperObscurance ../lib/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){var n=f.vec3d,t=f.mat4d,u=p.assert;return function(){function f(b,f,m,h){this._drawSSAOMapDebugQuad=this._drawShadowMapDebugQuad=!1;this._needsRender=!0;this._content={};this._rctx=h;this._renderer=new g(b,f,m,this._rctx,!1);this._programRep=b;this._nearFarCalc=new e;this._helpers={shadowMap:new k(b,this._rctx),ssao:new l(b,m,this._rctx,this.setNeedsRender.bind(this)),highlight:new a(b,m,this._rctx),renderOccluded:new d(b,m,this._rctx),offscreenRendering:new c(b,
- this._rctx)}}Object.defineProperty(f.prototype,"isLoadingResources",{get:function(){return this._renderer.isLoadingResources},enumerable:!0,configurable:!0});f.prototype.getCombinedStats=function(){return this._renderer.getCombinedStats()};f.prototype.dispose=function(){this._renderer.dispose();this._helpers.shadowMap.getEnableState()&&this._helpers.shadowMap.setEnableState(!1);this._helpers.shadowMap.dispose();this._helpers.ssao.getEnableState()&&this._helpers.ssao.setEnableState(!1);this._helpers.ssao.dispose();
- this._helpers.highlight.getEnableState()&&this._helpers.highlight.setEnableState(!1);this._helpers.renderOccluded.getEnableState()&&this._helpers.renderOccluded.setEnableState(!1);this._helpers.offscreenRendering.getEnableState()&&this._helpers.offscreenRendering.setEnableState(!1)};f.prototype.setLighting=function(a){this._renderer.setLighting(a)};f.prototype.getViewParams=function(a){var b=a||{};if(!a||a.pixelRatio)b.pixelRatio=this._renderer.getPixelRatio();return b};f.prototype.setViewParams=
- function(a){null!=a.pixelRatio&&this._renderer.setPixelRatio(a.pixelRatio)};f.prototype.setRenderParams=function(a){void 0!==a.shadowMapResolution&&!1===this._helpers.shadowMap.getEnableState()&&this._helpers.shadowMap.setTextureResolution(a.shadowMapResolution);void 0!==a.shadowMap&&a.shadowMap!==this._helpers.shadowMap.getEnableState()&&this._helpers.shadowMap.setEnableState(a.shadowMap);void 0!==a.shadowMapMaxCascades&&this._helpers.shadowMap.setMaxNumCascades(a.shadowMapMaxCascades);!0!==this._helpers.highlight.getEnableState()&&
- this._helpers.highlight.setEnableState(!0);void 0!==a.ssao&&a.ssao!==this._helpers.ssao.getEnableState()&&this._helpers.ssao.setEnableState(a.ssao);void 0!==a.ssaoAttenuation&&this._helpers.ssao.setAttenuation(a.ssaoAttenuation);void 0!==a.ssaoRadius&&this._helpers.ssao.setRadius(a.ssaoRadius);void 0!==a.ssaoFilterRadius&&console.error("The property ssaoFilterRadius is no longer supported as a render parameter.");void 0!==a.ssaoSamples&&this._helpers.ssao.setSamples(a.ssaoSamples);void 0!==a.drawShadowMapDebugQuad&&
- (this._drawShadowMapDebugQuad=a.drawShadowMapDebugQuad);void 0!==a.drawSSAODebugQuad&&(this._drawSSAOMapDebugQuad=a.drawSSAODebugQuad);this._helpers.ssao.getEnableState()?this._renderer.ssaoEnabled=!0:this._renderer.ssaoEnabled=!1;void 0!==a.offscreenRendering&&a.offscreenRendering!==this._helpers.offscreenRendering.getEnableState()&&this._helpers.offscreenRendering.setEnableState(a.offscreenRendering);void 0!==a.antialiasingEnabled&&(this._renderer.renderOptions.antialiasing=a.antialiasingEnabled?
- "smaa":"none");void 0!==a.earlyOcclusionPixelDraw&&(this._renderer.renderOptions.earlyOcclusionPixelDraw=a.earlyOcclusionPixelDraw);void 0!==a.defaultHighlightOptions&&this._helpers.highlight.setDefaultOptions(a.defaultHighlightOptions);this._needsRender=!0};f.prototype.getRenderParams=function(){var a={};this._helpers.shadowMap.getIsSupported()&&(a.shadowMap=this._helpers.shadowMap.getEnableState(),a.shadowMapResolution=this._helpers.shadowMap.getTextureResolution(),a.shadowMapMaxCascades=this._helpers.shadowMap.getMaxNumCascades());
- this._helpers.ssao.getIsSupported()&&(a.ssao=this._helpers.ssao.getEnableState(),a.ssaoAttenuation=this._helpers.ssao.getAttenuation(),a.ssaoRadius=this._helpers.ssao.getRadius(),a.ssaoFilterRadius=this._helpers.ssao.getFilterRadius(),a.ssaoSamples=this._helpers.ssao.getSamples());return a};f.prototype.modify=function(a,b,c,d){this._renderer.modify(a,b,c,d);for(d=0;d<b.length;++d)delete this._content[b[d].uniqueName];for(d=0;d<a.length;++d)this._content[a[d].uniqueName]=a[d];for(d=0;d<c.length;++d)u(this._content[c[d].renderGeometry.uniqueName]===
- c[d].renderGeometry)};f.prototype.getContent=function(){return this._content};f.prototype.getPickRay=function(a,b,c,d,e,f){n.unproject(n.createFrom(a[0],a[1],0),d,c.projectionMatrix,c.fullViewport,e);n.unproject(n.createFrom(a[0],a[1],1),d,c.projectionMatrix,c.fullViewport,f)};f.prototype.getProjectionMatrix=function(a,b,c,d,e){b=p.fovx2fovy(b,a[2],a[3]);t.perspective(180*b/Math.PI,a[2]/a[3],c,d,e)};f.prototype.addExternalRenderer=function(a,b){return this._renderer.addExternalRenderer(a,b)};f.prototype.removeExternalRenderer=
- function(a){return this._renderer.removeExternalRenderer(a)};f.prototype.getExternalRenderers=function(){return this._renderer.getExternalRenderers()};f.prototype.resetNeedsRender=function(){this._needsRender=!1;this._renderer.resetNeedsRender()};f.prototype.needsRender=function(){return this._needsRender||this._renderer.needsRender()};f.prototype.setNeedsRender=function(){this._needsRender=!0};f.prototype.render=function(a,c,d){var e=a.viewport,f;if(this._helpers.shadowMap.getEnableState()){f=this._nearFarCalc.calculateSceneNearFar(a,
- this._content);this._helpers.shadowMap.prepare(a,c,this._content,f);c=this._helpers.shadowMap.getCascades();for(f=0;f<c.length;++f){var g=c[f];g.camera.setGLViewport(this._rctx);this._renderer.renderGeometryPass(b.MATERIAL_DEPTH_SHADOWMAP,g.camera)}this._helpers.shadowMap.finish(d);a.setGLViewport(this._rctx)}this._helpers.shadowMap.bindAll(this._programRep);this._renderer.renderAuxiliaryBuffers(a,d,this._helpers);this._renderer.render(a,d,this._helpers);this._drawShadowMapDebugQuad&&this._helpers.shadowMap.getEnableState()&&
- (a=t.ortho(e[0],e[2],e[1],e[3],-1,1),this._helpers.shadowMap.drawDebugQuad(a));this._drawSSAOMapDebugQuad&&this._helpers.ssao.getEnableState()&&(a=t.ortho(e[0],e[2],e[1],e[3],-1,1),this._helpers.ssao.drawQuad(a))};f.prototype.getEdgeView=function(){return this._renderer.edgeView};return f}()})},"esri/views/3d/webgl-engine/lib/NearFarCalc":function(){define(["require","exports","./ComponentUtils","./gl-matrix","./Util"],function(r,h,f,a,e){r=a.vec3d;var c=a.vec4d,g=a.mat4d;a=function(){function a(){this._context=
- {content:[],near:[],far:[],nearSpecial:[],farSpecial:[],bestNear:0,bestFar:0,bestNear2:0,bestFar2:0};this._boundingInfoHelper=new d}a.prototype._resetContext=function(){var a=this._context;a.content.length=0;a.near.length=0;a.far.length=0;a.nearSpecial.length=0;a.farSpecial.length=0;a.bestNear=Number.MAX_VALUE;a.bestFar=-Number.MAX_VALUE;return this._context};a.prototype.calculateSceneNearFar=function(a,b){var c=this._resetContext(),d=a.viewMatrix,e=d[2],g=d[6],k=d[10],h=d[14],n=0,p;for(p in b)if(d=
- b[p],!f.isAllHidden(d.instanceParameters.componentVisibilities,d.componentOffsets)&&d.castShadow){var t=void 0,u=void 0;d.hasShaderTransformation?(t=d.getBoundingSphere(d.getShaderTransformation(),null,l),u=l):(t=d.bsRadius,u=d.center);var r=e*u[0]+g*u[1]+k*u[2]+h,u=r-t,t=r+t;c.content[n]=d;c.near[n]=-t;c.far[n]=-u;++n}if(0===n)return[c.bestNear,c.bestFar];for(b=0;b<n;++b)c.near[b]>c.bestFar&&(c.bestFar=c.near[b]),2<c.near[b]&&c.far[b]<c.bestNear&&(c.bestNear=c.far[b]);c.bestNear2=Math.max(.5*c.bestNear,
- 2);c.bestFar2=2*c.bestFar;for(b=g=e=0;b<n;++b)c.near[b]<c.bestNear&&(c.near[b]>=c.bestNear2?c.bestNear=c.near[b]:c.nearSpecial[e++]=b),c.far[b]>c.bestFar&&(c.far[b]<=c.bestFar2?c.bestFar=c.far[b]:c.farSpecial[g++]=b);if(0===e&&0===g)return[c.bestNear,c.bestFar];c.nearSpecial.length=e;c.farSpecial.length=g;c.nearSpecial.sort(function(a,b){return c.near[a]<c.near[b]?-1:c.near[a]>c.near[b]?1:0});c.farSpecial.sort(function(a,b){return c.far[a]<c.far[b]?1:c.far[a]>c.far[b]?-1:0});this._boundingInfoHelper.init(a,
- c);for(b=0;b<e;++b)c.near[c.nearSpecial[b]]<c.bestNear&&(d=c.content[c.nearSpecial[b]],a=d.boundingInfo,this._boundingInfoHelper.includeNearBoundingInfoRec(a,d.getShaderTransformation()));for(b=0;b<g;++b)c.far[c.farSpecial[b]]>c.bestFar&&(d=c.content[c.farSpecial[b]],a=d.boundingInfo,this._boundingInfoHelper.includeFarBoundingInfoRec(a,d.getShaderTransformation()));return[c.bestNear,c.bestFar]};return a}();var d=function(){function a(){this._clippingHelper=new b;this._planes=[c.create(),c.create(),
- c.create(),c.create(),c.create(),c.create()];this._viewProj=g.create();this._view=g.create()}a.prototype.init=function(a,b){this._context=b;g.set(a.viewMatrix,this._view);g.multiply(a.projectionMatrix,this._view,this._viewProj);a.copyFrustumPlanes(this._planes);this._clippingHelper.init(b)};a.prototype.includeNearBoundingInfoRec=function(a,b){var c=a.getBSRadius(),d=a.getCenter();g.multiplyVec3(b,d,l);var d=l[0],e=l[1],f=l[2],c=c*Math.sqrt(Math.max(Math.max(b[0]*b[0]+b[4]*b[4]+b[8]*b[8],b[1]*b[1]+
- b[5]*b[5]+b[9]*b[9]),b[2]*b[2]+b[6]*b[6]+b[10]*b[10]));if(!(this._planes[0][0]*d+this._planes[0][1]*e+this._planes[0][2]*f+this._planes[0][3]>c||this._planes[1][0]*d+this._planes[1][1]*e+this._planes[1][2]*f+this._planes[1][3]>c||this._planes[2][0]*d+this._planes[2][1]*e+this._planes[2][2]*f+this._planes[2][3]>c||this._planes[3][0]*d+this._planes[3][1]*e+this._planes[3][2]*f+this._planes[3][3]>c||(d=this._view[2]*d+this._view[6]*e+this._view[10]*f+this._view[14],e=d+c,2>-(d-c)||-e>=this._context.bestNear)))if(-e>
- this._context.bestNear2)this._context.bestNear=-e;else{if(100<c&&(c=a.getChildren(),void 0!==c)){for(a=0;8>a;++a)void 0!==c[a]&&this.includeNearBoundingInfoRec(c[a],b);return}this._clippingHelper.intersectFrustumAABB(this._viewProj,b,a.getBBMin(),a.getBBMax())}};a.prototype.includeFarBoundingInfoRec=function(a,b){var c=a.getBSRadius(),d=a.getCenter();g.multiplyVec3(b,d,l);var d=l[0],e=l[1],f=l[2],c=c*Math.sqrt(Math.max(Math.max(b[0]*b[0]+b[4]*b[4]+b[8]*b[8],b[1]*b[1]+b[5]*b[5]+b[9]*b[9]),b[2]*b[2]+
- b[6]*b[6]+b[10]*b[10]));if(!(this._planes[0][0]*d+this._planes[0][1]*e+this._planes[0][2]*f+this._planes[0][3]>c||this._planes[1][0]*d+this._planes[1][1]*e+this._planes[1][2]*f+this._planes[1][3]>c||this._planes[2][0]*d+this._planes[2][1]*e+this._planes[2][2]*f+this._planes[2][3]>c||this._planes[3][0]*d+this._planes[3][1]*e+this._planes[3][2]*f+this._planes[3][3]>c||(d=this._view[2]*d+this._view[6]*e+this._view[10]*f+this._view[14]-c,-d<=this._context.bestFar)))if(-d<this._context.bestFar2)this._context.bestFar=
- -d;else{if(100<c&&(c=a.getChildren(),void 0!==c)){for(a=0;8>a;++a)void 0!==c[a]&&this.includeFarBoundingInfoRec(c[a],b);return}this._clippingHelper.intersectFrustumAABB(this._viewProj,b,a.getBBMin(),a.getBBMax())}};return a}(),b=function(){function a(){this._clipP=Array(8);for(var a=0;8>a;++a)this._clipP[a]=c.create()}a.prototype.init=function(a){this._context=a};a.prototype.intersectFrustumAABB=function(a,b,c,d){g.multiply(a,b,p);for(a=0;8>a;++a){b=this._clipP[a];var e=0===a||3===a||4===a||7===a?
- c[0]:d[0],f=0===a||1===a||4===a||5===a?c[1]:d[1],l=4>a?c[2]:d[2];b[0]=p[0]*e+p[4]*f+p[8]*l+p[12];b[1]=p[1]*e+p[5]*f+p[9]*l+p[13];b[2]=p[2]*e+p[6]*f+p[10]*l+p[14];b[3]=p[3]*e+p[7]*f+p[11]*l+p[15]}for(a=0;12>a;++a){c=this._clipTriangle(this._clipP[k[a][0]],this._clipP[k[a][1]],this._clipP[k[a][2]]);d=!0;for(b=0;b<c.length;++b)if(e=c[b][3],2<=e){d=!1;break}if(!d)for(b=0;b<c.length;++b)e=c[b][3],e<this._context.bestNear&&(this._context.bestNear=e),e>this._context.bestFar&&(this._context.bestFar=e)}};
- a.prototype._inside=function(a,b){if(0===b)return a[0]>=-a[3];if(1===b)return a[1]>=-a[3];if(2===b)return a[0]<=a[3];if(3===b)return a[1]<=a[3];e.assert(!1)};a.prototype._intersect=function(a,b,d){var e=0;0===d?e=(-a[3]-a[0])/(b[0]-a[0]+b[3]-a[3]):1===d?e=(-a[3]-a[1])/(b[1]-a[1]+b[3]-a[3]):2===d?e=(a[3]-a[0])/(b[0]-a[0]-b[3]+a[3]):3===d&&(e=(a[3]-a[1])/(b[1]-a[1]-b[3]+a[3]));return c.lerp(a,b,e,c.create())};a.prototype._clipTriangle=function(a,b,c){a=[a,b,c];for(b=0;4>b;++b){c=a;a=[];for(var d=0;d<
- c.length;++d){var e=c[d],f=c[(d+1)%c.length];this._inside(f,b)?(this._inside(e,b)||a.push(this._intersect(e,f,b)),a.push(f)):this._inside(e,b)&&a.push(this._intersect(e,f,b))}}return a};return a}(),k=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],l=r.create(),p=g.create();return a})},"esri/views/3d/webgl-engine/lib/ShadowMap":function(){define("./Camera ./Util ./gl-matrix ./glUtil3D ../../../../core/Logger ../../../webgl/Texture ../../../webgl/FramebufferObject ../../../webgl/VertexArrayObject ../../../webgl/BufferObject ./DefaultVertexAttributeLocations ./DefaultVertexBufferLayouts ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){var n=f.vec2d,t=f.vec3d,u=f.vec4d,q=f.mat3d,v=f.mat4d,x=f.mat4,m=e.getLogger("esri.views.3d.webgl-engine.lib.ShadowMap");return function(e,f){function z(a,b){t.set3(a[b],a[b+3],a[b+6],Fa);return Fa}var B=f.gl,D,E=4096,F,I=a.createEmptyTexture(f),P=1,G=2,M=[0,0,0,0,0];this.dispose=function(){I.dispose();I=null};var H=function(){this.camera=new r;this.lightMat=v.create()},J=[],O,N,S;for(O=0;4>O;++O)J[O]=new H;this.getIsSupported=function(){return f.capabilities.standardDerivatives};
- this.setTextureResolution=function(a){E=a};this.getTextureResolution=function(){return E};this.setMaxNumCascades=function(a){G=h.clamp(Math.floor(a),1,4)};this.getMaxNumCascades=function(){return G};this.setEnableState=function(a){a?this.enable():this.disable()};this.getEnableState=function(){return void 0!==D};this.getDepthTexture=function(){return D};this.enable=function(){this.getEnableState()||(this.getIsSupported()?(D=new c(f,{target:B.TEXTURE_2D,pixelFormat:B.RGBA,dataType:B.UNSIGNED_BYTE,wrapMode:B.CLAMP_TO_EDGE,
- samplingMode:B.NEAREST,flipped:!0,width:E,height:E}),F=g.createWithAttachments(f,D,{colorTarget:0,depthStencilTarget:1,width:E,height:E})):m.warn("Shadow maps are not supported for this browser or hardware"))};this.disable=function(){this.getEnableState()&&F&&(F.dispose(),D=F=void 0)};var R=v.create(),Y=v.create(),X=u.create(),Q=Array(8);for(O=0;8>O;++O)Q[O]=u.create();var K=t.create(),L=t.create(),V=n.create(),U=n.create(),ca=n.create(),ga=n.create(),da=n.create(),ka=v.create(),Z=t.create();this.prepare=
- function(a,b,c,d){h.assert(this.getEnableState());v.multiply(a.projectionMatrix,a.viewMatrix,R);var e=d[0],g=d[1];2>e&&(e=2);2>g&&(g=2);e>=g&&(e=2,g=4);P=Math.min(1+Math.floor(h.logWithBase(g/e,4)),G);c=Math.pow(g/e,1/P);for(d=0;d<P+1;++d)M[d]=e*Math.pow(c,d);v.inverse(R,Y);v.lookAt([0,0,0],[-b[0],-b[1],-b[2]],[0,1,0],ka);c=a.viewMatrix;a=a.projectionMatrix;for(d=0;d<P;++d){var k=J[d],e=-M[d],g=-M[d+1],e=(a[10]*e+a[14])/Math.abs(a[11]*e+a[15]),g=(a[10]*g+a[14])/Math.abs(a[11]*g+a[15]);h.assert(e<
- g);for(N=0;8>N;++N)for(u.set4(0===N%4||3==N%4?-1:1,0===N%4||1==N%4?-1:1,4>N?e:g,1,X),v.multiplyVec4(Y,X,Q[N]),S=0;3>S;++S)Q[N][S]/=Q[N][3];t.negate(Q[0],Z);v.translate(ka,Z,k.camera.viewMatrix);for(N=0;8>N;++N)v.multiplyVec3(k.camera.viewMatrix,Q[N]);t.set(Q[0],K);t.set(Q[0],L);for(N=1;8>N;++N)for(S=0;3>S;++S)K[S]=Math.min(K[S],Q[N][S]),L[S]=Math.max(L[S],Q[N][S]);K[2]-=200;L[2]+=200;k.camera.near=-L[2];k.camera.far=-K[2];e=1/Q[0][3];g=1/Q[4][3];h.assert(e<g);var l=e+Math.sqrt(e*g),m=Math.sin(Math.acos(c[2]*
- b[0]+c[6]*b[1]+c[10]*b[2])),l=l/m,e=Q,p=l,q=m,m=V,x=U,C=ca,A=ga,l=da;n.set2(0,0,T);for(var r=void 0,r=0;4>r;++r)n.add(T,e[r],T);n.scale(T,.25);n.set2(0,0,ha);for(r=4;8>r;++r)n.add(ha,e[r],ha);n.scale(ha,.25);n.lerp(e[4],e[5],.5,ia[0]);n.lerp(e[5],e[6],.5,ia[1]);n.lerp(e[6],e[7],.5,ia[2]);n.lerp(e[7],e[4],.5,ia[3]);for(var D=0,I=n.dist2(ia[0],T),r=1;4>r;++r){var H=n.dist2(ia[r],T);H<I&&(I=H,D=r)}n.subtract(ia[D],e[D+4],la);r=la[0];la[0]=-la[1];la[1]=r;n.subtract(ha,T,w);n.lerp(la,w,q);n.normalize(la);
- D=q=void 0;q=D=n.dot(n.subtract(e[0],T,ra),la);for(r=1;8>r;++r)I=n.dot(n.subtract(e[r],T,ra),la),I<q?q=I:I>D&&(D=I);n.set(T,m);n.scale(la,q-p,ra);n.add(m,ra,m);for(var H=-1,O=1,r=p=I=0;8>r;++r){n.subtract(e[r],m,wa);n.normalize(wa);var za=la[0]*wa[1]-la[1]*wa[0];0<za?za>H&&(H=za,I=r):za<O&&(O=za,p=r)}h.verify(0<H,"leftArea");h.verify(0>O,"rightArea");n.scale(la,q,xa);n.add(xa,T,xa);n.scale(la,D,oa);n.add(oa,T,oa);na[0]=-la[1];na[1]=la[0];x=h.rayRay2D(m,e[p],oa,n.add(oa,na,ra),1,x);C=h.rayRay2D(m,
- e[I],oa,ra,1,C);A=h.rayRay2D(m,e[I],xa,n.add(xa,na,ra),1,A);e=h.rayRay2D(m,e[p],xa,ra,1,l);h.verify(x,"rayRay");h.verify(C,"rayRay");h.verify(A,"rayRay");h.verify(e,"rayRay");C=V;e=U;m=ga;A=da;l=k.camera.projectionMatrix;n.scale(n.subtract(m,A,ua),.5);ba[0]=ua[0];ba[1]=ua[1];ba[2]=0;ba[3]=ua[1];ba[4]=-ua[0];ba[5]=0;ba[6]=ua[0]*ua[0]+ua[1]*ua[1];ba[7]=ua[0]*ua[1]-ua[1]*ua[0];ba[8]=1;ba[6]=-n.dot(z(ba,0),C);ba[7]=-n.dot(z(ba,1),C);C=n.dot(z(ba,0),m)+ba[6];x=n.dot(z(ba,1),m)+ba[7];r=n.dot(z(ba,0),A)+
- ba[6];A=n.dot(z(ba,1),A)+ba[7];C=-(C+r)/(x+A);ba[0]+=ba[1]*C;ba[3]+=ba[4]*C;ba[6]+=ba[7]*C;C=1/(n.dot(z(ba,0),m)+ba[6]);x=1/(n.dot(z(ba,1),m)+ba[7]);ba[0]*=C;ba[3]*=C;ba[6]*=C;ba[1]*=x;ba[4]*=x;ba[7]*=x;ba[2]=ba[1];ba[5]=ba[4];ba[8]=ba[7];ba[7]+=1;C=n.dot(z(ba,1),e)+ba[7];x=n.dot(z(ba,2),e)+ba[8];r=n.dot(z(ba,1),m)+ba[7];A=n.dot(z(ba,2),m)+ba[8];C=-.5*(C/x+r/A);ba[1]+=ba[2]*C;ba[4]+=ba[5]*C;ba[7]+=ba[8]*C;C=n.dot(z(ba,1),e)+ba[7];x=n.dot(z(ba,2),e)+ba[8];r=-x/C;ba[1]*=r;ba[4]*=r;ba[7]*=r;l[0]=ba[0];
- l[1]=ba[1];l[2]=0;l[3]=ba[2];l[4]=ba[3];l[5]=ba[4];l[6]=0;l[7]=ba[5];l[8]=0;l[9]=0;l[10]=1;l[11]=0;l[12]=ba[6];l[13]=ba[7];l[14]=0;l[15]=ba[8];k.camera.projectionMatrix[10]=2/(K[2]-L[2]);k.camera.projectionMatrix[14]=-(K[2]+L[2])/(K[2]-L[2]);v.multiply(k.camera.projectionMatrix,k.camera.viewMatrix,k.lightMat);e=E/2;k.camera.viewport[0]=0===d%2?0:e;k.camera.viewport[1]=0===Math.floor(d/2)?0:e;k.camera.viewport[2]=e;k.camera.viewport[3]=e}fa=void 0;M[P]=100*g;f.bindFramebuffer(F);f.bindTexture(null,
- 7);f.setClearColor(1,1,1,1);f.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT);f.setBlendingEnabled(!1)};var ea=[];this.getCascades=function(){for(var a=0;a<P;++a)ea[a]=J[a];ea.length=P;return ea};this.finish=function(a){h.assert(this.getEnableState());f.bindFramebuffer(a)};this.bind=function(a){var b=this.getEnableState();f.bindTexture(b?D:I,7);f.bindProgram(a);a.setUniform1i("depthTex",7);a.setUniform1f("depthHalfPixelSz",b?.5/E:-1);a.setUniform1i("shadowMapNum",P);a.setUniform4f("shadowMapDistance",
- M[0],M[1],M[2],M[3])};this.bindAll=function(a){a=a.getProgramsUsingUniform("shadowMapDistance");for(var b=0;b<a.length;b++)this.bind(a[b])};var ja=x.create(),aa=new Float32Array(64),fa;this.bindView=function(a,b){if(this.getEnableState()){if(!fa||fa[0]!==b[0]||fa[1]!==b[1]||fa[2]!==b[2]){var c;fa=fa||t.create();t.set(b,fa);for(N=0;N<P;++N)for(x.translate(J[N].lightMat,b,ja),c=0;16>c;++c)aa[16*N+c]=ja[c]}a.setUniformMatrix4fv("shadowMapMatrix",aa)}};H=new Float32Array(16);H[0]=0;H[1]=0;H[2]=0;H[3]=
- 0;H[4]=256;H[5]=0;H[6]=1;H[7]=0;H[8]=0;H[9]=256;H[10]=0;H[11]=1;H[12]=256;H[13]=256;H[14]=1;H[15]=1;var qa=new d(f,k.Default3D,{geometry:l.Pos2Tex},{geometry:b.createVertex(f,B.STATIC_DRAW,H)});this.drawDebugQuad=function(a){h.assert(this.getEnableState());var b=e.get("showDepth");f.setDepthTestEnabled(!1);f.bindProgram(b);b.setUniformMatrix4fv("proj",a);b.setUniform1i("depthTex",0);f.bindTexture(D,0);f.bindVAO(qa);p.assertCompatibleVertexAttributeLocations(qa,b);f.drawArrays(B.TRIANGLE_STRIP,0,p.vertexCount(qa,
- "geometry"));f.setDepthTestEnabled(!0)};var T=n.create(),ha=n.create(),ia=[n.create(),n.create(),n.create(),n.create()],la=n.create(),w=n.create(),ra=n.create(),wa=n.create(),xa=n.create(),oa=n.create(),na=n.create(),Fa=t.create(),ua=n.create(),ba=q.create()}})},"esri/views/support/screenshotUtils":function(){define(["require","exports","dojo/_base/lang"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.adjustScreenshotSettings=function(a,e){a=f.mixin({format:"png",quality:100},
- a||{});var c,g;a.includePadding?(c=e.width,g=e.height):(c=e.width-e.padding.left-e.padding.right,g=e.height-e.padding.top-e.padding.bottom);var d=c/g;void 0!==a.width&&void 0===a.height?a.height=a.width/d:void 0!==a.height&&void 0===a.width&&(a.width=d*a.height);void 0!==a.height&&(a.height=Math.floor(a.height));void 0!==a.width&&(a.width=Math.floor(a.width));a.area||a.includePadding||(a.area={x:e.padding.left,y:e.padding.top,width:c,height:g});return a};h.resampleHermite=function(a,e,c,f,d,b,k){void 0===
- k&&(k=!0);var g=e/d;c/=b;for(var h=Math.ceil(g/2),n=Math.ceil(c/2),t=0;t<b;t++)for(var u=0;u<d;u++){for(var q=4*(u+(k?b-t-1:t)*d),v=0,x=0,m=0,B=0,z=0,C=0,r=0,D=(t+.5)*c,E=Math.floor(t*c);E<(t+1)*c;E++)for(var F=Math.abs(D-(E+.5))/n,I=(u+.5)*g,F=F*F,P=Math.floor(u*g);P<(u+1)*g;P++){var G=Math.abs(I-(P+.5))/h,v=Math.sqrt(F+G*G);-1<=v&&1>=v&&(v=2*v*v*v-3*v*v+1,0<v&&(G=4*(P+E*e),r+=v*a[G+3],m+=v,255>a[G+3]&&(v=v*a[G+3]/250),B+=v*a[G],z+=v*a[G+1],C+=v*a[G+2],x+=v))}f[q]=B/x;f[q+1]=z/x;f[q+2]=C/x;f[q+3]=
- r/m}}})},"esri/views/webgl/RenderingContext":function(){define(["require","exports","./enums","./capabilities/isWebGL2Context","./capabilities/load"],function(r,h,f,a,e){return function(){function c(c,d){this.gl=null;this._blendEnabled=!1;this._blendColorState={r:0,g:0,b:0,a:0};this._blendFunctionState={srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0};this._blendEquationState={mode:32774,modeAlpha:32774};this._colorMaskState={r:!0,g:!0,b:!0,a:!0};this._polygonCullingEnabled=!1;this._cullFace=1029;this._frontFace=
- 2305;this._scissorTestEnabled=!1;this._scissorRect={x:0,y:0,width:0,height:0};this._depthTestEnabled=!1;this._depthFunction=513;this._clearDepth=1;this._depthWriteEnabled=!0;this._depthRange={zNear:0,zFar:1};this._viewport=null;this._polygonOffsetFillEnabled=this._stencilTestEnabled=!1;this._polygonOffset=[0,0];this._stencilFunction={face:1032,func:519,ref:0,mask:1};this._clearStencil=0;this._stencilWriteMask=1;this._stencilOperation={face:1032,fail:7680,zFail:7680,zPass:7680};this._lineWidth=1;this._clearColor=
- {r:0,g:0,b:0,a:0};this._activeFramebuffer=this._activeIndexBuffer=this._activeVertexBuffer=this._activeShaderProgram=null;this._activeTextureUnit=0;this._textureUnitMap={};this.contextVersion=a.default(c)?"webgl2":"webgl";this.gl=c;c instanceof WebGLRenderingContext&&this.gl.getExtension("OES_element_index_uint");this._capabilities=e.loadCapabilities(c,d);c=this.gl.getParameter(this.gl.VIEWPORT);this._viewport={x:c[0],y:c[1],width:c[2],height:c[3]};c=this.capabilities.textureFilterAnisotropic;this._parameters=
- {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:c?this.gl.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY):void 0,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS)};this.enforceState()}Object.defineProperty(c.prototype,"contextAttributes",{get:function(){return this.gl.getContextAttributes()},enumerable:!0,
- configurable:!0});Object.defineProperty(c.prototype,"parameters",{get:function(){return this._parameters},enumerable:!0,configurable:!0});c.prototype.dispose=function(){this.bindVAO(null);this.unbindBuffer(34962);this.unbindBuffer(34963);this._textureUnitMap={};this.gl=null};c.prototype.setBlendingEnabled=function(a){this._blendEnabled!==a&&(!0===a?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._blendEnabled=a)};c.prototype.setBlendColor=function(a,c,b,e){if(a!==this._blendColorState.r||
- c!==this._blendColorState.g||b!==this._blendColorState.b||e!==this._blendColorState.a)this.gl.blendColor(a,c,b,e),this._blendColorState.r=a,this._blendColorState.g=c,this._blendColorState.b=b,this._blendColorState.a=e};c.prototype.setBlendFunction=function(a,c){if(a!==this._blendFunctionState.srcRGB||c!==this._blendFunctionState.dstRGB)this.gl.blendFunc(a,c),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=a,this._blendFunctionState.dstRGB=c,this._blendFunctionState.dstAlpha=c};
- c.prototype.setBlendFunctionSeparate=function(a,c,b,e){if(this._blendFunctionState.srcRGB!==a||this._blendFunctionState.srcAlpha!==b||this._blendFunctionState.dstRGB!==c||this._blendFunctionState.dstAlpha!==e)this.gl.blendFuncSeparate(a,c,b,e),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=b,this._blendFunctionState.dstRGB=c,this._blendFunctionState.dstAlpha=e};c.prototype.setBlendEquation=function(a){this._blendEquationState.mode!==a&&(this.gl.blendEquation(a),this._blendEquationState.mode=
- a,this._blendEquationState.modeAlpha=a)};c.prototype.setBlendEquationSeparate=function(a,c){if(this._blendEquationState.mode!==a||this._blendEquationState.modeAlpha!==c)this.gl.blendEquationSeparate(a,c),this._blendEquationState.mode=a,this._blendEquationState.modeAlpha=c};c.prototype.setColorMask=function(a,c,b,e){if(this._colorMaskState.r!==a||this._colorMaskState.g!==c||this._colorMaskState.b!==b||this._colorMaskState.a!==e)this.gl.colorMask(a,c,b,e),this._colorMaskState.r=a,this._colorMaskState.g=
- c,this._colorMaskState.b=b,this._colorMaskState.a=e};c.prototype.setClearColor=function(a,c,b,e){if(this._clearColor.r!==a||this._clearColor.g!==c||this._clearColor.b!==b||this._clearColor.a!==e)this.gl.clearColor(a,c,b,e),this._clearColor.r=a,this._clearColor.g=c,this._clearColor.b=b,this._clearColor.a=e};c.prototype.setFaceCullingEnabled=function(a){this._polygonCullingEnabled!==a&&(!0===a?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._polygonCullingEnabled=a)};c.prototype.setPolygonOffsetFillEnabled=
- function(a){this._polygonOffsetFillEnabled!==a&&(!0===a?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._polygonOffsetFillEnabled=a)};c.prototype.setPolygonOffset=function(a,c){if(this._polygonOffset[0]!==a||this._polygonOffset[1]!==c)this._polygonOffset[0]=a,this._polygonOffset[1]=c,this.gl.polygonOffset(a,c)};c.prototype.setCullFace=function(a){this._cullFace!==a&&(this.gl.cullFace(a),this._cullFace=a)};c.prototype.setFrontFace=function(a){this._frontFace!==
- a&&(this.gl.frontFace(a),this._frontFace=a)};c.prototype.setScissorTestEnabled=function(a){this._scissorTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._scissorTestEnabled=a)};c.prototype.setScissorRect=function(a,c,b,e){if(this._scissorRect.x!==a||this._scissorRect.y!==c||this._scissorRect.width!==b||this._scissorRect.height!==e)this.gl.scissor(a,c,b,e),this._scissorRect.x=a,this._scissorRect.y=c,this._scissorRect.width=b,this._scissorRect.height=
- e};c.prototype.setDepthTestEnabled=function(a){this._depthTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTestEnabled=a)};c.prototype.setClearDepth=function(a){this._clearDepth!==a&&(this.gl.clearDepth(a),this._clearDepth=a)};c.prototype.setDepthFunction=function(a){this._depthFunction!==a&&(this.gl.depthFunc(a),this._depthFunction=a)};c.prototype.setDepthWriteEnabled=function(a){this._depthWriteEnabled!==a&&(this.gl.depthMask(a),this._depthWriteEnabled=
- a)};c.prototype.setDepthRange=function(a,c){if(this._depthRange.zNear!==a||this._depthRange.zFar!==c)this.gl.depthRange(a,c),this._depthRange.zNear=a,this._depthRange.zFar=c};c.prototype.setStencilTestEnabled=function(a){this._stencilTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTestEnabled=a)};c.prototype.setClearStencil=function(a){a!==this._clearStencil&&(this.gl.clearStencil(a),this._clearStencil=a)};c.prototype.setStencilFunction=
- function(a,c,b){if(this._stencilFunction.func!==a||this._stencilFunction.ref!==c||this._stencilFunction.mask!==b)this.gl.stencilFunc(a,c,b),this._stencilFunction.face=1032,this._stencilFunction.func=a,this._stencilFunction.ref=c,this._stencilFunction.mask=b};c.prototype.setStencilFunctionSeparate=function(a,c,b,e){if(this._stencilFunction.face!==a||this._stencilFunction.func!==c||this._stencilFunction.ref!==b||this._stencilFunction.mask!==e)this.gl.stencilFuncSeparate(a,c,b,e),this._stencilFunction.face=
- a,this._stencilFunction.func=c,this._stencilFunction.ref=b,this._stencilFunction.mask=e};c.prototype.setStencilWriteMask=function(a){this._stencilWriteMask!==a&&(this.gl.stencilMask(a),this._stencilWriteMask=a)};c.prototype.setStencilOp=function(a,c,b){if(this._stencilOperation.fail!==a||this._stencilOperation.zFail!==c||this._stencilOperation.zPass!==b)this.gl.stencilOp(a,c,b),this._stencilOperation.face=1032,this._stencilOperation.fail=a,this._stencilOperation.zFail=c,this._stencilOperation.zPass=
- b};c.prototype.setStencilOpSeparate=function(a,c,b,e){if(this._stencilOperation.face!==a||this._stencilOperation.fail!==c||this._stencilOperation.zFail!==b||this._stencilOperation.zPass!==e)this.gl.stencilOpSeparate(a,c,b,e),this._stencilOperation.face=a,this._stencilOperation.face=a,this._stencilOperation.fail=c,this._stencilOperation.zFail=b,this._stencilOperation.zPass=e};c.prototype.setLineWidth=function(a){var c=this._lineWidth;this._lineWidth!==a&&(this.gl.lineWidth(a),this._lineWidth=a);return c};
- c.prototype.setActiveTexture=function(a){var c=this._activeTextureUnit;0<=a&&a!==this._activeTextureUnit&&(this.gl.activeTexture(f.BASE_TEXTURE_UNIT+a),this._activeTextureUnit=a);return c};c.prototype.clear=function(a){a&&this.gl.clear(a)};c.prototype.drawArrays=function(a,c,b){this.gl.drawArrays(a,c,b)};c.prototype.drawElements=function(a,c,b,e){5123===b?this.gl.drawElements(a,c,b,e):5125===b&&this.gl.drawElements(a,c,b,e)};Object.defineProperty(c.prototype,"capabilities",{get:function(){return this._capabilities},
- enumerable:!0,configurable:!0});c.prototype.setViewport=function(a,c,b,e){var d=this._viewport;if(d.x!==a||d.y!==c||d.width!==b||d.height!==e)d.x=a,d.y=c,d.width=b,d.height=e,this.gl.viewport(a,c,b,e)};c.prototype.getViewport=function(){return{x:this._viewport.x,y:this._viewport.y,width:this._viewport.width,height:this._viewport.height}};c.prototype.bindProgram=function(a){a?this._activeShaderProgram!==a&&(a.initialize(),this.gl.useProgram(a.glName),this._activeShaderProgram=a):(this.gl.useProgram(null),
- this._activeShaderProgram=null)};c.prototype.bindTexture=function(a,d){void 0===d&&(d=0);-1===c._MAX_TEXTURE_IMAGE_UNITS&&(c._MAX_TEXTURE_IMAGE_UNITS=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS));(d>=c._MAX_TEXTURE_IMAGE_UNITS||0>d)&&console.error("Input texture unit is out of range of available units!");var b=this._textureUnitMap[d];this.setActiveTexture(d);null==a||null==a.glName?(null!=b&&(this.gl.bindTexture(b.descriptor.target,null),b.setBoundToUnit(d,!1)),this._textureUnitMap[d]=null):
- b&&b.id===a.id?a.applyChanges():(this.gl.bindTexture(a.descriptor.target,a.glName),a.setBoundToUnit(d,!0),a.applyChanges(),this._textureUnitMap[d]=a)};c.prototype.bindFramebuffer=function(a){a?this._activeFramebuffer!==a&&(a.initialize()||this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,a.glName),this._activeFramebuffer=a):(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this._activeFramebuffer=null)};c.prototype.bindBuffer=function(a){a&&(34962===a.bufferType?this._activeVertexBuffer=c._bindBuffer(this.gl,
- a,a.bufferType,this._activeVertexBuffer):this._activeIndexBuffer=c._bindBuffer(this.gl,a,a.bufferType,this._activeIndexBuffer))};c.prototype.unbindBuffer=function(a){34962===a?this._activeVertexBuffer=c._bindBuffer(this.gl,null,a,this._activeVertexBuffer):this._activeIndexBuffer=c._bindBuffer(this.gl,null,a,this._activeIndexBuffer)};c.prototype.bindVAO=function(a){a?this._activeVertexArrayObject&&this._activeVertexArrayObject.id===a.id||(a.bind(),this._activeVertexArrayObject=a):this._activeVertexArrayObject&&
- (this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null)};c.prototype.getBoundTexture=function(a){return this._textureUnitMap[a]};c.prototype.getBoundFramebufferObject=function(){return this._activeFramebuffer};c.prototype.getBoundVAO=function(){return this._activeVertexArrayObject};c.prototype.resetState=function(){this.bindProgram(null);this.bindVAO(null);this.bindFramebuffer(null);this.unbindBuffer(34962);this.unbindBuffer(34963);for(var a=0;a<this.parameters.maxTextureImageUnits;a++)this.bindTexture(null,
- a);this.setBlendingEnabled(!1);this.setBlendFunction(1,0);this.setBlendEquation(32774);this.setBlendColor(0,0,0,0);this.setFaceCullingEnabled(!1);this.setCullFace(1029);this.setFrontFace(2305);this.setPolygonOffsetFillEnabled(!1);this.setPolygonOffset(0,0);this.setScissorTestEnabled(!1);this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height);this.setDepthTestEnabled(!1);this.setDepthFunction(513);this.setDepthRange(0,1);this.setStencilTestEnabled(!1);this.setStencilFunction(519,0,0);this.setStencilOp(7680,
- 7680,7680);this.setClearColor(0,0,0,0);this.setClearDepth(1);this.setClearStencil(0);this.setColorMask(!0,!0,!0,!0);this.setStencilWriteMask(4294967295);this.setDepthWriteEnabled(!0);this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)};c.prototype.enforceState=function(){var a=this.gl,c=this._capabilities.vao;c&&c.bindVertexArray(null);for(var b=0;b<this.parameters.maxVertexAttributes;b++)a.disableVertexAttribArray(b);this._activeVertexBuffer?a.bindBuffer(this._activeVertexBuffer.bufferType,
- this._activeVertexBuffer.glName):a.bindBuffer(34962,null);this._activeIndexBuffer?a.bindBuffer(this._activeIndexBuffer.bufferType,this._activeIndexBuffer.glName):a.bindBuffer(34963,null);if(c&&this._activeVertexArrayObject){if(c=this._activeVertexArrayObject)this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null;this.bindVAO(c)}a.bindFramebuffer(a.FRAMEBUFFER,this._activeFramebuffer?this._activeFramebuffer.glName:null);a.useProgram(this._activeShaderProgram?this._activeShaderProgram.glName:
- null);a.blendColor(this._blendColorState.r,this._blendColorState.g,this._blendColorState.b,this._blendColorState.a);!0===this._blendEnabled?a.enable(this.gl.BLEND):a.disable(this.gl.BLEND);a.blendEquationSeparate(this._blendEquationState.mode,this._blendEquationState.modeAlpha);a.blendFuncSeparate(this._blendFunctionState.srcRGB,this._blendFunctionState.dstRGB,this._blendFunctionState.srcAlpha,this._blendFunctionState.dstAlpha);a.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,
- this._clearColor.a);a.clearDepth(this._clearDepth);a.clearStencil(this._clearStencil);a.colorMask(this._colorMaskState.r,this._colorMaskState.g,this._colorMaskState.b,this._colorMaskState.a);a.cullFace(this._cullFace);a.depthFunc(this._depthFunction);a.depthRange(this._depthRange.zNear,this._depthRange.zFar);!0===this._depthTestEnabled?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST);a.depthMask(this._depthWriteEnabled);a.frontFace(this._frontFace);a.lineWidth(this._lineWidth);!0===this._polygonCullingEnabled?
- a.enable(a.CULL_FACE):a.disable(a.CULL_FACE);a.polygonOffset(this._polygonOffset[0],this._polygonOffset[1]);!0===this._polygonOffsetFillEnabled?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL);a.scissor(this._scissorRect.x,this._scissorRect.y,this._scissorRect.width,this._scissorRect.height);!0===this._scissorTestEnabled?a.enable(a.SCISSOR_TEST):a.disable(a.SCISSOR_TEST);a.stencilFunc(this._stencilFunction.func,this._stencilFunction.ref,this._stencilFunction.mask);a.stencilOpSeparate(this._stencilOperation.face,
- this._stencilOperation.fail,this._stencilOperation.zFail,this._stencilOperation.zPass);!0===this._stencilTestEnabled?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST);a.stencilMask(this._stencilWriteMask);for(c=0;c<this.parameters.maxTextureImageUnits;c++)a.activeTexture(f.BASE_TEXTURE_UNIT+c),a.bindTexture(3553,null),(b=this._textureUnitMap[c])&&a.bindTexture(b.descriptor.target,b.glName);a.activeTexture(f.BASE_TEXTURE_UNIT+this._activeTextureUnit);a.viewport(this._viewport.x,this._viewport.y,this._viewport.width,
- this._viewport.height)};c._bindBuffer=function(a,c,b,e){if(!c)return a.bindBuffer(b,null),null;if(e===c)return e;a.bindBuffer(b,c.glName);return c};c._MAX_TEXTURE_IMAGE_UNITS=-1;return c}()})},"esri/views/webgl/enums":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.BASE_TEXTURE_UNIT=33984})},"esri/views/webgl/capabilities/load":function(){define("require exports ./DisjointTimerQuery ./Instancing ./isWebGL2Context ./VertexArrayObjects".split(" "),
- function(r,h,f,a,e,c){function g(a,b,c,f,g){if(f&&e.default(a))return!0;if(b[c])return!1;for(b=0;b<g.length;b++)if(a.getExtension(g[b]))return!0;return!1}Object.defineProperty(h,"__esModule",{value:!0});h.loadCapabilities=function(d,b){b=b&&b.disabledExtensions||{};var k=a.load(d,b),l=c.load(d,b),h;h=b.compressedTextureS3TC?null:(h=d.getExtension("WEBGL_compressed_texture_s3tc"))?{COMPRESSED_RGB_S3TC_DXT1:h.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:h.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:h.COMPRESSED_RGBA_S3TC_DXT3_EXT,
- COMPRESSED_RGBA_S3TC_DXT5:h.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null;var n;n=b.textureFilterAnisotropic?null:(n=d.getExtension("EXT_texture_filter_anisotropic")||d.getExtension("MOZ_EXT_texture_filter_anisotropic")||d.getExtension("WEBKIT_EXT_texture_filter_anisotropic"))?{MAX_TEXTURE_MAX_ANISOTROPY:n.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:n.TEXTURE_MAX_ANISOTROPY_EXT}:null;var t=f.load(d,b),u;if(e.default(d))u=b.colorBufferFloat||!d.getExtension("EXT_color_buffer_float")?null:{R16F:d.R16F,
- RG16F:d.RG16F,RGBA16F:d.RGBA16F,R32F:d.R32F,RG32F:d.RG32F,RGBA32F:d.RGBA32F,R11F_G11F_B10F:d.R11F_G11F_B10F};else if(d instanceof WebGLRenderingContext){u=!b.colorBufferFloat&&d.getExtension("EXT_color_buffer_half_float");var q=!b.colorBufferFloat&&d.getExtension("WEBGL_color_buffer_float");u=u||q?{RGBA16F:u?u.RGBA16F_EXT:void 0,RGBA32F:q?q.RGBA32F_EXT:void 0}:null}else u=void 0;q=e.default(d)?{MIN:d.MIN,MAX:d.MAX}:b.blendMinMax?null:(q=d.getExtension("EXT_blend_minmax"))?{MIN:q.MIN_EXT,MAX:q.MAX_EXT}:
- null;return{instancing:k,vao:l,compressedTextureS3TC:h,textureFilterAnisotropic:n,disjointTimerQuery:t,colorBufferFloat:u,blendMinMax:q,depthTexture:g(d,b,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),standardDerivatives:g(d,b,"standardDerivatives",!0,["OES_standard_derivatives"]),shaderTextureLOD:g(d,b,"shaderTextureLOD",!0,["EXT_shader_texture_lod"]),textureFloatLinear:g(d,b,"textureFloatLinear",!1,["OES_texture_float_linear"]),fragDepth:g(d,b,
- "fragDepth",!0,["EXT_frag_depth"])}}})},"esri/views/webgl/capabilities/DisjointTimerQuery":function(){define(["require","exports","./isWebGL2Context"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.load=function(a,e){if(e.disjointTimerQuery)return null;var c=a.getExtension("EXT_disjoint_timer_query")||a.getExtension("EXT_disjoint_timer_query_webgl2");return c?f.default(a)?{createQuery:function(){return a.createQuery()},resultAvailable:function(c){return a.getQueryParameter(c,a.QUERY_RESULT_AVAILABLE)},
- getResult:function(c){return a.getQueryParameter(c,a.QUERY_RESULT)},disjoint:function(){return a.getParameter(c.GPU_DISJOINT_EXT)},beginTimeElapsed:function(e){return a.beginQuery(c.TIME_ELAPSED_EXT,e)},endTimeElapsed:function(){return a.endQuery(c.TIME_ELAPSED_EXT)},createTimestamp:function(a){return c.queryCounterEXT(a,c.TIMESTAMP_EXT)},timestampBits:function(){return a.getQuery(c.TIMESTAMP_EXT,c.QUERY_COUNTER_BITS_EXT)}}:{createQuery:function(){return c.createQueryEXT()},resultAvailable:function(a){return c.getQueryObjectEXT(a,
- c.QUERY_RESULT_AVAILABLE_EXT)},getResult:function(a){return c.getQueryObjectEXT(a,c.QUERY_RESULT_EXT)},disjoint:function(){return a.getParameter(c.GPU_DISJOINT_EXT)},beginTimeElapsed:function(a){return c.beginQueryEXT(c.TIME_ELAPSED_EXT,a)},endTimeElapsed:function(){return c.endQueryEXT(c.TIME_ELAPSED_EXT)},createTimestamp:function(a){return c.queryCounterEXT(a,c.TIMESTAMP_EXT)},timestampBits:function(){return c.getQueryEXT(c.TIMESTAMP_EXT,c.QUERY_COUNTER_BITS_EXT)}}:null}})},"esri/views/webgl/capabilities/Instancing":function(){define(["require",
- "exports","./isWebGL2Context"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.load=function(a,e){return f.default(a)?{drawArraysInstanced:a.drawArraysInstanced.bind(a),drawElementsInstanced:a.drawElementsInstanced.bind(a),vertexAttribDivisor:a.vertexAttribDivisor.bind(a)}:e.angleInstancedArrays?null:(a=a.getExtension("ANGLE_instanced_arrays"))?{drawArraysInstanced:a.drawArraysInstancedANGLE.bind(a),drawElementsInstanced:a.drawElementsInstancedANGLE.bind(a),vertexAttribDivisor:a.vertexAttribDivisorANGLE.bind(a)}:
- null}})},"esri/views/webgl/capabilities/VertexArrayObjects":function(){define(["require","exports","./isWebGL2Context"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.load=function(a,e){return f.default(a)?{createVertexArray:a.createVertexArray.bind(a),deleteVertexArray:a.deleteVertexArray.bind(a),bindVertexArray:a.bindVertexArray.bind(a)}:e.vao?null:(a=a.getExtension("OES_vertex_array_object")||a.getExtension("MOZ_OES_vertex_array_object")||a.getExtension("WEBKIT_OES_vertex_array_object"))?
- {createVertexArray:a.createVertexArrayOES.bind(a),deleteVertexArray:a.deleteVertexArrayOES.bind(a),bindVertexArray:a.bindVertexArrayOES.bind(a)}:null}})},"esri/views/3d/layers/graphics/Graphics3DSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../core/Logger ../../../../core/scheduling ./constants ./ElevationContext ./featureExpressionInfoUtils ./Graphics3DSymbolCommonCode ./graphicUtils ../../support/PromiseLightweight".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){function n(a,b){a=null!=a?b.attributes[a]:0;null!=a&&isFinite(a)||(a=0);return a}var t=new d,u=e.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer"),q={mode:"on-the-ground",offset:0,unit:"meters"},v={mode:"absolute-height",offset:0,unit:"meters"};return function(e){function m(a,b,c,f){var g=e.call(this)||this;g._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0};g.symbolContainer=a;g.symbol=b;g._context=c;g._symbolLayerOrder=c.layerOrder;
- g._symbolLayerOrderDelta=c.layerOrderDelta;g._elevationContext=new d;g._material=null;g._geometryCreationWarningHandle=null;g._updateDrivenProperties(f);g._updateElevationContext();g._prepareResources();return g}f(m,e);m.prototype._logWarning=function(a){u.warn(a)};m.prototype._logGeometryCreationWarnings=function(a,b,d,e){var f=this;if(null==this._geometryCreationWarningHandle){var g=a.geometryData&&a.geometryData.polygons;e+=" geometry failed to be created";var k=null;a.projectionSuccess?!b.length||
- 1===b.length&&!b[0].length?k=e+" (no "+d+" were defined)":Array.isArray(b)&&Array.isArray(b[0])?b.some(function(a){return 1===a.length})?k=e+" ("+d+" should contain at least 2 vertices)":g&&0===g.length&&"rings"===d&&(k=e+" (filled "+d+" should use clockwise winding - try reversing the order of vertices)"):k=e+" ("+d+" should be defined as a 2D array)":k=e+" (failed to project geometry to view spatial reference)";k&&(this._geometryCreationWarningHandle=c.schedule(function(){return f._onNextTick()}),
- this._logWarning(k))}};m.prototype._onNextTick=function(){this._geometryCreationWarningHandle=null};m.prototype._getGeometryCentroid=function(a){a=this._validateGeometry(a.geometry);switch(a.type){case "extent":return a.center;case "polyline":return k.placePointOnPolyline(a);case "polygon":return k.placePointOnPolygon(a);case "point":return a;case "mesh":return a.extent.center;default:return this._logWarning("unsupported geometry type: "+a.type),null}};m.prototype._validateGeometry=function(a){switch(a.type){case "point":if(null==
- a.x||null==a.y){this._logWarning("point coordinate is null - setting to default value");var b=a.clone();b.x=a.x||0;b.y=a.y||0;return b}}return a};m.prototype._prepareResources=function(a){throw Error("This is an abstract base class");};m.prototype._defaultElevationInfoNoZ=function(){return q};m.prototype._defaultElevationInfoZ=function(){return v};m.prototype._updateElevationContext=function(){this._elevationContext.setDefaults();var a=this._context.layer.elevationInfo;a&&this._elevationContext.mixinApi(a);
- (a=this.symbol&&this.symbol.elevationInfo)&&this._elevationContext.mixinApi(a);this._elevationContext.featureExpressionInfoContext=this._context.featureExpressionInfoContext};m.prototype.getGraphicElevationContext=function(a){var c=a.geometry.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ();t.setUnit(null!=this._elevationContext.unit?this._elevationContext.unit:c.unit);t.mode=this._elevationContext.mode||c.mode;t.setOffsetMeters(null!=this._elevationContext.meterUnitOffset?this._elevationContext.meterUnitOffset:
- c.offset);t.featureExpressionInfoContext=this._elevationContext.featureExpressionInfoContext;t.hasOffsetAdjustment=!1;this._elevationOptions.supportsOnTheGround||"on-the-ground"!==t.mode||(t.mode="relative-to-ground",t.setOffsetMeters(0),t.featureExpressionInfoContext=b.zeroContext);c=b.createFeature(a);b.setContextFeature(t.featureExpressionInfoContext,c);k.needsOffsetAdjustment(t,this._elevationOptions,a.geometry,this.symbolContainer)&&(t.setOffsetRenderUnits(g.defaultIconElevationOffset),t.hasOffsetAdjustment=
- !0);return t};m.prototype._getDrapedZ=function(){return-2};m.prototype._updateDrivenProperties=function(a){var b={color:!1,opacity:!1,size:!1};!a&&(a=this._context.renderer)&&(b.color=!!a.colorInfo,b.size=!!a.sizeInfo,a.visualVariables&&a.visualVariables.forEach(function(a){switch(a.type){case "color":b.color=!0;if(a.colors)for(var c=0;c<a.colors.length;c++){var d=a.colors[c];d&&(Array.isArray(d)&&3<d.length&&255!==d[3]||void 0!==d.a&&255!==d.a)&&(b.opacity=!0)}if(a.stops)for(c=0;c<a.stops.length;c++)(d=
- a.stops[c].color)&&(Array.isArray(d)&&3<d.length&&255!==d[3]||void 0!==d.a&&255!==d.a)&&(b.opacity=!0);break;case "opacity":b.opacity=!0;break;case "size":b.size=!0}}));this._drivenProperties=b};m.prototype._isPropertyDriven=function(a){return this._drivenProperties[a]};m.prototype._getLayerOpacity=function(){if(this._context.layerView&&"fullOpacity"in this._context.layerView)return this._context.layerView.fullOpacity;var a=this._context.layer.opacity;return null==a?1:a};m.prototype._getMaterialOpacity=
- function(){var a;a=1*this._getLayerOpacity();var b=this.symbol&&this.symbol.material;b&&!this._isPropertyDriven("opacity")&&b.color&&(a*=b.color.a);return a};m.prototype._getMaterialOpacityAndColor=function(){var b=this.symbol&&this.symbol.material,c=this._getMaterialOpacity(),b=!this._isPropertyDriven("color")&&b&&b.color?a.toUnitRGB(b.color):null;return l.mixinColorAndOpacity(b,c)};m.prototype._getVertexOpacityAndColor=function(a,b,c){var d=this._isPropertyDriven("color")?a.color:null;a=this._isPropertyDriven("opacity")?
- a.opacity:null;d=l.mixinColorAndOpacity(d,a);c&&(d[0]*=c,d[1]*=c,d[2]*=c,d[3]*=c);return b?new b(d):d};m.prototype._getStageIdHint=function(){return this._context.layer.id+"_symbol"};m.prototype.isFastUpdatesEnabled=function(){return this._fastUpdates&&this._fastUpdates.enabled};m.prototype.setDrawOrder=function(a,b,c){this._material&&(this._material.renderPriority=a,c[this._material.id]=!0)};m.prototype.createGraphics3DGraphic=function(a,b){for(var c=2;c<arguments.length;c++);throw Error("This is an abstract base class");
- };m.prototype.destroy=function(){this._geometryCreationWarningHandle&&(this._geometryCreationWarningHandle.remove(),this._geometryCreationWarningHandle=null)};m.prototype.layerPropertyChanged=function(a,b,c){return!1};m.prototype.applyRendererDiff=function(a,b,c,d){return!1};m.prototype._getFastUpdateAttrValues=function(a){if(!this._fastUpdates.enabled)return null;var b=this._fastUpdates.visualVariables,c=b.size?n(b.size.field,a):0;a=b.color?n(b.color.field,a):0;return[c,a,0,0]};return m}(p.Promise)})},
- "esri/views/3d/layers/graphics/constants":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.defaultIconElevationOffset=1})},"esri/views/3d/support/PromiseLightweight":function(){(function(r){function h(a){this._callbacks=[];this._errbacks=[];this._cancelCallback=a;this._iserr=this._isdone=this._iscancelled=!1}function f(a,c){var e=new h;0===a.length?e.done.apply(e,c):a[0].apply(null,c).then(function(){a.splice(0,1);f(a,arguments).then(function(){e.done.apply(e,
- arguments)})});return e}h.prototype.cancel=function(a){this._callbacks=[];this._errbacks=[];this._iscancelled=!0;this._cancelCallback&&this._cancelCallback(a)};h.prototype.then=function(a,c,f){var d;if(!this._iscancelled)return this._isdone?d=a.apply(f,this.result):this._iserr&&c?d=c.apply(f,this.result):(this._callbacks.push(function(){return a.apply(f,arguments)}),c&&this._errbacks.push(function(){return c.apply(f,arguments)})),d};h.prototype.done=function(){this.result=arguments;this._isdone=!0;
- for(var a=0;a<this._callbacks.length;a++)this._callbacks[a].apply(null,arguments);this._callbacks=[];this._errbacks=[]};h.prototype.resolve=h.prototype.done;h.prototype.reject=function(){if(!this._iscancelled){this.result=arguments;this._iserr=!0;for(var a=0;a<this._errbacks.length;a++)this._errbacks[a].apply(null,arguments);this._callbacks=[];this._errbacks=[]}};h.prototype.isRejected=function(){return this._iserr};h.prototype.isFulfilled=function(){return this._isdone||this._iserr};h.prototype.isResolved=
- function(){return this._isdone};h.prototype.isCancelled=function(){return this._iscancelled};var a={Promise:h,join:function(a){function c(a,c){return function(){c&&(l=!0);b+=1;f[a]=Array.prototype.slice.call(arguments);b===d&&(l?e.reject():e.done(f))}}for(var e=new h,d=a.length,b=0,f=[],l=!1,p=0;p<d;p++)a[p].then(c(p,!1),c(p,!0));0===a.length&&e.done();return e},chain:f};"function"===typeof define&&define.amd?define(function(){return a}):r.promise=a})(this)},"esri/views/3d/webgl-engine/lib/Geometry":function(){define("require exports ./BoundingInfo ./ComponentUtils ./geometryDataUtils ./IdGen ./Util ./Util".split(" "),
- function(r,h,f,a,e,c,g,d){return function(){function b(a,c,d){this.singleUse=!1;this.componentAABB=null;this.id=b.__idGen.gen(c);this.data=a;this.boundingInfo=d}b.prototype.getData=function(){return this.data};b.prototype.getComponentCount=function(){return a.componentCount(this.data.componentOffsets)};b.prototype.getComponentAABB=function(a,b){null==this.componentAABB&&(this.componentAABB=this._computeComponentAABB());for(var c=0;6>c;c++)b[c]=this.componentAABB[6*a+c];return b};b.prototype._computeComponentAABB=
- function(){for(var a=this.getComponentCount(),b=new Float32Array(6*a),c=0;c<a;c++)this._calculateAABB(c,b,6*c);return b};b.prototype._calculateAABB=function(a,b,c){void 0===c&&(c=0);var e=this.data.getIndices(d.VertexAttrConstants.POSITION),f=this.data.getAttribute(d.VertexAttrConstants.POSITION),g=this.data.componentOffsets,k=g.length?g[a+1]:e.length,l=Infinity,h=Infinity,m=Infinity,p=-Infinity,z=-Infinity,r=-Infinity,A=f.offsetIdx,D=f.strideIdx;for(a=g.length?g[a]:0;a<k;a++)var E=A+D*e[a],g=f.data[E],
- F=f.data[E+1],E=f.data[E+2],l=Math.min(l,g),h=Math.min(h,F),m=Math.min(m,E),p=Math.max(p,g),z=Math.max(z,F),r=Math.max(r,E);b?(b[c]=l,b[c+1]=h,b[c+2]=m,b[c+3]=p,b[c+4]=z,b[c+5]=r):b=[l,h,m,p,z,r];return b};b.prototype.calculateBoundingInfo=function(){var a=this.data.getIndices(d.VertexAttrConstants.POSITION),b=this.data.getAttribute(d.VertexAttrConstants.POSITION),c="triangle"===this.data.primitiveType?3:1;if(0===a.length)for(var a=new Uint32Array(c),h=0;h<c;++h)a[h]=h;h=a.length;g.assert(0===h%c);
- h=e.generateDefaultIndexArray(h/c);return new f(h,c,a,b)};b.prototype.getBoundingInfo=function(){null==this.boundingInfo&&(this.boundingInfo=this.calculateBoundingInfo());return this.boundingInfo};b.prototype.invalidateBoundingInfo=function(){this.boundingInfo=null};b.__idGen=new c;return b}()})},"esri/views/3d/webgl-engine/lib/BoundingInfo":function(){define(["require","exports","./gl-matrix","./Util"],function(r,h,f,a){var e=f.vec3d;return function(){function c(c,d,b,f){a.assert(1<=c.length);a.assert(0===
- b.length%d);a.assert(b.length>=c.length*d);a.assert(3===f.size||4===f.size);this.primitiveIndices=c;this.indices=b;this._position=f;this._numIndexPerPrimitive=d;var g=f.data,k=f.offsetIdx;f=f.strideIdx;var h=c.length,t=k+f*b[d*c[0]];this.bbMin=e.createFrom(g[t],g[t+1],g[t+2]);this.bbMax=e.create(this.bbMin);for(var u=0;u<h;++u)for(var q=d*c[u],v=0;v<d;++v)t=k+f*b[q+v],this.bbMin[0]=Math.min(g[t],this.bbMin[0]),this.bbMax[0]=Math.max(g[t],this.bbMax[0]),++t,this.bbMin[1]=Math.min(g[t],this.bbMin[1]),
- this.bbMax[1]=Math.max(g[t],this.bbMax[1]),++t,this.bbMin[2]=Math.min(g[t],this.bbMin[2]),this.bbMax[2]=Math.max(g[t],this.bbMax[2]);this.center=e.create();this.bsRadius=0;e.lerp(this.bbMin,this.bbMax,.5,this.center);for(u=0;u<h;++u)for(q=d*c[u],v=0;v<d;++v){var t=k+f*b[q+v],x=g[t]-this.center[0],m=g[t+1]-this.center[1],t=g[t+2]-this.center[2];this.bsRadius=Math.max(x*x+m*m+t*t,this.bsRadius)}this.bsRadius=Math.sqrt(this.bsRadius)}c.prototype.getCenter=function(){return this.center};c.prototype.getBSRadius=
- function(){return this.bsRadius};c.prototype.getBBMin=function(){return this.bbMin};c.prototype.getBBMax=function(){return this.bbMax};c.prototype.getPrimitiveIndices=function(){return this.primitiveIndices};c.prototype.getIndices=function(){return this.indices};c.prototype.getPosition=function(){return this._position};c.prototype.getChildren=function(){if(this.children)return this.children;if(1<e.dist2(this.bbMin,this.bbMax)){for(var a=e.lerp(this.bbMin,this.bbMax,.5,e.create()),d=this.primitiveIndices.length,
- b=new Uint8Array(d),f=Array(8),l=0;8>l;++l)f[l]=0;for(var l=this._position,h=l.data,n=l.offsetIdx,t=l.strideIdx,l=0;l<d;++l){for(var u=0,q=this._numIndexPerPrimitive*this.primitiveIndices[l],v=n+t*this.indices[q],x=h[v],m=h[v+1],B=h[v+2],z=1;z<this._numIndexPerPrimitive;++z){var v=n+t*this.indices[q+z],r=h[v],A=h[v+1],v=h[v+2];r<x&&(x=r);A<m&&(m=A);v<B&&(B=v)}x<a[0]&&(u|=1);m<a[1]&&(u|=2);B<a[2]&&(u|=4);b[l]=u;++f[u]}for(l=a=0;8>l;++l)0<f[l]&&++a;if(2>a)return;a=Array(8);for(l=0;8>l;++l)a[l]=0<f[l]?
- new Uint32Array(f[l]):void 0;for(l=0;8>l;++l)f[l]=0;for(l=0;l<d;++l)u=b[l],a[u][f[u]++]=this.primitiveIndices[l];this.children=Array(8);for(l=0;8>l;++l)void 0!==a[l]&&(this.children[l]=new c(a[l],this._numIndexPerPrimitive,this.indices,this._position))}return this.children};return c}()})},"esri/views/3d/layers/graphics/Graphics3DSymbol":function(){define("require exports ../../../../core/tsSupport/extendsHelper ./Graphics3DGraphic ./Graphics3DSymbolLayerFactory ../../support/PromiseLightweight".split(" "),
- function(r,h,f,a,e,c){return function(c){function d(a,d,f){var b=c.call(this)||this;b.symbol=a;a=a.symbolLayers;f&&(a=f.concat(a));f=a.length;b.childGraphics3DSymbols=Array(a.length);b.childGraphics3DSymbolPromises=Array(a.length);for(var g=d.layerOrder,k=0,l=0,h=!1,v=function(a,b){b&&(this.childGraphics3DSymbols[a]=b,l++);k--;!this.isRejected()&&h&&1>k&&(0<l?this.resolve():this.reject())},x=0;x<f;x++){var m=a.getItemAt(x);!1!==m.enabled&&(d.layerOrder=g+(1-(1+x)/f),d.layerOrderDelta=1/f,m=e.make(b.symbol,
- m,d,m._ignoreDrivers))&&(k++,b.childGraphics3DSymbolPromises[x]=m,m.then(v.bind(b,x,m),v.bind(b,x,null)))}d.layerOrder=g;h=!0;!b.isRejected()&&1>k&&b.resolve();return b}f(d,c);d.prototype.createGraphics3DGraphic=function(b,c,d){for(var e=Array(this.childGraphics3DSymbols.length),f=0;f<this.childGraphics3DSymbols.length;f++){var g=this.childGraphics3DSymbols[f];g&&(e[f]=g.createGraphics3DGraphic(b,c))}return new a(b,d||this,e)};d.prototype.layerPropertyChanged=function(a,c){for(var b=this.childGraphics3DSymbols.length,
- d=function(b){var d=e.childGraphics3DSymbols[b],f=function(a){return a._graphics[b]};if(d&&!d.layerPropertyChanged(a,c,f))return{value:!1}},e=this,f=0;f<b;f++){var g=d(f);if("object"===typeof g)return g.value}return!0};d.prototype.applyRendererDiff=function(a,c,d){return this.isResolved()?this.childGraphics3DSymbols.reduce(function(b,e,f){return b&&(!e||e.applyRendererDiff(a,c,d,f))},!0):!1};d.prototype.getFastUpdateStatus=function(){var a=0,c=0,d=0;this.childGraphics3DSymbolPromises.forEach(function(b){b&&
- !b.isFulfilled()?a++:b&&b.isFastUpdatesEnabled()?d++:b&&c++});return{loading:a,slow:c,fast:d}};d.prototype.setDrawOrder=function(a,c){for(var b=this.childGraphics3DSymbols.length,d=1/b,e=0;e<b;e++){var f=this.childGraphics3DSymbols[e];f&&f.setDrawOrder(a+(1-(1+e)/b),d,c)}};d.prototype.destroy=function(){this.isFulfilled()||this.reject();for(var a=0;a<this.childGraphics3DSymbolPromises.length;a++)this.childGraphics3DSymbolPromises[a]&&this.childGraphics3DSymbolPromises[a].destroy()};return d}(c.Promise)})},
- "esri/views/3d/layers/graphics/Graphics3DSymbolLayerFactory":function(){define("require exports ../../../../core/Logger ./Graphics3DExtrudeSymbolLayer ./Graphics3DIconSymbolLayer ./Graphics3DLineSymbolLayer ./Graphics3DMeshFillSymbolLayer ./Graphics3DObjectSymbolLayer ./Graphics3DPathSymbolLayer ./Graphics3DPolygonFillSymbolLayer ./Graphics3DTextSymbolLayer".split(" "),function(r,h,f,a,e,c,g,d,b,k,l){Object.defineProperty(h,"__esModule",{value:!0});var p=f.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayerFactory");
- h.make=function(a,b,c,d){var e=t[a.type]&&t[a.type][b.type]||n[b.type];return e?new e(a,b,c,d):(p.error("GraphicsLayerFactory#make","unknown symbol type "+b.type),null)};var n={icon:e,object:d,line:c,path:b,fill:k,extrude:a,text:l},t={"mesh-3d":{fill:g}}})},"esri/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/libs/earcut/earcut ../../../../geometry/Point ../../../../geometry/Polygon ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ../support/edgeUtils ../../lib/glMatrix ../../support/projectionUtils ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Util ../../webgl-engine/materials/DefaultMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m){function B(a,b,c,d,e,f,g,k,l,h,m,n,p,t){var q=c.length/3,u=0;m+=2*d.count;var v=d.index,z=d.count,x=l,B=m;D.set(p,I);var r=0<n?1:-1,v=3*v,A=x;p=3*A;for(var E=x+z,x=3*E,L=0;L<z;++L)t&&(I[0]=a[v+0],I[1]=a[v+1],I[2]=a[v+2],D.normalize(I)),e[p+0]=a[v+0],e[p+1]=a[v+1],e[p+2]=a[v+2],f[p+0]=b[v+0],f[p+1]=b[v+1],f[p+2]=b[v+2],g[p+0]=-r*I[0],g[p+1]=-r*I[1],g[p+2]=-r*I[2],k[A]=0,e[x+0]=a[v+0]+n*I[0],e[x+1]=a[v+1]+n*I[1],e[x+2]=a[v+2]+n*I[2],f[x+0]=b[v+0],f[x+
- 1]=b[v+1],f[x+2]=b[v+2],g[x+0]=r*I[0],g[x+1]=r*I[1],g[x+2]=r*I[2],k[E]=n,p+=3,x+=3,v+=3,A+=1,E+=1;v=0;p=3*B;x=3*(B+q);p=3*(B+q);x=3*B;a=P;b=G;0>n&&(a=G,b=P);for(L=0;L<q;++L)h[p+0]=c[v+a[0]],h[p+1]=c[v+a[1]],h[p+2]=c[v+a[2]],h[x+0]=c[v+b[0]]+z,h[x+1]=c[v+b[1]]+z,h[x+2]=c[v+b[2]]+z,p+=3,x+=3,v+=3;l+=2*d.count;m=m+2*q-(2*d.count+2*q);C(e,f,k,g,u,d.pathLengths[0],d.count,l,h,m,n);l+=4*d.pathLengths[0];m+=2*d.pathLengths[0];u+=d.pathLengths[0];for(c=1;c<d.pathLengths.length;++c)C(e,f,k,g,u,d.pathLengths[c],
- d.count,l,h,m,n),l+=4*d.pathLengths[c],m+=2*d.pathLengths[c],u+=d.pathLengths[c]}function z(a,b,c,d,e,f,g){d[f]=d[g];g*=3;f*=3;a[f+0]=a[g+0];a[f+1]=a[g+1];a[f+2]=a[g+2];b[f+0]=b[g+0];b[f+1]=b[g+1];b[f+2]=b[g+2];c[f+0]=e[0];c[f+1]=e[1];c[f+2]=e[2]}function C(a,b,c,d,e,f,g,k,l,h,m){var n=e,p=e+1,t=e+g,q=e+g+1,u=k,v=k+1,x=k+2*f;k=k+2*f+1;0>m&&(n=e+g+1,q=e);h*=3;for(var B=0;B<f;++B){B===f-1&&(0<m?(p=e,q=e+g):(p=e,n=e+g));var r=a,C=n,A=p,E=t,L=J,C=3*C,A=3*A,E=3*E;D.set3(r[C++],r[C++],r[C++],O);D.set3(r[A++],
- r[A++],r[A++],N);D.set3(r[E++],r[E++],r[E++],S);D.subtract(N,O,R);D.subtract(S,O,Y);D.cross(Y,R,L);D.normalize(L,L);z(a,b,d,c,J,u,n);z(a,b,d,c,J,v,p);z(a,b,d,c,J,x,t);z(a,b,d,c,J,k,q);l[h++]=u;l[h++]=x;l[h++]=k;l[h++]=u;l[h++]=k;l[h++]=v;n++;p++;t++;q++;u+=2;v+=2;x+=2;k+=2}}var A=x.VertexAttrConstants,D=p.vec3d,E=p.mat4d,F=D.create(),I=D.create(),P=[0,2,1],G=[0,1,2],M=new e,H={verticalDistanceToGround:0,terrainElevation:0};r=function(b){function e(){var a=null!==b&&b.apply(this,arguments)||this;a._edgeStageObjects=
- new Set;return a}f(e,b);e.prototype._prepareResources=function(){if(!this._isPropertyDriven("size")){var a=k.validateSymbolLayerSize(this._getSymbolSize());if(a){this._logWarning(a);this.reject();return}}var a=this._getStageIdHint(),b=this._getMaterialOpacityAndColor(),c=D.create(b),b=b[3],c={diffuse:c,ambient:c,opacity:b,transparent:1>b||this._isPropertyDriven("opacity"),vertexColors:!0};this._material=new m(c,a+"_3dlinemat");this._context.stage.add(t.ModelContentType.MATERIAL,this._material);this.resolve()};
- e.prototype.destroy=function(){b.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&this._context.stage.remove(t.ModelContentType.MATERIAL,this._material.id)};e.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("polygon"!==c.type&&"extent"!==c.type)return this._logWarning("unsupported geometry type for extrude symbol: "+c.type),null;var c="polygon"===c.type||"extent"===c.type?"rings":"paths",d="graphic"+a.uid,e=this._getVertexOpacityAndColor(b,
- Float32Array,255),f=this.getGraphicElevationContext(a);return this._createAs3DShape(a,c,b,e,f,d,a.uid)};e.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a){b=this._getMaterialOpacity();c=1>b||this._isPropertyDriven("opacity");this._material.setParameterValues({opacity:b,transparent:c});if(0<this._edgeStageObjects.size){var e=this._context.stage.view.getEdgeView(),f=this._getLayerOpacity(),g=this.symbol.edges?this.symbol.edges.color.a:0;this._edgeStageObjects.forEach(function(a){e.updateComponentOpacity(a,
- 0,g*f)})}return!0}if("elevationInfo"===a){this._updateElevationContext();for(var k in b){var l=b[k];if(a=c(l))l=this.getGraphicElevationContext(l.graphic),a.needsElevationUpdates=d.needsElevationUpdates3D(l.mode),a.elevationContext.set(l)}return!0}return!1};e.prototype._getExtrusionSize=function(a){a=a.size&&this._isPropertyDriven("size")?d.getSingleSizeDriver(a.size,2):this._getSymbolSize();return a/=this._context.renderCoordsHelper.unitInMeters};e.prototype._getSymbolSize=function(){return this.symbol.size||
- 1};e.prototype._createAs3DShape=function(b,e,f,k,h,m,p){var t=this,q=b.geometry;"extent"===q.type&&(q=c.fromExtent(q));b=q[e];var z=q.hasZ,x=[],r=[],C=[],L=D.create(),V=Array(6),S=this._context.renderSpatialReference===n.SphericalECEFSpatialReference,w=this._getExtrusionSize(f),K=D.create();S||this._context.renderCoordsHelper.worldUpAtPosition(null,K);f=d.getGeometryVertexData3D(b,z,q.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,
- h);this._logGeometryCreationWarnings(f,b,e,"ExtrudeSymbol3DLayer");if(0<b.length){var I=f.geometryData.polygons,ca=f.eleVertexData,N=f.vertexData;e=N.length/3;var P=new Float64Array(18*e),G=new Float64Array(18*e),J=new Float64Array(18*e),U=new Float64Array(6*e),R=0;e=function(b){var c=I[b],e=c.count,f=c.index;if(da._context.clippingExtent&&(d.computeBoundingBox(ca,f,e,V),d.boundingBoxClipped(V,da._context.clippingExtent)))return"continue";var g=new Float64Array(ca.buffer,3*f*P.BYTES_PER_ELEMENT,3*
- e),l=c.holeIndices.map(function(a){return a-f}),g=a(g,l,3);if(0<g.length){d.chooseOrigin(N,f,e,L);var l=new Uint32Array(6*e+2*g.length),h=6*e,n=new Float64Array(P.buffer,3*R*P.BYTES_PER_ELEMENT,3*h),p=new Float64Array(G.buffer,3*R*G.BYTES_PER_ELEMENT,3*h),t=new Float64Array(J.buffer,3*R*J.BYTES_PER_ELEMENT,3*h),q=new Float64Array(U.buffer,1*R*U.BYTES_PER_ELEMENT,1*h);B(N,ca,g,c,n,t,p,q,0,l,0,w,K,S);d.subtractCoordinates(n,0,h,L);R+=6*e;c=da._createExtrudeGeometry(l,{positions:n,elevation:t,normals:p,
- heights:q},k);b=new u(c,m+"path"+b);b.singleUse=!0;x.push(b);r.push([da._material]);b=E.identity();E.translate(b,L,b);C.push(b)}};var da=this;for(b=0;b<I.length;++b)e(b);if(0<x.length){p=new v({geometries:x,materials:r,transformations:C,castShadow:!0,metadata:{layerUid:this._context.layer.uid,graphicId:p},idHint:m});var ga=function(a){var b=t._context.stage.view.getEdgeView();if(b){b.removeObject(a);t._edgeStageObjects.delete(a);var c=l.createMaterial(b,t.symbol,t._getLayerOpacity());c&&(t._edgeStageObjects.add(a),
- b.addObject(a,[c]))}};ga(p);p=new g(this,p,x,null,null,function(a,b,c,e){var f=e.setAltitude;M.spatialReference=c.spatialReference;for(var g=a.getGeometryRecords(),k=g.length,l="absolute-height"!==b.mode,h=0,m=0;m<k;m++){var n=g[m].geometry,p=g[m].transformation,t=n.getData();Q[0]=p[12];Q[1]=p[13];Q[2]=p[14];n.invalidateBoundingInfo();for(var t=t.getVertexAttr(),n=t[A.POSITION].data,p=t[A.SIZE].data,t=t.mapPos.data,q=n.length/3,u=0,v=0,z=!1,x=0,B=0;B<q;B++){M.x=t[v];M.y=t[v+1];M.z=t[v+2];X[0]=n[u];
- X[1]=n[u+1];X[2]=n[u+2];var r=d.computeElevation(c,M,b,e,l?H:null);l&&(x+=H.terrainElevation);F[0]=n[u]+Q[0];F[1]=n[u+1]+Q[1];F[2]=n[u+2]+Q[2];f(r+p[u/3],F);n[u]=F[0]-Q[0];n[u+1]=F[1]-Q[1];n[u+2]=F[2]-Q[2];r=.01/e.unitInMeters;if(Math.abs(X[0]-n[u])>r||Math.abs(X[1]-n[u+1])>r||Math.abs(X[2]-n[u+2])>r)z=!0;v+=3;u+=3}z&&a.geometryVertexAttrsUpdated(m);h+=x/q}b=h/k;ga(a);return b},h);p.alignedTerrainElevation=f.terrainElevation;p.needsElevationUpdates=d.needsElevationUpdates3D(h.mode);return p}}return null};
- e.prototype._createExtrudeGeometry=function(a,b,c){for(var d=a.length,e=new Uint32Array(d),f=0;f<d;f++)e[f]=0;d={};f={};d[A.POSITION]=a;d[A.NORMAL]=a;d[A.COLOR]=e;f[A.POSITION]={size:3,data:b.positions};f[A.NORMAL]={size:3,data:b.normals};f[A.COLOR]={size:4,data:c};f[A.SIZE]={size:1,data:b.heights};b.elevation&&(f.mapPos={size:3,data:b.elevation},d.mapPos=a);return new q(f,d)};return e}(b);var J=D.create(),O=D.create(),N=D.create(),S=D.create(),R=D.create(),Y=D.create(),X=D.create(),Q=D.create();
- return r})},"esri/views/3d/layers/support/edgeUtils":function(){define(["require","exports","../../../../Color","../../../../core/screenUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.createMaterial=function(e,c,g){c=c&&c.enabled&&c.edges;if(!c||0===c.color.a||0===g)return null;var d=f.toUnitRGBA(c.color);d[3]*=g;switch(c.type){case "solid":return e.createSolidEdgeMaterial({color:d,size:a.pt2px(c.size),extensionLength:a.pt2px(c.extensionLength)});case "sketch":return e.createSketchEdgeMaterial({color:d,
- size:a.pt2px(c.size),extensionLength:a.pt2px(c.extensionLength)})}}})},"esri/views/3d/layers/graphics/Graphics3DIconSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/when dojo/_base/lang dojo/errors/CancelError ../../../../Color ../../../../core/Error ../../../../core/screenUtils ../../../../core/sniff ../../../../core/urlUtils ../../../../geometry/Polygon ../../../../symbols/support/symbolUtils ./ElevationAligners ./Graphics3DDrapedGraphicLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ./SignedDistanceFunctions ../support/FastSymbolUpdates ../../lib/glMatrix ../../support/projectionUtils ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/lib/Texture ../../webgl-engine/materials/HUDMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G){function M(a){return"cross"===a||"x"===a}function H(a){var b;"primitive:"===a.substring(0,10)&&(a=a.substring(10));switch(a){case K.PRIM_CIRCLE:b=B.computeSignedDistancefieldCicle(128,64);break;case K.PRIM_SQUARE:b=B.computeSignedDistancefieldSquare(128,64,!1);break;case K.PRIM_KITE:b=B.computeSignedDistancefieldSquare(128,64,!0);break;case K.PRIM_CROSS:b=B.computeSignedDistancefieldCrossAndX(128,64,!1);break;case K.PRIM_X:b=B.computeSignedDistancefieldCrossAndX(128,
- 64,!0)}return new P(b,"sdf_"+a,{mipmap:!1,wrapClamp:!0,width:128,height:128,components:4})}var J=C.vec3d;r=C.vec4d;var O=C.mat4d.identity(),N=[0,0,1],S=[0,0,0,0],R=[0,0,0],Y=[1,1,1],X="center bottom top left right bottom-left bottom-right top-left top-right".split(" "),Q=[.25,.25,.75,.75],K={PRIM_CIRCLE:"circle",PRIM_SQUARE:"square",PRIM_CROSS:"cross",PRIM_X:"x",PRIM_KITE:"kite"},L=[64,64];x=function(h){function x(){var a=null!==h&&h.apply(this,arguments)||this;a._elevationOptions={supportsOffsetAdjustment:!0,
- supportsOnTheGround:!0};return a}f(x,h);x.prototype._prepareResources=function(){var a=this.symbol,c=Math.round(null!=a.size?b.pt2px(a.size):16);this._size=null;this._symbolTextureRatio=1;this._primitive=null;var d=this._getStageIdHint();if(!this._isPropertyDriven("size")){var e=m.validateSymbolLayerSize(c);if(e){this._logWarning(e);this.reject();return}}this._isPropertyDriven("size")&&64>c&&(c=64);var f=a.resource||{primitive:"circle",href:void 0},e={anchorPos:this._getAnchorPos(a)},g=this.symbolContainer;
- if(this._hasVisibleVerticalOffset(g)){var g=g.verticalOffset,k=g.minWorldLength,l=g.maxWorldLength;e.verticalOffset={screenLength:b.pt2px(g.screenLength),minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);f.href?(this._outlineSize=this._getOutlineSize(a,null),e.color=this._getFillColor(a,null),e.outlineColor=this._getOutlineColor(a),e.outlineSize=this._outlineSize,
- e.textureIsSignedDistanceField=!1,this._prepareImageResources(c,e,d)):(f=f.primitive||"circle",g="primitive:"+f,this._primitive=f,this._outlineSize=this._getOutlineSize(a,f),e.color=this._getFillColor(a,f),e.outlineColor=this._getOutlineColor(a),e.outlineSize=this._outlineSize,M(f)&&0===e.outlineSize?this.reject():(this.texture=this._context.sharedResources.textures.acquire(g,H),this._textureURI=g,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=Q,e.textureId=this.texture.id,this._size=
- [c,c],this._symbolTextureRatio=2,this._createMaterialsAndAddToStage(e,this._context.stage,d),this.resolve()))};x.prototype._getOutlineSize=function(a,c){var d=0,d=a.outline&&null!=a.outline.size?b.pt2px(a.outline.size):M(c)?1.5:0;return Math.max(d,0)};x.prototype._getOutlineColor=function(a){var b=this._getLayerOpacity();if(a.outline&&null!=a.outline.color){var c=g.toUnitRGB(a.outline.color);return[c[0],c[1],c[2],a.outline.color.a*b]}return[0,0,0,b]};x.prototype._getFillColor=function(a,b){return M(b)?
- S:this._getMaterialOpacityAndColor()};x.prototype._getAnchorPos=function(a){return-1<X.indexOf(a.anchor)?a.anchor:"center"};x.prototype._prepareImageResources=function(b,e,f){var g=this,h=n.getIconHref(this.symbolContainer,this.symbol);!k("esri-canvas-svg-support")&&l.isSVG(h)?(this._logWarning("IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)"),this.reject(new d("SVG Not Supported","IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)"))):(a(this._context.sharedResources.textures.acquire(h,
- null,b),function(a){if(!g.isRejected()){var c=a.params,d=c.width/c.height;g._size=b?1<d?[b,Math.round(b/d)]:[Math.round(b*d),b]:[c.width,c.height];e.textureId=a.id;g._createMaterialsAndAddToStage(e,g._context.stage,f);g.resolve()}},function(a){a instanceof c?g.reject():(a="IconSymbol3DLayer failed to load (Request for icon resource failed: "+h+")",g._logWarning(a),g.reject(new d("Request Failed",a)))}),this._textureURI=h)};x.prototype._createMaterialsAndAddToStage=function(a,b,c){this._fastUpdates=
- z.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(),this._fastVisualVariableConvertOptions());this._fastUpdates.enabled&&e.mixin(a,this._fastUpdates.materialParameters);var d=e.mixin({},a);d.verticalOffset=null;d.screenSizePerspective=null;d.occlusionTest=!1;d.shaderPolygonOffset=0;this._drapedMaterial=new G(d,c+"_iconDraped");b.add(D.ModelContentType.MATERIAL,this._drapedMaterial);a.occlusionTest=!0;this._material=new G(a,c+"_icon");b.add(D.ModelContentType.MATERIAL,
- this._material)};x.prototype.destroy=function(){h.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(D.ModelContentType.MATERIAL,this._material.id),this._material=null);this._drapedMaterial&&(this._context.stage.remove(D.ModelContentType.MATERIAL,this._drapedMaterial.id),this._drapedMaterial=null);this._textureURI&&(this._context.sharedResources.textures.release(this._textureURI),this._textureURI=null)};x.prototype._getGeometry=function(a){a=
- this._validateGeometry(a.geometry);if("extent"===a.type)return v.placePointOnPolygon(p.fromExtent(a));if("polyline"===a.type)return v.placePointOnPolyline(a);if("polygon"===a.type)return v.placePointOnPolygon(a);if("point"===a.type)return a;this._logWarning("unsupported geometry type for icon symbol: "+a.type);return null};x.prototype._getScaleFactor=function(a){if(this._isPropertyDriven("size")&&a.size){for(var c=0;3>c;c++){var d=a.size[c];d&&"symbolValue"!==d&&"proportional"!==d&&(a.size[c]=b.pt2px(d))}c=
- this._size[0]>this._size[1]?this._size[0]:this._size[1];if("symbolValue"!==a.size[0]){if(isFinite(+a.size[0]))return+a.size[0]/c;if(isFinite(+a.size[2]))return+a.size[2]/c}}return 1};x.prototype.createGraphics3DGraphic=function(a,b){var c=this._getGeometry(a);if(null===c)return null;var d="graphic"+a.uid,e=this._getVertexOpacityAndColor(b),f=1;this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size||(f=this._getScaleFactor(b));f*=this._symbolTextureRatio;b=[this._size[0]*f,this._size[1]*
- f];f=this.getGraphicElevationContext(a);return"on-the-ground"===f.mode?this._createAsOverlay(a,c,e,b,f,d,a.uid):this._createAs3DShape(a,c,e,b,f,d,a.uid)};x.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)return b=this._getFillColor(this.symbol,this._primitive),this._drapedMaterial.setParameterValues({color:b}),this._material.setParameterValues({color:b}),b=this._getOutlineColor(this.symbol),this._drapedMaterial.setParameterValues({outlineColor:b}),this._material.setParameterValues({outlineColor:b}),
- !0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var d=this._elevationContext.mode;if("on-the-ground"===a&&"on-the-ground"===d)return!0;if(a!==d&&("on-the-ground"===a||"on-the-ground"===d))return!1;a=v.needsElevationUpdates2D(d)||"absolute-height"===d;for(var e in b){var f=b[e];(d=c(f))&&!d.isDraped()&&(f=this.getGraphicElevationContext(f.graphic),d.needsElevationUpdates=a,d.elevationContext.set(f))}return!0}return!1};x.prototype.applyRendererDiff=function(a,
- b,c,d){for(var e in a.diff)switch(e){case "visualVariables":if(z.updateFastSymbolUpdatesState(this._fastUpdates,b,this._fastVisualVariableConvertOptions()))this._material.setParameterValues(this._fastUpdates.materialParameters),this._drapedMaterial.setParameterValues(this._fastUpdates.materialParameters);else return!1;break;default:return!1}return!0};x.prototype.setDrawOrder=function(a,b,c){this._drapedMaterial&&(this._drapedMaterial.renderPriority=a,c[this._drapedMaterial.id]=!0)};x.prototype._defaultElevationInfoNoZ=
- function(){return V};x.prototype._createAs3DShape=function(a,b,c,d,e,f,g){var k=this,l=this._getFastUpdateAttrValues(a);a=l?function(a){return z.evaluateModelTransform(k._fastUpdates.materialParameters,l,a)}:null;c=F.createPointGeometry(N,null,c,d,U,null,l);c=[new E(c,f)];f=v.createStageObjectForPoint.call(this,b,c,[[this._material]],null,null,e,f,this._context.layer.uid,g,!0,a);if(null===f)return null;var h=new q(this,f.object,c,null,null,t.perObjectElevationAligner,e);h.alignedTerrainElevation=
- f.terrainElevation;h.needsElevationUpdates=v.needsElevationUpdates2D(e.mode)||"absolute-height"===e.mode;h.getScreenSize=this._createScreenSizeGetter(d,a);h.calculateRelativeScreenBounds=function(a){return k._material.calculateRelativeScreenBounds(h.getScreenSize(),1,a)};v.extendPointGraphicElevationContext(h,b,this._context.elevationProvider);return h};x.prototype._createAsOverlay=function(a,b,c,d,e,f,g){var k=this;this._drapedMaterial.renderPriority=this._symbolLayerOrder;g=J.create();A.pointToVector(b,
- g,this._context.overlaySR);g[2]=this._getDrapedZ();if((b=this._context.clippingExtent)&&!v.pointInBox2D(g,b))return null;var l=this._getFastUpdateAttrValues(a);a=l?function(a){return z.evaluateModelTransform(k._fastUpdates.materialParameters,l,a)}:null;c=F.createPointGeometry(N,g,c,d,null,null,l);b=new I(c);b.material=this._drapedMaterial;b.center=g;b.bsRadius=0;b.transformation=O;b.name=f;b.uniqueName=f+"#"+c.id;var h=new u(this,[b],null,null,null,e);h.getScreenSize=this._createScreenSizeGetter(d,
- a);h.calculateRelativeScreenBounds=function(a){return k._drapedMaterial.calculateRelativeScreenBounds(h.getScreenSize(),1,a)};return h};x.prototype._createScreenSizeGetter=function(a,b){var c=this._outlineSize+2;if(this._fastUpdates.enabled){var d=a[0]/this._symbolTextureRatio,e=a[1]/this._symbolTextureRatio;return function(a){void 0===a&&(a=Array(2));var f=b(O);a[0]=f[0]*d+c;a[1]=f[5]*e+c;return a}}var f=a[0]/this._symbolTextureRatio+c,g=a[1]/this._symbolTextureRatio+c;return function(a){void 0===
- a&&(a=Array(2));a[0]=f;a[1]=g;return a}};x.prototype._supportsShaderVisualVariables=function(){return!0};x.prototype._fastVisualVariableConvertOptions=function(){var a=this._size[0]>this._size[1]?this._size[0]:this._size[1],c=[a,a,a],d=b.px2pt(1),a=a*d;return{modelSize:c,symbolSize:[a,a,a],unitInMeters:d,transformation:{anchor:R,scale:Y,rotation:R}}};x.prototype._hasVisibleVerticalOffset=function(a){return this.symbolContainer&&"point-3d"===this.symbolContainer.type&&this.symbolContainer.hasVisibleVerticalOffset()};
- x.PRIMITIVE_SIZE=L;x.VALID_ANCHOR_STRINGS=X;return x}(x);var V={mode:"relative-to-ground",offset:0},U=r.createFrom(0,0,0,1);return x})},"esri/symbols/support/symbolUtils":function(){define(["require","exports","../../core/sniff"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.isVolumetricSymbol=function(a){return(a=a&&a.symbolLayers)?a.some(function(a){a=a.type;return"object"===a||"path"===a||"extrude"===a}):!1};h.getIconHref=function(e,c){c=c.resource.href;return!f("esri-canvas-svg-support")&&
- e.styleOrigin&&a.test(c)?c.replace(a,"/resource/png/$1.png"):c};var a=/\/resource\/(.*?)\.svg$/})},"esri/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/tsSupport/generatorHelper ../../../../core/tsSupport/awaiterHelper ./ElevationContext ../../support/aaBoundingBox ../../support/aaBoundingRect ../../webgl-engine/Stage".split(" "),function(r,h,f,a,e,c,g,d,b){r=function(){function d(a,b,d,e,f,g){this.needsElevationUpdates=
- !1;this.graphics3DSymbolLayer=a;this.renderGeometries=b;this.uniqueMaterials=d;this.uniqueTextures=e;this.boundingBox=f;this.elevationContext=new c(g);this.stage=null;this._visible=!1}d.prototype.initialize=function(a,c){this.stage=c;if(this.uniqueMaterials)for(a=0;a<this.uniqueMaterials.length;a++)c.add(b.ModelContentType.MATERIAL,this.uniqueMaterials[a]);if(this.uniqueTextures)for(a=0;a<this.uniqueTextures.length;a++)c.add(b.ModelContentType.TEXTURE,this.uniqueTextures[a])};d.prototype.isDraped=
- function(){return!0};d.prototype.setVisibility=function(a){if(null!=this.stage)return this._visible!==a?((this._visible=a)?this.stage.getTextureGraphicsRenderer().addRenderGeometries(this.renderGeometries):this.stage.getTextureGraphicsRenderer().removeRenderGeometries(this.renderGeometries),!0):!1};d.prototype.destroy=function(){if(this.stage){var a=this.stage;this._visible&&a.getTextureGraphicsRenderer().removeRenderGeometries(this.renderGeometries);this._visible=!1;if(this.uniqueMaterials)for(var c=
- 0;c<this.uniqueMaterials.length;c++)a.remove(b.ModelContentType.MATERIAL,this.uniqueMaterials[c].id);if(this.uniqueTextures)for(c=0;c<this.uniqueTextures.length;c++)a.remove(b.ModelContentType.TEXTURE,this.uniqueTextures[c].id);this.stage=null}};d.prototype.alignWithElevation=function(a,b,c){};d.prototype.setDrawOrder=function(a,b,c){var d=this;this.uniqueMaterials&&this.uniqueMaterials.forEach(function(c){c.renderPriority=a;d._visible&&(b[c.id]=!0)})};d.prototype.getBSRadius=function(){return this.renderGeometries.reduce(function(a,
- b){return Math.max(a,b.bsRadius)},0)};d.prototype.getCenterObjectSpace=function(){return[0,0,0]};d.prototype.addHighlight=function(a,b){var c=this.stage.getTextureGraphicsRenderer();this.renderGeometries.forEach(function(d){var e=c.addRenderGeometryHighlight(d,b);a.addRenderGeometry(d,c,e)})};d.prototype.removeHighlight=function(a){this.renderGeometries.forEach(function(b){a.removeRenderGeometry(b)})};d.prototype.getProjectedBoundingBox=function(b,c,d,f){return e(this,void 0,void 0,function(){var e,
- l,h;return a(this,function(a){switch(a.label){case 0:g.set(d,g.NEGATIVE_INFINITY);for(e=0;e<this.renderGeometries.length;e++)l=this.renderGeometries[e],this._getRenderGeometryProjectedBoundingRect(l,k,b,f),g.expand(d,k);if(!c)return[3,5];g.center(d,p);h=void 0;a.label=1;case 1:return a.trys.push([1,3,,4]),[4,c.queryElevation(p[0],p[1])];case 2:return h=a.sent(),[3,4];case 3:return a.sent(),h=null,[3,4];case 4:null!=h&&(d[2]=Math.min(d[2],h),d[5]=Math.max(d[5],h)),a.label=5;case 5:return[2,d]}})})};
- d.prototype._getRenderGeometryProjectedBoundingRect=function(a,b,c,d){if(this.boundingBox)g.set(l,this.boundingBox);else{var e=a.center;a=a.bsRadius;l[0]=e[0]-a;l[1]=e[1]-a;l[2]=e[2]-a;l[3]=e[0]+a;l[4]=e[1]+a;l[5]=e[2]+a}c(l,0,2);this.calculateRelativeScreenBounds&&d.push({location:g.center(l),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()});return g.toRect(l,b)};return d}();var k=d.create(),l=[0,0,0,0,0,0],p=[0,0,0];return r})},"esri/views/3d/layers/graphics/SignedDistanceFunctions":function(){define(["require",
- "exports","../../support/mathUtils"],function(r,h,f){function a(a){return a-Math.floor(a)}function e(b,d,e){b=f.clamp(b,0,.9999991);var k=a(b*c[0]),l=a(b*c[1]),h=a(b*c[2]);b=a(b*c[3]);d[e+0]=256*(k-k*g[0]);d[e+1]=256*(l-k*g[1]);d[e+2]=256*(h-l*g[2]);d[e+3]=256*(b-h*g[3])}Object.defineProperty(h,"__esModule",{value:!0});var c=[16777216,65536,256,1],g=[0,1/256,1/256,1/256],d=[1/16777216,1/65536,1/256,1];h.packFloat=e;h.unpackFloat=function(a,c){var b=a[c+1]/256,e=a[c+2]/256,f=a[c+3]/256;a=0+a[c+0]/
- 256*d[0];a+=b*d[1];a+=e*d[2];return a+=f*d[3]};h.computeSignedDistancefieldCicle=function(a,c){var b=new Uint8Array(4*a*a),d=a/2-.5;c/=2;for(var f=0;f<a;f++)for(var g=0;g<a;g++){var k=g+a*f,h=g-d,v=f-d,h=Math.sqrt(h*h+v*v)-c,h=h/a+.5;e(h,b,4*k)}return b};h.computeSignedDistancefieldSquare=function(a,c,d){d&&(c/=Math.SQRT2);for(var b=new Uint8Array(4*a*a),f=0;f<a;f++)for(var g=0;g<a;g++){var k=g-.5*(a-.5),l=f-.5*(a-.5),h=f*a+g;if(d)var x=(k+l)/Math.SQRT2,l=(l-k)/Math.SQRT2,k=x;k=Math.max(Math.abs(k),
- Math.abs(l))-.5*c;k=k/a+.5;e(k,b,4*h)}return b};h.computeSignedDistancefieldCrossAndX=function(a,c,d){d&&(c*=Math.SQRT2);c*=.5;for(var b=new Uint8Array(4*a*a),f=0;f<a;f++)for(var g=0;g<a;g++){var k=g-.5*a+0,l=f-.5*a+0,h=f*a+g;if(d)var x=(k+l)/Math.SQRT2,l=(l-k)/Math.SQRT2,k=x;k=Math.abs(k);l=Math.abs(l);x=void 0;x=k>l?k>c?Math.sqrt((k-c)*(k-c)+l*l):l:l>c?Math.sqrt(k*k+(l-c)*(l-c)):k;x=x/a+.5;e(x,b,4*h)}return b}})},"esri/views/3d/layers/support/FastSymbolUpdates":function(){define(["require","exports",
- "../../../../renderers/support/utils","../graphics/graphicUtils","../../lib/glMatrix"],function(r,h,f,a,e){function c(a){return null!==a&&void 0!==a}function g(a){return"number"===typeof a}function d(a,b){a&&a.push(b)}function b(a,b,e,l,h){var m=a.minSize,n=a.maxSize;if(a.expression)return d(h,"Could not convert size info: expression not supported"),!1;if(a.useSymbolValue)return a=l.symbolSize[e],b.minSize[e]=a,b.maxSize[e]=a,b.offset[e]=b.minSize[e],b.factor[e]=0,b.type[e]=1,!0;if(c(a.field)){if(c(a.stops)){if(2===
- a.stops.length&&g(a.stops[0].size)&&g(a.stops[1].size))return k(a.stops[0].size,a.stops[1].size,a.stops[0].value,a.stops[1].value,b,e),b.type[e]=1,!0;d(h,"Could not convert size info: stops only supported with 2 elements");return!1}if(g(m)&&g(n)&&c(a.minDataValue)&&c(a.maxDataValue))return k(m,n,a.minDataValue,a.maxDataValue,b,e),b.type[e]=1,!0;if(null!=f.meterIn[a.valueUnit])return b.minSize[e]=-Infinity,b.maxSize[e]=Infinity,b.offset[e]=0,b.factor[e]=1/f.meterIn[a.valueUnit],b.type[e]=1,!0;"unknown"===
- a.valueUnit?d(h,"Could not convert size info: proportional size not supported"):d(h,"Could not convert size info: scale-dependent size not supported");return!1}if(!c(a.field)){if(a.stops&&a.stops[0]&&g(a.stops[0].size))return b.minSize[e]=a.stops[0].size,b.maxSize[e]=a.stops[0].size,b.offset[e]=b.minSize[e],b.factor[e]=0,b.type[e]=1,!0;if(g(m))return b.minSize[e]=m,b.maxSize[e]=m,b.offset[e]=m,b.factor[e]=0,b.type[e]=1,!0}d(h,"Could not convert size info: unsupported variant of sizeInfo");return!1}
- function k(a,b,c,d,e,f){d=0<Math.abs(d-c)?(b-a)/(d-c):0;e.minSize[f]=0<d?a:b;e.maxSize[f]=0<d?b:a;e.offset[f]=a-c*d;e.factor[f]=d}function l(a,c,e,f){if(a.normalizationField||a.valueRepresentation)return d(f,"Could not convert size info: unsupported property"),null;var g=a.field;if(null!=g&&"string"!==typeof g)return d(f,"Could not convert size info: field is not a string"),null;if(!c.size)c.size={field:a.field,minSize:[0,0,0],maxSize:[0,0,0],offset:[0,0,0],factor:[0,0,0],type:[0,0,0]};else if(a.field)if(!c.size.field)c.size.field=
- a.field;else if(a.field!==c.size.field)return d(f,"Could not convert size info: multiple fields in use"),null;switch(a.axis){case "width":return(g=b(a,c.size,0,e,f))?c:null;case "height":return(g=b(a,c.size,2,e,f))?c:null;case "depth":return(g=b(a,c.size,1,e,f))?c:null;case "width-and-depth":return(g=b(a,c.size,0,e,f))&&b(a,c.size,1,e,f),g?c:null;case null:case void 0:case "all":return(g=(g=(g=b(a,c.size,0,e,f))&&b(a,c.size,1,e,f))&&b(a,c.size,2,e,f))?c:null;default:return d(f,'Could not convert size info: unknown axis "'+
- a.axis+'""'),null}}function p(a,b,c){for(var e=0;3>e;++e){var f=b.unitInMeters;1===a.type[e]&&(f*=b.modelSize[e],a.type[e]=2);a.minSize[e]/=f;a.maxSize[e]/=f;a.offset[e]/=f;a.factor[e]/=f}if(0!==a.type[0])b=0;else if(0!==a.type[1])b=1;else if(0!==a.type[2])b=2;else return d(c,"No size axis contains a valid size or scale"),!1;for(e=0;3>e;++e)0===a.type[e]&&(a.minSize[e]=a.minSize[b],a.maxSize[e]=a.maxSize[b],a.offset[e]=a.offset[b],a.factor[e]=a.factor[b],a.type[e]=a.type[b]);return!0}function n(a,
- b,c){a[4*b+0]=c.r/255;a[4*b+1]=c.g/255;a[4*b+2]=c.b/255;a[4*b+3]=c.a}function t(a,b,e){if(a.normalizationField)return d(e,"Could not convert color info: unsupported property"),null;if("string"===typeof a.field)if(a.stops){if(8<a.stops.length)return d(e,"Could not convert color info: too many color stops"),null;b.color={field:a.field,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};a=a.stops;for(e=0;8>e;++e){var f=a[Math.min(e,a.length-1)];b.color.values[e]=
- f.value;n(b.color.colors,e,f.color)}}else if(a.colors){if(!c(a.minDataValue)||!c(a.maxDataValue))return d(e,"Could not convert color info: missing data values"),null;if(2!==a.colors.length)return d(e,"Could not convert color info: invalid colors array"),null;b.color={field:a.field,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};b.color.values[0]=a.minDataValue;n(b.color.colors,0,a.colors[0]);b.color.values[1]=a.maxDataValue;n(b.color.colors,1,a.colors[1]);
- for(e=2;8>e;++e)b.color.values[e]=a.maxDataValue,n(b.color.colors,e,a.colors[1])}else return d(e,"Could not convert color info: missing stops or colors"),null;else if(a.stops&&0<=a.stops.length||a.colors&&0<=a.colors.length)for(a=a.stops&&0<=a.stops.length?a.stops[0].color:a.colors[0],b.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},e=0;8>e;e++)b.color.values[e]=Infinity,n(b.color.colors,e,a);else return d(e,"Could not convert color info: no field and no colors/stops"),
- null;return b}function u(a,b,c,d){a=2===c&&"arithmetic"===a.rotationType;b.offset[c]=a?90:0;b.factor[c]=a?-1:1;b.type[c]=1}function q(a,b,c){if("string"!==typeof a.field)return d(c,"Could not convert rotation info: field is not a string"),null;if(!b.rotation)b.rotation={field:a.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(a.field)if(!b.rotation.field)b.rotation.field=a.field;else if(a.field!==b.rotation.field)return d(c,"Could not convert rotation info: multiple fields in use"),null;
- switch(a.axis){case "tilt":return u(a,b.rotation,0,c),b;case "roll":return u(a,b.rotation,1,c),b;case null:case void 0:case "heading":return u(a,b.rotation,2,c),b;default:return d(c,'Could not convert rotation info: unknown axis "'+a.axis+'""'),null}}function v(a,b,c){if(!a)return null;var e=!b.supportedTypes||!!b.supportedTypes.size,f=!b.supportedTypes||!!b.supportedTypes.color,g=!b.supportedTypes||!!b.supportedTypes.rotation;return(a=a.reduce(function(a,k){if(!a)return a;if(k.valueExpression)return d(c,
- "Could not convert visual variables: arcade expressions not supported"),null;switch(k.type){case "size":return e?l(k,a,b,c):a;case "color":return f?t(k,a,c):a;case "rotation":return g?q(k,a,c):a;default:return d(c,"Could not convert visual variables: unsupported type "+k.type),null}},{size:null,color:null,rotation:null}))&&a.size&&!p(a.size,b,c)?null:a}function x(a,b,c){if(!!a!==!!b||a&&a.field!==b.field)return!1;if(a&&"rotation"===c)for(c=0;3>c;c++)if(a.type[c]!==b.type[c]||a.offset[c]!==b.offset[c]||
- a.factor[c]!==b.factor[c])return!1;return!0}function m(a,b){var c={vvSizeEnabled:!1,vvSizeMinSize:null,vvSizeMaxSize:null,vvSizeOffset:null,vvSizeFactor:null,vvSizeValue:null,vvColorEnabled:!1,vvColorValues:null,vvColorColors:null,vvSymbolAnchor:null,vvSymbolRotation:null},d=a&&null!=a.size;a&&a.size?(c.vvSizeEnabled=!0,c.vvSizeMinSize=a.size.minSize,c.vvSizeMaxSize=a.size.maxSize,c.vvSizeOffset=a.size.offset,c.vvSizeFactor=a.size.factor):a&&d&&(c.vvSizeValue=b.transformation.scale);a&&d&&(c.vvSymbolAnchor=
- b.transformation.anchor,c.vvSymbolRotation=b.transformation.rotation);a&&a.color&&(c.vvColorEnabled=!0,c.vvColorValues=a.color.values,c.vvColorColors=a.color.colors);return c}Object.defineProperty(h,"__esModule",{value:!0});h.convertVisualVariables=v;h.initFastSymbolUpdatesState=function(a,b,c){return b&&a&&!a.disableFastUpdates?(a=v(a.visualVariables,c))?{enabled:!0,visualVariables:a,materialParameters:m(a,c),customTransformation:a&&null!=a.size}:{enabled:!1}:{enabled:!1}};h.updateFastSymbolUpdatesState=
- function(a,b,c){if(!b||!a.enabled)return!1;var d=a.visualVariables;b=v(b.visualVariables,c);if(!(b&&x(d.size,b.size,"size")&&x(d.color,b.color,"color")&&x(d.rotation,b.rotation,"rotation")))return!1;a.visualVariables=b;a.materialParameters=m(b,c);a.customTransformation=b&&null!=b.size;return!0};h.getMaterialParams=m;var B;(function(b){var c=e.mat4d,d=e.vec3,f=c.create(),g=d.create();b.evaluateModelTransform=function(b,d,e){if(!b.vvSizeEnabled)return e;c.identity(f);c.multiply(e,f,f);a.computeObjectRotation(b.vvSymbolRotation[2],
- b.vvSymbolRotation[0],b.vvSymbolRotation[1],f);if(b.vvSizeEnabled){for(e=0;3>e;++e){var k=b.vvSizeOffset[e]+d[0]*b.vvSizeFactor[e],l=e;var h=b.vvSizeMinSize[e],m=b.vvSizeMaxSize[e],k=k<h?h:k>m?m:k;g[l]=k}c.scale(f,g,f)}else c.scale(f,b.vvSizeValue,f);c.translate(f,b.vvSymbolAnchor,f);return f}})(B||(B={}));h.evaluateModelTransform=B.evaluateModelTransform})},"esri/views/3d/layers/graphics/Graphics3DLineSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/screenUtils ../../../../geometry/Polygon ./ElevationAligners ./Graphics3DDrapedGraphicLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ./lineUtils ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){var m=n.vec3d,B=n.mat4d;return function(k){function h(){return null!==k&&k.apply(this,arguments)||this}f(h,k);h.prototype._prepareResources=function(){var a=this.symbol,b=this._isPropertyDriven("size")||this._isPropertyDriven("color")||this._isPropertyDriven("opacity"),a={idHint:this._getStageIdHint(),width:this._getWidth(a),color:this._getMaterialOpacityAndColor()};if(!this._isPropertyDriven("size")){var c=l.validateSymbolLayerSize(a.width);if(c){this._logWarning(c);
- this.reject();return}}if(b||1.5<=a.width)this._isPropertyDriven("size")&&(a.width=0),this._material=p.createRibbonMaterial(a);else if(0<a.width)this._material=p.createNativeMaterial(a);else{this.reject();return}this._context.stage.add(u.ModelContentType.MATERIAL,this._material);this.resolve()};h.prototype._getWidth=function(b){return null!=b.size?a.pt2px(b.size):1};h.prototype.destroy=function(){k.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(u.ModelContentType.MATERIAL,
- this._material.id),this._material=null)};h.prototype.createGraphics3DGraphic=function(c,d){var e=this._validateGeometry(c.geometry);if("polyline"!==e.type&&"polygon"!==e.type&&"extent"!==e.type)return this._logWarning("unsupported geometry type for line symbol: "+e.type),null;var e="polygon"===e.type||"extent"===e.type?"rings":"paths",f="graphic"+c.uid,g=this._getVertexOpacityAndColor(d,Float32Array,255),k=0;d.size&&this._isPropertyDriven("size")&&(k=b.getSingleSizeDriver(d.size),k=a.pt2px(k));d=
- this.getGraphicElevationContext(c);return"on-the-ground"===d.mode?this._createAsOverlay(c,e,g,k,d,f):this._createAs3DShape(c,e,g,k,d,f,c.uid)};h.prototype.layerPropertyChanged=function(a,c,d){if("opacity"===a)return c=this._material.getColor(),this._material.setColor([c[0],c[1],c[2],this._getMaterialOpacity()]),!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var e=this._elevationContext.mode;if(null==a||null==e)return!1;if("on-the-ground"===a&&"on-the-ground"===
- e)return!0;if(a!==e&&("on-the-ground"===a||"on-the-ground"===e))return!1;a=b.needsElevationUpdates2D(e);for(var f in c){var g=c[f];(e=d(g))&&!e.isDraped()&&(g=g.graphic,e.needsElevationUpdates=a,e.elevationContext.set(this.getGraphicElevationContext(g)))}return!0}return!1};h.prototype._getOutlineGeometry=function(a,b){return b};h.prototype._getGeometry=function(a){a=this._validateGeometry(a.geometry);"extent"===a.type&&(a=e.fromExtent(a));return a};h.prototype._createAs3DShape=function(a,e,f,g,k,
- l,h){var n=this._getGeometry(a),t=n.hasZ,u=n[e],x=this._getOutlineGeometry(n,u);a=[];var z=[],r=[],C=m.create(),A=Array(6),n=b.getGeometryVertexData3D(x,t,n.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,k);this._logGeometryCreationWarnings(n,u,e,"LineSymbol3DLayer");if(0<x.length){for(var u=n.geometryData.outlines,x=n.eleVertexData,t=n.vertexData,E=0;E<u.length;++E){var D=u[E];if(!(1>=D.count)){var F=D.index,L=D.count;if(this._context.clippingExtent&&
- (b.computeBoundingBox(x,F,L,A),b.boundingBoxClipped(A,this._context.clippingExtent)))continue;b.chooseOrigin(t,F,L,C);b.subtractCoordinates(t,F,L,C);D=new Float64Array(x.buffer,3*F*x.BYTES_PER_ELEMENT,3*L);F=new Float64Array(t.buffer,3*F*t.BYTES_PER_ELEMENT,3*L);F=p.createPolylineGeometry(F,D,"rings"===e,f,g);F=new q(F,l+"path"+E);F.singleUse=!0;a.push(F);z.push([this._material]);F=B.identity();B.translate(F,C,F);r.push(F)}}if(0<a.length)return e=new v({geometries:a,materials:z,transformations:r,
- castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicId:h},idHint:l}),e=new d(this,e,a,null,null,c.perVertexElevationAligner,k),e.alignedTerrainElevation=n.terrainElevation,e.needsElevationUpdates=b.needsElevationUpdates2D(k.mode),e}return null};h.prototype._createAsOverlay=function(a,c,d,e,f,k){var l=this._getGeometry(a);this._material.renderPriority=this._symbolLayerOrder;var h=l[c],n=this._getOutlineGeometry(l,h);a=[];var q=Array(6),u=t.create(t.NEGATIVE_INFINITY),v=m.create(),l=b.getGeometryVertexDataDraped(n,
- l.spatialReference,this._context.overlaySR);this._logGeometryCreationWarnings(l,h,c,"LineSymbol3DLayer");if(0<n.length){h=l.vertexData;n=l.geometryData.outlines;for(l=0;l<n.length;++l){var z=n[l],r=z.index,z=z.count;b.computeBoundingBox(h,r,z,q);if(!b.boundingBoxClipped(q,this._context.clippingExtent)){t.expand(u,q);b.chooseOrigin(h,r,z,v);b.subtractCoordinates(h,r,z,v);b.setZ(h,r,z,this._getDrapedZ());z=new Float64Array(h.buffer,3*r*h.BYTES_PER_ELEMENT,3*z);r=B.identity();B.translate(r,v,r);var z=
- p.createPolylineGeometry(z,null,"rings"===c,d,e),C=new x(z);C.material=this._material;C.center=[.5*(q[0]+q[3]),.5*(q[1]+q[4]),0];C.bsRadius=.5*Math.sqrt((q[3]-q[0])*(q[3]-q[0])+(q[4]-q[1])*(q[4]-q[1]));C.transformation=r;C.name=k;C.uniqueName=k+"#"+z.id;a.push(C)}}return new g(this,a,null,null,u,f)}return null};return h}(k)})},"esri/views/3d/layers/graphics/lineUtils":function(){define("require exports ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Util ../../webgl-engine/materials/NativeLineMaterial ../../webgl-engine/materials/RibbonLineMaterial".split(" "),
- function(r,h,f,a,e,c){function g(a){var b=a.length;return a[0]===a[b-3]&&a[1]===a[b-2]&&a[2]===a[b-1]}Object.defineProperty(h,"__esModule",{value:!0});var d=a.VertexAttrConstants;h.createRibbonMaterial=function(a){var b={width:a.width,color:a.color,miterLimit:a.miterLimit,polygonOffset:!0};"miter"===a.join||"bevel"===a.join?b.join=a.join:(b.join="miter",a.join&&console.warn("unsupported join type for line symbol: "+a.join));return new c(b,a.idHint+"_ribbonlinemat")};h.createNativeMaterial=function(a){return new e({color:a.color},
- a.idHint+"_nativelinemat")};h.isClosed=g;h.createPolylineGeometry=function(a,c,e,h,n){var b,k,l;if(e=e&&!g(a)){e=new Float32Array(a.length+3);for(k=0;k<a.length;k++)e[k]=a[k];k=e.length;e[k-3]=a[0];e[k-2]=a[1];e[k-1]=a[2];b=a.length/3+1;k=new Uint32Array(2*(b-1));l=new Uint32Array(2*(b-1))}else b=a.length/3,k=new Uint32Array(2*(b-1)),l=new Uint32Array(2*(b-1)),e=a;a=new Float32Array(1);a[0]=n;for(var p=n=0,x=0;x<b-1;x++)k[n++]=x,k[n++]=x+1,l[p++]=0,l[p++]=0;n={};b={};n[d.POSITION]=k;n[d.COLOR]=l;
- n[d.SIZE]=l;b[d.POSITION]={size:3,data:e,offsetIdx:0,strideIdx:3};b[d.COLOR]={size:4,data:h,offsetIdx:0,strideIdx:4};b[d.SIZE]={size:1,data:a,offsetIdx:0,strideIdx:1};c&&(n.mapPos=k,b.mapPos={size:3,data:c,offsetIdx:0,strideIdx:3});return new f(b,n,f.DefaultOffsets,"line")}})},"esri/views/3d/webgl-engine/materials/NativeLineMaterial":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/Logger ../lib/ComponentUtils ../lib/DefaultVertexBufferLayouts ../lib/gl-matrix ../lib/GLMaterial ../lib/Material ../lib/RenderSlot ../lib/Util ./internal/MaterialUtil ../../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n){var t=l.VertexAttrConstants,u=c.Pos3,q=n.getStride(u)/4,v={color:[1,1,1,1]},x=a.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial");r=function(a){function b(b,c){c=a.call(this,c)||this;c.params=p.copyParameters(b,v);c.canBeMerged=!0;return c}f(b,a);b.prototype.setColor=function(a){this.params.color=a;this.notifyDirty("matChanged")};b.prototype.getColor=function(){return this.params.color};b.prototype.getParameterValues=function(){return{color:this.params.color}};
- b.prototype.getOutputAmount=function(a){return a*q};b.prototype.getInstanceBufferLayout=function(){};b.prototype.getVertexBufferLayout=function(){return u};b.prototype.fillInterleaved=function(a,b,c,d,e,f,g){c=a.vertexAttr[t.POSITION].data;if(b)for(g=c,c=R,d=0;d<g.length;d+=3){var k=g[d],l=g[d+1],h=g[d+2];c[d]=b[0]*k+b[4]*l+b[8]*h+b[12];c[d+1]=b[1]*k+b[5]*l+b[9]*h+b[13];c[d+2]=b[2]*k+b[6]*l+b[10]*h+b[14]}a=a.indices[t.POSITION];for(d=0;d<a.length;d++)b=3*a[d],e[f++]=c[b],e[f++]=c[b+1],e[f++]=c[b+
- 2]};b.prototype.intersect=function(a,b,c,d,f,k,h,m){if(d.isSelection&&!e.isAllHidden(b.componentVisibilities,a.data.componentOffsets))if(l.isTranslationMatrix(c)){b=a.getData().getVertexAttr().position.data;f=d.camera;k=d.point;g.vec3d.set3(k[0]-2,k[1]+2,0,M[0]);g.vec3d.set3(k[0]+2,k[1]+2,0,M[1]);g.vec3d.set3(k[0]+2,k[1]-2,0,M[2]);g.vec3d.set3(k[0]-2,k[1]-2,0,M[3]);for(m=0;4>m;m++)f.unprojectPoint(M[m],H[m]);l.point2plane(f.eye,H[0],H[1],J);l.point2plane(f.eye,H[1],H[2],O);l.point2plane(f.eye,H[2],
- H[3],N);l.point2plane(f.eye,H[3],H[0],S);a=Number.MAX_VALUE;for(m=0;m<b.length-5;m+=3)if(z[0]=b[m]+c[12],z[1]=b[m+1]+c[13],z[2]=b[m+2]+c[14],C[0]=b[m+3]+c[12],C[1]=b[m+4]+c[13],C[2]=b[m+5]+c[14],!(0>l.planeDistance(z,J)&&0>l.planeDistance(C,J)||0>l.planeDistance(z,O)&&0>l.planeDistance(C,O)||0>l.planeDistance(z,N)&&0>l.planeDistance(C,N)||0>l.planeDistance(z,S)&&0>l.planeDistance(C,S))){f.projectPoint(z,E);f.projectPoint(C,F);if(0>E[2]&&0<F[2]){g.vec3d.subtract(z,C,A);var n=f.frustumPlanes,p=-(g.vec3d.dot(n[4],
- z)+n[4][3]),n=p/g.vec3d.dot(A,n[4]);g.vec3d.scale(A,n,A);g.vec3d.add(z,A,z);f.projectPoint(z,E)}else if(0<E[2]&&0>F[2])g.vec3d.subtract(C,z,A),n=f.frustumPlanes,p=-(g.vec3d.dot(n[4],C)+n[4][3]),n=p/g.vec3d.dot(A,n[4]),g.vec3d.scale(A,n,A),g.vec3d.add(C,A,C),f.projectPoint(C,F);else if(0>E[2]&&0>F[2])continue;n=l.pointLineSegmentDistanceSquared2D(E,F,k);n<a&&(a=n,g.vec3d.set(z,I),g.vec3d.set(C,P))}c=d.p0;d=d.p1;4>a&&(a=l.lineLineDistanceSquared3D(I,P,c,d,G),b=Number.MAX_VALUE,a.success&&(g.vec3d.subtract(a.pa,
- c,D),a=g.vec3d.length(D),g.vec3d.scale(D,1/a),b=a/g.vec3d.dist(c,d)),h(b,D))}else x.error("intersection assumes a translation-only matrix")};b.prototype.getGLMaterials=function(){return{color:m,depthShadowMap:void 0,normal:void 0,depth:void 0,highlight:B}};b.prototype.getAllTextureIds=function(){return[]};return b}(b);var m=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.program=c.get("simple");b.updateParameters();return b}f(b,a);b.prototype.updateParameters=function(){this.params=this.material.getParameterValues()};
- b.prototype.beginSlot=function(a){return a===k.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,b){b=this.program;var c=this.params;a.bindProgram(b);b.setUniform4fv("color",c.color);a.setBlendingEnabled(1>c.color[3]);a.setBlendFunctionSeparate(a.gl.SRC_ALPHA,a.gl.ONE_MINUS_SRC_ALPHA,a.gl.ONE,a.gl.ONE_MINUS_SRC_ALPHA);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){1>this.params.color[3]&&a.setBlendingEnabled(!1)};b.prototype.bindView=function(a,
- b){p.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.LINES};return b}(d),B=function(a){function b(b,c,d){b=a.call(this,b,c)||this;b.program=c.get("highlight");return b}f(b,a);b.prototype.updateParameters=function(){};b.prototype.beginSlot=function(a){return a===k.OPAQUE_MATERIAL};b.prototype.getProgram=function(){return this.program};b.prototype.bind=function(a,
- b){a.bindProgram(this.program);a.setDepthTestEnabled(!0)};b.prototype.release=function(a){};b.prototype.bindView=function(a,b){p.bindView(b.origin,b.view,this.program)};b.prototype.bindInstance=function(a,b){this.program.setUniformMatrix4fv("model",b.transformation)};b.prototype.getDrawMode=function(a){return a.gl.LINES};return b}(d),z=g.vec3d.create(),C=g.vec3d.create(),A=g.vec3d.create(),D=g.vec3d.create(),E=g.vec3d.create(),F=g.vec3d.create(),I=g.vec3d.create(),P=g.vec3d.create(),G={success:!1,
- dist2:0,pa:g.vec3d.create(),pb:g.vec3d.create()},M=[g.vec3d.create(),g.vec3d.create(),g.vec3d.create(),g.vec3d.create()],H=[g.vec3d.create(),g.vec3d.create(),g.vec3d.create(),g.vec3d.create()],J=g.vec4d.create(),O=g.vec4d.create(),N=g.vec4d.create(),S=g.vec4d.create(),R=[];return r})},"esri/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../geometry/support/MeshComponent ../../../../geometry/support/webMercatorUtils ../../../../geometry/support/meshUtils/projection ./ElevationAligners ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ../support/edgeUtils ../support/symbolColorUtils ../../lib/glMatrix ../../support/aaBoundingBox ../../support/debugFlags ../../support/projectionUtils ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Texture ../../webgl-engine/lib/Util ../../webgl-engine/materials/DefaultMaterial ../../webgl-engine/materials/NativeLineMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E){var F=A.VertexAttrConstants;r=function(e){function l(){var a=null!==e&&e.apply(this,arguments)||this;a._edgeStageObjects=new Set;a._materials={};a._textures={};return a}f(l,e);l.prototype._prepareResources=function(){q.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new E({color:[1,0,1,1]},"debugVertexNormal"),this._debugFaceNormalMaterial=new E({color:[0,1,1,1]},"debugFAceNormal"));this.resolve()};l.prototype.destroy=function(){e.prototype.destroy.call(this);
- this.isFulfilled()||this.reject();for(var a in this._materials)this._context.stage.remove(x.ModelContentType.MATERIAL,this._materials[a].material.id);for(a in this._textures)this._context.stage.remove(x.ModelContentType.TEXTURE,this._textures[a].id);this._materials={};this._textures={}};l.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("mesh"!==c.type)return this._logWarning("unsupported geometry type for fill on mesh-3d symbol: "+c.type),null;var c="graphic"+
- a.uid,d=this.getGraphicElevationContext(a);return this._createAs3DShape(a,b,d,c,a.uid)};l.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a){b=this._getLayerOpacity();for(var d in this._materials){c=this._materials[d];c.material.setParameterValues({layerOpacity:b});var e=c.material.getParameterValues();this._setMaterialTransparentParameter(e);c.material.setParameterValues({transparent:e.transparent})}if(0<this._edgeStageObjects.size){var f=this._context.stage.view.getEdgeView(),g=this._getLayerOpacity(),
- l=this.symbol.edges?this.symbol.edges.color.a:0;this._edgeStageObjects.forEach(function(a){f.updateComponentOpacity(a,0,l*g)})}return!0}if("elevationInfo"===a){this._updateElevationContext();for(e in b)if(a=b[e],d=c(a))a=this.getGraphicElevationContext(a.graphic),d.needsElevationUpdates=k.needsElevationUpdates3D(a.mode),d.elevationContext.set(a);return!0}return!1};l.prototype._requiresVertexColors=function(){return this._isPropertyDriven("color")||this._isPropertyDriven("opacity")};l.prototype._colorUid=
- function(a){a=a.material&&a.material.color;if(!a)return"-";if(a)switch(a.type){case "value":return a.value.toHex();case "image":return a.uid}};l.prototype._materialProperties=function(a,b){a=this._requiresVertexColors();var c=b.material&&b.material.color;b=this._colorUid(b);return{hasVertexColors:a,color:c,uid:"vc:"+a+",cmuid:"+b}};l.prototype._setInternalColorValueParameters=function(b,c){c.diffuse=a.toUnitRGB(b.value);c.opacity=b.value.a};l.prototype._setInternalColorImageParameters=function(a,
- b,c){var d=a.url;if(d){var e=this._textures[a.uid];e||(e=new C(d,b+"_"+a.uid+"_tex",{mipmap:!0,wrapClamp:!1,noUnpackFlip:!0}),this._textures[a.uid]=e,this._context.stage.add(x.ModelContentType.TEXTURE,e));c.textureId=e.id}};l.prototype._setInternalMaterialParameters=function(a,b,c){if(a=a.material&&a.material.color)switch(a.type){case "value":this._setInternalColorValueParameters(a,c);break;case "image":this._setInternalColorImageParameters(a,b,c)}};l.prototype._setExternalMaterialParameters=function(b){if(this._isPropertyDriven("color"))b.externalColor=
- P;else{var c=this.symbol.material?a.toUnitRGBA(this.symbol.material.color):P;b.externalColor=c}if(c=this.symbol.material&&this.symbol.material.colorMixMode)b.colorMixMode=c};l.prototype._getOrCreateMaterial=function(a,b){a=this._materialProperties(a,b);var c=this._materials[a.uid];if(c)return c.material;var c=this._getStageIdHint(),d={specular:G,symbolColors:a.hasVertexColors,ambient:G,diffuse:I,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:"none",layerOpacity:this._getLayerOpacity()};
- this._setInternalMaterialParameters(b,c,d);this._setExternalMaterialParameters(d);this._setMaterialTransparentParameter(d);c=new D(d,c+"_"+a.uid+"_mat");b=b.material&&b.material.color&&"value"===b.material.color.type&&b.material.color.value;this._materials[a.uid]={geometryOpacity:b?b.a:1,material:c};this._context.stage.add(x.ModelContentType.MATERIAL,c);return c};l.prototype._setMaterialTransparentParameter=function(a){this._isPropertyDriven("opacity")&&(a.transparent=!0);a.transparent=1>a.layerOpacity||
- 1>a.opacity||a.externalColor&&1>a.externalColor[3]};l.prototype._addDebugNormals=function(a,b,c,d){var e=b.length,f=a.spatialReference.isWGS84?20015077/180:1,g=.1*Math.max(a.extent.width*f,a.extent.height*f,a.extent.zmax-a.extent.zmin),k=[],l=[];a=[];for(var f=[],h=0;h<e;h++)for(var n=b[h],p=n.data.getAttribute(F.POSITION),q=n.data.getAttribute(F.NORMAL),u=n.data.getIndices(F.POSITION),n=n.data.getIndices(F.NORMAL),p=p.data,q=q.data,v=0;v<u.length;v++){for(var x=3*u[v],z=3*n[v],r=0;3>r;r++)k.push(p[x+
- r]);for(r=0;3>r;r++)k.push(p[x+r]+q[z+r]*g);l.push(l.length);l.push(l.length);if(0===v%3){this._calculateFaceNormal(p,u,v,N);this._getFaceVertices(p,u,v,H,J,O);t.vec3d.add(H,J);t.vec3d.add(H,O);t.vec3d.scale(H,1/3);for(r=0;3>r;r++)a.push(H[r]);for(r=0;3>r;r++)a.push(H[r]+N[r]*g);f.push(f.length);f.push(f.length)}}e=(C={},C[F.POSITION]={data:new Float64Array(k),size:3},C);C=(A={},A[F.POSITION]=new Uint32Array(l),A);A=new B(e,C,void 0,"line");A=new m(A,"debugVertexNormal");A.singleUse=!0;b.push(A);
- c.push([this._debugVertexNormalMaterial]);d.push(t.mat4d.create(d[0]));e=(E={},E[F.POSITION]={data:new Float64Array(a),size:3},E);C=(D={},D[F.POSITION]=new Uint32Array(f),D);A=new B(e,C,void 0,"line");A=new m(A,"debugFaceNormal");A.singleUse=!0;b.push(A);c.push([this._debugFaceNormalMaterial]);d.push(t.mat4d.create(d[0]));var C,A,E,D};l.prototype._createAs3DShape=function(a,c,e,f,g){var l=this;a=a.geometry;if("mesh"!==a.type)return null;var h=this._createGeometryInfo(a,c,f);if(!h)return null;c=h.geometries;
- var m=h.materials,n=h.transformations,h=h.objectTransformation;q.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,c,m,n);f=new z({geometries:c,materials:m,transformations:n,castShadow:!0,metadata:{layerUid:this._context.layer.uid,graphicId:g},idHint:f});f.setObjectTransformation(h);var t=function(a){var b=l._context.stage.view.getEdgeView();if(b){b.removeObject(a);l._edgeStageObjects.delete(a);var c=p.createMaterial(b,l.symbol,l._getLayerOpacity());c&&(l._edgeStageObjects.add(a),b.addObject(a,
- [c],{mergeGeometries:!0}))}};t(f);g=function(a,b,c,e,f){b=d.perObjectElevationAligner(a,b,c,e,f);t(a);return b};c=new b(this,f,c,null,null,g,e);c.needsElevationUpdates=k.needsElevationUpdates3D(e.mode);e=a.extent.center.clone();e.z=0;c.elevationContext.centerPointInElevationSR=e;c.alignedTerrainElevation=g(f,c.elevationContext,this._context.elevationProvider,this._context.renderCoordsHelper,this._context.featureExpressionInfoContext);return c};l.prototype._createComponentNormals=function(a,b,c,d){switch(c.shading||
- "flat"){case "source":return this._createComponentNormalsSource(a,b,c,d);case "flat":return this._createComponentNormalsFlat(a,c,d);case "smooth":return this._createComponentNormalsSmooth(a,c,d)}};l.prototype._createComponentNormalsSource=function(a,b,c,d){if(!b)return this._createComponentNormalsFlat(a,c,d);c=!1;for(var e=0;e<d.length;e+=3){this._calculateFaceNormal(a,d,e,N);for(var f=0;3>f;f++){var g=3*d[e+f];H[0]=b[g+0];H[1]=b[g+1];H[2]=b[g+2];0>t.vec3d.dot(N,H)&&(b[g+0]=-b[g+0],b[g+1]=-b[g+1],
- b[g+2]=-b[g+2],c=!0)}}return{normals:b,indices:d,didFlipNormals:c}};l.prototype._createComponentNormalsFlat=function(a,b,c){b=new Float32Array(c.length);for(var d=new Uint32Array(3*c.length),e=0;e<c.length;e+=3)for(var f=this._calculateFaceNormal(a,c,e,N),g=0;3>g;g++)b[e+g]=f[g],d[e+g]=e/3;return{normals:b,indices:d,didFlipNormals:!1}};l.prototype._createComponentNormalsSmooth=function(a,b,c){b={};for(var d=0;d<c.length;d+=3)for(var e=this._calculateFaceNormal(a,c,d,N),f=0;3>f;f++){var g=c[d+f],k=
- b[g];k||(k={normal:t.vec3d.create(),count:0},b[g]=k);t.vec3d.add(k.normal,e);k.count++}a=new Float32Array(3*c.length);e=new Uint32Array(3*c.length);for(d=0;d<c.length;d++){g=c[d];k=b[g];1!==k.count&&(t.vec3d.normalize(t.vec3d.scale(k.normal,1/k.count)),k.count=1);for(f=0;3>f;f++)a[3*d+f]=k.normal[f];e[d]=d}return{normals:a,indices:e,didFlipNormals:!1}};l.prototype._getFaceVertices=function(a,b,c,d,e,f){var g=3*b[c+0],k=3*b[c+1];b=3*b[c+2];d[0]=a[g+0];d[1]=a[g+1];d[2]=a[g+2];e[0]=a[k+0];e[1]=a[k+1];
- e[2]=a[k+2];f[0]=a[b+0];f[1]=a[b+1];f[2]=a[b+2]};l.prototype._calculateFaceNormal=function(a,b,c,d){this._getFaceVertices(a,b,c,H,J,O);t.vec3d.subtract(J,H);t.vec3d.subtract(O,H);t.vec3d.cross(J,O,H);t.vec3d.normalize(H,d);return d};l.prototype._getOrCreateComponents=function(a){return a.components?a.components:X};l.prototype._createPositionBuffer=function(a){var b=a.vertexAttributes.position,c=new Float64Array(b.length);k.reproject(a.vertexAttributes.position,0,a.spatialReference,c,0,this._context.renderSpatialReference,
- b.length/3);return c};l.prototype._createNormalBuffer=function(a,b){var c=a.vertexAttributes.normal;if(!c)return null;if("local"===this._context.layerView.view.viewingMode)return c;var d=a.vertexAttributes.position,e=new Float32Array(c.length);return g.projectNormalToECEF(c,d,b,a.spatialReference,e)};l.prototype._createColorBuffer=function(a){if(this._requiresVertexColors()){a=this._getVertexOpacityAndColor(a);var b=this.symbol.material&&this.symbol.material.colorMixMode||null,c=new Uint8Array(4);
- n.encodeSymbolColor(a,b,c);return c}return null};l.prototype._createColorIndices=function(a,b){a=new Uint32Array(b.length);for(b=0;b<a.length;b++)a[b]=0;return a};l.prototype._createBuffers=function(a,b){var c=a.vertexAttributes&&a.vertexAttributes.position;if(!c)return this._logWarning("Mesh geometry must contain position vertex attributes"),null;var d=a.vertexAttributes.normal,e=a.vertexAttributes.uv;if(d&&d.length!==c.length)return this._logWarning("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),
- null;if(e&&e.length/2!==c.length/3)return this._logWarning("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;c=this._createPositionBuffer(a);b=this._createColorBuffer(b);d=this._createNormalBuffer(a,c);a=this._transformCenterLocal(a,c,d);return{positionBuffer:c,normalBuffer:d,uvBuffer:e,colorBuffer:b,objectTransformation:a}};l.prototype._transformCenterLocal=function(a,b,c){var d=a.extent.center,e=this._context.renderSpatialReference;M[0]=d.x;M[1]=d.y;M[2]=
- 0;d=t.mat4d.create();v.computeLinearTransformation(a.spatialReference,M,d,e);t.mat4d.inverse(d,S);for(a=0;a<b.length;a+=3)H[0]=b[a+0],H[1]=b[a+1],H[2]=b[a+2],t.mat4d.multiplyVec3(S,H),b[a+0]=H[0],b[a+1]=H[1],b[a+2]=H[2];if(c)for(t.mat4d.toMat3(d,R),t.mat3d.transpose(R,R),a=0;a<c.length;a+=3)H[0]=c[a+0],H[1]=c[a+1],H[2]=c[a+2],t.mat3d.multiplyVec3(R,H),c[a+0]=H[0],c[a+1]=H[1],c[a+2]=H[2];return d};l.prototype._validateFaces=function(a,b){a=a.vertexAttributes.position.length/3;if(b=b.faces){for(var c=
- -1,d=0;d<b.length;d++){var e=b[d];e>c&&(c=e)}if(a<=c)return this._logWarning("Vertex index "+c+" is out of bounds of the mesh position buffer"),!1}else if(0!==a%3)return this._logWarning("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0};l.prototype._getOrCreateFaces=function(a,b){if(b.faces)return b.faces;a=new Uint32Array(a.vertexAttributes.position.length/3);for(b=0;b<a.length;b++)a[b]=b;return a};
- l.prototype._isOutsideClippingArea=function(a){if(!this._context.clippingExtent)return!1;var b=a.vertexAttributes&&a.vertexAttributes.position;if(!b)return!1;var c=this._context.elevationProvider.spatialReference,d=b.length/3;a.spatialReference.equals(c)||(b=new Float64Array(b.length),k.reproject(a.vertexAttributes.position,0,a.spatialReference,b,0,c,d));k.computeBoundingBox(b,0,d,Y);return k.boundingBoxClipped(Y,this._context.clippingExtent)};l.prototype._createGeometryInfo=function(a,b,d){if(!c.canProject(a,
- this._context.layerView.view.spatialReference))return this._logWarning("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(a))return null;var e=this._createBuffers(a,b);if(!e)return null;b=e.positionBuffer;for(var f=e.uvBuffer,g=e.colorBuffer,k=e.normalBuffer,e=e.objectTransformation,l=[],h=[],n=[],p=!1,q=0,u=this._getOrCreateComponents(a);q<u.length;q++){var v=u[q];if(!this._validateFaces(a,v))return null;var x=this._getOrCreateFaces(a,v);if(0!==x.length){var z=
- this._createComponentNormals(b,k,v,x);z.didFlipNormals&&(p=!0);var r=(w={},w[F.POSITION]={size:3,data:b},w[F.NORMAL]={size:3,data:z.normals},w),z=(C={},C[F.POSITION]=x,C[F.NORMAL]=z.indices,C);g&&(r[F.SYMBOLCOLOR]={size:4,data:g},z[F.SYMBOLCOLOR]=this._createColorIndices(v,x));a.vertexAttributes.uv&&(r[F.UV0]={size:2,data:f},z[F.UV0]=x);x=new B(r,z);x=new m(x,d+"_mesh");x.singleUse=!0;l.push(x);h.push(t.mat4d.identity());n.push([this._getOrCreateMaterial(a,v)])}}p&&this._logWarning("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals.");
- return{geometries:l,transformations:h,materials:n,objectTransformation:e};var w,C};return l}(l);var I=[1,1,1],P=[1,1,1,1],G=[0,0,0],M=t.vec3d.create(),H=t.vec3d.create(),J=t.vec3d.create(),O=t.vec3d.create(),N=t.vec3d.create(),S=t.mat4d.create(),R=t.mat3d.create(),Y=u.create(),X=[new e];return r})},"esri/views/3d/layers/support/symbolColorUtils":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.encodeSymbolColor=function(f,a,e){null==f||"ignore"===
- a?(e[0]=255,e[1]=255,e[2]=255,e[3]=255):(e[0]=Math.floor(255*f[0]),e[1]=Math.floor(255*f[1]),e[2]=Math.floor(255*f[2]),f=Math.floor(85*f[3]),e[3]=0===f?0:"tint"===a?f:"replace"===a?f+85:f+170)}})},"esri/views/3d/layers/graphics/Graphics3DObjectSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/_base/lang dojo/errors/CancelError ../../../../Color ../../../../core/screenUtils ../../../../symbols/ObjectSymbol3DLayer ./ElevationAligners ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ./objectResourceUtils ../support/FastSymbolUpdates ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/materials/DefaultMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z){var C=q.mat4d,A=q.vec3d,D=[1,1,1],E=[1,1,1,1],F=[0,0,0];r=[-.5,-.5,-.5,.5,.5,.5];h=[-.5,-.5,0,.5,.5,1];var I={sphere:r,cube:r,cylinder:h,cone:h,"inverted-cone":h,tetrahedron:[-.5,-.5,0,.5,.5,.5],diamond:r},P=[x.ModelContentType.MATERIAL,x.ModelContentType.TEXTURE,x.ModelContentType.GEOMETRY];return function(h){function p(){return null!==h&&h.apply(this,arguments)||this}f(p,h);p.prototype._prepareResources=function(){var a=this.symbol,b=this._getStageIdHint();
- if(!this._isPropertyDriven("size")){var c=n.validateSymbolLayerSize(this.symbol);if(c){this._logWarning(c);this.reject();return}}a.resource&&a.resource.href?this._prepareModelResources(a.resource.href,b):this._preparePrimitiveResources(a.resource?a.resource.primitive:"sphere",b)};p.prototype._preparePrimitiveResources=function(b,d){var e=this.symbol;if("sphere"===b)this._geometryData=B.createPolySphereGeometry(.5,2,!0);else if("cube"===b)this._geometryData=B.createBoxGeometry(1);else if("cylinder"===
- b)this._geometryData=B.createCylinderGeometry(1,.5,32,[0,0,1],[0,0,.5]);else if("cone"===b)this._geometryData=B.createConeGeometry(1,.5,15,!1),B.cgToGIS(this._geometryData);else if("inverted-cone"===b)this._geometryData=B.createConeGeometry(1,.5,15,!0),B.cgToGIS(this._geometryData);else if("tetrahedron"===b)this._geometryData=B.createTetrahedronGeometry(1),B.cgToGIS(this._geometryData);else if("diamond"===b)this._geometryData=B.createDiamondGeometry(1),B.cgToGIS(this._geometryData);else{this._logWarning("Unknown object symbol primitive: "+
- b);this.reject();return}this._geometry=new m(this._geometryData,d);this._context.stage.add(x.ModelContentType.GEOMETRY,this._geometry);this._resourceBoundingBox=I[b];this._resourceSize=v.size(this._resourceBoundingBox);this._symbolSize=n.computeSizeWithResourceSize(this._resourceSize,e);b=this._getMaterialOpacity();b={specular:[0,0,0],opacity:b,transparent:1>b||this._isPropertyDriven("opacity"),instanced:["transformation"],ambient:D,diffuse:D};var f=this.symbolContainer;if("point-3d"===f.type&&f.verticalOffset){var f=
- f.verticalOffset,k=f.minWorldLength,l=f.maxWorldLength;b.verticalOffset={screenLength:g.pt2px(f.screenLength),minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity};b.castShadows=!1}this._context.screenSizePerspectiveEnabled&&(b.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings);this._isPropertyDriven("color")?b.externalColor=E:(e=e.material?c.toUnitRGBA(e.material.color):E,b.externalColor=e);this._fastUpdates=u.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(),
- this._fastVisualVariableConvertOptions());this._fastUpdates.enabled?(a.mixin(b,this._fastUpdates.materialParameters),b.instanced.push("featureAttribute")):this._hasPerInstanceColor()&&b.instanced.push("color");this._material=new z(b,d+"_objectmat");this._context.stage.add(x.ModelContentType.MATERIAL,this._material);this.resolve()};p.prototype._prepareModelResources=function(b,c){var d=this,f=["transformation"];c={materialParamsMixin:{instanced:f},idHint:c,streamDataSupplier:this._context.streamDataSupplier};
- this._fastUpdates=u.initFastSymbolUpdatesState(this._context.renderer,this._supportsShaderVisualVariables(),this._fastVisualVariableConvertOptions());this._fastUpdates.enabled?(a.mixin(c.materialParamsMixin,this._fastUpdates.materialParameters),f.push("featureAttribute")):this._hasPerInstanceColor()&&f.push("color");f=this.symbolContainer;if("point-3d"===f.type&&f.verticalOffset){var f=f.verticalOffset,k=f.minWorldLength,l=f.maxWorldLength;c.materialParamsMixin.verticalOffset={screenLength:g.pt2px(f.screenLength),
- minWorldLength:k||0,maxWorldLength:null!=l?l:Infinity};c.materialParamsMixin.castShadows=!1}this._symbolLoaderPromise=t.fetch(b,c);this._symbolLoaderPromise.then(function(a){d._symbolLoaderPromise=null;if(!d.isRejected()){var b=d._context,c=a.stageResources,e=b.stage,f=d._getExternalColorParameters(d.symbol.material),g=d._getMaterialOpacity(),k=d._isPropertyDriven("opacity"),l=c[x.ModelContentType.MATERIAL];a.originalMaterialOpacities=Array(l.length);l.forEach(function(c,d){var e=c.getParameterValues();
- c.setParameterValues(f);a.originalMaterialOpacities[d]=e.opacity;d=e.opacity*g;c.setParameterValues({opacity:d,transparent:1>d||k||e.transparent});b.screenSizePerspectiveEnabled&&c.setParameterValues({screenSizePerspective:b.sharedResources.screenSizePerspectiveSettings})});P.forEach(function(a){for(var b=c[a],d=0;b&&d<b.length;d++)e.add(a,b[d])});d._resourceBoundingBox=t.computeBoundingBox(a);d._resourceSize=v.size(d._resourceBoundingBox);d._pivotOffset=a.pivotOffset;d._symbolSize=n.computeSizeWithResourceSize(d._resourceSize,
- d.symbol);d._i3sModel=a;u.updateFastSymbolUpdatesState(d._fastUpdates,d._context.renderer,d._fastVisualVariableConvertOptions())&&l.forEach(function(a){return a.setParameterValues(d._fastUpdates.materialParameters)});d.resolve()}},function(a){d._symbolLoaderPromise=null;if(!d.isFulfilled()){if(!(a instanceof e)){var b="ObjectSymbol3DLayer failed to load";a&&a.message&&(b+=" ("+a.message+")");d._logWarning(b)}d.reject()}})};p.prototype._forEachMaterial=function(a){this._i3sModel?this._i3sModel.stageResources[x.ModelContentType.MATERIAL].forEach(a):
- a(this._material)};p.prototype._getExternalColorParameters=function(a){var b={};this._isPropertyDriven("color")?b.externalColor=E:a&&a.color?b.externalColor=c.toUnitRGBA(a.color):(b.externalColor=E,b.colorMixMode="ignore");return b};p.prototype.destroy=function(){h.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._symbolLoaderPromise&&this._symbolLoaderPromise.cancel();var a=this._context.stage;if(this._i3sModel){var b=this._i3sModel.stageResources;P.forEach(function(c){for(var d=
- b[c],e=0;d&&e<d.length;e++)a.remove(c,d[e].id)})}else this._material&&a.remove(x.ModelContentType.MATERIAL,this._material.id),this._geometry&&a.remove(x.ModelContentType.GEOMETRY,this._geometry.id)};p.prototype._getGeometry=function(a){a=this._validateGeometry(a.geometry);return"polyline"===a.type?l.placePointOnPolyline(a):"polygon"===a.type?l.placePointOnPolygon(a):"extent"===a.type?a.center:"point"!==a.type?(this._logWarning("unsupported geometry type for object symbol: "+a.type),null):a};p.prototype.createGraphics3DGraphic=
- function(a,b){var c=this._getGeometry(a);if(null===c)return null;var d="graphic"+a.uid,e=this.getGraphicElevationContext(a);return this._createAs3DShape(a,c,b,e,d,a.uid)};p.prototype.layerPropertyChanged=function(a,b,c){var d=this;if("opacity"===a){var e=this._isPropertyDriven("opacity");if(this._i3sModel){var f=this._getMaterialOpacity();this._i3sModel.stageResources[x.ModelContentType.MATERIAL].forEach(function(a,b){b=d._i3sModel.originalMaterialOpacities[b]*f;a.setParameterValues({opacity:b,transparent:1>
- b||e})})}else b=this._getMaterialOpacity(),this._material.setParameterValues({opacity:b,transparent:1>b||e});return!0}if("elevationInfo"===a){this._updateElevationContext();for(var g in b){var k=b[g];if(a=c(k))k=this.getGraphicElevationContext(k.graphic),a.needsElevationUpdates=l.needsElevationUpdates3D(k.mode),a.elevationContext.set(k)}return!0}return!1};p.prototype.applyRendererDiff=function(a,b,c,d){var e=this,f;for(f in a.diff)switch(f){case "visualVariables":if(u.updateFastSymbolUpdatesState(this._fastUpdates,
- b,this._fastVisualVariableConvertOptions()))this._forEachMaterial(function(a){return a.setParameterValues(e._fastUpdates.materialParameters)});else return!1;break;default:return!1}return!0};p.prototype._createAs3DShape=function(a,c,d,e,f,g){var h=this,m=null,p=null;if(a=this._getFastUpdateAttrValues(a))m=m||{},m.featureAttribute=a,p=function(a){return u.evaluateModelTransform(h._fastUpdates.materialParameters,m.featureAttribute,a)};!this._fastUpdates.enabled&&this._hasPerInstanceColor()&&(m=m||{},
- m.color=n.mixinColorAndOpacity(d.color,d.opacity));a=this._context.layer.uid;var t=C.identity();this._applyObjectRotation(d,t);this._applyObjectRotation(this.symbol,t);this._applyObjectScale(d,t);this._applyAnchor(t);if(this._i3sModel){d=this._i3sModel.stageResources[x.ModelContentType.GEOMETRY];for(var q=this._i3sModel.materialsByComponent,v=Array(d.length),z=0;z<t.length;z++)v[z]=t;f=l.createStageObjectForPoint.call(this,c,d,q,v,m,e,f,a,g,null,p)}else f=l.createStageObjectForPoint.call(this,c,[this._geometry],
- [[this._material]],[t],m,e,f,a,g,null,p);if(null===f)return null;if(this._fastUpdates.enabled){var B=u.getMaterialParams(this._fastUpdates.visualVariables,this._fastVisualVariableConvertOptions());this._forEachMaterial(function(a){return a.setParameterValues(B)})}f.object.setCastShadow(!0);g=new k(this,f.object,null,null,null,b.perObjectElevationAligner,e,k.VisibilityModes.REMOVE_OBJECT);g.alignedTerrainElevation=f.terrainElevation;g.needsElevationUpdates=l.needsElevationUpdates3D(e.mode);l.extendPointGraphicElevationContext(g,
- c,this._context.elevationProvider);return g};p.prototype._applyObjectScale=function(a,b){this._fastUpdates.enabled&&this._fastUpdates.customTransformation||(a=this._isPropertyDriven("size")&&a.size?a.size:this._symbolSize,a=n.computeObjectScale(a,this._symbolSize,this._resourceSize,this._context.renderCoordsHelper.unitInMeters),1===a[0]&&1===a[1]&&1===a[2]||C.scale(b,a))};p.prototype._applyObjectRotation=function(a,b){if(!(this._fastUpdates.enabled&&this._fastUpdates.customTransformation&&a instanceof
- d))return n.computeObjectRotation(a.heading,a.tilt,a.roll,b)};p.prototype._computeAnchor=function(){switch(this.symbol.anchor){case "center":return A.scale(v.center(this._resourceBoundingBox),-1);case "top":var a=v.center(this._resourceBoundingBox);return[-a[0],-a[1],-this._resourceBoundingBox[5]];case "bottom":return a=v.center(this._resourceBoundingBox),[-a[0],-a[1],-this._resourceBoundingBox[2]];default:return this._pivotOffset?A.scale(this._pivotOffset,-1,Array(3)):F}};p.prototype._applyAnchor=
- function(a){if(!this._fastUpdates.enabled||!this._fastUpdates.customTransformation){var b=this._computeAnchor();b&&C.translate(a,b)}};p.prototype._hasPerInstanceColor=function(){return this._isPropertyDriven("color")||this._isPropertyDriven("opacity")};p.prototype._supportsShaderVisualVariables=function(){return this._context.stage.has("instancedRendering")?!0:!1};p.prototype._fastVisualVariableConvertOptions=function(){var a=this._resourceBoundingBox?v.size(this._resourceBoundingBox):D,b=this._resourceBoundingBox?
- this._computeAnchor():F,c=this._context.renderCoordsHelper.unitInMeters,d=n.computeObjectScale(this._symbolSize,this._symbolSize,this._resourceSize,c);return{modelSize:a,symbolSize:this._symbolSize||D,unitInMeters:c,transformation:{anchor:b,scale:d,rotation:[this.symbol.tilt||0,this.symbol.roll||0,this.symbol.heading||0]}}};p.PRIMITIVE_BOUNDING_BOX=I;return p}(p)})},"esri/views/3d/layers/graphics/objectResourceUtils":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/Deferred dojo/sniff dojo/_base/lang dojo/errors/CancelError ../../../../request ../../../../core/Error ../../../../core/Logger ../../../../core/Version ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Texture ../../webgl-engine/materials/DefaultMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){function m(a){return new b("","Request for object resource failed: "+a)}function B(a,b){var d,f,g=[],k=[],h=[],m=[],n=[],p=l.Version.parse(a.version||"1.0","wosr");C.validate(p);var p="meshsymbol_"+a.model.name,t=a.textureDefinitions,B={},r;for(r in t){var A=t[r];if(d=A.images[0].data){f=A.encoding+";base64,"+d;d="/textureDefinitions/"+r;var D={noUnpackFlip:!0,wrapClamp:!1};e("enable-feature:jkieboom/alpha-channel-usage")&&(D.wrapClamp=!0);f=new v(f,p,
- D);n.push(f);B[d]={engineTexObj:f,alphaChannelUsage:"rgba"===A.channels?A.alphaChannelUsage||"transparency":"none"}}else z.warn("Externally referenced texture data is not yet supported")}r=a.model.geometries;t=a.materialDefinitions;for(A=0;A<r.length;A++){f=D=r[A];var X=f.params,Q=X.topology;d=!0;X.vertexAttributes||(z.warn("Geometry must specify vertex attributes"),d=!1);switch(X.topology){case "PerAttributeArray":break;case "Indexed":case null:case void 0:if(!X.faces)z.warn("Indexed geometries must specify faces"),
- d=!1;else if(X.vertexAttributes)for(Q in Q=void 0,X.vertexAttributes){var K=X.faces[Q];K&&K.values?(null!=K.valueType&&"UInt32"!==K.valueType&&(z.warn("Unsupported indexed geometry indices type '"+K.valueType+"', only UInt32 is currently supported"),d=!1),null!=K.valuesPerElement&&1!==K.valuesPerElement&&(z.warn("Unsupported indexed geometry values per element '"+K.valuesPerElement+"', only 1 is currently supported"),d=!1)):(z.warn("Indexed geometry does not specify face indices for '"+Q+"' attribute"),
- d=!1)}break;default:z.warn("Unsupported topology '"+Q+"'"),d=!1}f.params.material||(z.warn("Geometry requires material"),d=!1);f=f.params.vertexAttributes;X=void 0;for(X in f)f[X].values||(z.warn("Geometries with externally defined attributes are not yet supported"),d=!1);if(d){f=D.params;d=f.material;f=f.texture;var Q=D.params.vertexAttributes,X={},L;for(L in Q)K=Q[L],X[L]={data:K.values,size:K.valuesPerElement};h.push([]);Q={};if("PerAttributeArray"===D.params.topology){for(var D=X.position.data.length/
- X.position.size,K=new Uint32Array(D),V=0;V<D;V++)K[V]=V;var D=K,U;for(U in X)Q[U]=D}else for(var ca in D.params.faces)Q[ca]=new Uint32Array(D.params.faces[ca].values);D=f?B[f]:null;K=m[d]?m[d][f]:null;K||(K=d.substring(d.lastIndexOf("/")+1),K=t[K].params,1===K.transparency&&(K.transparency=0),K={ambient:K.diffuse,diffuse:K.diffuse,specular:[0,0,0],opacity:1-(K.transparency||0),transparent:0<K.transparency,textureId:D?D.engineTexObj.id:void 0,doubleSided:!0,cullFace:"none",flipV:!1,colorMixMode:K.externalColorMixMode||
- "tint"},e("enable-feature:jkieboom/alpha-channel-usage")&&D&&("transparency"===D.alphaChannelUsage||"maskAndTransparency"===D.alphaChannelUsage)&&(K.transparent=!0),b&&b.materialParamsMixin&&c.mixin(K,b.materialParamsMixin),K=new x(K,p),m[d]||(m[d]={}),m[d][f]=K,k.push(K));h[A].push(K);d=new u(new q(X,Q),p);g.push(d)}}return{stageResources:{textures:n,materials:k,geometries:g},materialsByComponent:h,pivotOffset:a.model.pivotOffset}}Object.defineProperty(h,"__esModule",{value:!0});var z=k.getLogger("esri.views.3d.layers.graphics.objectResourceUtils"),
- C=new l.Version(1,1,"wosr");h.fetch=function(b,c){c=c||{};var e=c.streamDataSupplier;if(e){var f=e.request(b,"json"),k=new a(function(){return e.cancelRequest(f)});f.then(function(a,b){try{var d=B(b,c);return k.resolve(d)}catch(O){return k.reject(O)}},function(a){k.reject(a instanceof g?a:m(a))});return k.promise}var l=d(b),h=new a(function(){return l.cancel()});l.then(function(a){try{var b=B(a.data,c);return h.resolve(b)}catch(J){return h.reject(J)}},function(a){h.reject(a instanceof g?a:m(b))});
- return h.promise};h.computeBoundingBox=function(a){a=a.stageResources[t.ModelContentType.GEOMETRY];for(var b=n.create(n.NEGATIVE_INFINITY),c=[0,0,0],d=[0,0,0],e=0;e<a.length;e++){var f=a[e].getBoundingInfo();p.vec3d.set(f.getBBMin(),c);p.vec3d.set(f.getBBMax(),d);for(f=0;3>f;++f)b[f]=Math.min(b[f],c[f]),b[f+3]=Math.max(b[f+3],d[f])}return b};h.createStageResources=B})},"esri/core/Version":function(){define(["require","exports","./Error"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});
- r=function(){function a(a,c,f){void 0===f&&(f="");this.major=a;this.minor=c;this._context=f}a.prototype.lessThan=function(a,c){return this.major<a||a===this.major&&this.minor<c};a.prototype.since=function(a,c){return!this.lessThan(a,c)};a.prototype.validate=function(a){if(this.major!==a.major)throw new f((this._context&&this._context+":")+"unsupported-version","Required major "+(this._context&&this._context+" ")+"version is '"+this.major+"', but got '${version.major}.${version.minor}'",{version:a});
- };a.prototype.clone=function(){return new a(this.major,this.minor,this._context)};a.parse=function(e,c){void 0===c&&(c="");var g=e.split("."),d=g[0],g=g[1],b=/^\s*\d+\s*$/;if(!d||!d.match||!d.match(b))throw new f((c&&c+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!g||!g.match||!g.match(b))throw new f((c&&c+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});e=parseInt(d,10);d=parseInt(g,10);return new a(e,
- d,c)};return a}();h.Version=r})},"esri/views/3d/layers/graphics/Graphics3DPathSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../geometry/Point ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ../../../../views/3d/lib/glMatrix ../../support/projectionUtils ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/Util ../../webgl-engine/materials/DefaultMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){function v(a,b,d,e){for(var f=a.getGeometryRecords(),g=f.length,k="absolute-height"!==b.mode,l=0,h=0;h<g;h++){var m=f[h].geometry,n=[f[h].transformation[12],f[h].transformation[13],f[h].transformation[14]],p=m.getData().getVertexAttr(),t=p[z.POSITION].data,q=p.zOffset.data,p=p.mapPos.data,u=p.length/3;B(t.length/3===u*E+2,"unexpected tube geometry");var v=0,x=0;A.spatialReference=d.spatialReference;for(var r=0,F=0;F<u;F++){A.x=p[3*F];A.y=p[3*F+1];A.z=p[3*
- F+2];var I=c.computeElevation(d,A,b,e,k?D:null);k&&(r+=D.terrainElevation);var G=E;0!==F&&F!==u-1||G++;for(var P=0;P<G;P++)C[0]=t[v]+n[0],C[1]=t[v+1]+n[1],C[2]=t[v+2]+n[2],e.setAltitude(I+q[x],C),t[v]=C[0]-n[0],t[v+1]=C[1]-n[1],t[v+2]=C[2]-n[2],v+=3,x+=1;m.invalidateBoundingInfo()}a.geometryVertexAttrsUpdated(h);l+=r/u}return l/g}var x=b.vec3d,m=b.mat4d,B=u.assert;r=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}f(b,a);b.prototype._prepareResources=function(){if(!this._isPropertyDriven("size")){var a=
- d.validateSymbolLayerSize(this._getSymbolSize());if(a){this._logWarning(a);this.reject();return}}var a=this._getStageIdHint(),b=this._getMaterialOpacityAndColor(),c=x.create(b),b=b[3],c={diffuse:c,ambient:c,opacity:b,transparent:1>b||this._isPropertyDriven("opacity"),vertexColors:this._isPropertyDriven("color")||this._isPropertyDriven("opacity")};this._material=new q(c,a+"_3dlinemat");this._context.stage.add(l.ModelContentType.MATERIAL,this._material);this.resolve()};b.prototype.destroy=function(){a.prototype.destroy.call(this);
- this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(l.ModelContentType.MATERIAL,this._material.id),this._material=null)};b.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);if("polyline"!==c.type)return this._logWarning("unsupported geometry type for path symbol: "+c.type),null;var c="graphic"+a.uid,d=this.getGraphicElevationContext(a);return this._createAs3DShape(a,b,d,c,a.uid)};b.prototype.layerPropertyChanged=function(a,b,d){if("opacity"===
- a)return b=this._getMaterialOpacity(),d=1>b||this._isPropertyDriven("opacity"),this._material.setParameterValues({opacity:b,transparent:d}),!0;if("elevationInfo"===a){this._updateElevationContext();for(var e in b){var f=b[e];if(a=d(f))f=this.getGraphicElevationContext(f.graphic),a.needsElevationUpdates=c.needsElevationUpdates3D(f.mode),a.elevationContext.set(f)}return!0}return!1};b.prototype._getPathSize=function(a){a=a.size&&this._isPropertyDriven("size")?c.getSingleSizeDriver(a.size):this._getSymbolSize();
- return a/=this._context.renderCoordsHelper.unitInMeters};b.prototype._getSymbolSize=function(){return this.symbol.size||1};b.prototype._createAs3DShape=function(a,b,d,f,g){var l=a.geometry,h=l.hasZ,q=l.paths;a=[];var u=[],z=[],B=x.create(),r=this._context.renderSpatialReference===k.SphericalECEFSpatialReference,C=Array(6),A=this._getPathSize(b),l=c.getGeometryVertexData3D(q,h,l.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,d);
- this._logGeometryCreationWarnings(l,q,"paths","PathSymbol3DLayer");if(0<q.length){for(var q=l.geometryData.outlines,h=l.eleVertexData,D=l.vertexData,F=0;F<q.length;++F){var I=q[F];if(!(1>=I.count)){var G=I.index,P=I.count;if(this._context.clippingExtent&&(c.computeBoundingBox(h,G,P,C),c.boundingBoxClipped(C,this._context.clippingExtent)))continue;c.chooseOrigin(D,G,P,B);c.subtractCoordinates(D,G,P,B);I=new Float64Array(h.buffer,3*G*h.BYTES_PER_ELEMENT,3*P);G=c.flatArrayToArrayOfArrays(D,G,P);G=n.createTubeGeometry(G,
- .5*A,E,r,B);G.getVertexAttr().mapPos={size:3,data:I,offsetIdx:0,strideIdx:3};this._material.getParams().vertexColors&&(I=this._getVertexOpacityAndColor(b),G=n.addVertexColors(G,I));I=new p(G,f+"path"+F);I.singleUse=!0;a.push(I);u.push([this._material]);I=m.identity();m.translate(I,B,I);z.push(I)}}if(0<a.length)return b=new t({geometries:a,materials:u,transformations:z,castShadow:!0,metadata:{layerUid:this._context.layer.uid,graphicId:g},idHint:f}),b=new e(this,b,a,null,null,v,d),b.alignedTerrainElevation=
- l.terrainElevation,b.needsElevationUpdates=c.needsElevationUpdates3D(d.mode),b}return null};return b}(g);var z=u.VertexAttrConstants,C=x.create(),A=new a,D={verticalDistanceToGround:0,terrainElevation:0},E=10;return r})},"esri/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../core/screenUtils ../../../../core/libs/earcut/earcut ../../../../geometry/Polygon ./ElevationAligners ./Graphics3DDrapedGraphicLayer ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ./lineUtils ../../lib/glMatrix ../../support/aaBoundingBox ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryData ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry ../../webgl-engine/lib/Util ../../webgl-engine/materials/ColorMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A){var D=C.VertexAttrConstants;r=u.vec3d;var E=u.mat4d;p=function(h){function p(){var a=null!==h&&h.apply(this,arguments)||this;a._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0};return a}f(p,h);p.prototype._prepareResources=function(){this._prepareFillResources();this._prepareOutlineResources();this.resolve()};p.prototype._prepareFillResources=function(){var a=this._getStageIdHint(),b=this._getMaterialOpacityAndColor(),b=
- {color:b,transparent:1>b[3]||this._isPropertyDriven("opacity"),polygonOffset:!1,vertexColors:!0};this._material=new A(b,a+"_colormat");this._context.stage.add(v.ModelContentType.MATERIAL,this._material)};p.prototype._prepareOutlineResources=function(){var a=this.symbol.outline;if(this._hasOutline=!!(a&&a.size&&0<a.size&&a.color))a={idHint:this._getStageIdHint()+"_outline",color:this._getOutlineColor(),width:e.pt2px(a.size)},this._outlineMaterial=1.5<=a.width?t.createRibbonMaterial(a):t.createNativeMaterial(a),
- this._context.stage.add(v.ModelContentType.MATERIAL,this._outlineMaterial)};p.prototype.destroy=function(){h.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(v.ModelContentType.MATERIAL,this._material.id),this._material=null);this._outlineMaterial&&(this._context.stage.remove(v.ModelContentType.MATERIAL,this._outlineMaterial.id),this._outlineMaterial=null)};p.prototype.createGraphics3DGraphic=function(a,b){var c=this._validateGeometry(a.geometry);
- if("polyline"!==c.type&&"polygon"!==c.type&&"extent"!==c.type)return this._logWarning("unsupported geometry type for fill symbol: "+c.type),null;c="graphic"+a.uid;b=this._getVertexOpacityAndColor(b,Uint8Array,255);var d=this.getGraphicElevationContext(a);return"on-the-ground"===d.mode?this._createAsOverlay(a,b,d,c):this._createAs3DShape(a,b,d,c,a.uid)};p.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)return b=this._material.getColor(),c=this._getMaterialOpacity(),this._material.setColor([b[0],
- b[1],b[2],c]),this._material.setTransparent(1>c),this._outlineMaterial&&(b=this._outlineMaterial.getColor(),this._outlineMaterial.setColor([b[0],b[1],b[2],this._getOutlineOpacity()])),!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var d=this._elevationContext.mode;if(null==a||null==d)return!1;if("on-the-ground"===a&&"on-the-ground"===d)return!0;if(a!==d&&("on-the-ground"===a||"on-the-ground"===d))return!1;a=l.needsElevationUpdates2D(d);for(var e in b){var f=
- b[e];(d=c(f))&&!d.isDraped()&&(f=f.graphic,d.needsElevationUpdates=a,d.elevationContext.set(this.getGraphicElevationContext(f)))}return!0}return!1};p.prototype.setDrawOrder=function(a,b,c){this._material&&(this._material.renderPriority=a+b/2,c[this._material.id]=!0);this._outlineMaterial&&(this._outlineMaterial.renderPriority=a,c[this._outlineMaterial.id]=!0)};p.prototype._createAs3DShape=function(a,b,c,e,f){var g=this._getPolyGeometry(a),h=g.hasZ;a=g.rings;var m=this._getOutlineGeometry(g,a),g=l.getGeometryVertexData3D(m,
- h,g.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,c);G.idHint=e;G.color=b;G.data=g;var n;this._hasOutline&&(n=new g.vertexData.constructor(g.vertexData));G.outNum=0;G.outGeometries=[];G.outTransforms=[];G.outMaterials=[];this._createAs3DShapeFill(G);G.data.vertexData=n;this._createAs3DShapeOutline(G);this._logGeometryCreationWarnings(G.data,a,"rings","FillSymbol3DLayer");if(0===G.outNum)return null;b=new B({geometries:G.outGeometries,
- materials:G.outMaterials,transformations:G.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicId:f},idHint:e});b=new k(this,b,G.outGeometries,null,null,d.perVertexElevationAligner,c);b.alignedTerrainElevation=g.terrainElevation;b.needsElevationUpdates=l.needsElevationUpdates2D(c.mode);return b};p.prototype._createAs3DShapeFill=function(a){for(var b=a.data.geometryData.polygons,d=a.data.eleVertexData,e=a.data.vertexData,f=function(f){var k=b[f];f=k.count;var h=k.index;if(g._context.clippingExtent&&
- (l.computeBoundingBox(d,h,f,F),l.boundingBoxClipped(F,g._context.clippingExtent)))return"continue";var m=new Float64Array(d.buffer,3*h*d.BYTES_PER_ELEMENT,3*f),n=new Float64Array(e.buffer,3*h*e.BYTES_PER_ELEMENT,3*f),k=k.holeIndices.map(function(a){return a-h}),k=c(m,k,3);if(0===k.length)return"continue";l.chooseOrigin(e,h,f,I);l.subtractCoordinates(e,h,f,I);f=g._createFillGeometry(k,0,n,m,a.color);f=new x(f,a.idHint);f.singleUse=!0;m=E.identity();E.translate(m,I,m);a.outGeometries.push(f);a.outMaterials.push([g._material]);
- a.outTransforms.push(m);a.outNum++},g=this,k=0;k<b.length;++k)f(k)};p.prototype._createAs3DShapeOutline=function(a){if(this._hasOutline)for(var b=a.data.geometryData.outlines,c=a.data.eleVertexData,d=a.data.vertexData,e=0;e<b.length;++e){var f=b[e],g=f.index,k=f.count;if(this._context.clippingExtent&&(l.computeBoundingBox(c,g,k,F),l.boundingBoxClipped(F,this._context.clippingExtent)))continue;l.chooseOrigin(d,g,k,I);l.subtractCoordinates(d,g,k,I);f=new Float64Array(c.buffer,3*g*c.BYTES_PER_ELEMENT,
- 3*k);g=new Float64Array(d.buffer,3*g*d.BYTES_PER_ELEMENT,3*k);g=t.createPolylineGeometry(g,f,a.isRings,P,0);g=new x(g,a.idHint+"outline"+e);g.singleUse=!0;f=E.identity();E.translate(f,I,f);a.outGeometries.push(g);a.outMaterials.push([this._outlineMaterial]);a.outTransforms.push(f);a.outNum++}};p.prototype._createAsOverlay=function(a,c,d,e){var f=this._getPolyGeometry(a);a=f.rings;var g=this._getOutlineGeometry(f,a);this._material.renderPriority=this._symbolLayerOrder+this._symbolLayerOrderDelta/2;
- this._hasOutline&&(this._outlineMaterial.renderPriority=this._symbolLayerOrder);f=l.getGeometryVertexDataDraped(g,f.spatialReference,this._context.overlaySR);G.idHint=e;G.color=c;G.data=f;var k;this._hasOutline&&(k=new f.vertexData.constructor(f.vertexData));G.outNum=0;G.outGeometries=[];G.outBoundingBox=q.create(q.NEGATIVE_INFINITY);this._createAsOverlayFill(G);G.data.vertexData=k;this._createAsOverlayOutline(G);this._logGeometryCreationWarnings(G.data,a,"rings","FillSymbol3DLayer");return 0<G.outNum?
- new b(this,G.outGeometries,null,null,G.outBoundingBox,d):null};p.prototype._createAsOverlayFill=function(a){for(var b=a.data.vertexData,d=a.data.geometryData.polygons,e=function(e){var g=d[e];e=g.count;var k=g.index,h=new Float64Array(b.buffer,3*k*b.BYTES_PER_ELEMENT,3*e),g=g.holeIndices.map(function(a){return a-k}),h=c(h,g,3);if(0===h.length)return"continue";l.computeBoundingBox(b,k,e,F);if(l.boundingBoxClipped(F,f._context.clippingExtent))return"continue";q.expand(a.outBoundingBox,F);l.chooseOrigin(b,
- k,e,I);l.subtractCoordinates(b,k,e,I);l.setZ(b,k,e,f._getDrapedZ());e=E.identity();E.translate(e,I,e);h=f._createFillGeometry(h,k,b,null,a.color);g=new z(h);g.material=f._material;var m=F;g.center=[.5*(m[0]+m[3]),.5*(m[1]+m[4]),0];g.bsRadius=.5*Math.sqrt((m[3]-m[0])*(m[3]-m[0])+(m[4]-m[1])*(m[4]-m[1]));g.transformation=e;g.name=a.idHint;g.uniqueName=a.idHint+"#"+h.id;a.outGeometries.push(g);a.outNum++},f=this,g=0;g<d.length;++g)e(g)};p.prototype._createAsOverlayOutline=function(a){if(this._hasOutline)for(var b=
- a.data.vertexData,c=a.data.geometryData.outlines,d=0;d<c.length;++d){var e=c[d],f=e.index,e=e.count;l.computeBoundingBox(b,f,e,F);if(!l.boundingBoxClipped(F,this._context.clippingExtent)){q.expand(a.outBoundingBox,F);l.chooseOrigin(b,f,e,I);l.subtractCoordinates(b,f,e,I);l.setZ(b,f,e,this._getDrapedZ());e=new Float64Array(b.buffer,3*f*b.BYTES_PER_ELEMENT,3*e);f=E.identity();E.translate(f,I,f);var e=t.createPolylineGeometry(e,null,!0,P,0),g=new z(e);g.material=this._outlineMaterial;var k=F;g.center=
- [.5*(k[0]+k[3]),.5*(k[1]+k[4]),0];g.bsRadius=.5*Math.sqrt((k[3]-k[0])*(k[3]-k[0])+(k[4]-k[1])*(k[4]-k[1]));g.transformation=f;g.name=a.idHint+"outline";g.uniqueName=a.idHint+"outline#"+e.id;a.outGeometries.push(g);a.outNum++}}};p.prototype._getOutlineGeometry=function(a,b){return b};p.prototype._getOutlineOpacity=function(){return this._getLayerOpacity()*this.symbol.outline.color.a};p.prototype._getOutlineColor=function(){var b=this.symbol.outline.color,c=this._getOutlineOpacity();return n.mixinColorAndOpacity(a.toUnitRGB(b),
- c)};p.prototype._getPolyGeometry=function(a){a=a.geometry;return"extent"===a.type?g.fromExtent(a):a};p.prototype._createFillGeometry=function(a,b,c,d,e){for(var f=a.length,g=new Uint32Array(f),k=new Uint32Array(f),l=0;l<f;l++)g[l]=a[l]+b,k[l]=0;a={};b={};a[D.POSITION]=g;a[D.COLOR]=k;b[D.POSITION]={size:3,data:c};b[D.COLOR]={size:4,data:e};d&&(b.mapPos={size:3,data:d},a.mapPos=g);return new m(b,a)};return p}(p);var F=q.create(),I=r.create(),P=new Float32Array([255,255,255,255]),G={idHint:null,color:null,
- data:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};return p})},"esri/views/3d/layers/graphics/Graphics3DTextSymbolLayer":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../Color ../../../../core/screenUtils ../../../../symbols/callouts/calloutUtils ./ElevationAligners ./Graphics3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/GeometryUtil ../../webgl-engine/lib/TextTexture ../../webgl-engine/materials/HUDMaterial".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q=[1,1,1,1],v=[0,0,1],x={mode:"relative-to-ground",offset:0},m=[0,0,0,1];return function(k){function h(){var a=null!==k&&k.apply(this,arguments)||this;a._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1};return a}f(h,k);h.prototype._prepareResources=function(){if(!this._isPropertyDriven("size")){var a=l.validateSymbolLayerSize(this._getTextSize());if(a){this._logWarning(a);this.reject();return}}this._anchor="center";this.resolve()};h.prototype.destroy=
- function(){k.prototype.destroy.call(this);this.isFulfilled()||this.reject()};h.prototype.createGraphics3DGraphic=function(a,b,c,d){var e="polyline"===a.geometry.type,f=this._getGeometryCentroid(a);if(!f)return this._logWarning("unsupported geometry type for text symbol: "+a.geometry.type),null;var g=this._context.layer.id+"_label_"+a.uid,k=b.text||this.symbol.text;if(!k||1>k.length)return null;b&&null!=b.needsOffsetAdjustment&&(this._elevationOptions.needsOffsetAdjustment=b.needsOffsetAdjustment);
- var l=this.getGraphicElevationContext(a,b.elevationOffset||0);return this._createAs3DShape(this.symbol,f,k,l,g,a.uid,b,c,d,e)};h.prototype.getGraphicElevationContext=function(a,b){void 0===b&&(b=0);a=k.prototype.getGraphicElevationContext.call(this,a);a.addOffsetRenderUnits(b);return a};h.prototype.layerPropertyChanged=function(a,b,c){if("opacity"===a)this._logWarning("layer opacity change not yet implemented in Graphics3DTextSymbolLayer");else if("elevationInfo"===a){this._updateElevationContext();
- if(b)for(var d in b){a=b[d];var e=c(a);e&&this.updateGraphicElevationContext(a.graphic,e)}return!0}return!1};h.prototype.updateGraphicElevationContext=function(a,c){a=this.getGraphicElevationContext(a,c.metadata.elevationOffset);c.elevationContext.set(a);c.needsElevationUpdates=b.needsElevationUpdates2D(a.mode)||"absolute-height"===a.mode};h.prototype._defaultElevationInfoNoZ=function(){return x};h.prototype._createAs3DShape=function(f,k,l,h,x,z,B,r,M,H){var C=B.centerOffset||m,A=B.screenOffset||
- [0,0],E=B.debugDrawBorder||!1,D=B.translation||[0,0,0],F=B.anchor||this._anchor||"center";this._anchor=F;var I=f.material?a.toUnitRGBA(f.material.color):q,G=f.halo&&f.halo.color&&0<f.halo.size,P=G?a.toUnitRGBA(f.halo.color):q,G=G?e.pt2px(f.halo.size):0,K=this._getTextSize(f);f=new t(l,{size:K,color:I,font:{family:f.font&&f.font.family?f.font.family:"Arial",weight:f.font&&f.font.weight?f.font.weight:"normal",style:f.font&&f.font.style?f.font.style:"normal"},halo:{size:G,color:P}},x);M=(I=M&&M.canHoldTextTexture(f))?
- M.addTextTexture(f):null;var L;r?L=B:c.isCalloutSupport(this.symbolContainer)&&this.symbolContainer.hasVisibleVerticalOffset()&&(L=this.symbolContainer);A={textureId:I?M.texture.id:f.id,texCoordScale:I?[1,1]:f.getTexcoordScale(),occlusionTest:!0,screenOffset:A,anchorPos:F,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:B.centerOffsetUnits,debugDrawBorder:E,drawInSecondSlot:!0};L&&L.verticalOffset&&(L=L.verticalOffset,E=L.minWorldLength,F=L.maxWorldLength,A.verticalOffset={screenLength:e.pt2px(L.screenLength),
- minWorldLength:E||0,maxWorldLength:null!=F?F:Infinity});this._context.screenSizePerspectiveEnabled&&(L=this._context.sharedResources,E=L.screenSizePerspectiveSettings,A.screenSizePerspective=L.screenSizePerspectiveSettingsLabels.overridePadding(G),A.screenSizePerspectiveAlignment=E);H&&(A.shaderPolygonOffset=1E-4);H=null;G=JSON.stringify(A);null!=r?(H=r.getMaterial(G),null==H?(H=new u(A,x),r.addMaterial(G,H)):I&&H.setTextureDirty()):H=new u(A,x);H=[H];G=[f.getTextWidth(),f.getTextHeight()];C=n.createPointGeometry(v,
- D,void 0,G,C,M?M.uvMinMax:null);C=[new p(C,x)];x=b.createStageObjectForPoint.call(this,k,C,[H],null,null,h,x,this._context.layer.uid,z,!0);r=new d(this,x.object,C,null==r?H:null,I?null:[f],g.perObjectElevationAligner,h);r.alignedTerrainElevation=x.terrainElevation;r.needsElevationUpdates=b.needsElevationUpdates2D(h.mode)||"absolute-height"===h.mode;var V=I?f.getTextWidth():f.getWidth(),U=I?f.getTextHeight():f.getHeight();r.getScreenSize=function(a){void 0===a&&(a=Array(2));a[0]=V;a[1]=U;return a};
- r.metadata={labelText:l,elevationOffset:B.elevationOffset||0};b.extendPointGraphicElevationContext(r,k,this._context.elevationProvider);return r};h.prototype._getTextSize=function(a){return e.pt2px((a||this.symbol).size)||12};return h}(k)})},"esri/views/3d/webgl-engine/lib/TextTexture":function(){define(["require","exports","./Texture","./Util","../../../webgl/Texture"],function(r,h,f,a,e){function c(){var a=document.createElement("canvas");a.width=512;a.height=512;return a}function g(a){return"rgb("+
- a.slice(0,3).map(function(a){return Math.floor(255*a)}).toString()+")"}function d(a){return"rgba("+a.slice(0,3).map(function(a){return Math.floor(255*a)}).toString()+","+a[3]+")"}r=function(){function k(b,c,e,f){void 0===f&&(f=!0);this._idHint=e;this._text=b;this._textLines=b.split(/\r?\n/);this._params=c;this._haloSize=Math.round(this._params.halo.size);this._fillStyle=d(this._params.color);this._haloStyle=g(this._params.halo.color);this._textWidth=this._computeTextWidth();this._lineHeight=this._computeLineHeight();
- this._textHeight=this._computeTextHeight();this._scaleFactor=f?Math.min(1,Math.min(2048/this._textWidth,2048/this._textHeight)):1;this._renderedWidth=Math.round(this._textWidth*this._scaleFactor);this._renderedHeight=Math.round(this._textHeight*this._scaleFactor);f&&a.assert(2048>=this._renderedWidth&&2048>=this._renderedHeight);this._width=a.nextHighestPowerOfTwo(this._renderedWidth);this._height=a.nextHighestPowerOfTwo(this._renderedHeight)}Object.defineProperty(k.prototype,"id",{get:function(){null==
- this._id&&(this._id=f.idGen.gen(this._idHint));return this._id},enumerable:!0,configurable:!0});k.prototype.getParams=function(){return this._params};k.prototype.getText=function(){return this._text};k.prototype.deferredLoading=function(){return!1};k.prototype.getWidth=function(){return this._width};k.prototype.getHeight=function(){return this._height};k.prototype.getTextWidth=function(){return this._textWidth};k.prototype.getTextHeight=function(){return this._textHeight};k.prototype.getRenderedWidth=
- function(){return this._renderedWidth};k.prototype.getRenderedHeight=function(){return this._renderedHeight};k.prototype.initializeThroughRender=function(a,b){var c=this._getTextCanvas();c.width=this._width;c.height=this._height;var d=c.getContext("2d");d.save();b.samplingMode=9987;b.wrapMode=33071;b.flipped=!0;b.preMultiplyAlpha=!0;b.hasMipmap=!0;this.renderText(this._renderedWidth,this._renderedHeight,d,0,this._height-this._renderedHeight);a=new e(a,b,c);d.restore();return a};k.prototype.getTexcoordScale=
- function(){return[this._renderedWidth/this._width,this._renderedHeight/this._height]};k.prototype.setUnloadFunc=function(a){this._unloadFunc=a};k.prototype.unload=function(){this._unloadFunc&&(this._unloadFunc(this._id),this._unloadFunc=null)};k.prototype.renderText=function(a,c,d,e,f){void 0===e&&(e=0);void 0===f&&(f=0);c=this._lineHeight*this._scaleFactor;var g=this._haloSize,k=d.textAlign;a=("center"===k?.5*a:"right"===k?a:0)+g;d.save();var l=3>g;if(0<g){var k=g,h=this._getHaloCanvas();h.width=
- Math.max(512,this._renderedWidth);h.height=Math.max(512,this._renderedHeight);var n=h.getContext("2d");n.clearRect(0,0,h.width,h.height);this._setFontProperties(n,this._params.size*this._scaleFactor);n.fillStyle=this._haloStyle;n.strokeStyle=this._haloStyle;n.lineJoin=l?"miter":"round";if(l)for(var p=0,t=this._textLines;p<t.length;p++){for(var l=t[p],u=0,r=b;u<r.length;u++){var E=r[u];n.fillText(l,a+g*E[0],g+g*E[1])}k+=c}else for(p=0,t=this._textLines;p<t.length;p++){l=t[p];u=2*g;for(r=0;5>r;r++)n.lineWidth=
- (.6+.1*r)*u,n.strokeText(l,a,k);k+=c}d.globalAlpha=this._params.halo.color[3];d.drawImage(h,e,f);h.width=512;h.height=512;d.globalAlpha=1}this._setFontProperties(d,this._params.size*this._scaleFactor);k=f+g;f=0;for(g=this._textLines;f<g.length;f++)l=g[f],d.globalCompositeOperation="destination-out",d.fillStyle="rgb(0, 0, 0)",d.fillText(l,e+a,k),d.globalCompositeOperation="source-over",d.fillStyle=this._fillStyle,d.fillText(l,e+a,k),k+=c;d.restore()};k.preferredAtlasSize=function(){return 512};k.prototype._getTextCanvas=
- function(){null==k._textCanvas2D&&(k._textCanvas2D=c());return k._textCanvas2D};k.prototype._getHaloCanvas=function(){null==k._haloCanvas2D&&(k._haloCanvas2D=c());return k._haloCanvas2D};k.prototype._setFontProperties=function(a,b){var c=this._params.font;a.font=c.style+" "+c.weight+" "+b+"px "+c.family;a.textAlign="left";a.textBaseline="top"};k.prototype._computeTextWidth=function(){var a=this._getTextCanvas().getContext("2d");this._setFontProperties(a,this._params.size);for(var b=0,c=0,d=this._textLines;c<
- d.length;c++){var e=a.measureText(d[c]).width;e>b&&(b=e)}c=this._params.font;if("italic"===c.style||"oblique"===c.style||"string"===typeof c.weight&&("bold"===c.weight||"bolder"===c.weight)||"number"===typeof c.weight&&600<c.weight)b+=.3*a.measureText("A").width;b+=2*this._haloSize;return b=Math.round(b)};k.prototype._computeLineHeight=function(){return Math.floor(1.275*this._params.size+2*this._haloSize)};k.prototype._computeTextHeight=function(){return this._computeLineHeight()*this._textLines.length};
- return k}();var b=[];for(h=0;360>h;h+=22.5)b.push([Math.cos(Math.PI*h/180),Math.sin(Math.PI*h/180)]);return r})},"esri/views/3d/layers/graphics/Graphics3DWebStyleSymbol":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../support/PromiseLightweight"],function(r,h,f,a){return function(a){function c(c,d){var b=a.call(this)||this;b.symbol=null;b.graphics3DSymbol=null;b.symbol=c;c.fetchSymbol().then(function(a){if(b.isRejected())throw Error();b.graphics3DSymbol=d(a)}).then(function(){if(b.isRejected())throw Error();
- b.graphics3DSymbol.then(function(){b.isRejected()||b.resolve()},function(a){b.isRejected()||b.reject(a)})}).catch(function(a){b.isRejected()||b.reject(a)});return b}f(c,a);c.prototype.createGraphics3DGraphic=function(a,c){return this.graphics3DSymbol.createGraphics3DGraphic(a,c,this)};c.prototype.layerPropertyChanged=function(a,c){return this.graphics3DSymbol.layerPropertyChanged(a,c)};c.prototype.applyRendererDiff=function(a,c,b){return this.graphics3DSymbol.applyRendererDiff(a,c,b)};c.prototype.getFastUpdateStatus=
- function(){return this.graphics3DSymbol?this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}};c.prototype.setDrawOrder=function(a,c){return this.graphics3DSymbol.setDrawOrder(a,c)};c.prototype.destroy=function(){this.isFulfilled()||this.reject();this.graphics3DSymbol&&this.graphics3DSymbol.destroy()};return c}(a.Promise)})},"esri/views/3d/webgl-engine/lib/FloatingBoxLocalOriginFactory":function(){define(["require","exports","./gl-matrix"],function(r,h,f){var a=f.vec3d;r=function(){function c(a,
- c){this._origins=[];this._boxSize=a;this._maxNumOrigins=c}c.prototype.getOrigin=function(f){for(var d=this._origins.length,b,g=!1,l=Number.MAX_VALUE,h=0;h<d;h++){var n=this._origins[h];a.subtract(f,n.vec3,e);e[0]=Math.abs(e[0]);e[1]=Math.abs(e[1]);e[2]=Math.abs(e[2]);var t=e[0]+e[1]+e[2];t<l&&(b=n,l=t,g=e[0]<this._boxSize&&e[1]<this._boxSize&&e[2]<this._boxSize)}g||b&&null!=this._maxNumOrigins&&!(this._origins.length<this._maxNumOrigins)||(d=c.OFFSET,b={vec3:[f[0]+d,f[1]+d,f[2]+d],id:c.ORIGIN_PREFIX+
- this._origins.length},this._origins.push(b));return b};c.OFFSET=1.11;c.ORIGIN_PREFIX="fb_";return c}();var e=a.create();return r})},"esri/views/3d/webgl-engine/lib/Layer":function(){define("require exports dojo/has ./gl-matrix ./IdGen ./ModelContentType ./Octree ./PerformanceTimer ./Util".split(" "),function(r,h,f,a,e,c,g,d,b){var k=a.vec3d;return function(){function a(b,c,d){this._parentStages=[];this._children=[];this.id=a._idGen.gen(d);this.name=b;c=c||{};this.group=c.group||"";this.isPickable=
- null!=c.isPickable?c.isPickable:!0;this.translation=k.create(c.translation);this._extent=[k.createFrom(0,0,0),k.createFrom(1E3,1E3,1E3)];this._extentDirty=!0}a.prototype.getParentStages=function(){return this._parentStages};a.prototype.addParentStage=function(a){-1===this._parentStages.indexOf(a)&&this._parentStages.push(a)};a.prototype.removeParentStage=function(a){a=this._parentStages.indexOf(a);-1<a&&this._parentStages.splice(a,1)};a.prototype.getName=function(){return this.name};a.prototype.getGroup=
- function(){return this.group};a.prototype.getTranslation=function(){return this.translation};a.prototype.getObjectIds=function(){return this._children.map(function(a){return a.id})};a.prototype.getObjects=function(){return this._children};a.prototype.getExtent=function(){this._updateExtent();return this._extent};a.prototype.addObject=function(a){this._children.push(a);a.addParentLayer(this);this.notifyDirty("layObjectAdded",a);this._invalidateExtent();this._spatialAccelerator&&this._spatialAccelerator.add(a)};
- a.prototype.hasObject=function(a){return-1<this._children.indexOf(a)};a.prototype.removeObject=function(a){return null!=b.arrayRemove(this._children,a)?(a.removeParentLayer(this),this.notifyDirty("layObjectRemoved",a),this._invalidateExtent(),this._spatialAccelerator&&this._spatialAccelerator.remove(a),!0):!1};a.prototype.replaceObject=function(a,c){var d=this._children.indexOf(a);b.assert(-1<d,"Layer.replaceObject: layer doesn't contain specified object");this._children[d]=c;a.removeParentLayer(this);
- c.addParentLayer(this);this.notifyDirty("layObjectReplaced",[a,c]);this._invalidateExtent();this._spatialAccelerator&&(this._spatialAccelerator.remove(a),this._spatialAccelerator.add(c))};a.prototype.notifyObjectBBChanged=function(a,b){this._spatialAccelerator&&this._spatialAccelerator.update(a,b)};a.prototype.getCenter=function(){this._updateExtent();var a=k.create();return k.lerp(this._extent[0],this._extent[1],.5,a)};a.prototype.getBSRadius=function(){this._updateExtent();return.5*k.dist(this._extent[0],
- this._extent[1])};a.prototype.getSpatialQueryAccelerator=function(){if(this._spatialAccelerator)return this._spatialAccelerator;if(50<this._children.length)return this._createOctree(),this._spatialAccelerator};a.prototype.shaderTransformationChanged=function(){this.notifyDirty("shaderTransformationChanged",null)};a.prototype.invalidateSpatialQueryAccelerator=function(){this._spatialAccelerator=null};a.prototype.notifyDirty=function(a,b,d,e){d=d||c.LAYER;e=e||this;for(var f=0;f<this._parentStages.length;f++)this._parentStages[f].notifyDirty(d,
- e,a,b)};a.prototype._createOctree=function(){for(var a=this.getExtent(),b=0,c=0;3>c;c++)b=Math.max(b,a[1][c]-a[0][c]);c=k.create();k.lerp(a[0],a[1],.5,c);this._spatialAccelerator=new g(c,1.2*b);this._spatialAccelerator.add(this._children)};a.prototype._invalidateExtent=function(){this._extentDirty=!0};a.prototype._updateExtent=function(){if(this._extentDirty)if(0===this._children.length)this._extent=[[0,0,0],[0,0,0]];else{var a=this._children[0];this._extent=[k.create(a.getBBMin()),k.create(a.getBBMax())];
- for(a=0;a<this._children.length;++a)for(var b=this._children[a],c=b.getBBMin(),b=b.getBBMax(),d=0;3>d;++d)this._extent[0][d]=Math.min(this._extent[0][d],c[d]),this._extent[1][d]=Math.max(this._extent[1][d],b[d]);this._extentDirty=!1}};a._idGen=new e;return a}()})},"esri/views/3d/webgl-engine/lib/Octree":function(){define(["require","exports","./gl-matrix","./Util"],function(r,h,f,a){function e(a,b,c){c=c||a;c[0]=a[0]+b;c[1]=a[1]+b;c[2]=a[2]+b;return c}var c=f.vec3d;r=function(){function d(a,b,d){this._maximumObjectsPerNode=
- 10;this._maximumDepth=20;this._autoResize=!0;this._outsiders=[];d&&(void 0!==d.maximumObjectsPerNode&&(this._maximumObjectsPerNode=d.maximumObjectsPerNode),void 0!==d.maximumDepth&&(this._maximumDepth=d.maximumDepth),void 0!==d.autoResize&&(this._autoResize=d.autoResize));isNaN(a[0])||isNaN(a[1])||isNaN(a[2])||isNaN(b)?this._root=new g(null,c.createFrom(0,0,0),.5):this._root=new g(null,a,b/2)}Object.defineProperty(d.prototype,"center",{get:function(){return this._root.center},enumerable:!0,configurable:!0});
- Object.defineProperty(d.prototype,"size",{get:function(){return 2*this._root.halfSize},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"root",{get:function(){return this._root.node},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"outsiders",{get:function(){return this._outsiders.slice()},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"maximumObjectsPerNode",{get:function(){return this._maximumObjectsPerNode},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,
- "maximumDepth",{get:function(){return this._maximumDepth},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"autoResize",{get:function(){return this._autoResize},enumerable:!0,configurable:!0});d.prototype.add=function(a){a=this._objectOrObjectsArray(a);this._grow(a);for(var b=g.acquire(),c=0;c<a.length;c++){var d=a[c];b.init(this._root);0===d.getBSRadius()||isNaN(d.getBSRadius())||!this._autoResize&&!this._fitsInsideTree(this._boundingSphereFromObject(d,t))?this._outsiders.push(d):
- this._add(d,b)}g.release(b)};d.prototype.remove=function(b,c){b=this._objectOrObjectsArray(b);for(var d=g.acquire(),e=!0,f=0;f<b.length;f++){var e=b[f],k=this._boundingSphereFromObject(c||e,t);0===k.radius||isNaN(k.radius)||!this._autoResize&&!this._fitsInsideTree(k)?e=null!=a.arrayRemove(this._outsiders,e):(d.init(this._root),e=this._remove(e,k,d))}g.release(d);this._shrink();return e};d.prototype.update=function(a,b){this.remove(a,b);this.add(a)};d.prototype.forEachAlongRay=function(b,c,d){this._forEachTest(function(d){e(d.center,
- 2*-d.halfSize,l);e(d.center,2*d.halfSize,p);return a.rayBoxTest(b,c,l,p)},d)};d.prototype.forEachInBoundingBox=function(a,b,c){this._forEachTest(function(c){for(var d=2*c.halfSize,e=0;3>e;e++)if(c.center[e]+d<a[e]||c.center[e]-d>b[e])return!1;return!0},c)};d.prototype.forEachNode=function(a){this._forEachNode(this._root,function(b){return a(b.node,b.center,2*b.halfSize)})};d.prototype._forEachTest=function(a,b){this._outsiders.forEach(b);this._forEachNode(this._root,function(c){return a(c)?(c=c.node,
- c.terminals.forEach(b),null!==c.residents&&c.residents.forEach(b),!0):!1})};d.prototype._forEachNode=function(a,b){a=g.acquire().init(a);for(var c=[a];0!==c.length;){a=c.pop();if(b(a)&&!a.isLeaf())for(var d=0;d<a.node.children.length;d++)a.node.children[d]&&c.push(g.acquire().init(a).advance(d));g.release(a)}};d.prototype._objectOrObjectsArray=function(a){Array.isArray(a)||(b[0]=a,a=b);return a};d.prototype._remove=function(b,c,d){n.length=0;d.advanceTo(c,function(a,b){n.push(a.node,b)})?(b=null!=
- a.arrayRemove(d.node.terminals,b),d=0===d.node.terminals.length):(b=null!=a.arrayRemove(d.node.residents,b),d=0===d.node.residents.length);if(d)for(d=n.length-2;0<=d&&this._purge(n[d],n[d+1]);d-=2);return b};d.prototype._nodeIsEmpty=function(a){if(0!==a.terminals.length)return!1;if(null!==a.residents)return 0===a.residents.length;for(var b=0;b<a.children.length;b++)if(a.children[b])return!1;return!0};d.prototype._purge=function(a,b){0<=b&&(a.children[b]=null);return this._nodeIsEmpty(a)?(null===a.residents&&
- (a.residents=[]),!0):!1};d.prototype._add=function(a,b){b.advanceTo(this._boundingSphereFromObject(a,t))?b.node.terminals.push(a):(b.node.residents.push(a),b.node.residents.length>this._maximumObjectsPerNode&&b.depth<this._maximumDepth&&this._split(b))};d.prototype._split=function(a){var b=a.node.residents;a.node.residents=null;for(var c=0;c<b.length;c++){var d=g.acquire().init(a);this._add(b[c],d);g.release(d)}};d.prototype._grow=function(a){if(0!==a.length&&this._autoResize&&(a=this._boundingSphereFromObjects(a,
- this._boundingSphereFromObject,u),!isNaN(a.radius)&&0!==a.radius&&!this._fitsInsideTree(a)))if(this._nodeIsEmpty(this._root.node))c.set(a.center,this._root.center),this._root.halfSize=1.25*a.radius;else{var b=g.acquire();this._rootBoundsForRootAsSubNode(a,b);this._placingRootViolatesMaxDepth(b)?this._rebuildTree(a,b):this._growRootAsSubNode(b);g.release(b)}};d.prototype._rebuildTree=function(a,b){var d=this;c.set(b.center,q.center);q.radius=b.halfSize;a=this._boundingSphereFromObjects([a,q],function(a){return a},
- v);b=g.acquire().init(this._root);this._root.initFrom(null,a.center,1.25*a.radius);this._forEachNode(b,function(a){d.add(a.node.terminals);null!==a.node.residents&&d.add(a.node.residents);return!0});g.release(b)};d.prototype._placingRootViolatesMaxDepth=function(a){var b=0;this._forEachNode(this._root,function(a){b=Math.max(b,a.depth);return!0});return b+Math.log(a.halfSize/this._root.halfSize)*Math.LOG2E>this._maximumDepth};d.prototype._rootBoundsForRootAsSubNode=function(a,b){var c=a.radius,d=a.center;
- a=-Infinity;for(var e=this._root.center,f=this._root.halfSize,g=0;3>g;g++){var l=Math.max(0,Math.ceil((e[g]-f-(d[g]-c))/(2*f))),h=Math.max(0,Math.ceil((d[g]+c-(e[g]+f))/(2*f)))+1;a=Math.max(a,Math.pow(2,Math.ceil(Math.log(l+h)*Math.LOG2E)));x[g].min=l;x[g].max=h}for(g=0;3>g;g++)l=x[g].min,h=x[g].max,c=(a-(l+h))/2,l+=Math.ceil(c),h+=Math.floor(c),k[g]=e[g]-f-l*f*2+(h+l)*f;return b.initFrom(null,k,a*f,0)};d.prototype._growRootAsSubNode=function(a){var b=this._root.node;c.set(this._root.center,u.center);
- u.radius=this._root.halfSize;this._root.init(a);a.advanceTo(u,null,!0);a.node.children=b.children;a.node.residents=b.residents;a.node.terminals=b.terminals};d.prototype._shrink=function(){if(this._autoResize)for(;;){var a=this._findShrinkIndex();if(-1===a)break;this._root.advance(a);this._root.depth=0}};d.prototype._findShrinkIndex=function(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;for(var a=null,b=this._root.node.children,c=0,d=0;d<b.length&&null==a;)c=d++,a=b[c];for(;d<
- b.length;)if(b[d++])return-1;return c};d.prototype._fitsInsideTree=function(a){var b=this._root.center,c=this._root.halfSize,d=a.center;return a.radius<=c&&d[0]>=b[0]-c&&d[0]<=b[0]+c&&d[1]>=b[1]-c&&d[1]<=b[1]+c&&d[2]>=b[2]-c&&d[2]<=b[2]+c};d.prototype._boundingSphereFromObject=function(a,b){c.set(a.getCenter(),b.center);b.radius=a.getBSRadius();return b};d.prototype._boundingSphereFromObjects=function(a,b,d){if(1===a.length){var e=b(a[0],u);c.set(e.center,d.center);d.radius=e.radius}else{l[0]=Infinity;
- l[1]=Infinity;l[2]=Infinity;p[0]=-Infinity;p[1]=-Infinity;p[2]=-Infinity;for(var f=0;f<a.length;f++){var e=b(a[f],u),g=l,k=e.center,h=e.radius;g[0]=Math.min(g[0],k[0]-h);g[1]=Math.min(g[1],k[1]-h);g[2]=Math.min(g[2],k[2]-h);g=p;k=e.center;e=e.radius;g[0]=Math.max(g[0],k[0]+e);g[1]=Math.max(g[1],k[1]+e);g[2]=Math.max(g[2],k[2]+e)}c.scale(c.add(l,p,d.center),.5);d.radius=Math.max(p[0]-l[0],p[1]-l[1],p[2]-l[2])/2}return d};return d}();var g=function(){function a(a,b,d,e){void 0===d&&(d=0);void 0===e&&
- (e=0);this.center=c.create();this.initFrom(a,b,d,0)}a.prototype.init=function(a){return this.initFrom(a.node,a.center,a.halfSize,a.depth)};a.prototype.initFrom=function(b,d,e,f){void 0===b&&(b=null);void 0===e&&(e=this.halfSize);void 0===f&&(f=this.depth);this.node=b||a.createEmptyNode();d&&c.set(d,this.center);this.halfSize=e;this.depth=f;return this};a.prototype.advance=function(b){var c=this.node.children[b];c||(c=a.createEmptyNode(),this.node.children[b]=c);this.node=c;this.halfSize/=2;this.depth++;
- b=d[b];this.center[0]+=b[0]*this.halfSize;this.center[1]+=b[1]*this.halfSize;this.center[2]+=b[2]*this.halfSize;return this};a.prototype.advanceTo=function(a,b,c){for(void 0===c&&(c=!1);;){if(this.isTerminalFor(a))return b&&b(this,-1),!0;if(this.isLeaf()&&!c)return b&&b(this,-1),!1;this.isLeaf()&&(this.node.residents=null);var d=this._childIndex(a);b&&b(this,d);this.advance(d)}};a.prototype.isLeaf=function(){return null!=this.node.residents};a.prototype.isTerminalFor=function(a){return a.radius>this.halfSize/
- 2};a.prototype._childIndex=function(a){a=a.center;for(var b=this.center,c=0,d=0;3>d;d++)b[d]<a[d]&&(c|=1<<d);return c};a.createEmptyNode=function(){return{children:[null,null,null,null,null,null,null,null],terminals:[],residents:[]}};a.acquire=function(){if(0===this._pool.length)return new a;var b=this._pool[this._pool.length-1];this._pool.length--;return b};a.release=function(a){this._pool.push(a)};a._pool=[];return a}(),d=[[-1,-1,-1],[1,-1,-1],[-1,1,-1],[1,1,-1],[-1,-1,1],[1,-1,1],[-1,1,1],[1,1,
- 1]],b=[null],k=c.create(),l=c.create(),p=c.create(),n=[],t={center:c.create(),radius:0},u={center:c.create(),radius:0},q={center:c.create(),radius:0},v={center:c.create(),radius:0},x=[{min:0,max:0},{min:0,max:0},{min:0,max:0}];return r})},"esri/views/3d/layers/graphics/Graphics3DElevationAlignment":function(){define(["require","exports","../../../../core/throttle","../../support/aaBoundingRect"],function(r,h,f,a){return function(){function e(){this.dirtyExtent=a.create(a.NEGATIVE_INFINITY);this.numPendingSpatialIndexQueries=
- 0;this.elevationDirtyGraphicsQueue=[];this.elevationDirtyGraphicsSet={};this.elevationUpdateEventHandle=null;this.eventHandles=[];this.updateElevation=!1;this.graphicsCore=this.layerView=null;this.markDirtyThrottled=f.throttle(this.markDirty,100,this)}e.prototype.initialize=function(a,e,d,b){var c=this;this.layerView=a;this.graphicsCore=d;this.elevationProvider=b;this.getGraphicsInExtent=e;this.elevationUpdateEventHandle=b.on("elevation-change",function(a){return c.elevationUpdateHandler(a)});this.eventHandles.push(this.layerView.watch("suspended",
- function(){return c.suspendedChange()}))};e.prototype.destroy=function(){this.elevationDirtyGraphicsSet=this.elevationDirtyGraphicsQueue=null;this.elevationUpdateEventHandle&&(this.elevationUpdateEventHandle.remove(),this.elevationUpdateEventHandle=null);this.eventHandles.forEach(function(a){return a.remove()});this.eventHandles=null;this.markDirtyThrottled.remove();this.getGraphicsInExtent=this.graphicsCore=this.layerView=null};e.prototype.clear=function(){this.elevationDirtyGraphicsSet={};this.elevationDirtyGraphicsQueue=
- []};e.prototype.suspendedChange=function(){!0===this.layerView.suspended?this.updateElevation=!1:!1===this.layerView.suspended&&this.updateElevation&&this.markAllGraphicsElevationDirty()};e.prototype.isUpdating=function(){return 0<this.elevationDirtyGraphicsQueue.length||this.markDirtyThrottled.hasPendingUpdates()||0<this.numPendingSpatialIndexQueries};e.prototype.numNodesUpdating=function(){return this.elevationDirtyGraphicsQueue.length};e.prototype.needsIdleUpdate=function(){return this.elevationProvider&&
- 0<this.elevationDirtyGraphicsQueue.length};e.prototype.idleUpdate=function(a){if(!a.done()){var c=this.layerView.view,d=this.elevationDirtyGraphicsQueue.length;if(0<d){for(var b=this.graphicsCore.stageLayer.id,e=this.graphicsCore.labelStageLayer?this.graphicsCore.labelStageLayer.id:null,f=0,h=0,h=0;h<d;h++){var n=this.elevationDirtyGraphicsQueue[h],t=this.graphicsCore.graphics[n];t&&t.alignWithElevation(this.elevationProvider,c.renderCoordsHelper);delete this.elevationDirtyGraphicsSet[n];f++;if(20<=
- f){c._stage.processDirtyLayer(b);null!=e&&c._stage.processDirtyLayer(e);if(a.done())break;f=0}}c._stage.processDirtyLayer(b);null!=e&&c._stage.processDirtyLayer(e);this.elevationDirtyGraphicsQueue.splice(0,h+1);c.deconflictor.setDirty();this.layerView._evaluateUpdatingState()}}};e.prototype.markAllGraphicsElevationDirty=function(){for(var a in this.graphicsCore.graphics)this.markGraphicElevationDirty(this.graphicsCore.graphics[a].graphic.uid);this.layerView._evaluateUpdatingState()};e.prototype.markGraphicElevationDirty=
- function(a){this.elevationDirtyGraphicsSet[a]||(this.elevationDirtyGraphicsSet[a]=!0,this.elevationDirtyGraphicsQueue.push(a))};e.prototype.elevationUpdateHandler=function(c){var e=c.extent;this.layerView.suspended?this.updateElevation||(c=this.graphicsCore.computedExtent)&&e[2]>c.xmin&&e[0]<c.xmax&&e[3]>c.ymin&&e[1]<c.ymax&&(this.updateElevation=!0):(a.expand(this.dirtyExtent,e),this.spatialReference=c.spatialReference,this.markDirtyThrottled(),this.layerView._evaluateUpdatingState())};e.prototype.markDirty=
- function(){var c=this,e=this.dirtyExtent;-Infinity===e[0]?this.markAllGraphicsElevationDirty():(this.numPendingSpatialIndexQueries++,this.getGraphicsInExtent(e,this.spatialReference,function(a,b){c.numPendingSpatialIndexQueries--;for(var d=0;d<b;d++){var e=a[d],f=c.graphicsCore.graphics[e];f&&f.needsElevationUpdates()&&c.markGraphicElevationDirty(e)}c.layerView._evaluateUpdatingState()}),this.layerView._evaluateUpdatingState());a.set(this.dirtyExtent,a.NEGATIVE_INFINITY)};return e}()})},"esri/core/throttle":function(){define(["require",
- "exports"],function(r,h){function f(a,e,c,f){var d=null,b=1E3;"number"===typeof e?(b=e,f=c):(d=e,b=c);var g=0,l,h=function(){g=0;a.apply(f,l)};e=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];d&&d.apply(f,a);l=a;b?g||(g=setTimeout(h,b)):h()};e.remove=function(){g&&(clearTimeout(g),g=0)};e.forceUpdate=function(){g&&(clearTimeout(g),h())};e.hasPendingUpdates=function(){return!!g};return e}Object.defineProperty(h,"__esModule",{value:!0});h.throttle=f;h.default=f})},"esri/views/3d/layers/graphics/Graphics3DSpatialIndex":function(){define("require exports dojo/Deferred ../../../../geometry/SpatialReference ../../../../geometry/support/webMercatorUtils ../../../../processors/SpatialIndex".split(" "),
- function(r,h,f,a,e,c){return function(){function g(){var a=this;this.spatialIndex=new c;this.spatialIndexNumPendingQueries=this.spatialIndexNumGraphics=0;this.graphicsCore=this.viewSR=this.layer=this.layerView=null;this._readyDfd=new f;var b=function(a){return a.workerClient&&a.workerClient.worker};if(b(this.spatialIndex))this._readyDfd.resolve();else this.spatialIndex.on("start",function(){b(a.spatialIndex)&&a._readyDfd.resolve()})}g.prototype.initialize=function(a,b,c,e){this.layerView=a;this.layer=
- b;this.viewSR=c;this.graphicsCore=e};g.prototype.destroy=function(){this.spatialIndex&&(this.spatialIndex.destroy(),this.spatialIndex=null);this.graphicsCore=this.layerView=this.viewSR=null};g.prototype.numNodesUpdating=function(){return 0};g.prototype.isUpdating=function(){return 0<this.spatialIndexNumPendingQueries};g.prototype.hasGraphics=function(){return 0<this.spatialIndexNumGraphics};g.prototype.intersects=function(a,b,c){var d=this;this.hasGraphics()?(this.spatialIndexNumPendingQueries++,
- this.spatialIndex.intersects(a,void 0,void 0,!0).then(function(a){d.spatialIndexNumPendingQueries--;c(a.results,a.results.length);d.layerView._evaluateUpdatingState()})):c([],0)};g.prototype.shouldAddToSpatialIndex=function(a,b,c){return c||b.needsElevationUpdates()};g.prototype.addGraphicsToSpatialIndex=function(a){if(this.layerView.loadedGraphics)for(var b=this.layerView.loadedGraphics.toArray(),c=b.length,d=0;d<c;d++){var e=b[d],f=this.graphicsCore.getGraphics3DGraphicById(e.uid);f&&!f.addedToSpatialIndex&&
- this.shouldAddToSpatialIndex(e,f,a)&&this.addGraphicToSpatialIndex(e,f)}};g.prototype.serializeGeometry=function(a){return"mesh"===a.type?a.extent.toJSON():a.toJSON()};g.prototype.addGraphicToSpatialIndex=function(c,b){var d=c.geometry.spatialReference,f=this.viewSR,g={id:c.uid,geometry:null};if(d.equals(f))g.geometry=this.serializeGeometry(c.geometry);else{var h=void 0;if(d.wkid===a.WGS84.wkid&&f.isWebMercator)h=e.geographicToWebMercator(c.geometry);else if(d.isWebMercator&&f.wkid===a.WGS84.wkid)h=
- e.webMercatorToGeographic(c.geometry);else return console.warn("Cannot convert graphic geometry to map spatial reference, elevation and scale updates are disabled"),!1;g.geometry=this.serializeGeometry(h)}this.spatialIndexNumGraphics++;this.spatialIndex.runProcess([g],this.layer.id);return b.addedToSpatialIndex=!0};g.prototype.whenLoaded=function(){return this._readyDfd.promise};return g}()})},"esri/processors/SpatialIndex":function(){define(["../core/declare","dojo/Deferred","dojo/_base/lang","./Processor",
- "../workers/WorkerClient"],function(r,h,f,a,e){return r([a],{declaredClass:"esri.processors.SpatialIndex",index:null,indexType:"rtree",autostart:!1,constructor:function(a){a=a||{};var c=!1!==a.autostart;f.mixin(this,a);this.workerCallback=["./scripts/helpers","./scripts/indexInterface","./indexWorker"];if(!this.fetchWithWorker){var d=this;this.workerClient=new e("./mutableWorker",function(a){this.workerClient=a;this.workerCallback.push("./libs/"+this.indexType);this.workerClient.importScripts(this.workerCallback).then(function(){d._attachedSystem=
- !0;c&&d.start()})}.bind(this))}this._featCache={}},destroy:function(){this.workerClient&&this.workerClient.terminate()},addLayer:function(a,e){if(a.graphics&&a.graphics.length||e||"feature"===a.type){var c=this.workerClient;if(!this._attachedSystem&&c.worker){var b=this;this.inherited(arguments,[a,!0]);c.importScripts("./libs/"+this.indexType).then(function(){b.runProcess(a.graphics,a.id);b._attachedSystem=!0})}else this.inherited(arguments,[a])}},unsetMap:function(){this.stop();this.workerClient.terminate();
- this.fetchWithWorker||(this.workerClient=new e(this.workerCallback,function(){}));this.inherited(arguments);this.start()},removeLayer:function(a){this.inherited(arguments)},runProcess:function(a,e){if(a&&a.length){var c=this,b=this.workerClient,f=a[0]._graphicsLayer;e||0===e||(e=f?f.id:"rawFeatures_"+Object.keys(this._featCache).length);this._featCache[e]||(this._featCache[e]={});for(var g,h,n=[],t=a.length,u=f&&f.objectIdField;t--;)h=a[t],g=h.attributes&&u?h.attributes[u]:h.id,null!=g&&this._featCache[e][g]||
- (this._featCache[e][g]=1,h.declaredClass?n.push({id:g,geometry:h.geometry.toJSON(!0),attributes:h.attributes}):n.push(h));0!==n.length&&(b.postMessage({insert:n,system:this.indexType,options:this.indexOptions,idField:f&&f.objectIdField,layerId:e}).then(function(a){f&&f.emit("process-end",{processor:c,results:{insert:a.insert}})}),f&&f.emit("process-start",{processor:this}))}},_sendFeaturesFromLayer:function(a,e){e=e.graphic;var c=this.workerClient,b=this,f=e.attributes[a.objectIdField];this._featCache[a.id]||
- (this._featCache[a.id]={});this._featCache[a.id][f]||(this._featCache[a.id][f]=1,c.postMessage({insert:[{attributes:e.attributes,geometry:e.geometry.toJSON(!0)}],system:this.indexType,options:this.indexOptions,idField:a.objectIdField,layerId:a.id}).then(function(c){a.emit("process-end",{processor:b,results:{insert:c.insert}})}),a.emit("process-start",{processor:b}))},_notifyProcessStart:function(a,e){},_sendFeaturesFromTask:function(a,e){e=e.featureSet.features;var c=[],b=this.workerClient,f=this,
- g=e.length,h,n;for(this._featCache[a.id]||(this._featCache[a.id]={});g--;)n=e[g],h=n.attributes[a.objectIdField],this._featCache[a.id][h]||(this._featCache[a.id][h]=1,c.push(n));b.postMessage({insert:c,system:this.indexType,options:this.indexOptions,idField:a.objectIdField,layerId:a.id}).then(function(b){a.emit("process-end",{processor:f,results:{insert:b.insert}})});a.emit("process-start",{processor:f})},get:function(){},intersects:function(a,e,d,b){return"rtree"!=this.indexType?(console.error("Index.intersects only works with rtree indexes"),
- a=new h,a.reject({message:"Index.intersects only works with rtree indexes"}),a.promise):this.workerClient.postMessage({search:a,layerId:e,returnNode:d,onlyIds:b})},within:function(a,e,d){if("rtree"!=this.indexType)return console.error("Index.within only works with rtree indexes"),a=new h,a.reject({message:"Index.within only works with rtree indexes"}),a.promise},nearest:function(a){return"kdtree"!=this.indexType?(console.error("Index.nearest only works with kdtree indexes"),a=new h,a.reject({message:"Index.nearest only works with kdtree indexes"}),
- a.promise):this.workerClient.postMessage({search:a})}})})},"esri/processors/Processor":function(){define("../core/sniff ../core/declare dojo/_base/lang dojo/_base/array dojo/Evented ../workers/RequestClient ../layers/GraphicsLayer".split(" "),function(r,h,f,a,e,c,g){return h([e],{declaredClass:"esri.processors.Processor",layers:null,results:null,passFeatures:!0,drawFeatures:!0,requireWorkerSupport:!0,fetchWithWorker:!1,workerCallback:null,workerClient:null,_started:null,_handlers:null,constructor:function(a){a=
- a||{};f.mixin(this,a);r("esri-workers")||!1===this.requireWorkerSupport&&!1===a.requireWorkerSupport?(this._handlers={},this._notifyProcessStart=f.hitch(this,this._notifyProcessStart),this._sendFeaturesFromTask=f.hitch(this,this._sendFeaturesFromTask),this._sendFeaturesFromLayer=f.hitch(this,this._sendFeaturesFromLayer),!1!==a.autostart&&this.start()):(console.log("Browser doesn't support workers \x26 worker support is required for this processor"),this.addLayer=this.setMap=this.start=this.runProcess=
- function(){},this._disabled=!0)},addLayer:function(a,b){var d=a._task,e=this._handlers[a.id]=[],g="complete";!1===this.drawFeatures&&(a._params.drawMode=!1);this.fetchWithWorker?(this.workerClient||(this.workerClient=c.getClient(this.workerCallback)),d.requestOptions={workerOptions:{worker:this.workerClient}},this.passFeatures&&e.push(d.on(g,f.partial(this._notifyProcessStart,a)))):this.passFeatures?(g=this.drawFeatures?"graphic-draw":"graphic-add",e.push(a.on(g,f.partial(this._sendFeaturesFromLayer,
- a)))):e.push(d.on(g,f.partial(this._sendFeaturesFromTask,a)));!0!==b&&a.graphics&&this.runProcess(a.graphics,a.id)},removeLayer:function(c){a.forEach(this._handlers[c.id],function(a){a.remove()});delete this._handlers[c.id]},setMap:function(c){if(this.map)if(c!=this.map)this.unsetMap();else return;var b=this;a.forEach(this.layers,b.removeLayer);a.forEach(c.graphicsLayerIds,function(a){b.addLayer(c.findLayerById(a))});this._handlers.map=[c.on("layer-add",function(a){a=a.layer;a.isInstanceOf(g)&&b.addLayer(a)}),
- c.on("layer-remove",function(a){a=a.layer;a.isInstanceOf(g)&&b.removeLayer(a)})];this.map=c},unsetMap:function(){this.map&&(a.forEach(this._handlers.map,function(a){a.remove()}),delete this._handlers.map,a.forEach(this.layers,this.removeLayer),this.map=null)},start:function(){this.map?this.setMap(this.map):this.layers&&(f.isArray(this.layers)||(this.layers=[this.layers]),a.forEach(this.layers,this.addLayer));this._started=!0;this.emit("start",{processor:this})},stop:function(){this._started=!1;for(var a in this._handlers)this._handlers.hasOwnProperty(a)&&
- (this._handlers[a].remove(),delete this._handlers[a]);this.emit("stop",{processor:this})},runProcess:function(a,b){},_sendFeaturesFromTask:function(){},_sendFeaturesFromLayer:function(){},_notifyProcessStart:function(){}})})},"esri/workers/RequestClient":function(){define(["../core/declare","dojo/_base/xhr","../config","./WorkerClient"],function(r,h,f,a){function e(a,b){var e=new c;e.addWorkerCallback(a,b);g.unshift({id:b?a+"::"+b:a,client:e});g.length>d&&g.pop().client.terminate();return e}var c=
- r([a],{declaredClass:"esri.workers.RequestClient",constructor:function(){this.setWorker(["./mutableWorker","./requestWorker"],function(){})},get:function(a){return this._send("GET",a)},post:function(a){return this._send("POST",a)},_send:function(a,b){b=h._ioSetArgs(b);b.xhr=null;var c=b.ioArgs,d=c.url;delete c.url;delete c.args;this.postMessage({method:a,url:d,options:c}).then(this._getSuccessHandler(b),this._getErrorHandler(b),this._getProgressHandler(b));return b},_addHeaderFunctions:function(a){a.getResponseHeader=
- function(b){var c,d=a.headers;Object.keys(d).forEach(function(a){if(a.toLowerCase()==b.toLowerCase())return c=d[a],!1});return c};a.getAllResponseHeaders=function(){var b=[],c=a.headers;Object.keys(c).forEach(function(a){b.push(a+": "+c[a])});return b=b.join("\n")};return a},_getSuccessHandler:function(a){var b=this,c=a.ioArgs;return function(d){a.xhr=b._addHeaderFunctions(d);d=a.xhr.getResponseHeader("content-type");("xml"==c.handleAs||-1<d.indexOf("xml"))&&"string"==typeof a.xhr.response&&(a.xhr.response=
- (new DOMParser).parseFromString(a.xhr.response,"text/xml"));a.resolve(a.xhr.response,a.xhr)}},_getErrorHandler:function(a){return function(b){a.reject(b)}},_getProgressHandler:function(a){return function(b){a.progress(b)}}}),g=[],d=f.request.maxWorkers,b=new c;c.getClient=function(a,c){if(a){var d;g.some(function(b){b.id==(c?a+"::"+c:a)&&(d=b.client);return!0});return d||e(a,c)}return b};c.setLimit=function(a){d=f.request.maxWorkers=a};return c})},"esri/workers/WorkerClient":function(){define("dojo/Evented ../core/declare dojo/Deferred dojo/_base/lang dojo/request ../core/sniff ../core/urlUtils require".split(" "),
- function(r,h,f,a,e,c,g,d){var b=window.Blob||window.webkitBlob||window.mozBlob,k=window.URL||window.webkitURL||window.mozURL;return h([r],{declaredClass:"esri.workers.WorkerClient",worker:null,_queue:null,constructor:function(b,d){this._isIE=c("ie");this._queue={};this._acceptMessage=a.hitch(this,this._acceptMessage);this._errorMessage=a.hitch(this,this._errorMessage);b&&this.setWorker(b,function(a){this.worker=a;d(this)}.bind(this))},setWorker:function(a,c){if(a instanceof Array){var d=a;a=d.shift()}var e=
- this._getUrl(a),e=g.normalize(e);a=!g.hasSameOrigin(e,location.href);var f;if(!1===e)return console.log("Can not resolve worker path"),!1;this.worker&&(f=this.worker,f.removeEventListener("message",this._acceptMessage,!1),f.removeEventListener("error",this._errorMessage,!1),f.terminate(),f=null);if(a){a=this._getUrl("./mutableWorker",!0);try{this._getRemoteText(a,function(a){a=k.createObjectURL(new b([a],{type:"text/javascript"}));c(this._createWorker(a,e))}.bind(this))}catch(q){try{a=g.getProxyUrl(a).path+
- "?"+encodeURI(a),this._useProxy=!0,c(this._createWorker(a,d))}catch(v){return console.log("Can not create worker"),!1}}}else c(this._createWorker(e,d))},_createWorker:function(a,b){a=new Worker(a);a.addEventListener("message",this._acceptMessage,!1);a.addEventListener("error",this._errorMessage,!1);this.worker=a;b&&this.importScripts(b);return a},postMessage:function(a,b){if(a instanceof Array||"object"!=typeof a)a={data:a};var c=Math.floor(64E9*Math.random()).toString(36);a.msgId=c;c=this._queue[c]=
- new f;this.worker?(b?this.worker.postMessage(a,b):this.worker.postMessage(a),this.emit("start-message",{target:this,message:a})):c.reject({message:"No worker was set."});return c.promise},terminate:function(){var a=Object.keys(this._queue);this.worker&&this.worker.terminate();for(var b=a.length-1;0<=b;b--)this._queue[a[b]].cancel("terminated"),delete this._queue[a[b]]},addWorkerCallback:function(b,c){var d=this._getUrl(b,!0);return!1===d?(c=new f,c.reject({message:"Could not load text from "+b}),
- c.promise):this.postMessage({action:"add-callback",url:d,cbName:c||"main"}).then(a.hitch(this,function(a){a.target=this;this.emit("callback-added",a)}))},importScripts:function(b){Array.isArray(b)||(b=[b]);b=b.map(function(a){a=this._getUrl(a,!0);this._useProxy&&!g.hasSameOrigin(a,location.href)&&(a=g.getProxyUrl(a).path+"?"+encodeURI(a));return a},this);return this.postMessage({action:"import-script",url:b}).then(a.hitch(this,function(a){a.target=this;this.emit("scripts-imported",a)}))},_acceptMessage:function(a){var b=
- a.data,c=b.msgId;if(b.status&&"debug"==b.status)console[b.showAs||"debug"](b);else if(c&&c in this._queue){var d=this._queue[c];"progress"==b.status?d.progress(a.data):("error"==b.status?d.reject(a.data):d.resolve(a.data),delete this._queue[c])}this.emit("message",{message:a.data,event:a,target:this})},_errorMessage:function(a){this.onerror||this.onError?this.onerror?this.onerror(a):this.onError(a):console.log("Worker Error: "+a.message+"\nIn "+a.filename+" on "+a.lineno)},_getUrl:function(a,b){if(!a)return console.error("can not resolve empty path"),
- !1;a.match(/\.js$/)||(a+=".js");a=d.toUrl(a);return b?g.makeAbsolute(a):a},_getRemoteText:function(a,b){(a=this._getUrl(a))&&e.get(a,{sync:!1,handleAs:"text",headers:{"X-Requested-With":"","Content-Type":"text/plain"}}).then(function(a){b(a)})},_startBlobWorker:function(){var a=this._xdSource;a||(a=this._getUrl("./mutableWorker"),a=new b(["if(!self._mutable){importScripts('"+a+"');}"],{type:"text/javascript"}),a=this._xdSource=k.createObjectURL(a));try{return new Worker(a)}catch(p){return console.log(p.message),
- !1}}})})},"esri/layers/GraphicsLayer":function(){define("require ../core/Accessor ../core/Collection ../core/promiseUtils ./Layer ./mixins/ScaleRangeLayer ../Graphic dojo/_base/lang".split(" "),function(r,h,f,a,e,c,g,d){var b=h.createSubclass({properties:{layer:null,layerView:null,graphics:null}});return e.createSubclass([c],{declaredClass:"esri.layers.GraphicsLayer",getDefaults:function(a){return d.mixin(this.inherited(arguments),{graphics:[]})},destroy:function(){this.removeAll()},_gfxHdl:null,
- properties:{elevationInfo:null,graphics:{type:f.ofType(g),set:function(a){var b=this._get("graphics");b||(a.forEach(function(a){a.layer=this},this),this._gfxHdl=a.on("change",function(a){var b,c,d;d=a.added;for(b=0;c=d[b];b++)c.layer=this;d=a.removed;for(b=0;c=d[b];b++)c.layer=null}.bind(this)),this._set("graphics",a),b=a);b.removeAll();b.addMany(a)}},screenSizePerspectiveEnabled:!0,type:{readOnly:!0,value:"graphics"}},add:function(a){this.graphics.add(a);return this},addMany:function(a){this.graphics.addMany(a);
- return this},removeAll:function(){this.graphics.removeAll();return this},createGraphicsController:function(c){return a.resolve(new b({layer:this,layerView:c.layerView,graphics:this.graphics}))},remove:function(a){this.graphics.remove(a)},removeMany:function(a){this.graphics.removeMany(a)},importLayerViewModule:function(b){switch(b.type){case "2d":return a.create(function(a){r(["../views/2d/layers/GraphicsLayerView2D"],a)});case "3d":return a.create(function(a){r(["../views/3d/layers/FeatureLayerView3D"],
- a)})}},graphicChanged:function(a){this.emit("graphic-update",a)}})})},"esri/views/layers/GraphicsView":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../Graphic ../../core/Accessor ../../core/Collection ../../core/accessorSupport/decorators".split(" "),function(r,h,f,a,e,c,g,d){return function(b){function c(){var a=null!==b&&b.apply(this,arguments)||this;a.graphics=null;a.renderer=null;a.view=null;return a}f(c,b);a([d.property({type:g.ofType(e)})],
- c.prototype,"graphics",void 0);a([d.property()],c.prototype,"renderer",void 0);a([d.property()],c.prototype,"view",void 0);return c=a([d.subclass("esri.views.layers.GraphicsView")],c)}(d.declared(c))})},"esri/views/3d/layers/graphics/Deconflictor":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/Handles ../../../../core/Logger ../../../../core/watchUtils ./deconflictorDebug ../../lib/glMatrix ../../support/aaBoundingRect ../../support/PreallocArray ../../webgl-engine/lib/screenSizePerspectiveUtils ../../webgl-engine/lib/Util ../../webgl-engine/materials/HUDMaterial ../../webgl-engine/materials/internal/MaterialUtil".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){function u(a){return!!a&&"selection"===a.type}var q=d.vec2d;r=d.vec4d;var v=p.VertexAttrConstants,x=e.getLogger("esri.views.3d.graphics.Deconflictor"),m=r.create(),B=r.create(),z=r.create(),C=r.create(),A=q.create(),D=b.create(),E=b.create(),F=new Set,I=p.lerp,P=new k(100),G=new k(100),M=function(){function a(a,b){this.creator=a;this.disposer=b;this.list=[];this.currentIndex=0}a.prototype.alloc=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];
- this.currentIndex>=this.list.length&&this.list.push(new this.creator(a));return this.list[this.currentIndex++]};a.prototype.freeAll=function(){for(var a=this.currentIndex,b=this.disposer,c=this.list;0<=--a;)b(c[a]);this.currentIndex=0};return a}(),H=function(){function a(){this.graphics3DGraphic=null;this.positions=[q.create(),q.create(),q.create(),q.create()];this.posView=this.yMax=this.yMin=this.xMax=this.xMin=0;this.graphicsOwner=null;this.graphicId=this.id=0}a.release=function(a){a.graphics3DGraphic=
- null;a.graphicsOwner=null};return a}();e=function(){function d(b){var d=this;this.graphicsOwners=[];this.deconflictTimeoutId=0;this.handles=new a;this.graphicInfoPool=new M(H,H.release);this.nextGraphicInfoId=0;this.accBinsNumX=15;this.accBinsNumY=20;this.accBinsSizeY=this.accBinsSizeX=0;this.accBins=null;this.accNumTests=0;this.iconMarginFactor=-.1;this.view=b;this.handles.add([b.watch("state.camera",function(){return d.scheduleRun()}),c.whenNot(b,"ready",function(){return d.clearDeconflictTimeout()})])}
- d.prototype.destroy=function(){this.handles.destroy();this.handles=null;this.clearDeconflictTimeout();this.graphicInfoPool.freeAll();this.view=this.graphicInfoPool=null};d.prototype.clearDeconflictTimeout=function(){this.deconflictTimeoutId&&(clearTimeout(this.deconflictTimeoutId),this.deconflictTimeoutId=0)};d.prototype.addGraphicsOwner=function(a){var b=this;this.graphicsOwners.push(a);this.setDirty();a.layer&&"function"===typeof a.layer.watch&&a.layer.watch("featureReduction",function(c,d){u(c)?
- b.setDirty():u(d)&&(b._removeIconVisibilityFlags(a),b.setDirty())})};d.prototype.removeGraphicsOwner=function(a){a=this.graphicsOwners.indexOf(a);0<=a&&this.graphicsOwners.splice(a,1);this.setDirty()};d.prototype.setDirty=function(){this.scheduleRun(10)};d.prototype.initializeLabelVisibility=function(a){a.setVisibilityFlag(2,!1,1)};d.prototype.doesIntersectExistingPoly=function(a){var b=a.graphicId,c=a.positions;F.clear();for(var d=Math.floor(a.xMin/this.accBinsSizeX);d<=Math.floor(a.xMax/this.accBinsSizeX);d++)if(!(0>
- d||d>=this.accBinsNumX))for(var e=Math.floor(a.yMin/this.accBinsSizeY);e<=Math.floor(a.yMax/this.accBinsSizeY);e++)if(!(0>e||e>=this.accBinsNumY)){var f=this.accBins[d][e],g=0;a:for(;g<f.length;g++){var k=f.data[g];if(k.graphicId!==b&&!F.has(k.id)){F.add(k.id);k=k.positions;this.accNumTests++;for(var l=0;2>l;l++){var h=0===l?c:k,m=0===l?k:c,n=0;b:for(;4>n;n++){var p=h[n],t=h[(n+1)%4],u=h[(n+2)%4];A[0]=t[0]-p[0];A[1]=t[1]-p[1];t=q.normalize(A);x=[-t[1],t[0]];t[0]=x[0];t[1]=x[1];p=t[0]*p[0]+t[1]*p[1];
- u=t[0]*u[0]+t[1]*u[1]<p;for(x=0;4>x;x++){var v=m[x],v=t[0]*v[0]+t[1]*v[1];if(u&&v<p||!u&&v>p)continue b}continue a}}return!0}}}return!1;var x};d.prototype.initBins=function(a,b){if(null==this.accBins){this.accBins=[];for(var c=0;c<this.accBinsNumX;c++){this.accBins.push([]);for(var d=this.accBins[this.accBins.length-1],e=0;e<this.accBinsNumY;e++)d.push(new k(10))}}for(c=0;c<this.accBinsNumX;c++)for(e=0;e<this.accBinsNumY;e++)this.accBins[c][e].clear();this.accBinsSizeX=a/this.accBinsNumX;this.accBinsSizeY=
- b/this.accBinsNumY;this.accNumTests=0};d.prototype.addToBins=function(a){for(var b=Math.floor(a.xMin/this.accBinsSizeX);b<=Math.floor(a.xMax/this.accBinsSizeX);b++)if(!(0>b||b>=this.accBinsNumX))for(var c=Math.floor(a.yMin/this.accBinsSizeY);c<=Math.floor(a.yMax/this.accBinsSizeY);c++)0>c||c>=this.accBinsNumY||this.accBins[b][c].push(a)};d.prototype.scheduleRun=function(a){var b=this;void 0===a&&(a=200);0===this.deconflictTimeoutId&&(this.deconflictTimeoutId=setTimeout(function(){return b.run()},
- a))};d.prototype.run=function(){var a=this.view;this.clearDeconflictTimeout();if(a.ready){var b=a.state.camera;this.graphicInfoPool.freeAll();this.nextGraphicInfoId=0;var c=b.fullWidth,d=b.fullHeight;g.prepare(a);P.clear();G.clear();for(var a=!1,e=0;e<this.graphicsOwners.length;e++){var f=this.graphicsOwners[e];if(null!=f.getGraphics3DGraphics&&null!=f.getGraphics3DGraphicsKeys){var k=null!=f.labelsEnabled&&f.labelsEnabled(),l=u(f.layer?f.layer.featureReduction:null);if(k||l){a||(this.initBins(c,
- d),a=!0);for(var h=f.getGraphics3DGraphics(),m=f.getGraphics3DGraphicsKeys(),n=0;n<m.length;n++){var p=h[m[n]];p.areVisibilityFlagsSet(void 0,2)&&(l&&this._collectGraphics(p,!1,f,b,P,this.iconMarginFactor),k&&this._collectGraphics(p,!0,f,b,G))}}}}P.sort(function(a,b){return b.posView-a.posView});G.sort(function(a,b){return b.posView-a.posView});this._deconflictVisibleObjects(P,!1);G.length&&this._deconflictVisibleObjects(G,!0);g.drawAccelerationStruct(this,P);g.drawAccelerationStruct(this,G)}else this.setDirty()};
- d.prototype._collectGraphics=function(a,c,d,e,f,g){void 0===g&&(g=0);var k=c?a._labelGraphics:a._graphics,h=c?1:0;if(k.length){c=b.set(D,b.NEGATIVE_INFINITY);for(var p,q,u,r=0;r<k.length;r++){var A=k[r];if(A&&!A.isDraped()){var F=A.stageObject,S=F?F.getNumGeometryRecords():0;if(!(1>S)){var G=F.getGeometryRecord(0),N=G.materials[0];if(N instanceof n)if(1<S)x.warn("Graphic objects with more than 1 geometry record are not supported");else{S=G.geometry.getData().getVertexAttr();if(!q){q=F.getCenter();
- u=G.origin.vec3;q=t.transformToWorld(q,u,m);q=t.transformToView(q,u,e.viewMatrix,B);N.applyVerticalOffsetTransformation(q,S[v.NORMAL].data,F.objectTransformation,e,J);F=S[v.AUXPOS1].data;S="screen"!==N.getParams().centerOffsetUnits;u=t.transformToProjection(q,e.projectionMatrix,S?F:[0,0,0],z);u=t.transformToNDC(u,C);S||(u[0]+=F[0]/e.fullWidth*2,u[1]+=F[1]/e.fullHeight*2);if(-1>u[0]||-1>u[1]||-1>u[2]||1<=u[0]||1<=u[1])break;p=q[2];a.areVisibilityFlagsSet(2,void 0,h)&&(p*=.7)}A=A.getScreenSize(O);l.applyPrecomputedScaleFactorVec2(A,
- J.factor,A);N=b.offset(N.calculateRelativeScreenBounds(A,J.scaleAlignment,E),I(0,e.fullWidth,.5+.5*u[0]),I(0,e.fullHeight,.5+.5*u[1]));0!==g&&(A=g*Math.min(b.width(N),b.height(N)),N[0]-=A,N[1]-=A,N[2]+=A,N[3]+=A);b.expand(c,N)}}}}null!=p&&(e=this.graphicInfoPool.alloc(),e.id=this.nextGraphicInfoId++,e.graphicId=a.graphic.uid,e.xMin=c[0],e.yMin=c[1],e.xMax=c[2],e.yMax=c[3],e.positions[0][0]=c[0],e.positions[0][1]=c[1],e.positions[1][0]=c[0],e.positions[1][1]=c[3],e.positions[2][0]=c[2],e.positions[2][1]=
- c[3],e.positions[3][0]=c[2],e.positions[3][1]=c[1],e.graphics3DGraphic=a,e.posView=p,e.graphicsOwner=d,f.push(e))}};d.prototype._deconflictVisibleObjects=function(a,b){for(var c=b?1:0,d=0;d<a.length;d++){var e=a.data[d],f=e.graphics3DGraphic,k=!(b&&!1===f.areVisibilityFlagsSet(2,void 0))&&!this.doesIntersectExistingPoly(e);k&&this.addToBins(e);f.setVisibilityFlag(2,k,c);g.drawPoly(e.positions,k?"green":"red")}};d.prototype._removeIconVisibilityFlags=function(a){if(null!=a.getGraphics3DGraphics&&null!=
- a.getGraphics3DGraphicsKeys){var b=a.getGraphics3DGraphics(),c=0;for(a=a.getGraphics3DGraphicsKeys();c<a.length;c++)b[a[c]].setVisibilityFlag(2,void 0)}};return d}();var J={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},scaleAlignment:0,minPixelSizeAlignment:0},O=q.create();return e})},"esri/views/3d/layers/graphics/deconflictorDebug":function(){define(["require","exports","../../../../core/tsSupport/extendsHelper","../../lib/glMatrix","../../support/debugFlags"],function(r,h,f,a,e){function c(a,
- b){if(d){var c=k.height,e=l;e.beginPath();e.lineWidth=1;e.strokeStyle=b;e.moveTo(a[0][0],c-a[0][1]);for(b=1;4>b;b++)e.lineTo(a[b][0],c-a[b][1]),e.stroke();e.lineTo(a[0][0],c-a[0][1]);e.stroke();e.closePath()}}Object.defineProperty(h,"__esModule",{value:!0});var g=a.vec2d,d=!1,b=!1,k,l;h.drawAccelerationStruct=function(a,d){if(b&&l){for(var e=l,f=[g.create(),g.create(),g.create(),g.create()],k=0,h=0;h<a.accBinsNumX;h++)for(var n=0;n<a.accBinsNumY;n++){var m=a.accBins[h][n],k=k+m.length,p=h*a.accBinsSizeX,
- r=(h+1)*a.accBinsSizeX,C=n*a.accBinsSizeY,A=(n+1)*a.accBinsSizeY;f[0][0]=p;f[0][1]=C;f[1][0]=r;f[1][1]=C;f[2][0]=r;f[2][1]=A;f[3][0]=p;f[3][1]=A;e.fillText(m.length.toFixed(),p+5,C+15);c(f,"blue")}e.fillText("total totalShownLabels: "+k,70,40);e.fillText("total visible labels: "+d.length,70,50);e.fillText("total numTests: "+a.accNumTests,70,30)}};h.prepare=function(a){d=e.DECONFLICTOR_SHOW_OUTLINES;b=e.DECONFLICTOR_SHOW_GRID;if(d||b)null==k&&(k=document.createElement("canvas"),k.setAttribute("id",
- "canvas2d"),a.surface.parentElement.style.position="relative",a.surface.parentElement.appendChild(k)),k.setAttribute("width",a.width+"px"),k.setAttribute("height",a.height+"px"),k.setAttribute("style","position:absolute;left:0px;top:0px;display:block;pointer-events:none;"),l=k.getContext("2d"),l.clearRect(0,0,a.width,a.height),l.font="8px Arial"};h.drawPoly=c})},"esri/views/3d/support/PreallocArray":function(){define(["../../../core/declare","./HeapSort"],function(r,h){return r([],{constructor:function(f,
- a){this.data=Array(f);this.length=0;if(a){for(var e=0;e<f;e++)this.data[e]=a(e);this._allocator=a;this._hasAllocator=!0}else this._allocator=this._nullAllocator,this._hasAllocator=!1},_nullAllocator:function(){return null},grow:function(f){for(;this.data.length<f;)this.data.push(this._allocator(this.data.length))},next:function(){if(!this._hasAllocator)return null;this.data.length===this.length&&this.grow(2*this.length);return this.data[this.length++]},swap:function(f,a){var e=this.data[f];this.data[f]=
- this.data[a];this.data[a]=e},push:function(f){this.data.length===this.length&&this.grow(2*this.length);this.data[this.length++]=f},pushArray:function(f){var a=this.length+f.length;a>=this.data.length&&this.grow(Math.max(2*this.length,a));for(a=0;a<f.length;a++)this.data[this.length++]=f[a]},pushEither:function(f){Array.isArray(f)?this.pushArray(f):this.push(f)},pop:function(){if(0===this.length)return null;var f=this.data[--this.length];this._hasAllocator||(this.data[this.length]=null);return f},
- slice:function(f,a){void 0===a&&(a=this.length);return this.data.slice(f,a)},clear:function(){if(!this._hasAllocator)for(var f=0;f<this.length;f++)this.data[f]=null;this.length=0},peek:function(){return 0===this.length?null:this.data[this.length-1]},sort:function(f){h.sort(this.data,0,this.length,f);return this}})})},"esri/views/3d/support/HeapSort":function(){define([],function(){function r(f,a,e,c){for(var g=a,d=e>>>1,b=f[g-1];a<=d;){a=g<<1;a<e&&0>c(f[a-1],f[a])&&++a;var k=f[a-1];if(0>=c(k,b))break;
- f[g-1]=k;g=a}f[g-1]=b}function h(f,a){return f<a?-1:f>a?1:0}return{sort:function(f,a,e,c){void 0===a&&(a=0);void 0===e&&(e=f.length);void 0===c&&(c=h);for(var g=e>>>1;g>a;g--)r(f,g,e,c);for(var d=a+1,g=e-1;g>a;g--)e=f[a],f[a]=f[g],f[g]=e,r(f,d,g,c);return f}}})},"esri/views/3d/state/ViewState":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ../../../views/ViewAnimation ../lib/glMatrix ./Constraints ./controllers/AnimationController ./controllers/CameraController ../support/earthUtils ../support/Evented ../support/PropertiesPool ../webgl-engine/lib/Camera".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function h(a){a=e.call(this,a)||this;a.propertiesPool=new t.default({camera:u},a);a.events=new n.Evented;a.updateQueue=new x;a.processingUpdates=!1;return a}f(h,e);h.prototype.destroy=function(){this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)};h.prototype.normalizeCtorArgs=function(a){return{camera:this.createInitialCamera(a.viewingMode),mode:a.viewingMode,spatialReference:a.spatialReference,
- constraints:new b.default({mode:a.viewingMode})}};Object.defineProperty(h.prototype,"animation",{get:function(){return this.cameraController instanceof k.AnimationController?this.cameraController.viewAnimation:null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"camera",{get:function(){return this._get("camera")},set:function(a){a!==q&&q.copyFrom(a);q.markViewDirty();q.computeUp(this.mode);v.camera=q;this.events.emit("before-camera-change",v);(a=this._get("camera"))&&a.equivalent(q)||
- this._set("camera",this.propertiesPool.get("camera").copyFrom(q))},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"isGlobal",{get:function(){return!this.isLocal},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"isLocal",{get:function(){return"local"===this.mode},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"interacting",{get:function(){return!!this.cameraController&&this.cameraController.isInteractive},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,
- "cameraController",{get:function(){return this._get("cameraController")},set:function(a){var b=this;this.stopActiveCameraController()?(a&&(a.watch("state",function(c){if(c===l.State.Finished||c===l.State.Stopped)b._set("cameraController",null),b.updateCamera(function(b){a.onControllerEnd(b)})},!0),a.onControllerStart(this.camera)),this._set("cameraController",a)):a&&(a.state=l.State.Rejected)},enumerable:!0,configurable:!0});h.prototype.switchCameraController=function(a){this.cameraController=a;return a.state!==
- l.State.Rejected};h.prototype.stopActiveCameraController=function(){return this.cameraController&&!this.cameraController.stopController()?!1:!0};h.prototype.cameraChanged=function(){this.updateCamera(function(){})};h.prototype.updateCamera=function(a){this.updateQueue.enqueue(a);this.processingUpdates||this.processUpdateQueue()};h.prototype.processUpdateQueue=function(){if(0!==this.updateQueue.length&&!this.processingUpdates){this.processingUpdates=!0;var a=this.updateQueue.dequeue();q.copyFrom(this._get("camera"));
- a(q);this.camera=q;this.processingUpdates=!1;this.processUpdateQueue()}};h.prototype.createInitialCamera=function(a){return"global"===a?new u(d.vec3d.createFrom(4*p.earthRadius,0,0),d.vec3d.createFrom(p.earthRadius,0,0),d.vec3d.createFrom(0,0,1)):new u(d.vec3d.createFrom(0,0,100),d.vec3d.createFrom(0,0,0),d.vec3d.createFrom(0,1,0))};a([c.property({readOnly:!0,type:g,dependsOn:["cameraController"]})],h.prototype,"animation",null);a([c.property({type:u})],h.prototype,"camera",null);a([c.property({constructOnly:!0})],
- h.prototype,"constraints",void 0);a([c.property({readOnly:!0})],h.prototype,"events",void 0);a([c.property({readOnly:!0,dependsOn:["isLocal"]})],h.prototype,"isGlobal",null);a([c.property({readOnly:!0,dependsOn:["mode"]})],h.prototype,"isLocal",null);a([c.property({constructOnly:!0})],h.prototype,"mode",void 0);a([c.property({constructOnly:!0})],h.prototype,"spatialReference",void 0);a([c.property({readOnly:!0,dependsOn:["cameraController"]})],h.prototype,"interacting",null);a([c.property()],h.prototype,
- "cameraController",null);return h=a([c.subclass()],h)}(c.declared(e));h.ViewState=r;var q=new u,v={camera:null},x=function(){function a(){this.data=[];this.length=this.ptr=0}a.prototype.enqueue=function(a){this.data.push(a);this.length++};a.prototype.dequeue=function(){if(0===this.length)return null;var a=this.data[this.ptr++];this.length--;0===this.length&&(this.ptr=this.data.length=0);return a};return a}();h.default=r})},"esri/views/3d/support/Evented":function(){define(["require","exports"],function(r,
- h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(){this._listeners={}}f.prototype.hasEventListener=function(a){return null!=this._listeners[a]&&0<this._listeners[a].size};f.prototype.on=function(a,e){var c=this;null==this._listeners[a]&&(this._listeners[a]=new Map);var f={};this._listeners[a].set(f,e);return{remove:function(){return c._listeners[a].delete(f)}}};f.prototype.emit=function(a,e){null!=this._listeners[a]&&this._listeners[a].forEach(function(a){return a(e)})};
- return f}();h.Evented=r})},"esri/views/3d/support/PropertiesPool":function(){define(["require","exports","../../../core/ObjectPool","../../../core/accessorSupport/watch"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function e(c,e){var d=this;this.owner=e;this.properties={};this.afterDispatchHandle=null;for(var b in c)e=new f(c[b],null,null,2,2),this.properties[b]={pool:e,acquired:[]};this.afterDispatchHandle=a.afterDispatch(function(){return d.release()})}e.prototype.destroy=
- function(){this.afterDispatchHandle&&(this.afterDispatchHandle.remove(),this.afterDispatchHandle=null);this.owner=null};e.prototype.get=function(a){var c=this.owner._get(a);a=this.properties[a];var d=a.pool.acquire();for(a.acquired.push(d);d===c;)a.acquired.push(d),d=a.pool.acquire();return d};e.prototype.release=function(){for(var c in this.properties){for(var e=this.properties[c],d=0,b=0,f=e.acquired;b<f.length;b++){var l=f[b];a.isValueInUse(l)?e.acquired[d++]=l:e.pool.release(l)}e.acquired.length=
- d}};return e}();h.PropertiesPool=r;h.default=r})},"esri/views/3d/state/ViewStateManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/_base/lang ../../../Camera ../../../Viewpoint ../../../core/Accessor ../../../core/Error ../../../core/Handles ../../../core/Logger ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../geometry/Extent ../../../geometry/Point ../../../geometry/ScreenPoint ../../../geometry/support/webMercatorUtils ../camera/constraintUtils ../camera/intersectionUtils ../lib/glMatrix ./ConstraintsManager ./Frustum ./controllers/PointToPointAnimationController ./controllers/SurfaceCollisionCorrectionController ./helpers/PickingHelper ../support/cameraUtils ../support/PropertiesPool ../support/viewpointUtils ../webgl-engine/lib/Camera ../../animation/easing".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G,M,H){Object.defineProperty(h,"__esModule",{value:!0});var J=l.getLogger("esri.views.3d.state.ViewStateManager");r=function(d){function l(a){a=d.call(this)||this;a.propertiesPool=new P.default({frustum:A.default},a);a.handles=new k;a.cameraSetByUser=!1;a.internalSetOrder=[];a.immediateGoToPromise=null;a.animatedGoToPromise=null;a.ready=!1;return a}f(l,d);Object.defineProperty(l.prototype,"camera",{get:function(){return this.ready?I.internalToExternal(this.view,
- this.view.state.camera):this._get("camera")},set:function(a){this.updatePropertyBeforeReady("camera",a)||this.setStateCamera(I.externalToInternal(this.view,a),{applyConstraints:!1})||J.error("#camera\x3d","Invalid camera",a)},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"center",{get:function(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")},set:function(a){this.updatePropertyBeforeReady("center",a)||(a?this.isCompatible(a)?this.setStateCamera(this.centerToCamera(a),
- {applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.forceUpdate():J.error("#center\x3d","Invalid center",a):J.error("#center\x3d","Center has an incompatible spatial reference (center: "+(a.spatialReference?a.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",a):J.error("#center\x3d","Center may not be null or undefined"))},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"extent",{get:function(){return this.ready?I.toExtent(this.view,null,
- null,null,R):this._get("extent")},set:function(a){this.updatePropertyBeforeReady("extent",a)||(a?this.isCompatible(a)?this.setStateCamera(this.extentToCamera(a),{applyConstraints:!0})||J.error("#extent\x3d","Invalid extent",a):J.error("#extent\x3d","Extent has an incompatible spatial reference (extent: "+(a.spatialReference?a.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",a):J.error("#extent\x3d","Extent may not be null or undefined"))},enumerable:!0,configurable:!0});
- Object.defineProperty(l.prototype,"frustum",{get:function(){var a=this.propertiesPool.get("frustum");a.update(this.view.state.camera);return a},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"hasInitialView",{get:function(){return!!this.view.get("map.initialViewProperties.viewpoint")},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"scale",{get:function(){if(!this.ready)return this._get("scale");var a=this.view.pointsOfInterest.centerOnContent;return I.distanceToScale(this.view,
- a.distance,a.location.latitude)},set:function(a){this.updatePropertyBeforeReady("scale",a)||this.setStateCamera(this.scaleToCamera(a),{applyConstraints:!0})||J.error("#scale\x3d","Invalid scale",a)},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"padding",{get:function(){if(!this.ready)return this._get("padding");var a=this.view.state.camera.padding,b=this._get("padding");return null!==b&&b.top===a[0]&&b.right===a[1]&&b.bottom===a[2]&&b.left===a[3]?b:{top:a[0],right:a[1],bottom:a[2],
- left:a[3]}},set:function(a){this.updatePropertyBeforeReady("padding",a)||(a?z.vec4d.set4(a.top||0,a.right||0,a.bottom||0,a.left||0,X):z.vec4d.set4(0,0,0,0,X),this.view.state.updateCamera(function(a){a.padding=X}))},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"screenCenter",{get:function(){var a=this.padding;return new v((this.view.width-(a.left+a.right))/2+a.left,(this.view.height-(a.top+a.bottom))/2+a.top)},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"viewpoint",
- {get:function(){return this.ready?G.fromCamera(this.view,this.camera):this._get("viewpoint")},set:function(a){if(!this.updatePropertyBeforeReady("viewpoint",a))if(a)if(this.isCompatible(a))this.setStateCamera(this.viewpointToCamera(a),{applyConstraints:!a.camera})||J.error("#viewpoint\x3d","Invalid viewpoint",a);else{var b=a.camera?a.camera.position:a.targetGeometry,b=b&&b.spatialReference;J.error("#viewpoint\x3d","Viewpoint has an incompatible spatial reference (viewpoint: "+(b?b.wkid:"none")+", view: "+
- this.view.spatialReference.wkid+")",a)}else J.error("#viewpoint\x3d","Viewpoint may not be null or undefined")},enumerable:!0,configurable:!0});Object.defineProperty(l.prototype,"zoom",{get:function(){return this.ready?I.scaleToZoom(this.view,this.scale):this._get("zoom")},set:function(a){this.updatePropertyBeforeReady("zoom",a)||this.setStateCamera(this.zoomToCamera(a),{applyConstraints:!0})||J.error("#zoom\x3d","Invalid zoom",a)},enumerable:!0,configurable:!0});l.prototype.initialize=function(){var a=
- this;this.pickingHelper=new F.PickingHelper(this.view);this.handles.add(this.view.watch("state.camera",function(b){return a.cameraChangedSync(b)},!0),n.on(this.view,"state.events","before-camera-change",function(b){return a.beforeCameraChangeHandle(b.camera)}));this.handles.add(this.view.on("resize",function(b){return a.handleResize(b.width,b.height)}));this.handles.add(this.view.watch("state.cameraController",function(){a.cameraSetByUser=!0;a.handles.remove(Q);a.cancelImmediateGoTo()}));this.handles.add(n.on(this.view,
- "pointsOfInterest.events","camera-parameters-changed",function(){return a.notifyChange("scale")}))};l.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null);this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)};l.prototype.init=function(){var a=this;this.constraintsManager=new C.default({view:this.view});this.handleResize(this.view.width,this.view.height);var b=this.getInitialProperties();this.cameraSetByUser=!1;this._set("ready",!0);for(var c=
- 0;c<b.length;c++){var d=b[c];this.set(d.name,d.value)}this.cameraSetByUser||((b=this.view.get("map.initialViewProperties.viewpoint")||this.view.initialExtent)&&this.isCompatible(b)?this.setInitialView(b):"local"===this.view.state.mode&&this.handles.add(n.whenOnce(this.view.basemapTerrain,"ready",function(){a.handles.remove(Q);a.setInitialView(a.view.groundExtent)}),Q))};l.prototype.deinit=function(){this.ready&&(this._override("padding",this.padding),this.cancelImmediateGoTo(),this.cancelAnimatedGoTo(),
- this._set("ready",!1),this._clearOverride("hasInitialView"),this.internalSetOrder.length=0,this.cameraSetByUser=!1,this.handles.remove(Q),this.constraintsManager&&(this.constraintsManager.destroy(),this.constraintsManager=null))};l.prototype.goTo=function(a,b){b=e.mixin({animate:!0},b);return b.animate?this.goToAnimated(a,b):this.goToImmediate(a,b)};l.prototype.debugSetCameraOnContent=function(){this.setStateCamera(B.cameraOnContentAlongViewDirection(this.view),{applyConstraints:!1})};l.prototype.step=
- function(a){var b=this.view.state,c=b&&this.view.state.cameraController;c&&(b.updateCamera(function(b){c.stepController(a,b)}),c.steppingFinished&&c.finishController())};l.prototype.cancelImmediateGoTo=function(){var a=this.immediateGoToPromise;a&&(this.immediateGoToPromise=null,a.cancel())};l.prototype.cancelAnimatedGoTo=function(){var a=this.animatedGoToPromise;a&&(this.animatedGoToPromise=null,a.cancel())};l.prototype.getInitialProperties=function(){for(var a=this,b=new Set,c=[],d=0,e=N;d<e.length;d++){var f=
- e[d],g=f.propertyName,f=f.overrides,k=b.has(g),l=this._isOverridden(g);!k&&l&&c.push({name:g,value:this._get(g)});this._clearOverride(g);(k||l)&&f.forEach(function(a){return b.add(a)})}return c.sort(function(b,c){b=a.internalSetOrder.indexOf(b.name);c=a.internalSetOrder.indexOf(c.name);return b<c?-1:b>c?1:0})};l.prototype.setInitialView=function(a){if(a&&!this.cameraSetByUser){var b={applyConstraints:!0};a instanceof c?b.applyConstraints=!1:a instanceof g?a.targetGeometry instanceof u?a=I.fromExtent(this.view,
- a.targetGeometry,0,.5,{noReset:!0}):(a.camera&&(b.applyConstraints=!1),a=G.toCamera(this.view,a)):a=I.fromExtent(this.view,a,0,.5,{noReset:!0});this.setStateCamera(I.externalToInternal(this.view,a),b)}};l.prototype.updatePropertyBeforeReady=function(a,b){if(this.ready)return!1;this._override(a,b);var c=this.internalSetOrder.indexOf(a);-1!==c&&(this.internalSetOrder=this.internalSetOrder.splice(c,1));b&&(this.internalSetOrder.push(a),-1!==O.indexOf(a)&&this._override("hasInitialView",!0));return!0};
- l.prototype.isCompatible=function(a){return a?a instanceof g?a.camera?this.isCompatible(a.camera):this.isCompatible(a.targetGeometry):a instanceof c?this.isCompatible(a.position):a.spatialReference&&x.canProject(a.spatialReference,this.view.spatialReference):!1};l.prototype.getPreservingHeadingTilt=function(a){void 0===a&&(a=S);this.cameraSetByUser?(a.heading=this.camera.heading,a.tilt=this.camera.tilt):(a.heading=0,a.tilt=.5);return a};l.prototype.centerPointAtDistanceToCamera=function(a,b,c){void 0===
- c&&(c=Y);var d=this.getPreservingHeadingTilt();return(a=I.eyeHeadingTiltForCenterPointAtDistance(this.view,d.heading,d.tilt,a,b))?(c.copyFrom(this.view.state.camera),c.eye=a.eye,c.center=a.center,c.up=a.up,c):null};l.prototype.centerToCamera=function(a){var b=this.view.pointsOfInterest.centerOnContent;b.forceUpdate();return this.centerPointAtDistanceToCamera(a,b.distance)};l.prototype.extentToCamera=function(a){var b=this.getPreservingHeadingTilt();if(a=I.fromExtent(this.view,a,b.heading,b.tilt,R))return I.externalToInternal(this.view,
- a)};l.prototype.scaleToCamera=function(a){var b=this.view.pointsOfInterest.centerOnContent;b.forceUpdate();var c=b.renderLocation;a=I.scaleToDistance(this.view,a,b.location.latitude);return this.centerPointAtDistanceToCamera(c,a)};l.prototype.zoomToCamera=function(a){return this.scaleToCamera(I.zoomToScale(this.view,a))};l.prototype.viewpointToCamera=function(a){return(a=G.toCamera(this.view,a))?I.externalToInternal(this.view,a):null};l.prototype.setStateCamera=function(a,b){var c=this;if(!a||!this.view.state.stopActiveCameraController())return!1;
- this.cameraSetByUser=!0;this.cancelImmediateGoTo();this.view.state.updateCamera(function(d){d.copyFrom(a);b.applyConstraints&&m.applyAll(c.view,d)});b.applyConstraints||(this.view.state.cameraController=new E.SurfaceCollisionCorrectionController({view:this.view,desiredCamera:a}));return!0};l.prototype.handleResize=function(a,b){var c=this.view.canvas;!c||c.width===a&&c.height===b||(c.width=a,c.height=b);this.view.state&&(c=this.view.state.camera,c.fullWidth!==a||c.fullHeight!==b)&&(Y.copyFrom(c),
- Y.fullWidth=a,Y.fullHeight=b,this.view.state.camera=Y)};l.prototype.beforeCameraChangeHandle=function(a){this.updateCameraAboveGround(a)};l.prototype.cameraChangedSync=function(a){a&&this.view._stage&&this.view._stage.setCamera(a)};l.prototype.updateCameraAboveGround=function(a){var b=this.view.basemapTerrain,c=this.view.renderCoordsHelper.getAltitude(a.eye),b=b&&b.spatialReference?B.surfaceElevationBelowEye(this.view,a):0;a.aboveGround=c>=b};l.prototype.createGoToCamera=function(a){var d=this;return n.whenOnce(this,
- "ready",null,!0).then(function(){return G.create(d.view,a)}).then(function(e){var f=!!(a instanceof g&&a.camera||a instanceof c),k=e.camera;if(!d.isCompatible(k))throw e=(e=k.position)&&e.spatialReference,new b("goto:incompatible-spatialreference","Resulting camera has an incompatible spatial reference (camera: "+(e?e.wkid:"none")+", view: "+d.view.spatialReference.wkid+")",{camera:k});k=I.externalToInternal(d.view,k);if(!k)throw new b("goto:invalid-camera","Resulting camera is invalid");return{viewpoint:e,
- camera:k,isFullySpecified:f}})};l.prototype.cancellableGoTo=function(a){var b=this,c;return p.create(function(b,d){c={resolve:b,reject:d};a.asyncResult=c},function(){b.view.state.cameraController===a&&a.active&&a.asyncResult===c&&a.stopController()})};l.prototype.goToImmediate=function(a,c){var d=this;this.cancelAnimatedGoTo();this.cancelImmediateGoTo();var e=this.createGoToCamera(a).then(function(a){d.immediateGoToPromise===e&&(d.immediateGoToPromise=null);d.setStateCamera(a.camera,{applyConstraints:!a.isFullySpecified})}).catch(function(a){d.immediateGoToPromise===
- e&&(d.immediateGoToPromise=null);a instanceof b&&a.message&&J.error("#goTo()","Failed to create camera from target, "+a.message[0].toLowerCase()+a.message.slice(1));throw a;});return this.immediateGoToPromise=e};l.prototype.goToAnimatedBeforeReady=function(a,c){var d=this;this.cancelAnimatedGoTo();var e=n.whenOnce(this.view,"ready").then(function(){if(e===d.animatedGoToPromise)return d.animatedGoToPromise=null,d.goToAnimated(a,c);throw new b("view:goto-cancelled","Cancelled");});return this.animatedGoToPromise=
- e};l.prototype.goToAnimated=function(a,c){var d=this;this.cancelAnimatedGoTo();if(!this.ready)return this.goToAnimatedBeforeReady(a,c);var e=this.view.state.cameraController,f;e instanceof D.PointToPointAnimationController&&(e.updateStateFromViewAnimation(),e.active&&(f=e));null==f&&(f=new D.PointToPointAnimationController(this.view.state,this.pickingHelper));var g=f.viewAnimation;a=this.createGoToCamera(a);var k=a.then(function(a){return a.viewpoint});g.update(k);if(f!==e&&!this.view.state.switchCameraController(f))return g.stop(),
- J.error("#goTo()","Cannot start an animation while interacting"),p.reject(new b("view:goto-cannot-interrupt","Cannot start an animation while interacting"));var l=g.target,h=function(){return d.view.state.cameraController===f&&f.viewAnimation.target===l&&f.active};a.then(function(a){var b=a.viewpoint,e=a.camera;a=a.isFullySpecified;if(h()){f.viewAnimation.update(b);l=f.viewAnimation.target;var k;a?(k=new E.SurfaceCollisionCorrectionController({view:d.view,desiredCamera:e}),m.applySurfaceCollision(d.view,
- e,1)):m.applyAll(d.view,e);f.begin(e,d.internalAnimateOptions(c));return g.when().then(function(){var a=d.view.state.cameraController;k&&(a&&a.active?a instanceof D.PointToPointAnimationController&&a.viewAnimation.target===l&&(d.view.state.cameraController=k):f.viewAnimation.target===l&&(d.view.state.cameraController=k))})}}).catch(function(a){a instanceof b&&a.message&&J.error("#goTo()","Failed to create camera from target, "+a.message[0].toLowerCase()+a.message.slice(1));if(h())throw d.view.state.cameraController.stopController(),
- a;});return this.cancellableGoTo(f)};l.prototype.internalAnimateOptions=function(a){var b={};a&&(null!=a.speedFactor&&(b.speedFactor=a.speedFactor),null!=a.duration&&(b.duration=a.duration/1E3),null!=a.maxDuration&&(b.maxDuration=a.maxDuration/1E3),null!=a.easing&&(b.easing="string"===typeof a.easing?H.named[a.easing]:a.easing));return b};a([t.property({type:c,dependsOn:["view.state.camera","ready"]})],l.prototype,"camera",null);a([t.property({type:q,dependsOn:["view.pointsOfInterest.centerOnContent.location",
- "ready"]})],l.prototype,"center",null);a([t.property({type:u,dependsOn:["view.state.camera","ready"]})],l.prototype,"extent",null);a([t.property({readOnly:!0,dependsOn:["view.state.camera","ready"]})],l.prototype,"frustum",null);a([t.property({readOnly:!0,dependsOn:["view.map.initialViewProperties.viewpoint"]})],l.prototype,"hasInitialView",null);a([t.property({readOnly:!0,type:Boolean})],l.prototype,"ready",void 0);a([t.property({dependsOn:["view.pointsOfInterest.centerOnContent.distance","ready"],
- type:Number})],l.prototype,"scale",null);a([t.property({dependsOn:["view.state.camera","ready"]})],l.prototype,"padding",null);a([t.property({readOnly:!0,dependsOn:["view.width","view.height","padding"]})],l.prototype,"screenCenter",null);a([t.property({constructOnly:!0})],l.prototype,"view",void 0);a([t.property({type:g,dependsOn:["camera","ready"]})],l.prototype,"viewpoint",null);a([t.property({type:Number,dependsOn:["scale"]})],l.prototype,"zoom",null);return l=a([t.subclass("esri.views.3d.state.ViewStateManager")],
- l)}(t.declared(d));h.ViewStateManager=r;var O="camera viewpoint extent scale center zoom".split(" "),N=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"center",overrides:[]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],S={heading:0,tilt:0},R=new c,Y=new M,X=z.vec4d.create(),Q="pending-initial-view";h.default=r})},
- "esri/views/3d/state/ConstraintsManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Handles ../../../core/watchUtils ../../../core/accessorSupport/decorators ../camera/constraintUtils ../camera/intersectionUtils ./NearFarHeuristic ./SurfaceCollisionConstraint ../support/mathUtils".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p,n){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function h(a){var b=
- e.call(this)||this;b.handles=new c;b.nearFarHeuristic=l.createNearFarHeuristic(a.view.state.mode,a.view.basemapTerrain,a.view.renderCoordsHelper.spatialReference);return b}f(h,e);h.prototype.initialize=function(){var a=this;this.handles.add([this.view.watch(["constraints.clipDistance.near","constraints.clipDistance.far"],function(){return a.handleClipDistanceNearFarChanged()}),this.view.watch("constraints.clipDistance.mode",function(){return a.handleClipDistanceModeChanged()}),this.view.state.events.on("before-camera-change",
- function(b){return a.cameraUpdateNearFar(b.camera)}),this.view.watch("dataExtent",function(){return a.updateNearFar()},!0)],"clipDistance");this.handles.add([this.view.watch(["constraints.altitude.min","constraints.altitude.max"],function(){return a.handleAltitudeMinMaxChanged()},!0)],"altitude");this.handles.add([this.view.watch("constraints.tilt.max",function(){return a.handleTiltMaxChanged()},!0),this.view.watch("constraints.tilt.mode",function(){return a.handleTiltModeChanged()},!0),this.view.watch("state.camera",
- function(){return a.tiltAutoUpdateMax()},!0)],"tilt");this.handles.add([this.view.watch("constraints.collision.enabled",function(){return a.handleCollisionEnabledChanged()},!0)],"collision");this.view.state.isLocal&&this.handles.add(g.init(this.view,"dataExtent",function(b){return a.updateLocalSurfaceDistance(b)}));this.updateNearFar();"local"!==this.view.state.mode&&this.updateAltitude();this.updateTilt();this.updateCollision();this._set("surfaceCollisionConstraint",new p.default({view:this.view}))};
- h.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null);this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))};h.prototype.handleClipDistanceNearFarChanged=function(){var a=this,b=this.view.constraints&&this.view.constraints.clipDistance;b&&"auto"!==b.mode&&this.view.state.updateCamera(function(c){a.cameraUpdateNearFarManual(c,b);return!0})};h.prototype.handleClipDistanceModeChanged=function(){this.updateNearFar()};
- h.prototype.updateNearFar=function(){var a=this;this.view.state.updateCamera(function(b){a.cameraUpdateNearFar(b);return!0})};h.prototype.cameraUpdateNearFar=function(a){var b=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(b?b.mode:"auto")?this.cameraUpdateNearFarManual(a,b):this.cameraUpdateNearFarAuto(a,b)};h.prototype.cameraUpdateNearFarAuto=function(a,b){var c=this.nearFarHeuristic.compute(a.eye,a.center,this.view.dataExtent,k.surfaceElevationBelowEye(this.view,a),t),d=
- c.distance,e=c.maxFarNearRatio,c=c.minNearDistance;d/e>c?(a.far=d,a.near=a.far/e):(a.near=c,a.far=a.near*e);b&&b.autoUpdate(a.near,a.far)};h.prototype.cameraUpdateNearFarManual=function(a,b){b&&(a.near=b.near,a.far=b.far)};h.prototype.handleCollisionEnabledChanged=function(){this.updateCollision()};h.prototype.updateCollision=function(){var a=this.view.constraints&&this.view.constraints.collision,b=this.view.state.constraints.collision,a=a?a.enabled:!1;a!==b.enabled&&(b.enabled=a)&&this.reapplyConstraints(8)};
- h.prototype.handleAltitudeMinMaxChanged=function(){this.updateAltitude()};h.prototype.updateAltitude=function(){var a=this.view.constraints&&this.view.constraints.altitude;this.view.state.constraints.altitude=a&&"local"!==this.view.state.mode?{min:a.min,max:a.max}:null;this.reapplyConstraints()};h.prototype.handleTiltModeChanged=function(){this.updateTilt()};h.prototype.handleTiltMaxChanged=function(){var a=this.view.constraints&&this.view.constraints.tilt;a&&"auto"!==a.mode&&(this.updateTiltManual(a),
- this.reapplyConstraints())};h.prototype.updateTilt=function(){var a=this.view.constraints&&this.view.constraints.tilt;"manual"===(a?a.mode:"auto")?this.updateTiltManual(a):this.updateTiltAuto(a);this.reapplyConstraints()};h.prototype.updateTiltManual=function(a){var b=this.view.state.constraints;b.tilt=b.createConstantMaxTilt(n.deg2rad(a.max))};h.prototype.updateTiltAuto=function(a){a=this.view.state.constraints;a.tilt=a.createDefaultTilt();this.tiltAutoUpdateMax()};h.prototype.tiltAutoUpdateMax=
- function(){var a=this.view.constraints&&this.view.constraints.tilt;if(a&&"auto"===a.mode){var b=this.view.state.constraints;b.tilt&&(b=b.tilt(this.view.state.camera.distance).max,a.autoUpdate(n.rad2deg(b)))}};h.prototype.updateLocalSurfaceDistance=function(a){var b=Math.max(a.width,a.height);0>=b||(a.hasZ&&(b=Math.max(b,a.zmax-a.zmin)),a=this.view.state,b=3*b/Math.atan(a.camera.fov/2),b!==a.constraints.distance&&(a.constraints.distance=b))};h.prototype.reapplyConstraints=function(a){var c=this;void 0===
- a&&(a=15);this.view.state.updateCamera(function(d){return b.applyAll(c.view,d,{selection:a,interactionType:0,interactionFactor:null,interactionStartCamera:null,interactionDirection:null})})};a([d.property({constructOnly:!0})],h.prototype,"view",void 0);a([d.property({readOnly:!0})],h.prototype,"surfaceCollisionConstraint",void 0);return h=a([d.subclass("esri.views.3d.state.ConstraintsManager")],h)}(d.declared(e));h.ConstraintsManager=r;var t={distance:0,maxFarNearRatio:0,minNearDistance:0};h.default=
- r})},"esri/views/3d/state/NearFarHeuristic":function(){define("require exports ../../../geometry/support/scaleUtils ../lib/glMatrix ../support/earthUtils ../support/mathUtils".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});h.createNearFarHeuristic=function(a,b,c){return"global"===a?new d:new g(b,c)};var g=function(){function d(a,b){this.elevationProvider=a;this.unitInMeters=f.getMetersPerUnitForSR(b)}d.prototype.compute=function(d,f,g,l,h){h||(h={maxFarNearRatio:0,
- distance:0,minNearDistance:0});var m=e.earthRadius;h.maxFarNearRatio=b;h.minNearDistance=k/this.unitInMeters;var p=d[2]*this.unitInMeters,v=p;l=p-l;var x=this.elevationProvider?this.elevationProvider.getElevationBounds():null;x&&(p=0<=l?v-this.unitInMeters*x[0]:this.unitInMeters*x[1]-v);v=Math.max(g.xmax-g.xmin,g.ymax-g.ymin,4*Math.max(g.xmax-g.xmin,g.ymax-g.ymin));a.vec3d.subtract(f,d,q);u[0]=0<q[0]?g.xmax:g.xmin;u[1]=0<q[1]?g.ymax:g.ymin;u[2]=0<q[2]?v/2:-v/2;a.vec3d.subtract(u,d);a.vec3d.normalize(q);
- d=1.1*a.vec3d.dot(u,q)*this.unitInMeters;f=p+m;m=Math.sqrt(f*f-m*m);g=Math.max(g.xmax-g.xmin,g.ymax-g.ymin);f=g*t*this.unitInMeters;p=c.clamp((p-f)/(g*n*this.unitInMeters-f),0,1);h.distance=c.lerp(m,d,p*p*p);h.distance*=Math.max(Math.log(Math.abs(l)),1);h.distance=Math.min(h.distance,Math.max(34064E4,v));h.distance/=this.unitInMeters;return h};return d}(),d=function(){function d(){}d.prototype.compute=function(d,f,g,l,h){h||(h={maxFarNearRatio:0,minNearDistance:0,distance:0});f=e.earthRadius;d=a.vec3d.dot(d,
- d);g=f*f;h.maxFarNearRatio=b;h.minNearDistance=k/1;this.isNemoMode(d,l)?(l=f+l,h.distance=Math.sqrt(d-l*l)/1):d>g?(h.maxFarNearRatio=c.clamp(2E4-(Math.log(Math.sqrt(d)-f)-7.983)/9.011*19E3,1E3,2E4),h.distance=Math.sqrt(d-g)/1):h.distance=h.maxFarNearRatio*h.minNearDistance;h.distance*=1.2;return h};d.prototype.isNemoMode=function(a,b){var c=e.earthRadius+l;return a<c*c&&b<p};return d}(),b=2E4,k=2,l=2E4,p=-500,n=.001,t=1E-4,u=a.vec3d.create(),q=a.vec3d.create()})},"esri/views/3d/state/SurfaceCollisionConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Handles ../../../core/accessorSupport/decorators ../camera/constraintUtils ../camera/intersectionUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function k(a){a=e.call(this)||this;a.handles=new c;return a}f(k,e);k.prototype.initialize=function(){var a=this;this.handles.add(this.view.basemapTerrain.on("elevation-change",function(b){return a.handleElevationChangeEvent(b)}))};k.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null)};k.prototype.handleElevationChangeEvent=function(a){if(this.view.state.cameraController)return!1;
- b.eyeWithinExtent(this.view,this.view.state.camera,a.extent,a.spatialReference)&&this.applyToCurrentCamera()};k.prototype.applyToCurrentCamera=function(){var a=this;this.view.state.updateCamera(function(b){d.applySurfaceCollision(a.view,b,1)})};a([g.property({constructOnly:!0})],k.prototype,"view",void 0);return k=a([g.subclass("esri.views.3d.state.ElevationCollisionConstraint")],k)}(g.declared(e));h.SurfaceCollisionConstraint=r;h.default=r})},"esri/views/3d/state/Frustum":function(){define(["require",
- "exports","../lib/glMatrix","../support/earthUtils","../webgl-engine/lib/Util"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function c(){this.planes=Array(6);this.points=Array(8);this.lines=Array(12);this.origin=f.vec3d.create();this.direction=f.vec3d.create();this._altitude=null;for(var a=0;6>a;a++)this.planes[a]=f.vec4d.create();for(a=0;8>a;a++)this.points[a]=f.vec3d.create();for(a=0;12>a;a++)this.lines[a]={origin:null,direction:f.vec3d.create(),endpoint:null}}
- c.prototype.updateLine=function(a,c,b){a.origin=c;a.endpoint=b;f.vec3d.direction(b,c,a.direction)};c.prototype.update=function(c){e.matrix2frustumPlanes(c.viewMatrix,c.projectionMatrix,this.points,this.planes);for(var d=0;4>d;d++){var b=d,g=d+4;this.updateLine(this.lines[d],this.points[b],this.points[g]);this.updateLine(this.lines[d+4],this.points[b],3===d?this.points[0]:this.points[b+1]);this.updateLine(this.lines[d+8],this.points[g],3===d?this.points[4]:this.points[g+1])}f.vec3d.set(c.eye,this.origin);
- f.vec3d.set(c.viewForward,this.direction);this._altitude=f.vec3d.length(this.origin)-a.earthRadius};Object.defineProperty(c.prototype,"altitude",{get:function(){return this._altitude},enumerable:!0,configurable:!0});return c}();h.Frustum=r;h.default=r})},"esri/views/3d/state/controllers/SurfaceCollisionCorrectionController":function(){define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/Handles ../../camera/constraintUtils ../../camera/intersectionUtils ./CameraController".split(" "),
- function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(d){function b(b){var c=d.call(this)||this;c.handles=new a;c.view=b.view;c.desiredCamera=b.desiredCamera.copy();return c}f(b,d);Object.defineProperty(b.prototype,"canStop",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"constraintEnabled",{get:function(){return this.view.state.constraints.collision.enabled},enumerable:!0,configurable:!0});b.prototype.onControllerStart=function(a){var b=
- this;d.prototype.onControllerStart.call(this,a);this.handles.add(this.view.basemapTerrain.on("elevation-change",function(a){return b.handleElevationChangeEvent(a)}));this.applyCorrection()};b.prototype.onControllerEnd=function(a){this.handles.removeAll();d.prototype.onControllerEnd.call(this,a)};b.prototype.handleElevationChangeEvent=function(a){c.eyeWithinExtent(this.view,this.desiredCamera,a.extent,a.spatialReference)&&this.applyCorrection()};b.prototype.applyCorrection=function(){var a=this;this.view.state.updateCamera(function(b){b.copyViewFrom(a.desiredCamera);
- e.applySurfaceCollision(a.view,b,1)||a.constraintEnabled||(a.state=g.State.Stopped)})};return b}(g.CameraController);h.SurfaceCollisionCorrectionController=r})},"esri/views/3d/support/cameraUtils":function(){define("require exports dojo/_base/lang ../../../Camera ../../../config ../../../geometry/Point ../../../geometry/SpatialReference ../../../geometry/support/webMercatorUtils ../camera/intersectionUtils ../lib/glMatrix ./cameraUtilsPlanar ./cameraUtilsSpherical ./earthUtils ./mathUtils ./projectionUtils ../webgl-engine/lib/Camera".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){function v(a){return"global"===a.viewingMode?p:l}function x(b,d,e){var f=b.renderSpatialReference,l=k.vec3d.set(d.viewForward,F),l=C(b,d.eye,l,d.up,I);b=b.spatialReference||g.WGS84;u.vectorToVector(d.eye,f,D,b)||(b=g.WGS84,u.vectorToVector(d.eye,f,D,b));return e?(e.position.x=D[0],e.position.y=D[1],e.position.z=D[2],e.position.spatialReference=b,e.heading=l.heading,e.tilt=l.tilt,e.fov=t.rad2deg(d.fov),e):new a(new c(D,b),l.heading,l.tilt,t.rad2deg(d.fov))}
- function m(a,b,c){var d=a.state.camera,f=d.fovX,d=d.width/2;"global"===a.viewingMode&&null!=c&&(b*=Math.cos(t.deg2rad(c)));b/=a.renderCoordsHelper.unitInMeters;return d/(39.37*e.screenDPI/b)/Math.tan(f/2)}function B(a,b,c){var d=a.state.camera;b=39.37*e.screenDPI/(d.width/2/(b*Math.tan(d.fovX/2)));"global"===a.viewingMode&&(b/=Math.cos(t.deg2rad(c)));return b*=a.renderCoordsHelper.unitInMeters}function z(b,c,d,e,f,k){var l=b.renderSpatialReference;c=A(b,e.heading,e.tilt,c,d,f);b=u.vectorToPoint(c.eye,
- l,b.spatialReference||g.WGS84);if(!b)return null;if(!k)return new a(b,c.heading,c.tilt,e.fov);k.position=b;k.heading=c.heading;k.tilt=c.tilt;k.fov=e.fov;return k}function C(a,b,c,d,e){return v(a).directionToHeadingTilt(b,c,d,e)}function A(a,b,d,e,l,h){var m=k.vec3d.create(),n=a.renderSpatialReference;if(e)if(e instanceof c){var p=e;u.pointToVector(p,m,a.renderSpatialReference);null==p.z&&null!=a.basemapTerrain&&(p=a.basemapTerrain.getElevation(p),null!=p&&a.renderCoordsHelper.setAltitude(p,m))}else e&&
- k.vec3d.set(e,m);else k.vec3d.set(a.state.camera.center,m);e&&e instanceof c||(e=u.vectorToPoint(m,n,a.spatialReference||g.WGS84));l=Math.max(l,a.state.constraints.minimumPoiDistance);n=d;d=l;if(!(p=h&&h.noReset))var p=e,t=a.engineToScreen(a.state.camera.center),q=a.toScreen(p),p=t.x-q.x,t=t.y-q.y,q=a.pointsOfInterest.centerOnSurfaceFrequent.distance,q=Math.log(Math.max(d,q)/Math.min(d,q))/Math.LN2,p=!(Math.sqrt(p*p+t*t)>5*Math.max(a.width,a.height)||8<q&&8E5<d);p?(n=v(a).eyeTiltToLookAtTilt(m,d,
- n),n=a.state.constraints.clampTilt(d,n),n=v(a).lookAtTiltToEyeTilt(m,d,n)):(b=0,n=a.state.constraints.tilt(d).min);d=n;n=v(a).eyeForCenterWithHeadingTilt;b=n(m,l,b,d);m={eye:b.eye,up:b.up,center:m,heading:b.heading,tilt:b.tilt};return h&&h.noReset||"global"!==a.viewingMode||(b=a.renderCoordsHelper.fromRenderCoords(m.eye,P,a.spatialReference)?a.basemapTerrain&&(a.basemapTerrain.getElevation(P)||0)>P.z-1:!1,!b)?m:(m=a.state.constraints.tilt(l).min,A(a,0,m,e,l,f.mixin({},h,{noReset:!0})))}Object.defineProperty(h,
- "__esModule",{value:!0});var D=k.vec3d.create(),E=k.vec3d.create(),F=k.vec3d.create(),I={heading:0,tilt:0},P=new c,G=new t.Cyclical(-2.0037508342788905E7,2.0037508342788905E7);h.externalToInternal=function(a,c){var d=a.renderSpatialReference,e=v(a).headingTiltToDirectionUp,f=k.vec3d.create();return u.pointToVector(c.position,f,d)?(d=e(f,c.heading,c.tilt),k.vec3d.add(d.direction,f),a=b.cameraOnContentAlongViewDirection(a,f,d.direction,d.up),a.fov=t.deg2rad(c.fov),a):null};h.internalToExternal=x;h.scaleToDistance=
- m;h.distanceToScale=B;h.fromCenterScale=function(a,b,c,d,e,f){c=m(a,c,b.latitude);return z(a,b,c,d,e,f)};h.fromCenterDistance=z;h.directionToHeadingTilt=C;h.eyeHeadingTiltForCenterPointAtDistance=A;h.fromExtent=function(b,e,f,k,l,h){var m;l instanceof a?(h=l,m={noReset:!1}):m=l;var p="global"===b.viewingMode;l=b.renderSpatialReference;var t=b.spatialReference||g.WGS84,q=g.WebMercator,v=e.spatialReference||q,x,r=0;null!=e.zmax&&null!=e.zmin&&(x=(e.zmax+e.zmin)/2,r=e.zmax-e.zmin);if(p){var p=new c(e.xmin,
- e.ymin,v),z=new c(e.xmax,e.ymax,v),p=d.project(p,q),z=d.project(z,q);if(null===p||null===z)return;e=new c(G.center(p.x,z.x),(z.y+p.y)/2,q);null!=x&&(e.z=x);x=n.getGreatCircleSpanAt(e,p,z);q=x.lon;v=x.lat;G.diff(p.x,z.x)>G.range/2&&(q+=n.halfEarthCircumference);q=Math.min(q,n.halfEarthCircumference);v=Math.min(v,n.halfEarthCircumference)}else d.canProject(e,t)&&(e=d.project(e,t)),q=e.xmax-e.xmin,v=e.ymax-e.ymin,e=new c({x:e.xmin+.5*q,y:e.ymin+.5*v,z:x,spatialReference:t});x=b.state.camera;f=A(b,f,
- k,e,Math.max(1/Math.tan(x.fovX/2)*q*.5,1/Math.tan(x.fovY/2)*v*.5,1/Math.tan(x.fov/2)*r*.5)/1,m);k=u.vectorToPoint(f.eye,l,t);if(!k)return null;h||(h=new a);h.position=k;h.heading=f.heading;h.tilt=f.tilt;h.fov=b.camera.fov;return h};h.toExtent=function(a,b,c,d,e){var f;f=a.renderSpatialReference;b||(c||(c=a.state.camera),b=x(a,c,e));if(c)e=u.vectorToPoint(c.center,f,a.spatialReference||g.WGS84),f=c.distance;else{e=a.toMap(a.screenCenter);if(!e)return null;f=n.computeCarthesianDistance(b.position,e)}c||
- (c=a.state.camera);b=2*f*Math.tan(c.fovX/2)*1;c=2*f*Math.tan(c.fovY/2)*1;return"global"===a.viewingMode?p.toExtent(a,e,b,c,d):l.toExtent(a,e,b,c,d)};h.scaleToZoom=function(a,b){return(a=a.basemapTerrain&&a.basemapTerrain.tilingScheme)?a.levelAtScale(b):void 0};h.zoomToScale=function(a,b){return(a=a.basemapTerrain&&a.basemapTerrain.tilingScheme)?a.scaleAtLevel(b):void 0};h.computeScale=function(a,b,c){var d=a.renderSpatialReference;b||(b=a.state.camera);var e;e=g.WGS84;b instanceof q?(u.vectorToVector(b.center,
- d,E,e),e=E[1],b=b.distance):(e=b.position.latitude,u.pointToVector(b.position,D,d),u.pointToVector(c,E,d),b=k.vec3d.dist(D,E));return B(a,b,e)}})},"esri/views/3d/support/cameraUtilsPlanar":function(){define("require exports ../../../geometry/Extent ../lib/glMatrix ./cameraUtilsInternal ./mathUtils ./projectionUtils".split(" "),function(r,h,f,a,e,c,g){function d(d,e,f){d=a.vec3d.create();var g=a.vec3d.create();a.mat4d.identity(l);a.mat4d.rotateZ(l,-c.deg2rad(e));a.mat4d.rotateX(l,c.deg2rad(f));a.mat4d.multiplyVec3(l,
- k,d);a.vec3d.scale(d,-1);a.mat4d.multiplyVec3(l,b,g);return{direction:d,up:g}}Object.defineProperty(h,"__esModule",{value:!0});var b=a.vec3d.createFrom(0,1,0),k=a.vec3d.createFrom(0,0,1),l=a.mat4d.create(),p=a.vec3d.create(),n=a.vec3d.create();h.headingTiltToDirectionUp=d;h.directionToHeadingTilt=function(a,c,d,f){return e.directionToHeadingTilt(c,d,f,k,b)};h.eyeForCenterWithHeadingTilt=function(b,c,e,f){var g=d(b,e,f);b=a.vec3d.add(a.vec3d.scale(g.direction,-c,a.vec3d.create()),b);return{up:g.up,
- eye:b,heading:e,tilt:f}};h.lookAtTiltToEyeTilt=function(a,b,d){return c.rad2deg(d)};h.eyeTiltToLookAtTilt=function(a,b,d){return c.deg2rad(d)};h.toExtent=function(a,b,c,d,e){var k=a.renderSpatialReference;a=a.map&&a.spatialReference||b.spatialReference;g.pointToVector(b,p,k);g.pointToVector(b,n,k);p[0]-=c/2;n[0]+=c/2;p[1]-=d/2;n[1]+=d/2;g.vectorToVector(p,k,p,a);g.vectorToVector(n,k,n,a);e?(e.xmin=p[0],e.ymin=p[1],e.xmax=n[0],e.ymax=n[1],e.spatialReference=a):e=new f(p[0],p[1],n[0],n[1],a);return e}})},
- "esri/views/3d/support/cameraUtilsInternal":function(){define(["require","exports","../lib/glMatrix","./mathUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});var e=f.vec3d.create(),c=f.vec3d.create();h.directionToHeadingTilt=function(g,d,b,k,l){var h=e;f.vec3d.normalize(g,h);var n=f.vec3d.dot(h,k),t=0<n,n=Math.abs(n);.99<n&&(n=Math.abs(f.vec3d.dot(d,k)),.99>n?(f.vec3d.set(d,h),t&&f.vec3d.scale(h,-1)):h=null);d=0;h&&(f.vec3d.scale(k,f.vec3d.dot(k,h),c),f.vec3d.subtract(h,c),
- d=f.vec3d.dot(h,l)/(f.vec3d.length(h)*f.vec3d.length(l)),f.vec3d.cross(h,l,c),d=(0<f.vec3d.dot(c,k)?1:-1)*a.rad2deg(a.acos(d)));g=a.rad2deg(a.acos(-f.vec3d.dot(k,g)/f.vec3d.length(g)));return b?(b.heading=d,b.tilt=g,b):{heading:d,tilt:g}}})},"esri/views/3d/support/cameraUtilsSpherical":function(){define("require exports ../../../geometry/Extent ../../../geometry/SpatialReference ../../../geometry/support/webMercatorUtils ../lib/glMatrix ./cameraUtilsInternal ./earthUtils ./mathUtils".split(" "),function(r,
- h,f,a,e,c,g,d,b){function k(a,d,e){var f=c.vec3d.create(),g=c.vec3d.create();c.vec3d.cross(a,n,v);0===c.vec3d.dot(v,v)&&c.vec3d.cross(a,t,v);c.mat4d.identity(q);c.mat4d.rotate(q,-b.deg2rad(d),a);c.mat4d.rotate(q,-b.deg2rad(e),v);c.vec3d.cross(v,a,g);c.vec3d.normalize(g);c.mat4d.multiplyVec3(q,g);c.vec3d.normalize(a,f);c.mat4d.multiplyVec3(q,c.vec3d.negate(f));return{direction:f,up:g}}function l(a){var b=a[1];a[1]=-a[2];a[2]=b}function p(a,b){b=k(b,a.heading,a.tilt);a.up=b.up;return a}Object.defineProperty(h,
- "__esModule",{value:!0});var n=c.vec3d.createFrom(0,0,1),t=c.vec3d.normalize(c.vec3d.createFrom(1,1,1)),u=new b.Cyclical(-180,180),q=c.mat4d.create(),v=c.vec3d.create(),x=c.vec3d.create();h.headingTiltToDirectionUp=k;h.directionToHeadingTilt=function(a,b,d,e){var f=v;c.vec3d.normalize(a,f);c.vec3d.cross(f,n,x);0===c.vec3d.dot(x,x)&&c.vec3d.cross(f,t,x);c.vec3d.cross(x,f,x);return g.directionToHeadingTilt(b,d,e,f,x)};h.eyeForCenterWithHeadingTilt=function(a,d,e,f){var g={eye:c.vec3d.create(),up:null,
- tilt:f,heading:e},k=v;k[0]=a[0];k[1]=a[2];k[2]=-a[1];e=b.deg2rad(e);var h=b.deg2rad(f);f=Math.sin(e);e=Math.cos(e);var m=Math.sin(h),n=Math.cos(h),t=c.vec3d.length(k);if(1E-8>Math.abs(h))h=d+t;else var q=t/m,u=b.asin(d/q),h=q*Math.sin(Math.PI-h-u);var q=m*d,n=n*d,u=e*q,x=h-n,r=x*x,z=d*d*m*m,m=e*e*z,z=f*f*z,B=k[1]*x,C=m*(m+r-k[1]*k[1]);if(0>C)return c.vec3d.scale(k,h/t,g.eye),g.tilt=0,g;var R=Math.sqrt(C),C=m+r,B=0<e?-R+B:R+B;if(1E-8>Math.abs(C))return 1E-8>t?(g.eye[0]=0,g.eye[1]=0,g.eye[2]=d):c.vec3d.scale(k,
- h/t,g.eye),g.tilt=0,l(g.eye),p(g,a);g.eye[1]=B/C;C=g.eye[1]*g.eye[1];d=1-C;B=Math.sqrt(d);u=m*C+z-2*u*g.eye[1]*B*x+d*r;if(1E-8>Math.abs(u))return c.vec3d.scale(k,h/t,g.eye),g.tilt=0,l(g.eye),p(g,a);g.eye[0]=(d*(h*k[0]-n*k[0])-q*B*(k[0]*g.eye[1]*e+k[2]*f))/u;g.eye[2]=(d*(h*k[2]-n*k[2])-q*B*(k[2]*g.eye[1]*e-k[0]*f))/u;c.vec3d.scale(g.eye,h);l(g.eye);return p(g,a)};h.lookAtTiltToEyeTilt=function(a,d,e){a=c.vec3d.length(a);d=b.asin(d/(Math.sqrt(d*d+a*a-2*d*a*Math.cos(Math.PI-e))/Math.sin(e)));return b.rad2deg(e-
- d)};h.eyeTiltToLookAtTilt=function(a,d,e){e=b.deg2rad(e);a=c.vec3d.length(a);return b.asin(d/(a/Math.sin(e)))+e};h.toExtent=function(c,g,k,l,h){function m(a){var c=Math.PI/2;a=b.cyclical2PI.normalize(a,-c);a>c&&(a=Math.PI-a);return a}var n;n=g.latitude;g=g.longitude;var p=d.getLonDeltaForDistance(g,n,k)/2;k=g-p;g+=p;n=b.deg2rad(n);p=d.earthRadius;n=(1+Math.sin(n))/(1-Math.sin(n));var t=(n+1)*Math.tan(l/p/2);n=1.5*Math.PI-2*Math.atan(.5*(t+Math.sqrt(4*n+t*t)));l=n+l/p;n=m(n);l=m(l);l<n&&(p=l,l=n,n=
- p);n=Math.max(b.rad2deg(n),-90);l=Math.min(b.rad2deg(l),90);g=u.monotonic(k,g);180<g-k&&(p=(g-k-180)/2,k+=p,g-=p);h?(h.xmin=k,h.ymin=n,h.xmax=g,h.ymax=l,h.spatialReference=a.WGS84):h=new f(k,n,g,l,a.WGS84);c.spatialReference&&c.spatialReference.isWebMercator&&e.geographicToWebMercator(h,!1,h);return h}})},"esri/views/3d/support/viewpointUtils":function(){define("require exports ../../../Camera ../../../geometry ../../../Graphic ../../../Viewpoint ../../../core/Error ../../../core/promiseUtils ../../../geometry/support/webMercatorUtils ../camera/intersectionUtils ../lib/glMatrix ./aaBoundingBox ./aaBoundingRect ./cameraUtils ./intersectionUtils ./mathUtils ./projectionUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){function x(a){return 360-q.cyclicalDeg.normalize(a)}function m(a){return q.cyclicalDeg.normalize(360-a)}function B(c,d,e){if(!d)return null;var g=c.spatialReference||a.SpatialReference.WGS84;if(d.camera){c=d.get("camera.position.spatialReference");if(!b.canProject(c,g))return null;d=d.camera.clone();c.equals(g)||(d.position=b.project(d.position,g));return d}var k=d.get("targetGeometry.spatialReference");if(k&&!b.canProject(k,g))return null;var k=t.internalToExternal(c,
- c.state.camera),l={noReset:!1};null!=d.rotation&&(k.heading=x(d.rotation),l.noReset=!0);null!=e&&(k.tilt=e);if("point"===d.targetGeometry.type){e=d.targetGeometry;var h=void 0,m=d.targetGeometry.clone(),h=null!=d.scale?t.scaleToDistance(c,d.scale,e.latitude):c.state.camera.distance;d=t.eyeHeadingTiltForCenterPointAtDistance(c,k.heading,k.tilt,m,h,l);g=v.vectorToPoint(d.eye,c.renderSpatialReference,g);return new f(g,d.heading,d.tilt,k.fov)}return t.fromExtent(c,d.targetGeometry.extent,k.heading,k.tilt,
- l)}function z(a,b,c){b=c.scale;null==b&&null!=c.zoom&&(b=t.zoomToScale(a,c.zoom));return b}function C(a,b){var c=!1;null!=b.heading?(a.heading=b.heading,c=!0):null!=b.rotation&&(a.heading=x(b.rotation),c=!0);null!=b.tilt&&(a.tilt=b.tilt,c=!0);null!=b.fov&&(a.fov=b.fov);return c}function A(b,c,d){var e=b.spatialReference||a.SpatialReference.WGS84;c=c||t.externalToInternal(b,d.camera);d.targetGeometry=v.vectorToPoint(c.center,b.renderSpatialReference,e);d.scale=t.computeScale(b,c);d.rotation=m(d.camera.heading);
- return d}function D(a,c,d){if(c){if(!b.canProject(c.spatialReference,a.spatialReference))throw new g("viewpointutils:incompatible-spatialreference","Spatial reference ("+(c.spatialReference?c.spatialReference.wkid:"unknown")+") is incompatible with the view ("+a.spatialReference.wkid+")",{geometry:c});var e=[];if(!c.hasZ&&a.basemapTerrain){var f=void 0;switch(c.type){case "point":f=c;break;case "multipoint":case "polyline":case "mesh":f=c.extent.center;break;case "extent":f=c.center;break;case "polygon":f=
- c.centroid}f&&b.canProject(f,a.basemapTerrain.spatialReference)?O[2]=a.basemapTerrain.getElevation(f)||0:O[2]=0}(0,U[c.type])(c,function(a){e.push(a[0],a[1],a[2])},O);var k=e.length/3;if(0!==k&&(f=Array(e.length),v.bufferToBuffer(e,c.spatialReference,0,f,a.spatialReference,0,k)))for(c.hasZ&&(d.hasZ=!0),a=0;a<f.length;a+=3)c.hasZ?(O[0]=f[a+0],O[1]=f[a+1],O[2]=f[a+2]):(O[0]=f[a+0],O[1]=f[a+1]),p.expand(d.boundingBox,O)}}function E(a,b,c){return a.whenViewForGraphic(b).then(function(a){if(a&&a.whenGraphicBounds)return a.whenGraphicBounds(b)}).then(function(a){var b=
- a.boundingBox;p.expand(c.boundingBox,b);a.screenSpaceObjects&&a.screenSpaceObjects.forEach(function(a){c.screenSpaceObjects.push(a)});isFinite(b[2])&&(c.hasZ=!0)}).catch(function(){D(a,b.geometry,c)})}function F(b,c,f){if(Array.isArray(c)&&2===c.length){var g=c[0],k=c[1];if("number"===typeof g&&"number"===typeof k)return V.x=g,V.y=k,V.z=void 0,V.spatialReference=a.SpatialReference.WGS84,D(b,V,f),d.resolve()}if(c&&"function"===typeof c.map)return d.eachAlways(c.map(function(a){return F(b,a,f)}));if(c instanceof
- a.BaseGeometry)try{D(b,c,f)}catch(ea){return d.reject(ea)}else if(c instanceof e)return E(b,c,f);return d.resolve()}function I(a,b,c,d){if(b.camera)return P(a,c,b.camera,d);d.scale=b.scale;d.rotation=b.rotation;d.targetGeometry=b.targetGeometry?b.targetGeometry.clone():null;d.camera=null;null!=c.heading?d.rotation=m(c.heading):null!=c.rotation&&(d.rotation=c.rotation);b=z(a,d.targetGeometry,c);null!=b&&(d.scale=b);d.camera=B(a,d,c.tilt);return d}function P(a,c,d,e){e.camera=d.clone();e.camera.fov=
- a.camera.fov;c=a.spatialReference;d=e.camera.position.spatialReference;if(!b.canProject(d,c))return null;d.equals(c)||(e.camera.position=b.project(e.camera.position,c));return A(a,null,e)}function G(b,c,d,e){if(!d)return null;e.targetGeometry=d.clone();var f=k.cameraOnContentAlongViewDirection(b);if(c.position){d=e.targetGeometry;var g=b.renderSpatialReference;v.pointToVector(c.position,Q,g);v.pointToVector(d,K,g);e.targetGeometry=new a.Point(d);e.camera.position=new a.Point(c.position);l.vec3d.subtract(K,
- Q,X);t.directionToHeadingTilt(b,Q,X,f.up,e.camera);e.scale=t.distanceToScale(b,l.vec3d.dist(Q,K),e.targetGeometry.latitude);e.rotation=m(e.camera.heading);return e}if(c.zoomFactor){var g=f.distance/c.zoomFactor,h=l.vec3d.scale(f.viewForward,-g,O);l.vec3d.add(f.center,h,f.eye);f.markViewDirty();e.scale=t.distanceToScale(b,g,d.latitude)}t.internalToExternal(b,f,e.camera);g={noReset:!1};C(e.camera,c)&&(g.noReset=!0);return c.zoomFactor||(e.scale=z(b,e.targetGeometry,c),null==e.scale&&(v.pointToVector(d,
- O,b.renderSpatialReference),u.frustumPoint(f.frustumPlanes,O)?e.scale=t.distanceToScale(b,l.vec3d.dist(f.eye,O),d.latitude):e.scale=t.computeScale(b,f)),t.fromCenterScale(b,e.targetGeometry,e.scale,e.camera,g,e.camera))?e:null}function M(a,b,c,d){d.targetGeometry=c.clone();var e=k.cameraOnContentAlongViewDirection(a);t.internalToExternal(a,e,d.camera);e={noReset:!1};C(d.camera,b)&&(e.noReset=!0);return t.fromExtent(a,c,d.camera.heading,d.camera.tilt,e,d.camera)?d:null}function H(a,b){if(!b||!a.spatialReference)return null;
- a={target:null};if("declaredClass"in b||Array.isArray(b))a.target=b;else{for(var c in b)a[c]=b[c];b.center&&!a.target&&(a.target=b.center)}return a}function J(a){a&&(a.rotation=m(a.camera.heading));return d.resolve(a)}Object.defineProperty(h,"__esModule",{value:!0});h.DEFAULT_FRAME_COVERAGE=.66;h.rotationToHeading=x;h.headingToRotation=m;h.toCamera=B;h.fromInternalCamera=function(a,b,d){d||(d=new c({camera:new f}));t.internalToExternal(a,b,d.camera);return A(a,b,d)};h.fromCamera=function(a,b,d){d||
- (d=new c);d.camera=b.clone();return A(a,null,d)};h.create=function(b,e){var m=H(b,e);if(!m)return d.reject(new g("viewpointutils-create:no-target","Missing target for creating viewpoint"));var q=new c({camera:new f({fov:b.camera.fov})}),u=null!=m.scale||null!=m.zoom;if(m.target instanceof c)return J(I(b,m.target,m,q));if(m.target instanceof f)return J(P(b,m,m.target,q));if(m.target instanceof a.Extent)return e=m.target.xmin===m.target.xmax||m.target.ymin===m.target.ymax,u||e?J(G(b,m,m.target.center,
- q)):J(M(b,m,m.target,q));var x={boundingBox:p.create(p.NEGATIVE_INFINITY),spatialReference:b.spatialReference,hasZ:!1,screenSpaceObjects:[]};return F(b,m.target,x).then(function(){if(isFinite(x.boundingBox[0])){p.center(x.boundingBox,O);V.x=O[0];V.y=O[1];V.z=O[2];V.spatialReference=b.spatialReference;var c=void 0;isFinite(V.z)&&x.hasZ?c=p.isPoint(x.boundingBox):(V.z=void 0,c=n.isPoint(p.toRect(x.boundingBox,Y)));if(u||c)return G(b,m,V,q);var d=V,c=x.boundingBox,e;e=x.screenSpaceObjects;var f=h.DEFAULT_FRAME_COVERAGE;
- if(e.length){for(var g=Number.NEGATIVE_INFINITY,r=0;r<e.length;r++)var z=e[r].screenSpaceBoundingRect,g=Math.max(g,Math.abs(z[0]),Math.abs(z[1]),Math.abs(z[2]),Math.abs(z[3]));e=f-g/Math.min(b.width,b.height)*2}else e=f;f=e;q.targetGeometry=d.clone();e=k.cameraOnContentAlongViewDirection(b);g=0;d.hasZ?g=d.z:b.basemapTerrain&&(g=b.basemapTerrain.getElevation(d));l.vec3d.set3(d.x,d.y,g,O);v.computeLinearTransformation(b.spatialReference,O,N,b.renderSpatialReference);l.mat4d.toMat3(N,S);l.mat3d.transpose(S);
- p.set(R,p.NEGATIVE_INFINITY);d=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(r=0;r<d.length;r++){var z=d[r],B=c[z[2]];isFinite(B)||(B=g);l.vec3d.set3(c[z[0]],c[z[1]],B,O);v.vectorToVector(O,b.spatialReference,O,b.renderSpatialReference);p.expand(R,l.mat3d.multiplyVec3(S,O))}c=p.width(R);d=p.height(R);g=p.depth(R);r=1/Math.tan(e.fovY/2);c=Math.max(.5*Math.sqrt(c*c+g*g)*Math.max(r,1/Math.tan(e.fovX/2))+.5*d,.5*d*r+.5*Math.max(c,g))/f;t.internalToExternal(b,e,q.camera);e={noReset:!1};
- C(q.camera,m)&&(e.noReset=!0);q.scale=t.distanceToScale(b,c,q.targetGeometry.latitude);c=t.fromCenterScale(b,q.targetGeometry,q.scale,q.camera,e,q.camera)?q:null;return c}if(m.position)return c=k.cameraOnContentAlongViewDirection(b),l.vec3d.set(c.viewForward,X),t.directionToHeadingTilt(b,c.eye,X,c.up,L),q.camera.position=new a.Point(m.position),q.camera.heading=null!=m.heading?m.heading:L.heading,q.camera.tilt=null!=m.tilt?m.tilt:L.tilt,A(b,null,q);c=k.cameraOnContentAlongViewDirection(b);c=v.vectorToPoint(c.center,
- b.renderSpatialReference,V,b.spatialReference);return G(b,m,c,q)}).then(function(a){return J(a)})};var O=l.vec3d.create(),N=l.mat4d.create(),S=l.mat3d.create(),R=p.create(),Y=n.create(),X=l.vec3d.create(),Q=l.vec3d.create(),K=l.vec3d.create(),L={heading:0,tilt:0},V=new a.Point,U={point:function(a,b,c){c[0]=a.x;c[1]=a.y;a.hasZ&&(c[2]=a.z);b(c)},polygon:function(a,b,c){for(var d=a.hasZ,e=0;e<a.rings.length;e++)for(var f=a.rings[e],g=0;g<f.length;g++)c[0]=f[g][0],c[1]=f[g][1],d&&(c[2]=f[g][2]),b(c)},
- polyline:function(a,b,c){for(var d=a.hasZ,e=0;e<a.paths.length;e++)for(var f=a.paths[e],g=0;g<f.length;g++)c[0]=f[g][0],c[1]=f[g][1],d&&(c[2]=f[g][2]),b(c)},multipoint:function(a,b,c){var d=a.points;a=a.hasZ;for(var e=0;e<d.length;e++)c[0]=d[e][0],c[1]=d[e][1],a&&(c[2]=d[e][2]),b(c)},extent:function(a,b,c){a.hasZ?(b(l.vec3d.set3(a.xmin,a.ymin,a.zmin,c)),b(l.vec3d.set3(a.xmax,a.ymin,a.zmin,c)),b(l.vec3d.set3(a.xmin,a.ymax,a.zmin,c)),b(l.vec3d.set3(a.xmax,a.ymax,a.zmin,c)),b(l.vec3d.set3(a.xmin,a.ymin,
- a.zmax,c)),b(l.vec3d.set3(a.xmax,a.ymin,a.zmax,c)),b(l.vec3d.set3(a.xmin,a.ymax,a.zmax,c)),b(l.vec3d.set3(a.xmax,a.ymax,a.zmax,c))):(b(l.vec3d.set3(a.xmin,a.ymin,c[2],c)),b(l.vec3d.set3(a.xmax,a.ymin,c[2],c)),b(l.vec3d.set3(a.xmin,a.ymax,c[2],c)),b(l.vec3d.set3(a.xmax,a.ymax,c[2],c)))},mesh:function(a,b,c){if(a=a.vertexAttributes&&a.vertexAttributes.position)for(var d=0;d<a.length;d+=3)b(l.vec3d.set3(a[d+0],a[d+1],a[d+2],c))}}})},"esri/views/3d/support/CombinedElevationProvider":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ./Evented".split(" "),
- function(r,h,f,a,e,c,g){return function(d){function b(a){var b=d.call(this)||this;b.providers={im:[],ground:[],scene:[]};b.handles=new Map;b.elevationChange=function(a){b.emit("elevation-change",a)};return b}f(b,d);b.prototype.getElevation=function(a,b){var c=-Infinity,d=!1;if("scene"===b)for(var e=0,f=this.providers.im;e<f.length;e++){var g=f[e],g=g.getElevation(a,b);null!=g&&(c=Math.max(g,c),!d&&isFinite(c)&&(d=!0))}if(!d)for(d=0,e=this.providers.ground;d<e.length;d++)g=e[d],g=g.getElevation(a,
- b),null!=g&&(c=Math.max(g,c));if("scene"===b)for(d=0,e=this.providers.scene;d<e.length;d++)g=e[d],g=g.getElevation(a,b),null!=g&&(c=Math.max(g,c));return isFinite(c)?c:null};b.prototype.register=function(a,b){this.handles.set(b,b.on("elevation-change",this.elevationChange));this.providers[a].push(b)};b.prototype.unregister=function(a){this.handles.has(a)&&(this.handles.get(a).remove(),this.handles.delete(a));for(var b=0,c=Object.keys(this.providers);b<c.length;b++){var d=c[b],e=this.providers[d].indexOf(a);
- -1<e&&this.providers[d].splice(e,1)}};a([c.property({constructOnly:!0})],b.prototype,"view",void 0);a([c.property({readOnly:!0,aliasOf:"view.basemapTerrain.spatialReference"})],b.prototype,"spatialReference",void 0);return b=a([c.subclass("esri.views.3d.support.CombinedElevationProvider")],b)}(c.declared(e,g.Evented))})},"esri/views/3d/support/DisplayQualityProfile":function(){define(["require","exports","../../../core/sniff"],function(r,h,f){var a=f("esri-mobile"),e=f("esri-iPhone");r=function(){function a(){}
- a.isValidProfile=function(c){return c in a.profiles};a.getDefaultProfile=function(){return f("trident")||e?"low":"medium"};a.apply=function(c,d){c=a.profiles[c];d.sceneService["3dObject"].lodFactor=c.sceneService["3dObject"].lodFactor;d.sceneService.point.lodFactor=c.sceneService.point.lodFactor;d.sceneService.integratedMesh.lodFactor=c.sceneService.integratedMesh.lodFactor;d.sceneService.pointCloud.lodFactor=c.sceneService.pointCloud.lodFactor;d.sceneService.uncompressedTextureDownsamplingEnabled=
- c.sceneService.uncompressedTextureDownsamplingEnabled;d.tiledSurface.lodBias=c.tiledSurface.lodBias;d.tiledSurface.angledSplitBias=c.tiledSurface.angledSplitBias;d.antialiasingEnabled=c.antialiasingEnabled;d.gpuMemoryLimit=c.gpuMemoryLimit};return a}();(function(c){c.profiles={low:{sceneService:{"3dObject":{lodFactor:.2},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5},antialiasingEnabled:!1,
- gpuMemoryLimit:200},medium:{sceneService:{"3dObject":{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1},antialiasingEnabled:!0,gpuMemoryLimit:a?400:500},high:{sceneService:{"3dObject":{lodFactor:1},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1},antialiasingEnabled:!0,
- gpuMemoryLimit:a?600:1E3}}})(r||(r={}));return r})},"esri/views/3d/support/HighlightOptions":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../Color ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),function(r,h,f,a,e,c,g){return function(c){function b(){var a=null!==c&&c.apply(this,arguments)||this;a.color=new e([0,255,255]);a.haloOpacity=1;a.fillOpacity=.25;return a}f(b,c);b.toEngineOptions=function(a){return{color:new Float32Array(e.toUnitRGBA(a.color)),
- haloOpacity:a.haloOpacity,haloOpacityOccluded:.25*a.haloOpacity,fillOpacity:a.fillOpacity,fillOpacityOccluded:.25*a.fillOpacity}};a([g.property({type:e})],b.prototype,"color",void 0);a([g.property()],b.prototype,"haloOpacity",void 0);a([g.property()],b.prototype,"fillOpacity",void 0);return b=a([g.subclass()],b)}(g.declared(c))})},"esri/views/3d/support/MapCoordsHelper":function(){define("require exports ../../../geometry ../../../core/Error ../../../core/promiseUtils ../../../geometry/support/scaleUtils ../../../portal/support/geometryServiceUtils ../../../tasks/support/ProjectParameters".split(" "),
- function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function b(a,b,d){void 0===d&&(d=null);var e=this;this.spatialReference=b;this.unitInMeters=c.getMetersPerUnitForSR(this.spatialReference);(this.geometryService=d)||g.create(a&&a.get("portalItem")).then(function(a){e.geometryService=a}).catch(function(){})}b.prototype.toGeographic=function(b){var c=this,g=!0;if(!this.geometryService)return e.reject(new a("mapcoordshelper:missing-geometry-service","Must specify geometryService in esri/config"));
- Array.isArray(b[0])&&"number"!==typeof b[0]||(b=[b],g=!1);b=b.map(function(a){return a instanceof f.Point?a:new f.Point(a,c.spatialReference)});b=new d({geometries:b,outSR:f.SpatialReference.WGS84});return this.geometryService.project(b).then(function(a){a=a.map(function(a){if("point"===a.type)return[a.x,a.y]});return g?a:a[0]})};b.prototype.canProject=function(){return!!this.geometryService};return b}();h.MapCoordsHelper=r;h.default=r})},"esri/views/3d/support/QualitySettings":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/typescript".split(" "),
- function(r,h,f,a,e,c){var g=function(b){function d(){return null!==b&&b.apply(this,arguments)||this}f(d,b);a([c.property({value:1})],d.prototype,"lodFactor",void 0);return d=a([c.subclass()],d)}(e),d=function(b){function d(){return null!==b&&b.apply(this,arguments)||this}f(d,b);d.prototype.getDefaults=function(){return{"3dObject":new g,point:new g,integratedMesh:new g,pointCloud:new g,uncompressedTextureDownsamplingEnabled:!1}};a([c.property()],d.prototype,"3dObject",void 0);a([c.property()],d.prototype,
- "point",void 0);a([c.property()],d.prototype,"integratedMesh",void 0);a([c.property()],d.prototype,"pointCloud",void 0);a([c.property()],d.prototype,"uncompressedTextureDownsamplingEnabled",void 0);return d=a([c.subclass()],d)}(e),b=function(b){function d(){return null!==b&&b.apply(this,arguments)||this}f(d,b);a([c.property({value:0})],d.prototype,"lodBias",void 0);a([c.property({value:1})],d.prototype,"angledSplitBias",void 0);return d=a([c.subclass()],d)}(e);return function(e){function g(){return null!==
- e&&e.apply(this,arguments)||this}f(g,e);g.prototype.getDefaults=function(){return{sceneService:new d,tiledSurface:new b,antialiasingEnabled:!0}};a([c.property()],g.prototype,"sceneService",void 0);a([c.property()],g.prototype,"tiledSurface",void 0);a([c.property()],g.prototype,"antialiasingEnabled",void 0);a([c.property()],g.prototype,"gpuMemoryLimit",void 0);return g=a([c.subclass()],g)}(e)})},"esri/core/accessorSupport/typescript":function(){define(["../declare","../typescript","../JSONSupport",
- "dojo/_base/lang"],function(r,h,f,a){function e(a,f){if(!a)return f;if(!f)return a;for(var c in f){var b=a[c],g=f[c];Array.isArray(g)&&Array.isArray(b)?a[c]=b.concat(g):a[c]="object"===typeof g&&"object"===typeof b?e(b,g):g}return a}return{subclass:function(c,g){return function(d){d=h.declareDefinition(d,c);b&&(d.instanceMembers.properties=e(b,d.instanceMembers.properties));var b=d.instanceMembers.properties;if(b)for(var g in b){var l=b[g];l&&!l.reader&&l.type&&(l.type===Date?l.reader=function(a){return null!=
- a?new Date(a):null}:-1!==l.type._meta.bases.indexOf(f)&&(l.reader=function(a){return function(b){return a.fromJSON(b)}}(l.type)))}return a.mixin(r(d.bases,d.instanceMembers),d.classMembers)}},shared:h.shared,property:function(a){return function(c,d){var b=Object.getPrototypeOf(c),b=b&&b.properties;c.properties&&c.properties!==b||(c.properties={});c.properties=c.properties||{};c.properties[d]=a||{}}}}})},"esri/core/typescript":function(){define(["./declare","dojo/_base/lang"],function(r,h){var f={declareDefinition:function(a,
- e){var c=[],f=Object.getPrototypeOf(a.prototype),d;if(f!==Object.prototype){var b=f.constructor;d=b.prototype;c.push(b)}e&&(c=c.concat(e));e={};for(var b=Object.getOwnPropertyNames(a.prototype),k=0;k<b.length;k++){var l=b[k];if("constructor"!==l){var h=l;"dojoConstructor"===l&&(h="constructor");d&&a.prototype[l]===d[l]||(e[h]=a.prototype[l])}}b=Object.getOwnPropertyNames(a);f=Object.getOwnPropertyNames(f.constructor);d={};for(k=0;k<b.length;k++)l=b[k],-1===f.indexOf(l)&&(d[l]=a[l]);return{bases:c,
- instanceMembers:e,classMembers:d}},subclass:function(a){return function(e){e=f.declareDefinition(e,a);return h.mixin(r(e.bases,e.instanceMembers),e.classMembers)}},shared:function(a){return function(e,c){e[c]=a}}};return f})},"esri/views/3d/support/RenderCoordsHelper":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../geometry/Point ../../../geometry/SpatialReference ../../../geometry/support/scaleUtils ../lib/glMatrix ./earthUtils ./mathUtils ./projectionUtils ../webgl-engine/lib/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){Object.defineProperty(h,"__esModule",{value:!0});h.createRenderCoordsHelper=function(a,b){return"global"===a?new n(b):new t(b)};var p;(function(a){a[a.X=0]="X";a[a.Y=1]="Y";a[a.Z=2]="Z"})(p=h.BasisDimension||(h.BasisDimension={}));r=function(){function b(a,b){this.spatialReference=a;this.unitInMeters=b}b.prototype.toRenderCoords=function(b,c,d){return b instanceof a?k.pointToVector(b,c,this.spatialReference):k.vectorToVector(b,c,d,this.spatialReference)};b.prototype.fromRenderCoords=
- function(b,c,d){return c instanceof a?k.vectorToPoint(b,this.spatialReference,c,d):c instanceof e?k.vectorToPoint(b,this.spatialReference,c):k.vectorToVector(b,this.spatialReference,c,d)};return b}();h.RenderCoordsHelper=r;var n=function(a){function c(b){return a.call(this,b||k.SphericalECEFSpatialReference,1)||this}f(c,a);c.prototype.getAltitude=function(a){return g.vec3d.length(a)-d.earthRadius};c.prototype.setAltitude=function(a,b){a=(a+d.earthRadius)/g.vec3d.length(b);g.vec3d.scale(b,a)};c.prototype.setAltitudeOfTransformation=
- function(a,b){var c=b[12],e=b[13],f=b[14];a=(a+d.earthRadius)/Math.sqrt(c*c+e*e+f*f);b[12]=c*a;b[13]=e*a;b[14]=f*a};c.prototype.worldUpAtPosition=function(a,b){return this.worldBasisAtPosition(a,p.Z,b)};c.prototype.worldBasisAtPosition=function(a,c,d){switch(c){case p.X:return b.cartesianToSpherical(a||x,q),a=q[2],g.vec3d.set3(-Math.sin(a),Math.cos(a),0,d);case p.Y:b.cartesianToSpherical(a||x,q);c=q[1];a=q[2];var e=Math.sin(c);return g.vec3d.set3(-e*Math.cos(a),-e*Math.sin(a),Math.cos(c),d);case p.Z:return g.vec3d.normalize(a||
- x,d)}};c.prototype.intersectManifold=function(a,b,c,e){void 0===e&&(e=g.vec3d.create());if(!l.raySphere(a,b,null,d.earthRadius+c,q)||0>g.vec3d.dot(g.vec3d.direction(q,a,v),b))return!1;g.vec3d.set(q,e);return!0};return c}(r),t=function(a){function b(b){b=a.call(this,b,c.getMetersPerUnitForSR(b))||this;b.worldX=[1,0,0];b.worldY=[0,1,0];b.worldZ=[0,0,1];return b}f(b,a);b.prototype.getAltitude=function(a,b){return b?a[b+2]:a[2]};b.prototype.setAltitude=function(a,b){b[2]=a};b.prototype.setAltitudeOfTransformation=
- function(a,b){b[14]=a};b.prototype.worldUpAtPosition=function(a,b){return g.vec3d.set(this.worldZ,b)};b.prototype.worldBasisAtPosition=function(a,b,c){switch(b){case p.X:return g.vec3d.set(this.worldX,c);case p.Y:return g.vec3d.set(this.worldY,c);case p.Z:return g.vec3d.set(this.worldZ,c)}};b.prototype.intersectManifold=function(a,b,c,d){void 0===d&&(d=g.vec3d.create());g.vec4d.set4(this.worldZ[0],this.worldZ[1],this.worldZ[2],-c,u);if(!l.rayPlane(a,b,u,q)||0>g.vec3d.dot(g.vec3d.direction(q,a,v),
- b))return!1;g.vec3d.set(q,d);return!0};return b}(r),u=g.vec4d.create(),q=g.vec3d.create(),v=g.vec3d.create(),x=[0,0,0]})},"esri/views/3d/support/ResourceController":function(){define("../../../core/declare ../../../core/Handles ../../../core/Logger ../../../core/scheduling ./MemoryController ./StreamDataSupplier ./StreamDataLoader ./PreallocArray ../webgl-engine/lib/Performance ../webgl-engine/lib/Util".split(" "),function(r,h,f,a,e,c,g,d,b,k){function l(a){this.budget=this.begin=0;this.performance=
- a;this.enabled=!0}var p=k.assert,n={TERRAIN:"terrain",SCENE:"scene",SYMBOLOGY:"symbols"},t=new d(20),u=f.getLogger("esri.views.support.ResourceController");l.prototype.now=function(){return this.performance.now()};l.prototype.reset=function(a){this.begin=this.now();this.budget=this.enabled?a:Number.MAX_VALUE};l.prototype.done=function(){return this.enabled&&this.elapsed()>=this.budget};l.prototype.remaining=function(){return Math.max(this.budget-this.elapsed(),0)};l.prototype.elapsed=function(){return this.now()-
- this.begin};r=r(null,{constructor:function(c,d,f){f=f||b;this._clients=[];this._frameWorkers=[];this._nextFrameWorker=0;this._budget=new l(f);this._idleFrameWorkers=[];this._idleFrameWorkerRobin=0;this._idleUpdatesStartFired=!1;this._lastTargetChangeTime=f.now();this._memoryController=new e(c);this.navigationTimeout=300;this.animatingFrameTimeBudget=10;this.idleFrameWorkerBudget=30;this.idleFrameTimeBudget=50;f={};for(var k in n)f[n[k]]=0;f[n.TERRAIN]=15;f[n.SCENE]=20;f[n.SYMBOLOGY]=5;this.streamDataLoader=
- new g(f);this._cameraListeners=new h;this._cameraListeners.add([c.watch("state.camera",this._cameraChangedHandler.bind(this),!0)]);d||(d=a);this._frameTask=d.addFrameTask({update:this._frameUpdate.bind(this)});this._view=c;this.stats={frameUpdateTime:new q,idleUpdateTime:new q};this.frameUpdateNavigation=null},destroy:function(){this._frameTask.remove();this._frameTask=null;this._cameraListeners.remove();this.streamDataLoader.destroy();this.streamDataLoader=null},setEnableBudget:function(a){this._budget.enabled=
- !!a},isUpdating:function(){return this._memoryController.updating},registerClient:function(a,b,d){this._clients.push({client:a,type:b});this._memoryController.setDirty();return new c(b,this.streamDataLoader,d)},deregisterClient:function(a){for(var b=0;b<this._clients.length;b++)if(this._clients[b].client===a){this._clients[b]=this._clients[this._clients.length-1];this._clients.pop();this._memoryController.setDirty();return}console.warn("deregistering an unregistered client.")},setMaxGpuMemory:function(a){this._memoryController.setMaxGpuMemory(a)},
- setMemoryDirty:function(){this._memoryController.setDirty()},getMemoryFactor:function(){return this._memoryController.getMemoryFactor()},getUsedMemory:function(){return this._memoryController.getUsedMemory()},getMemoryEvents:function(){return this._memoryController.events},registerIdleFrameWorker:function(a,b){var c=this._idleFrameWorkers.some(function(b){return b.client===a});p(!c,"Can only register idle frame workers once per client/layer");p(!b.idleFrame||b.needsUpdate,"needsUpdate has to be specified if idleFrame is specified");
- this._idleFrameWorkers.push({client:a,callbacks:b});this._isIdle()&&this._idleUpdatesStartFired&&b.idleBegin&&b.idleBegin.call(a)},deregisterIdleFrameWorker:function(a){for(var b=this._idleFrameWorkers,c=0;c<b.length;c++){var d=b[c];if(d.client===a){this._idleUpdatesStartFired&&d.callbacks.idleEnd&&d.callbacks.idleEnd.call(a);b[c]=b[b.length-1];b.pop();break}}},registerFrameWorker:function(a){-1===this._frameWorkers.indexOf(a)&&this._frameWorkers.push(a)},deregisterFrameWorker:function(a){-1===this._frameWorkers.indexOf(a)?
- u.warn("Can't deregister unknown frame handler"):(this._frameWorkers.splice(this._frameWorkers.indexOf(a),1),this._nextFrameWorker=0)},_cameraChangedHandler:function(){this._lastTargetChangeTime=this._budget.now();this._memoryController.setDirty();this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._callWorkersNoScheduling("idleEnd"))},_frameUpdate:function(a){var b=this._isIdle()?this.idleFrameWorkerBudget:this.animatingFrameTimeBudget;this._budget.reset(b-a.elapsedFrameTime);this._view.stateManager&&
- this._view.stateManager.step(a.deltaTime/1E3);this._view.inputManager&&this._view.inputManager._pinchNavigation&&this._view.inputManager._pinchNavigation.momentum.doFrameUpdate(a.deltaTime);this._memoryController.update();for(a=0;a<this._frameWorkers.length;++a)if(b=(this._nextFrameWorker+a)%this._frameWorkers.length,this._frameWorkers[b](this._budget),3>this._budget.remaining()){this._nextFrameWorker=(b+1)%this._frameWorkers.length;break}this.stats.frameUpdateTime.addSample(this._budget.elapsed());
- this._isIdle()&&(this._idleUpdatesStartFired||(this._callWorkersNoScheduling("idleBegin"),this._idleUpdatesStartFired=!0),this._budget.reset(this.idleFrameTimeBudget-this._budget.elapsed()),3<this._budget.remaining()&&(this._callWorkersStrictScheduling("idleFrame",this._budget),this.stats.idleUpdateTime.addSample(this._budget.elapsed())))},_isIdle:function(){return this._budget.now()-this._lastTargetChangeTime>this.navigationTimeout},_callWorkersNoScheduling:function(a){for(var b=this._idleFrameWorkers,
- c=0;c<b.length;c++){var d=b[c];d.callbacks[a]&&d.callbacks[a].call(d.client)}},_callWorkersStrictScheduling:function(a,b){var c=this._idleFrameWorkers,d=c.length,e,f,g;t.clear();f=0;for(g=this._idleFrameWorkerRobin;f<d;f++)e=c[g++%d],e.callbacks.needsUpdate&&e.callbacks.needsUpdate.call(e.client)&&(0===t.length&&(this._idleFrameWorkerRobin=g),t.push(e));e=b.now();for(c=e+b.remaining();0<t.length&&e<c;)b.reset((c-e)/t.length),e=t.pop(),e.callbacks[a].call(e.client,b),e=b.now()}});r.ClientType=n;var q=
- function(){this.addSample=function(a){this.min=Math.min(this.min,a);this.max=Math.max(this.max,a);this.total+=a;this.numSamples++};this.getAverage=function(){return this.total/this.numSamples};this.reset=function(){this.numSamples=this.total=0;this.min=Number.MAX_VALUE;this.max=-Number.MAX_VALUE};this.reset()};return r})},"esri/views/3d/support/MemoryController":function(){define(["require","exports","../../../core/Logger","../layers/support/MemoryManagedLayerView","./Evented"],function(r,h,f,a,e){var c=
- f.getLogger("esri.views.3d.support.MemoryController");return function(){function f(a){this._view=a;this._minQuality=.1;this._memoryHWM=this._maxQuality=1;this._memoryLWM=.8;this._divideRate=1.5;this.events=new e.Evented;this._maxMemory=500;this._quality=1;this._memoryCached=this._memoryCommitted=this._memoryUsed=this._stableQuality=0;this.updating=!1}f.prototype.setMaxGpuMemory=function(a){a&&0<a&&(this._maxMemory=a,this.setDirty())};f.prototype.getMemoryFactor=function(){return this._quality};f.prototype._updateQuality=
- function(a){a=Math.min(Math.max(a,this._minQuality),this._maxQuality);if(a===this._quality)return!1;this._quality=a;this.events.emit("quality-changed",this._quality);return!0};f.prototype.getUsedMemory=function(){return this._memoryUsed};f.prototype.setDirty=function(){this._stableQuality=0};f.prototype.update=function(){this._updateMemory();if(!(0>=this._memoryCommitted)){this._unloadSuspended();var a=this._layersUpdating();if(a){if(this._quality<=this._minQuality)return;if(this._memoryCommitted>
- 1.1*this._memoryHWM||this._memoryUsed>this._memoryHWM)0<this._stableQuality?this._updateQuality(this._stableQuality):this._updateQuality(this._quality/this._divideRate)}else{if(this._memoryCommitted>this._memoryHWM||this._memoryUsed>this._memoryHWM)this._stableQuality=0,a=this._updateQuality(this._quality/this._divideRate);this._memoryCommitted<this._memoryLWM&&this._quality<this._maxQuality&&this._stableQuality!==this._quality&&(this._stableQuality=this._quality,a=this._updateQuality(this._quality+
- .1*(this._memoryLWM-this._memoryCommitted+.1)))}this.updating!==a&&(this.updating=a,this.events.emit("updating-changed",this.updating))}};f.prototype._layersUpdating=function(){var a=!1;this._view.allLayerViews.forEach(function(b){a=a||b.updating});return a};f.prototype._unloadSuspended=function(){var c=this,b=function(){return 0===c._memoryCached?!1:c._memoryCommitted>1.1*c._memoryHWM||c._memoryUsed>c._memoryHWM||c._memoryUsed>=c._memoryLWM&&.9>c._quality};if(b())for(var e=this._view.allLayerViews.toArray().filter(function(a){return a.suspended}),
- f=function(){var b=null,c=0;e.forEach(function(d){if(a.isMemoryManagedLayerView(d)){var e=d.getUsedMemory();e>c&&(c=e,b=d)}});if(!b)return{value:void 0};b.removeCachedData();e.splice(e.indexOf(b),1);g._updateMemory()},g=this;b()&&0<e.length;){var h=f();if("object"===typeof h)return h.value}};f.prototype._updateMemory=function(){var d=0,b=0,e=0;this._view.basemapTerrain&&this._view.basemapTerrain.getUsedMemory&&(d+=this._view.basemapTerrain.getUsedMemory());var f=this._view._stage&&this._view._stage.view&&
- this._view._stage.view.getEdgeView();f&&(d+=f.getGpuMemoryUsage());this._view.allLayerViews&&this._view.allLayerViews.forEach(function(c){if(a.isMemoryManagedLayerView(c)){var f=c.getUsedMemory();d+=f;c.suspended&&(e+=f);b+=c.getUnloadedMemory()}});d>this._maxMemory&&d!==this._warnMemoryUsage&&(this._warnMemoryUsage=d,f=function(a){return a.toLocaleString(void 0,{maximumFractionDigits:1})+" Mb"},c.warn("GPU Memory Limit exceeded! Limit: "+f(this._maxMemory)+" Current: "+f(d)+" Projected: "+f(d+b)));
- this._memoryUsed=d/this._maxMemory;this._memoryCommitted=(d+b-e)/this._maxMemory;this._memoryCached=e/this._maxMemory};return f}()})},"esri/views/3d/layers/support/MemoryManagedLayerView":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.isMemoryManagedLayerView=function(f){return"function"===typeof f.getUsedMemory}})},"esri/views/3d/support/StreamDataSupplier":function(){define(["require","exports"],function(r,h){return function(){function f(a,
- e,c){this._clientType=a;this._loader=e;this._activeRequests=null;c&&c.trackRequests&&(this._activeRequests=new Map)}f.prototype.request=function(a,e){var c=this;e=this._loader.request(a,e,this._clientType);if(this._activeRequests){this._activeRequests.set(a,e);var f=function(){c._activeRequests.delete(a)};e.then(f,f)}return e};f.prototype.cancelRequest=function(a){this._loader.cancel(a)};f.prototype.cancelAll=function(){var a=this;this._activeRequests&&(this._activeRequests.forEach(function(e){a._loader.cancel(e)}),
- this._activeRequests.clear())};f.prototype.hasPendingDownloads=function(){return this._loader.hasPendingDownloads()};return f}()})},"esri/views/3d/support/StreamDataLoader":function(){define("require exports ../../../request ./AsyncQuotaRoundRobinQueue ./PromiseLightweight ../webgl-engine/lib/Performance ../webgl-engine/lib/Util".split(" "),function(r,h,f,a,e,c,g){function d(a,d){if(a.status===b.CANCELLED)return!1;a.status=b.DOWNLOADING;var e,g;switch(a.docType){case "binary":g="array-buffer";e=0;
- break;case "image":g="image";break;default:g="json"}a.startTime=c.now();a.downloadObj=f(a.url,{responseType:g,timeout:e,allowImageDataAccess:"image"===a.docType});a.downloadObj.then(function(b){a.duration=c.now()-a.startTime;a.size="binary"===a.docType?b.data.byteLength:0;a.result=b.data;d(a)},function(b){a.downloadObj.isCanceled()||d(a,b)});return!0}var b;(function(a){a[a.QUEUED=1]="QUEUED";a[a.DOWNLOADING=2]="DOWNLOADING";a[a.CANCELLED=4]="CANCELLED"})(b||(b={}));return function(){function c(b){this.tasks=
- new Map;this.loadQueue=new a(d,this._doneLoadingCallback,this,b)}c.prototype.destroy=function(){var a=this;this.tasks.forEach(function(b,c){c.isRejected()||c.reject(b.url,null);a._cancelTask(c)});this.loadQueue.clear();this.tasks=this.loadQueue=null};c.prototype.request=function(a,c,d){var f=this,g=new e.Promise(function(){f.cancel(g)});a={url:a,docType:c,clientType:d,result:null,status:b.QUEUED,clientPromise:g,downloadObj:null,_cancelledInQueue:!1,startTime:0,duration:0,size:0};this.tasks.set(g,
- a);this.loadQueue.push(a);return g};c.prototype.cancel=function(a){this._cancelTask(a)};c.prototype.hasPendingDownloads=function(){return 0<this.tasks.size};c.prototype._cancelTask=function(a){var c=this.tasks.get(a);c&&(c.status===b.DOWNLOADING&&(this.loadQueue.workerCancelled(c),c.status=b.CANCELLED,c.downloadObj.cancel(),c.downloadObj=null),c.status=b.CANCELLED,c.clientPromise=void 0,this.tasks.delete(a))};c.prototype._doneLoadingCallback=function(a,c){g.assert(a.status===b.DOWNLOADING);this.tasks.delete(a.clientPromise);
- c?a.clientPromise.isRejected()||a.clientPromise.reject(a.url,c):a.clientPromise.done(a.url,a.result)};return c}()})},"esri/views/3d/support/AsyncQuotaRoundRobinQueue":function(){define(["require","exports","../../../core/arrayUtils","../webgl-engine/lib/Util"],function(r,h,f,a){return function(){function e(a,e,d,b){this.workerFunc=a;this.robin=0;this.type2id={};this.tasks=[];this.typeNumWorkers=[];this.typeWorkerQuota=[];this.typeStatistics=[];this.numTypes=this.maxTotalNumWorkers=this.totalNumWorkers=
- 0;for(var c in b)this.tasks[this.robin]=[],this.typeNumWorkers[this.robin]=0,this.typeStatistics[this.robin]={requests:0,size:0,duration:0,speed:0},this.typeWorkerQuota[this.robin]=b[c],this.type2id[c]=this.robin++,this.maxTotalNumWorkers+=b[c];this.numTypes=this.tasks.length;this.robin=0;var f=this;this.taskCallback=function(a){a._cancelledInQueue||(e.apply(d,arguments),f.taskFinished(a))}}e.prototype.setWorkerQuota=function(c){a.assert(f.equals(Object.keys(this.typeWorkerAllication),Object.keys(c)));
- this.typeWorkerAllication=c;this.maxTotalNumWorkers=0;for(var e in c)this.typeWorkerQuota[this.type2id[e]]=c[e],this.maxTotalNumWorkers+=c[e]};e.prototype.setWorkerFunc=function(a){this.workerFunc=a};e.prototype.push=function(a){var c=this.type2id[a.clientType];this.totalNumWorkers<this.maxTotalNumWorkers?(this.typeNumWorkers[c]++,this.totalNumWorkers++,this.workerFunc(a,this.taskCallback)):this.tasks[c].push(a)};e.prototype._getStatsForType=function(a){a=this.type2id[a];return{quota:this.typeWorkerQuota[a],
- workers:this.typeNumWorkers[a],queueSize:this.tasks[a].length,requestStats:this.typeStatistics[a]}};e.prototype.removeTasks=function(a,e){for(var c=[],b=0,f=this.tasks[this.type2id[e]];b<f.length;b++){var g=f[b];-1===a.indexOf(g)&&c.push(g)}this.tasks[this.type2id[e]]=c};e.prototype.workerCancelled=function(a){this.taskFinished(a);a._cancelledInQueue=!0};e.prototype.clear=function(){for(var a=0;a<this.tasks.length;a++)this.tasks[a]=[]};e.prototype.taskFinished=function(c){var e=this.type2id[c.clientType];
- this.typeNumWorkers[e]--;this.totalNumWorkers--;this.typeStatistics[e].requests++;this.typeStatistics[e].size+=c.size||0;this.typeStatistics[e].duration+=c.duration||0;this.typeStatistics[e].speed=0<this.typeStatistics[e].duration?this.typeStatistics[e].size/this.typeStatistics[e].duration:0;a.assert(0<=this.typeNumWorkers[e]);this.next()};e.prototype.next=function(){var a=this.robin,e=!1;do this.typeNumWorkers[a]<this.typeWorkerQuota[a]&&this.processQueue(a)&&(e=!0),a=(a+1)%this.numTypes;while(!e&&
- a!==this.robin);if(!e){do this.processQueue(a)&&(e=!0),a=(a+1)%this.numTypes;while(!e&&a!==this.robin)}this.robin=a};e.prototype.processQueue=function(a){for(;0<this.tasks[a].length;)if(this.workerFunc(this.tasks[a].shift(),this.taskCallback))return this.typeNumWorkers[a]++,this.totalNumWorkers++,!0;return!1};return e}()})},"esri/views/3d/support/SharedSymbolResources":function(){define("require exports ../../../core/Handles ../../../core/watchUtils ./ResourceController ./TextureCollection ../webgl-engine/lib/screenSizePerspectiveUtils".split(" "),
- function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function b(a){this.streamDataSupplier=this.textures=null;this.graphicsOwners=[];this.screenSizePerspectiveHandles=null;var b=e.ClientType.SYMBOLOGY;this.viewState=a.viewState;this.stage=a.stage;this.pointsOfInterest=a.pointsOfInterest;this.resourceController=a.resourceController;this.streamDataSupplier=this.resourceController.registerClient(this,b);this.textures=new c(this.streamDataSupplier,a.stage,{preMultiplyAlpha:!0,
- wrapClamp:!0});this.screenSizePerspectiveSettings=g.getSettings(a.viewingMode);this.screenSizePerspectiveSettingsLabels=g.getLabelSettings(a.viewingMode)}b.prototype.destroy=function(){this.resourceController.deregisterClient(this);this.streamDataSupplier=this.textures=null};b.prototype.addGraphicsOwner=function(b){var c=this;this.graphicsOwners.push(b);var d=null;b.layerView&&(d=a.init(b.layerView,"layer.screenSizePerspectiveEnabled",function(){return c.updateScreenSizePerspectiveEnabled()}));return{remove:function(){d&&
- (d.remove(),d=null,c.updateScreenSizePerspectiveEnabled())}}};b.prototype.updateScreenSizePerspectiveEnabled=function(){var a=this,b=this.graphicsOwners.some(function(a){return a.layerView&&!0===a.layerView.get("layer.screenSizePerspectiveEnabled")});b&&!this.screenSizePerspectiveHandles?(this.screenSizePerspectiveHandles=new f,b=function(){return a.updateScreenSizePerspectiveSettings()},this.screenSizePerspectiveHandles.add([this.pointsOfInterest.centerOnSurfaceInfrequent.watch("distance",b,!0),
- this.pointsOfInterest.events.on("camera-parameters-changed",b)]),this.updateScreenSizePerspectiveSettings()):!b&&this.screenSizePerspectiveHandles&&(this.screenSizePerspectiveHandles.destroy(),this.screenSizePerspectiveHandles=null)};b.prototype.updateScreenSizePerspectiveSettings=function(){d.distance=this.pointsOfInterest.centerOnSurfaceInfrequent.distance;d.fovY=this.viewState.camera.fovY;this.screenSizePerspectiveSettings.update(d);this.screenSizePerspectiveSettingsLabels.update(d);this.stage.setNeedsRender()};
- return b}();h.SharedSymbolResources=r;var d={distance:0,fovY:0};h.default=r})},"esri/views/3d/support/TextureCollection":function(){define("../../../core/declare ../../../core/urlUtils dojo/Deferred dojo/_base/lang ../webgl-engine/Stage ../webgl-engine/lib/Texture ../webgl-engine/lib/Util".split(" "),function(r,h,f,a,e,c,g){var d=g.assert;return r(null,{constructor:function(a,c,d){this._streamDataSupplier=a;this._stage=c;this._textureRecords={};this._loadedHandler=this._loadedHandler.bind(this);this._errorHandler=
- this._errorHandler.bind(this);this._textureOptions=d||{}},acquire:function(a,c,d){var b;if(b=this._textureRecords[a])return b.referenceCount++,b.texture||b.clientDfd;if(c)return d=c(a),this._stage.add(e.ModelContentType.TEXTURE,d),b={texture:d,referenceCount:1},this._textureRecords[a]=b,d;b=new f;c=this._streamDataSupplier.request(a,"image");this._textureRecords[a]={clientDfd:b,loaderDfd:c,texture:null,size:Math.ceil(d||0),referenceCount:1};c.then(this._loadedHandler,this._errorHandler);return b.promise},
- release:function(a){var b=this._textureRecords[a];b?(1>b.referenceCount&&console.warn("TextureCollection: reference count is \x3c 1 for "+a),b.referenceCount--,1>b.referenceCount&&(b.texture?(this._stage.remove(e.ModelContentType.TEXTURE,b.texture.id),b.texture=null):this._streamDataSupplier.cancelRequest(b.loaderDfd),delete this._textureRecords[a])):console.warn("TextureCollection: texture doesn't exist: "+a)},isInUse:function(a){a=this._textureRecords[a];d(!a||0<a.referenceCount,"texture record with zero reference count");
- return!!a},_loadedHandler:function(b,f){var g=this._textureRecords[b];d(g&&!g.texture);if(h.isSVG(b)&&(g.size||0===f.width&&0===f.height)){b=f.width?f.height/f.width:1;var k=g.size||64;1<b?(f.width=Math.round(k/b),f.height=k):(f.width=k,f.height=Math.round(k*b))}b=a.mixin({width:f.width,height:f.height},this._textureOptions);f=new c(f,"symbol",b);this._stage.add(e.ModelContentType.TEXTURE,f);g.texture=f;g.clientDfd.resolve(f)},_errorHandler:function(a){a=this._textureRecords[a];d(a&&!a.texture);a.clientDfd.reject()}})})},
- "esri/views/3d/support/pointsOfInterest/PointsOfInterest":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/Handles ../../../../core/accessorSupport/decorators ../../../../geometry/Point ../../lib/glMatrix ../Evented ../PropertiesPool ./CenterOnSurface ./ContentGeometryUpdates ./disposeMembers ./StableSurfaceCenter ./SurfaceGeometryUpdates ../../webgl-engine/lib/Camera ../../webgl-engine/lib/Selector".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x){Object.defineProperty(h,"__esModule",{value:!0});var m=Array;r=function(e){function h(a){a=e.call(this,a)||this;a.handles=new c;a.lastSeenCameraParameters=new v;a.surfaceAltitudeAtCenter=0;a.surfaceAltitudeAtCenterDirty=!0;a.surfaceAltitudeAtCenterWithContent=0;a.surfaceAltitudeAtCenterWithContentDirty=!0;a.propertiesPool=new l.default({pointOfView:d,renderPointOfView:m},a);a.updateSurfaceAltitudeFrequentInterval=C;a.updateSurfaceAltitudeInfrequentInterval=
- A;a.events=new k.Evented;a.renderPointOfView=[0,0,0];return a}f(h,e);h.prototype.initialize=function(){var a=this,b=this.view.state,c=this.view.basemapTerrain,d=this.view.renderCoordsHelper;this.surfaceSelector=new x(b.mode);this.surfaceSelector.enableBackfacesTerrain=b.isGlobal?!1:!0;this.surfaceSelector.enableInvisibleTerrain=!1;this.contentSelector=new x(b.mode);this.contentSelector.enableTerrain=!1;var e=this.estimateSurfaceAltitudeAtCenter.bind(this);this._set("centerOnSurfaceInfrequent",new p.default({state:b,
- surface:c,renderCoordsHelper:d,estimateSurfaceAltitudeAtCenter:e,altitudeEstimationInterval:this.updateSurfaceAltitudeInfrequentInterval}));this._set("centerOnSurfaceFrequent",new p.default({state:b,surface:c,renderCoordsHelper:d,estimateSurfaceAltitudeAtCenter:e,altitudeEstimationInterval:this.updateSurfaceAltitudeFrequentInterval}));this._set("centerOnContent",new p.default({state:b,surface:c,renderCoordsHelper:d,estimateSurfaceAltitudeAtCenter:this.estimateSurfaceAltitudeAtCenterWithContent.bind(this),
- altitudeEstimationInterval:this.updateSurfaceAltitudeFrequentInterval}));this._set("surfaceGeometryUpdates",new q.default({state:b,surface:c,renderCoordsHelper:d,centerOnSurfaceInstances:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]}));this._set("contentGeometryUpdates",new n.default({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:d}));this._set("surfaceOrigin",new u.default({view:this.view}));this.handles.add(b.watch("camera",function(b){return a.cameraChanged(b)},
- !0));this.handles.add(this.surfaceGeometryUpdates.events.on("request-update",function(){return a.updateCenterPointsOfInterest()}));this.handles.add(c.watch("extent",function(){return a.updateCenterPointsOfInterest()}));this.handles.add(this.contentGeometryUpdates.events.on("request-update",function(){return a.updateCenterOnContent()}));this.cameraChanged(this.view.state.camera);this.forceUpdate()};h.prototype.destroy=function(){t.default(this,"handles","centerOnSurfaceInfrequent","centerOnSurfaceFrequent",
- "centerOnContent","surfaceOrigin","propertiesPool")};Object.defineProperty(h.prototype,"pointOfView",{get:function(){var a=this.propertiesPool.get("pointOfView");this.view.renderCoordsHelper.fromRenderCoords(this.renderPointOfView,a,this.view.state.spatialReference);return a},enumerable:!0,configurable:!0});h.prototype.forceUpdate=function(){this.surfaceGeometryUpdates.forceUpdate();this.centerOnSurfaceInfrequent.forceUpdate();this.centerOnSurfaceFrequent.forceUpdate();this.centerOnContent.forceUpdate()};
- h.prototype.hasPendingUpdates=function(){return this.surfaceGeometryUpdates.hasPendingUpdates()||this.centerOnContent.hasPendingUpdates()||this.centerOnSurfaceInfrequent.hasPendingUpdates()||this.centerOnSurfaceFrequent.hasPendingUpdates()};h.prototype.estimateSurfaceAltitudeAtCenterWithContent=function(){if(!this.surfaceAltitudeAtCenterWithContentDirty)return this.surfaceAltitudeAtCenterWithContent;this.surfaceAltitudeAtCenterWithContentDirty=!1;var a=this.view.state.camera;this.view._stage.pickRay(a.eye,
- a.center,null,null,null,!1,this.contentSelector);this.contentSelector.minResult.getIntersectionPoint(z)?this.surfaceAltitudeAtCenterWithContent=this.view.renderCoordsHelper.getAltitude(z):this.surfaceAltitudeAtCenterWithContent=this.estimateSurfaceAltitudeAtCenter();return this.surfaceAltitudeAtCenterWithContent};h.prototype.estimateSurfaceAltitudeAtCenter=function(){if(!this.view.basemapTerrain)return 0;if(!this.surfaceAltitudeAtCenterDirty)return this.surfaceAltitudeAtCenter;this.surfaceAltitudeAtCenterDirty=
- !1;var a=this.view.state.camera;this.surfaceSelector.init(null,a.eye,a.center,null,a,null,!1);this.view.basemapTerrain.intersect(this.surfaceSelector,a.eye,a.center);this.surfaceSelector.minResult.getIntersectionPoint(z)&&(this.surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(z));return this.surfaceAltitudeAtCenter};h.prototype.cameraChanged=function(a){this.updateCenterPointsOfInterest(a);this.cameraParametersChanged(this.lastSeenCameraParameters,a)&&(this.lastSeenCameraParameters.copyFrom(a),
- B.camera=a,this.events.emit("camera-parameters-changed",B));a=a.eye;this.renderPointOfView[0]===a[0]&&this.renderPointOfView[1]===a[1]&&this.renderPointOfView[2]===a[2]||this._set("renderPointOfView",b.vec3d.set(a,this.propertiesPool.get("renderPointOfView")))};h.prototype.updateCenterPointsOfInterest=function(a){void 0===a&&(a=this.view.state.camera);this.surfaceAltitudeAtCenterWithContentDirty=this.surfaceAltitudeAtCenterDirty=!0;this.centerOnSurfaceFrequent.update(a);this.centerOnSurfaceInfrequent.update(a);
- this.centerOnContent.update(a)};h.prototype.updateCenterOnContent=function(){this.surfaceAltitudeAtCenterWithContentDirty=!0;this.centerOnContent.update(this.view.state.camera)};h.prototype.cameraParametersChanged=function(a,b){return a.fov!==b.fov||a.fullViewport[0]!==b.fullViewport[0]||a.fullViewport[1]!==b.fullViewport[1]||a.fullViewport[2]!==b.fullViewport[2]||a.fullViewport[3]!==b.fullViewport[3]||a.padding[0]!==b.padding[0]||a.padding[1]!==b.padding[1]||a.padding[2]!==b.padding[2]||a.padding[3]!==
- b.padding[3]?!0:!1};a([g.property({constructOnly:!0})],h.prototype,"updateSurfaceAltitudeFrequentInterval",void 0);a([g.property({constructOnly:!0})],h.prototype,"updateSurfaceAltitudeInfrequentInterval",void 0);a([g.property({readOnly:!0})],h.prototype,"centerOnContent",void 0);a([g.property({readOnly:!0})],h.prototype,"centerOnSurfaceFrequent",void 0);a([g.property({readOnly:!0})],h.prototype,"centerOnSurfaceInfrequent",void 0);a([g.property({readOnly:!0})],h.prototype,"surfaceOrigin",void 0);a([g.property({readOnly:!0})],
- h.prototype,"contentGeometryUpdates",void 0);a([g.property({readOnly:!0})],h.prototype,"events",void 0);a([g.property({readOnly:!0,dependsOn:["renderPointOfView"]})],h.prototype,"pointOfView",null);a([g.property({readOnly:!0})],h.prototype,"renderPointOfView",void 0);a([g.property({readOnly:!0})],h.prototype,"surfaceGeometryUpdates",void 0);a([g.property({constructOnly:!0})],h.prototype,"view",void 0);return h=a([g.subclass("esri.views.3d.support.PointsOfInterest")],h)}(g.declared(e));h.PointsOfInterest=
- r;var B={camera:null},z=b.vec3d.create(),C=200,A=3E3;h.default=r})},"esri/views/3d/support/pointsOfInterest/CenterOnSurface":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/throttle ../../../../core/accessorSupport/decorators ../../../../geometry/Point ../../lib/glMatrix ../debugFlags ../earthUtils ../mathUtils ../PropertiesPool ./PointOfInterest".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p,n){Object.defineProperty(h,
- "__esModule",{value:!0});var t=Array;r=function(h){function n(a){a=h.call(this,a)||this;a.propertiesPool=new p.default({location:g,renderLocation:t},a);a.currentSurfaceAltitude=0;a.latestSurfaceAltitude=0;a.distance=0;a.renderLocation=[0,0,0];return a}f(n,h);m=n;n.prototype.initialize=function(){this.measureSurfaceAltitudeThrottle=e.throttle(this.measureSurfaceAltitude,this.altitudeEstimationInterval,this);this.handles.add(this.measureSurfaceAltitudeThrottle);this.measureSurfaceAltitude()};Object.defineProperty(n.prototype,
- "location",{get:function(){var a=this.propertiesPool.get("location");this.renderCoordsHelper.fromRenderCoords(this.renderLocation,a,this.state.spatialReference);return a},enumerable:!0,configurable:!0});n.prototype.update=function(a){this.measureSurfaceAltitudeThrottle();this.updateCenterOnSurface()};n.prototype.forceUpdate=function(){this.measureSurfaceAltitudeThrottle.forceUpdate();this.updateCenterOnSurface()};n.prototype.hasPendingUpdates=function(){return this.measureSurfaceAltitudeThrottle.hasPendingUpdates()};
- Object.defineProperty(n.prototype,"estimatedSurfaceAltitude",{get:function(){return this.latestSurfaceAltitude},enumerable:!0,configurable:!0});n.prototype.measureSurfaceAltitude=function(){this.latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter();this.updateCenterOnSurface()};n.prototype.updateCenterOnSurface=function(){var a=u,b=this.calculateSurfaceIntersection(this.currentSurfaceAltitude,a),c=this.currentSurfaceAltitude!==this.latestSurfaceAltitude;!b&&c&&(b=this.calculateSurfaceIntersection(this.latestSurfaceAltitude,
- a))&&(this.currentSurfaceAltitude=this.latestSurfaceAltitude);c=q;b&&this.latestSurfaceAltitudeChangesDistanceSignificantly(a,c)&&(d.vec3d.set(c,a),this.currentSurfaceAltitude=this.latestSurfaceAltitude);b?(b=d.vec3d.dist(this.state.camera.eye,a),b!==this._get("distance")&&this._set("distance",b)):(b=this.state.camera,d.vec3d.add(d.vec3d.scale(b.viewForward,this._get("distance"),a),b.eye));b=this._get("renderLocation");b[0]===a[0]&&b[1]===a[1]&&b[2]===a[2]||this._set("renderLocation",d.vec3d.set(a,
- this.propertiesPool.get("renderLocation")))};n.prototype.calculateSurfaceIntersection=function(a,b){var c=this.state.camera;if(!this.renderCoordsHelper.intersectManifold(c.eye,c.viewForward,a,b))return!1;if(this.state.isGlobal){a=k.earthRadius+a;var e=d.vec3d.length2(c.eye),f=e<a*a,g=d.vec3d.dist(c.eye,b);f&&g>k.earthRadius/4&&d.vec3d.add(d.vec3d.scale(c.viewForward,a-Math.sqrt(e),b),c.eye)}else if(c=this.surface.ready&&this.surface.extent)b[0]=l.clamp(b[0],c[0],c[2]),b[1]=l.clamp(b[1],c[1],c[3]);
- return!0};n.prototype.latestSurfaceAltitudeChangesDistanceSignificantly=function(a,c){if(this.latestSurfaceAltitude===this.currentSurfaceAltitude||null==a)return!1;if(this.calculateSurfaceIntersection(this.latestSurfaceAltitude,c)){var e=this.state.camera.eye;a=d.vec3d.dist(e,a);c=d.vec3d.dist(e,c);if(b.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS||Math.abs(c-a)/a>m.RELATIVE_ALTITUDE_CHANGE_THRESHOLD)return!0}return!1};n.RELATIVE_ALTITUDE_CHANGE_THRESHOLD=.05;a([c.property({constructOnly:!0})],n.prototype,
- "altitudeEstimationInterval",void 0);a([c.property({readOnly:!0})],n.prototype,"distance",void 0);a([c.property({constructOnly:!0})],n.prototype,"estimateSurfaceAltitudeAtCenter",void 0);a([c.property({readOnly:!0,dependsOn:["renderLocation"]})],n.prototype,"location",null);a([c.property({readOnly:!0})],n.prototype,"renderLocation",void 0);return n=m=a([c.subclass("esri.views.3d.support.CenterOnSurface")],n);var m}(c.declared(n.PointOfInterest));h.CenterOnSurface=r;var u=d.vec3d.create(),q=d.vec3d.create();
- h.default=r})},"esri/views/3d/support/pointsOfInterest/PointOfInterest":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/Handles ../../../../core/accessorSupport/decorators ./disposeMembers".split(" "),function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function e(a){a=b.call(this)||this;a.handles=new c;return a}f(e,b);e.prototype.destroy=function(){d.default(this,
- "handles")};a([g.property({constructOnly:!0})],e.prototype,"renderCoordsHelper",void 0);a([g.property({constructOnly:!0})],e.prototype,"surface",void 0);a([g.property({constructOnly:!0})],e.prototype,"state",void 0);return e=a([g.subclass("esri.views.3d.support.PointOfInterest")],e)}(g.declared(e));h.PointOfInterest=r;h.default=r})},"esri/views/3d/support/pointsOfInterest/disposeMembers":function(){define(["require","exports","../../../../core/Accessor"],function(r,h,f){function a(a){for(var c=[],
- e=1;e<arguments.length;e++)c[e-1]=arguments[e];if(a instanceof f&&a.destroyed)try{throw Error("instance is already destroyed");}catch(k){console.warn(k.stack)}else for(e=0;e<c.length;e++){var d=c[e];if(!(d in a))throw Error("Property '"+d+"' does not exist and cannot be disposed");var b=a[d];b&&("function"===typeof b.destroy?b.destroy():"function"===typeof b.dispose?b.dispose():"function"===typeof b.remove&&b.remove());a instanceof f&&d in a.__accessor__.metadatas?a._set(d,null):a[d]=null}}Object.defineProperty(h,
- "__esModule",{value:!0});h.disposeMembers=a;h.default=a})},"esri/views/3d/support/pointsOfInterest/ContentGeometryUpdates":function(){define(["require","exports","../../../../core/Handles","../Evented"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function c(c){this.handles=new f;this.events=new a.Evented;this.contentLayerViews=c.contentLayerViews;this.handles.add(this.contentLayerViews.on("change",this.layerViewsChanged.bind(this)));this.layerViewsChanged({added:this.contentLayerViews.toArray(),
- removed:[],moved:[],target:this.contentLayerViews})}c.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null)};c.prototype.layerViewsChanged=function(a){var c=this;a.added.forEach(function(a){"esri.views.3d.layers.SceneLayerView3D"===a.declaredClass&&c.handles.add(a.on("visible-geometry-changed",c.contentChanged.bind(c)),a.uid)});a.removed.forEach(function(a){return c.handles.remove(a.uid)})};c.prototype.contentChanged=function(){this.events.emit("request-update",e)};
- return c}();h.ContentGeometryUpdates=r;var e={};h.default=r})},"esri/views/3d/support/pointsOfInterest/StableSurfaceCenter":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/Handles ../../../../core/watchUtils ../../../../core/accessorSupport/decorators ../../../../geometry/Point ../aaBoundingRect".split(" "),function(r,h,f,a,e,c,g,d,b,k){Object.defineProperty(h,"__esModule",{value:!0});
- r=function(e){function h(a){a=e.call(this,a)||this;a.location=null;a._updatePromise=null;a._handles=new c;return a}f(h,e);Object.defineProperty(h.prototype,"renderLocation",{get:function(){if(!this.location)return null;var a=[0,0,0];this.view.renderCoordsHelper.toRenderCoords(this.location,a);return a},enumerable:!0,configurable:!0});h.prototype.initialize=function(){var a=this;this.view.state.isLocal&&(this._handles.add([this.watch("surfaceView.extent",function(){return a._update()}),g.on(this,"surface.layers",
- "change",function(){return a._update()})]),this._update())};h.prototype.destroy=function(){this._handles.destroy()};h.prototype._update=function(){var a=this;this._updatePromise&&(this._updatePromise.cancel("cancel"),this._updatePromise=null);if(this.surfaceView&&this.surfaceView.extent){var c=k.center(this.surfaceView.extent),c=new b({x:c[0],y:c[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&0<this.surface.layers.length?(this._set("location",null),this._updatePromise=this.surface.queryElevation(c,
- {noDataValue:0}).then(function(b){a._updatePromise=null;a._set("location",b.geometry)}).catch(function(a){"cancel"===a||a&&"elevation-query:invalid-layer"===a.name||console.error("StableSurfaceCenter failed to update: ",a)})):this._set("location",c)}else this._set("location",null)};a([d.property({constructOnly:!0})],h.prototype,"view",void 0);a([d.property({readOnly:!0,aliasOf:"view.map.ground"})],h.prototype,"surface",void 0);a([d.property({readOnly:!0,aliasOf:"view.basemapTerrain"})],h.prototype,
- "surfaceView",void 0);a([d.property({readOnly:!0})],h.prototype,"location",void 0);a([d.property({readOnly:!0,dependsOn:["location"]})],h.prototype,"renderLocation",null);return h=a([d.subclass("esri.views.3d.terrain.StableSurfaceCenter")],h)}(d.declared(e));h.StableSurfaceCenter=r;h.default=r})},"esri/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates":function(){define("require exports ../../../../core/Handles ../../../../core/scheduling ../../lib/glMatrix ../aaBoundingRect ../debugFlags ../Evented".split(" "),
- function(r,h,f,a,e,c,g,d){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function e(a){var b=this;this.handles=new f;this.tileGeometryUpdateExtent=c.create(c.NEGATIVE_INFINITY);this.tileGeometryUpdateSpatialReference=null;this.hasPendingTileGeometryChanges=!0;this.events=new d.Evented;this.centerOnSurfaceInstances=a.centerOnSurfaceInstances;this.renderCoordsHelper=a.renderCoordsHelper;this.state=a.state;this.handles.add(a.surface.on("elevation-change",function(a){return b.tileGeometryChangeHandler(a)}))}
- e.prototype.destroy=function(){this.handles&&(this.handles.destroy(),this.handles=null)};e.prototype.forceUpdate=function(){this.handles.has("tile-geometry-update")&&this.updateCenterOnGeometryUpdate();this.hasPendingTileGeometryChanges&&(this.events.emit("request-update",b),this.hasPendingTileGeometryChanges=!1)};e.prototype.hasPendingUpdates=function(){return this.handles.has("tile-geometry-update")};e.prototype.tileGeometryChangeHandler=function(b){var d=this;this.tileGeometryUpdateSpatialReference=
- b.spatialReference;c.expand(this.tileGeometryUpdateExtent,b.tile.extent);this.handles.has("tile-geometry-update")||this.handles.add(a.schedule(function(){return d.updateCenterOnGeometryUpdate()}),"tile-geometry-update")};e.prototype.updateCenterOnGeometryUpdate=function(){this.handles.remove("tile-geometry-update");this.centerIntersectsExtent(this.tileGeometryUpdateExtent,this.tileGeometryUpdateSpatialReference)&&(g.DISABLE_POI_UPDATE_ON_SURFACE_GEOMETRY_CHANGES?this.hasPendingTileGeometryChanges=
- !0:this.events.emit("request-update",b));c.set(this.tileGeometryUpdateExtent,c.NEGATIVE_INFINITY)};e.prototype.furthestCenterOnSurface=function(){for(var a=this.centerOnSurfaceInstances[0],b=1;b<this.centerOnSurfaceInstances.length;b++){var c=this.centerOnSurfaceInstances[b];c.distance>a.distance&&(a=c)}return a};e.prototype.centerIntersectsExtent=function(a,b){var d=this.state.camera.eye,e=p,f=this.furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(d,k,b);this.renderCoordsHelper.fromRenderCoords(f.renderLocation,
- l,b);k[0]<l[0]?(e[0]=k[0],e[2]=l[0]):(e[0]=l[0],e[2]=k[0]);k[1]<l[1]?(e[1]=k[1],e[3]=l[1]):(e[1]=l[1],e[3]=k[1]);return c.intersects(e,a)};return e}();h.SurfaceGeometryUpdates=r;var b={},k=e.vec3d.create(),l=e.vec3d.create(),p=c.create(c.NEGATIVE_INFINITY);h.default=r})},"esri/views/3d/terrain/TerrainSurface":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/arrayUtils ../../../core/CollectionFlattener ../../../core/Handles ../../../core/Logger ../../../core/ObjectPool ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../geometry/Point ../lib/glMatrix ../support/aaBoundingRect ../support/Evented ../support/mathUtils ../support/PreallocArray ../support/projectionUtils ../support/PromiseLightweight ../support/ResourceController ./OverlayManager ./PlanarTile ./SphericalTile ./SurfaceExtentHelper ./SurfaceTilingSchemeLogic ./TerrainConst ./TerrainRenderer ./terrainUtils ./TileGeometryFactory ./TilemapOnlyTile ./tileUtils ./tileUtils ../../vectorTiles/VectorTileDisplayObject ../../webgl/Texture".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G,M,H,J,O,N,S){function R(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]}function Y(a){return a&&("cancel"===a||"cancel"===a.dojoType)}function X(a,b){var c=!1;b=b||a;var d=0;for(a=a.children;d<a.length;d++){var e=a[d];if(e){for(var f in e.layerInfo)for(var g in e.layerInfo[f]){var k=e.layerInfo[f][g].upsampleFromTile;if(k&&k.tile===b)return!0}c=c||X(e,b)}}return c}var Q=t.vec3d,K=t.vec4d,L=t.mat4d,V=G.weakAssert,U=b.getLogger("esri.views.3d.terrain.TerrainSurface");
- r=function(b){function e(a,c){a=b.call(this)||this;a.defaultTileBackground=I.DEFAULT_TILE_BACKGROUND;a.hideSkirtsDistanceFromExtentMargin=ca;a.hideSkirtsMinimumCameraTilt=ga;a._clippingExtent=null;a._dataExtent=null;a._elevationBounds=[0,0];a._rootExtent=[0,0,0,0];a._iteratorPool=new k(O.IteratorPreorder);a._postorderIterator=new O.IteratorPostorder;a.visible=!1;a.suspended=!1;a._pendingUpdates=!1;a._lvPendingUpdates=!1;a._updateNextFrame=0;a._vectorTileLayerRequests=0;a._memoryUsage={};a._curOverlayOpacity=
- 1;a._curEyePos=Q.create();a._curSplitLimits=[0,0,0,0,0,0];a._curFrustumPlanes=Array(6);a._viewProjectionMatrix=L.identity();a.tilemapStats={tilemapRequestsSent:0,tilemapRequestsPending:0,tilemapRequestErrors:0,fullTilemaps:0,emptyTilemaps:0,tilesRequested:0,tileRequestsSent:0,tileRequestErrors:0,tilesNotPresent:0};a._layerViews=[[],[]];a._layerIndexByLayerViewId=[{},{}];a._basemapLayerViewHandles={};a._handles=new d;a._frameLambda=null;a._frameUpdateLowerPrio=new x(500);a._topLevelTilemapOnlyTiles=
- Array(I.TILEMAP_SIZE_EXP+1);a.loaded=!1;a.maxTextureScale=1.2;a.rootTiles=null;for(c=0;c<a._topLevelTilemapOnlyTiles.length;c++)a._topLevelTilemapOnlyTiles[c]=new H([c-I.TILEMAP_SIZE_EXP,0,0]);for(c=0;6>c;c++)a._curFrustumPlanes[c]=K.create();return a}f(e,b);e.prototype.normalizeCtorArgs=function(a,b){this._view=a;this._stage=a._stage;this._set("manifold",b);return{}};e.prototype.initialize=function(){var a=this;this.tilePool="planar"===this.manifold?A.Pool:D.Pool;this._renderer=new P(this.manifold,
- null,this._view.pointsOfInterest);this._renderer.loaded=this._setLoaded.bind(this);this._renderer.updateTileBackground(this.tileBackground);this._renderer.install(this._view._stage);this._set("overlayManager",new C({terrainSurface:this,view:this._view}));this._handles.add(this.watch("overlayManager.hasHighlights",this._handleHasHighlights.bind(this)),"overlayManager");var b={layers:this._view.map.allLayers,layerViews:this._view.allLayerViews,spatialReference:this._view.spatialReference};this.extentHelper=
- "spherical"===this.manifold?new E.SurfaceExtentHelperGlobal(b):new E.SurfaceExtentHelperLocal(b);this._handles.add(l.init(this.extentHelper,"stencilEnabledExtents",function(b){a._renderer.setStencilEnabledLayerExtents(b)}),"extentHelper");b=this._view.defaultsFromMap?new g({root:this._view.map,rootCollectionNames:this._view.defaultsFromMap.mapCollectionPaths,getChildrenFunction:function(a){return a.layers}}):this._view.map.allLayers;b=new F({layers:b,extentHelper:this.extentHelper,manifold:this.manifold,
- viewSpatialReference:this._view.spatialReference});this._set("tilingSchemeLogic",b);this._handles.add([this.tilingSchemeLogic.watch("tilingScheme",this._updateTilingSchemeAndExtent.bind(this),!0),this.tilingSchemeLogic.watch("extent",this._updateTilingSchemeAndExtent.bind(this),!0)],"tilingSchemeLogic");this._updateTilingSchemeAndExtent();this._streamDataSupplier=this._view.resourceController.registerClient(this,z.ClientType.TERRAIN);b={needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate};
- this._frameLambda=this._frameUpdate.bind(this);this._view.resourceController.registerFrameWorker(this._frameLambda);this._view.resourceController.registerIdleFrameWorker(this,b);this._viewChangeUpdate=this._viewChangeUpdate.bind(this);this._view.resourceController.getMemoryEvents().on("quality-changed",function(){return a._viewChangeUpdate()});this._handles.add([this._view.on("resize",this._viewChangeUpdate),this._view.watch("state.camera",this._viewChangeUpdate,!0),this._view.watch("qualitySettings.tiledSurface.lodBias",
- this._viewChangeUpdate),this._view.watch("clippingArea",this._clippingChanged.bind(this))],"view");this._handles.add(this._view.allLayerViews.on("change",this._handleLayerViewChanges.bind(this)),"allLayerViews");this._handleLayerViewChanges({added:this._view.allLayerViews.toArray(),removed:[],moved:[],target:this._view.allLayerViews});this._updateClippingExtent();this.notifyChange("extent")};e.prototype.destroy=function(){this._handles.destroy();this._removeAllTiles();this.tilingSchemeLogic.destroy();
- this._set("tilingSchemeLogic",null);this.extentHelper.destroy();this.extentHelper=null;for(var a in this._basemapLayerViewHandles)this._unregisterTiledLayerView(a);this._view.resourceController.deregisterFrameWorker(this._frameLambda);this._view.resourceController.deregisterIdleFrameWorker(this);this._view.resourceController.deregisterClient(this);this.overlayManager&&(this.overlayManager.destroy(),this._set("overlayManager",null));this._renderer.destroy(this._stage);this._streamDataSupplier=this._stage=
- this._view=this._renderer=null};Object.defineProperty(e.prototype,"cullBackFaces",{set:function(a){this._renderer.setCullBackFaces(a);this._set("cullBackFaces",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"extent",{get:function(){return this._clippingExtent||this._rootExtent},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"frontMostTransparent",{set:function(a){this._renderer.setFrontMostTransparent(a);this._set("frontMostTransparent",a)},enumerable:!0,
- configurable:!0});Object.defineProperty(e.prototype,"opacity",{set:function(a){this._renderer.setOpacity(a);this._set("opacity",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"ready",{get:function(){return!!this.rootTiles},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"renderOrder",{set:function(a){this._renderer.setRenderOrder(a);this._set("renderOrder",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"skirts",{set:function(a){this._renderer.setDrawSkirts(a);
- this._set("skirts",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"tileBackground",{set:function(a){a!==this.tileBackground&&this._renderer.updateTileBackground(a);this._set("tileBackground",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"velvetOverground",{set:function(a){a!==this.velvetOverground&&this._renderer.setVelvetOverground(a);this._set("velvetOverground",a)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"wireframe",{set:function(a){this._renderer.setWireframe(a);
- this._set("wireframe",a);this._view._stage.setRenderParams({earlyOcclusionPixelDraw:a})},enumerable:!0,configurable:!0});e.prototype.setVisibility=function(a){a!==this.visible&&(this.visible=a,this._renderer.setVisibility(a),this.setUpdatesDisabled(!a),a&&this._viewChangeUpdate())};e.prototype.isVisible=function(){return this.visible&&this.ready};e.prototype.isSeeThrough=function(){return this._renderer.isTransparent()};e.prototype.setUpdatesDisabled=function(a){(this.suspended=a)||this._viewChangeUpdate()};
- e.prototype.intersect=function(a,b,c){this._renderer.intersect(a,b,c)};e.prototype.getElevation=function(a){if(!this.ready)return null;var b=this.rootTiles;if(0===b[0].layerInfo[I.LayerClass.ELEVATION].length)return null;if(a instanceof n){if(!m.pointToVector(a,ea,this.tilingScheme.spatialReference))return U.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;a=ea}for(var c,d=0;d<b.length;d++){var e=b[d];if(J.isPosWithinTile(e,a)){for(;e&&
- !e.renderData;)b=0,a[0]>.5*(e.extent[0]+e.extent[2])&&(b+=1),a[1]<.5*(e.extent[1]+e.extent[3])&&(b+=2),e=e.children[b];c=(b=e.renderData)&&b.geometryState?b.geometryState.samplerData:null;break}}return c?M.elevationSampler(a[0],a[1],c):null};e.prototype.getElevationBounds=function(){return this._elevationBounds};e.prototype.getScale=function(a){if(this.tilingScheme){if(!m.pointToVector(a,ea,this.spatialReference))return U.error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),
- null;if(this.rootTiles)for(var b=0;b<this.rootTiles.length;b++)if(a=this.rootTiles[b],J.isPosWithinTile(a,ea)){for(;a.children[0];)b=0,ea[0]>a.children[0].extent[2]&&(b+=1),ea[1]<a.children[0].extent[1]&&(b+=2),a=a.children[b];return this._getLodBiasCorrectedScale(a.lij[0])}}return 1E100};e.prototype.queryVisibleScaleRange=function(a,b,c,d){b=b?this.tilingScheme.levelAtScale(b):0;c=c?this.tilingScheme.levelAtScale(c):Infinity;var e=this._getLodBias();this._renderer.queryVisibleLevelRange(a,b+e,c+
- e,d)};e.prototype._setLoaded=function(){this.loaded||this._set("loaded",!0)};e.prototype._updateTilingSchemeAndExtent=function(){var a=this.tilingSchemeLogic.extent,b=this.tilingSchemeLogic.tilingScheme,c=!1;a&&!u.equals(a,this._dataExtent)&&(c=!0,this._dataExtent?u.set(this._dataExtent,a):this._dataExtent=u.create(a));b!==this.tilingScheme&&(V(!!b,"tiling scheme cannot be reset to undefined"),c=!0,this.tilingScheme&&this._removeAllTiles(),this._set("tilingScheme",b),this._updateClippingExtent(),
- b&&(this._updateTiledLayers(),this._renderer.setTileSize(b.pixelSize[0]),this.overlayManager.setSpatialReference(b.spatialReference,"spherical"===this.manifold)));c&&this._updateRootTiles()};e.prototype._acquireTile=function(a,b,c,d){var e=this.tilePool.acquire();ja[0]=a;ja[1]=b;ja[2]=c;e.init(ja,d,this,this.tilingScheme);return e};e.prototype._releaseTile=function(a){a.dispose();a.parent=null;a.parentSurface=null;this.tilePool.release(a)};e.prototype._updateRootTiles=function(){var a=this,b=this._clippingExtent||
- this._dataExtent,d=this.tilingScheme;if(b&&d){var e=ea,f=d.rootTilesInExtent(b,e,Infinity);if(this.rootTiles){if(f.length>da){U.warn(I.TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR);return}var b=this.rootTiles.map(function(a){return a.lij}),g=c.difference(b,f,R);if(0<g.removed.length||0<g.added.length){var k=this.rootTiles.filter(function(b){return-1<c.findIndex(g.removed,R.bind(null,b.lij))?(a._purgeChildTiles(b),a._purgeTile(b),!1):!0});g.added.forEach(function(b){b=a._acquireTile(0,b[1],b[2],null);k.push(b);
- a._loadTile(b)});this._set("rootTiles",k);this._renderer.setRootTiles(this.rootTiles)}}else f.length>da&&(U.warn(I.TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR),f=d.rootTilesInExtent(b,e,da)),this._set("rootTiles",f.map(function(b){b=a._acquireTile(0,b[1],b[2],null);a._loadTile(b);return b})),this._renderer.setRootTiles(this.rootTiles);c.equals(e,this._rootExtent)||(this._rootExtent=K.create(e),this._hasFixedExtent()||this.notifyChange("extent"));this.setVisibility(!0);this._viewChangeUpdate();this.overlayManager.setOverlayDirty();
- this.notifyChange("ready")}};e.prototype._viewChangeUpdate=function(){this._stage&&!this.suspended&&this.tilingScheme&&this.visible&&(this._updateViewDependentParameters(),this._updateOverlayOpacity(this._curEyePos),this._updateTiles(this.rootTiles))};e.prototype._updateClippingStatus=function(a){a.updateClippingStatus(this._clippingExtent)&&a.pendingUpdates&Z.UPDATE_GEOMETRY&&(this._renderer.updateTileGeometryNeedsUpdate(a),this._updateTileGeometry(a),a.pendingUpdates&=~Z.UPDATE_GEOMETRY)};e.prototype._updateTiles=
- function(a){var b=this._iteratorPool.acquire();b.reset(a);var c=this._curSplitLimits,d=this._curFrustumPlanes,e=this._curEyePos,f;J.hasVisibleSiblings(a)?(a=this._elevationBounds[0],f=this._elevationBounds[1]):(a=Infinity,f=-Infinity);for(;!b.done;){var g=b.next();this._updateClippingStatus(g);var k=!0;if(g.updateVisibility(d,e)){g.updateScreenDepth(this._viewProjectionMatrix);g.renderData&&(a=Math.min(g.elevationBounds[0],a),f=Math.max(g.elevationBounds[1],f));var h=g.shouldSplit(c,e);h===Z.SPLIT?
- (g.pendingUpdates&=~Z.MERGE,g.renderData?(k=!1,g.pendingUpdates|=Z.SPLIT,b.skip()):k=!1):(g.pendingUpdates&=~Z.SPLIT,h===Z.VSPLITMERGE&&g.updateAgents(I.LayerClass.ELEVATION),b.skip())}else b.skip();if(k&&!g.renderData){g.pendingUpdates|=Z.MERGE;g.pendingUpdates&=~Z.SPLIT;k=this._iteratorPool.acquire();for(k.reset(g);!k.done;)h=k.next(),this._updateClippingStatus(h),h.updateVisibility(d,e),h.visible&&h.updateScreenDepth(this._viewProjectionMatrix);this._iteratorPool.release(k)}0!==g.pendingUpdates&&
- (this._pendingUpdates=!0)}this._iteratorPool.release(b);isFinite(a)&&isFinite(f)&&(this._elevationBounds[0]!==a||this._elevationBounds[1]!==f)&&(this._elevationBounds[0]=a,this._elevationBounds[1]=f,this.emit("elevation-bounds-change",null))};e.prototype._updateViewDependentParameters=function(){var a=this._view.state.camera,b=Math.tan(.5*a.fovX),c=Math.tan(.5*a.fovY),d=this.tilingScheme.pixelSize,e=Math.pow(2,-this._getLodBias());this._curSplitLimits[0]=b;this._curSplitLimits[1]=d[0]/a.width*this.maxTextureScale*
- e;this._curSplitLimits[2]=c;this._curSplitLimits[3]=d[1]/a.height*this.maxTextureScale*e;this._curSplitLimits[4]=this.tilingScheme.getMaxLod();this._curSplitLimits[5]=this._view.qualitySettings.tiledSurface.angledSplitBias;a.copyFrustumPlanes(this._curFrustumPlanes);L.multiply(a.projectionMatrix,a.viewMatrix,this._viewProjectionMatrix);Q.set(a.eye,this._curEyePos);G.autoUpdateSkirtsVisibility(this,this._curEyePos)};e.prototype._setLayerViewsUpdating=function(){for(var a=0;a<I.LayerClass.LAYER_CLASS_COUNT;a++)for(var b=
- this._layerViews[a],c=0;c<b.length;c++)b[c]._evaluateUpdatingState(this._pendingUpdates)};e.prototype._frameUpdateTraversal=function(a){if(this.suspended)return!1;this._frameUpdateLowerPrio.clear();var b=this._renderer.resourceCounter.numTileTexturesComposited,c=this._iteratorPool.acquire();c.reset(this.rootTiles);for(var d=!1,e=!1;!c.done&&(1<a.remaining()||!d)&&this._renderer.resourceCounter.numTileTexturesComposited-b<ka;){var f=c.next();f.pendingUpdates&Z.MERGE?(this._mergeTile(f),f.pendingUpdates&=
- ~Z.MERGE,d=!0,c.skip()):f.pendingUpdates&Z.SPLIT?(this._splitTile(f),f.pendingUpdates&=~Z.SPLIT,d=!0,c.skip()):0<f.pendingUpdates&&this._frameUpdateLowerPrio.push(f);0!==f.pendingUpdates&&(e=!0)}this._pendingUpdates=e||!c.done;this._iteratorPool.release(c);return d};e.prototype._updateTileGeometry=function(a){this._renderer._updateTileGeometry(a);aa.spatialReference=this.spatialReference;aa.tile=a;aa.extent=a.extent;this.emit("elevation-change",aa)};e.prototype._updateTileTexture=function(a){this._renderer.updateTileTexture(a)};
- e.prototype._frameUpdate=function(a){if(this.rootTiles){for(var b=this._frameUpdateTraversal(a);(1<a.remaining()||!b)&&0<this._frameUpdateLowerPrio.length;){var c=this._frameUpdateLowerPrio.pop();c.pendingUpdates&Z.DECODE_ELEVATION?(this._decodeElevation(c),c.pendingUpdates&=~Z.DECODE_ELEVATION,b=!0):c.pendingUpdates&Z.UPDATE_GEOMETRY?(this._renderer.updateTileGeometryNeedsUpdate(c),this._updateTileGeometry(c),b=!0,c.pendingUpdates&=~Z.UPDATE_GEOMETRY):c.pendingUpdates&Z.UPDATE_TEXTURE&&(this._updateTileTexture(c),
- c.pendingUpdates&=~Z.UPDATE_TEXTURE,b=!0);0!==c.pendingUpdates&&(this._pendingUpdates=!0)}0<this._frameUpdateLowerPrio.length&&(this._pendingUpdates=!0);if(this._streamDataSupplier.hasPendingDownloads()||0!==this._vectorTileLayerRequests)this._pendingUpdates=!0;this._pendingUpdates===this._lvPendingUpdates||!this._pendingUpdates&&20!==++this._updateNextFrame||(this._setLayerViewsUpdating(),this._lvPendingUpdates=this._pendingUpdates,this._updateNextFrame=0);b&&(this._memoryUsage={})}};e.prototype._needsIdleUpdate=
- function(){return this.isVisible()&&this.overlayManager&&this.overlayManager.overlaysNeedUpdate()};e.prototype._idleUpdate=function(){this.overlayManager.updateOverlay();this._updateOverlayOpacity(this._curEyePos)};e.prototype._updateClippingExtent=function(){if(!this.spatialReference)return!1;var a=[0,0,0,0],b=null;m.extentToBoundingRect(this._view.clippingArea,a,this.spatialReference)&&(b=a);if(c.equals(b,this._clippingExtent))return!1;this._clippingExtent=b;this._renderer.clippingExtent=b;this.notifyChange("extent");
- this.overlayManager.setOverlayDirty();return!0};e.prototype._clippingChanged=function(){this._updateClippingExtent()&&this._updateRootTiles()};e.prototype._getLodBias=function(){var a=this._view.resourceController.getMemoryFactor();return Math.round(this._view.qualitySettings.tiledSurface.lodBias+2*a-2)};e.prototype._getLodBiasCorrectedScale=function(a){var b=this.tilingScheme.levels;a=v.clamp(a-this._getLodBias(),0,b.length-1);return b[a].scale};e.prototype._cancelTilemapRequests=function(a){for(var b=
- 0;b<I.LayerClass.LAYER_CLASS_COUNT;b++){var c=a.layerInfo[b];if(c)for(var d=0;d<c.length;d++){var e=c[d];e.tilemapRequest&&(e.tilemapRequest.cancel(),e.tilemapRequest=null)}}};e.prototype._removeAllTiles=function(){var a=this;this.rootTiles&&(this.rootTiles.forEach(function(b){a._purgeChildTiles(b);a._purgeTile(b)}),this._set("rootTiles",null),this.notifyChange("ready"));for(var b=0;b<this._topLevelTilemapOnlyTiles.length;b++)this._cancelTilemapRequests(this._topLevelTilemapOnlyTiles[b]);this.setVisibility(!1)};
- e.prototype._purgeChildTiles=function(a){var b=this._postorderIterator;for(b.reset(a);!b.done;){for(var c=b.next(),d=0;4>d;d++)c.children[d]=null;c!==a&&this._purgeTile(c)}};e.prototype._purgeTile=function(a){a.unload(this._renderer);this._cancelTilemapRequests(a);a.parent=null;this._releaseTile(a)};e.prototype._splitTile=function(a){var b=a.lij[0]+1,c=2*a.lij[1],d=2*a.lij[2];a.children[0]=this._createTile(b,c,d,a);a.children[1]=this._createTile(b,c,d+1,a);a.children[2]=this._createTile(b,c+1,d,a);
- a.children[3]=this._createTile(b,c+1,d+1,a);a.unload(this._renderer);fa.spatialReference=this.spatialReference;fa.extent=a.extent;fa.scale=this._getLodBiasCorrectedScale(b);this.emit("scale-change",fa)};e.prototype._createTile=function(a,b,c,d){V(!!d,"_createTile sanity check");a=this._acquireTile(a,b,c,d);a.updateClippingStatus(this._clippingExtent);a.updateVisibility(this._curFrustumPlanes,this._curEyePos);a.visible&&(a.updateScreenDepth(this._viewProjectionMatrix),a.shouldSplit(this._curSplitLimits,
- this._curEyePos)===Z.SPLIT&&(a.pendingUpdates|=Z.SPLIT,this._pendingUpdates=!0));this._loadTile(a);return a};e.prototype._mergeTile=function(a){V(!a.renderData,"_mergeTile sanity check");this._loadTile(a);this._purgeChildTiles(a);fa.spatialReference=this.spatialReference;fa.extent=a.extent;fa.scale=this._getLodBiasCorrectedScale(a.lij[0]);this.emit("scale-change",fa)};e.prototype._loadTile=function(a){a.load(this._renderer);this.overlayManager&&this.overlayManager.hasOverlays()&&this.overlayManager.setOverlayParamsOfTile(a,
- a.renderData,this._curOverlayOpacity);aa.spatialReference=this.spatialReference;aa.tile=a;aa.extent=a.extent;this.emit("elevation-change",aa)};e.prototype._handleHasHighlights=function(a){this._renderer.setNeedsHighlight(a)};e.prototype._decodeElevation=function(a){var b=I.LayerClass.ELEVATION,c=a.layerInfo[b];if(c)for(var d=0;d<c.length;d++){var e=c[d];e.pendingUpdates&=~Z.DECODE_ELEVATION;if(e.rawData){var f=a.decodeElevationData(e.rawData);e.rawData=null;if(f){e.data=f;var e=a.lij[0],g=this._iteratorPool.acquire();
- for(g.reset(a);!g.done;){var k=g.next();k.findElevationBoundsForLayer(d,e);k.computeElevationBounds()}this._iteratorPool.release(g);a.dataArrived(d,b,f);this._updateTiles(a)}}}};e.prototype._handleLayerViewChanges=function(a){var b=this,c=!1;a.added.forEach(function(a){var d=a.layer;G.isTiledLayerView(a)?(b._registerTiledLayer(a),d.loaded&&(c=!0)):a.supportsDraping&&b.overlayManager&&b.overlayManager.registerLayerView(a)});a.removed.forEach(function(a){G.isTiledLayerView(a)?(c=!0,b._unregisterTiledLayerView(a.uid)):
- a.supportsDraping&&b.overlayManager&&b.overlayManager.unregisterLayerView(a)});(c=c||0<a.moved.filter(G.isTiledLayerView).length)&&this._updateTiledLayers()};e.prototype._registerTiledLayer=function(a){var b=this,c=[];c.push(a.watch("suspended",function(){b._updateTiledLayers()}));c.push(a.watch("fullOpacity",function(){return b._updateTileTextures()}));a.on("data-changed",function(){var c=G.isElevationLayerView(a)?I.LayerClass.ELEVATION:I.LayerClass.MAP,d=b._layerIndexByLayerViewId[c][a.uid];null!=
- d&&b._invalidateLayerData(d,c)});this._basemapLayerViewHandles[a.uid]=c};e.prototype._unregisterTiledLayerView=function(a){var b=this._basemapLayerViewHandles[a];if(b){for(var c=0;c<b.length;c++)b[c].remove();delete this._basemapLayerViewHandles[a]}};e.prototype._updateTiledLayers=function(){var a=this;if(this.tilingScheme){var b=this._view.allLayerViews,c=[[],[]],d=I.LayerClass,e=null,f=u.create(u.NEGATIVE_INFINITY);b.forEach(function(b){var g=b.layer;if(b.layer&&b&&!b.suspended&&G.isTiledLayerView(b)){var k=
- b.fullExtent;k?a.tilingScheme.compatibleWith(b.tileInfo)?(u.expand(f,k),G.isElevationLayerView(b)?c[d.ELEVATION].push(b):(Infinity!==b.maxDataLevel&&(null===e||b.maxDataLevel>e)&&(e=b.maxDataLevel),c[d.MAP].push(b))):U.warn("Terrain: tiling scheme of layer "+g.id+" is incompatible with other tiled layers, will not be drawn"):U.warn("Terrain: Map or elevation layer does not have fullExtent: "+g.id)}},this);for(var b=function(a){var b=g._layerViews[a],e=c[a];e.reverse();var f=b.length!==e.length,k=
- e.length,h=Array(k),l=Array(b.length);g._layerIndexByLayerViewId[a]={};for(var m=0;m<k;m++){g._layerIndexByLayerViewId[a][e[m].uid]=m;var n=b.indexOf(e[m]);h[m]=n;m!==n&&(f=!0);-1<n&&(l[n]=m)}if(f){g._topLevelTilemapOnlyTiles.forEach(function(b){return b.modifyLayers(l,h,a)});b=g._postorderIterator;if(g.rootTiles)for(b.reset(g.rootTiles);!b.done;)b.next().modifyLayers(l,h,a);g._layerViews[a]=e;if(g.rootTiles){for(b.reset(g.rootTiles);!b.done;)e=b.next(),e.restartAgents(a),a===d.ELEVATION&&e.computeElevationBounds();
- g._updateTiles(g.rootTiles)}}},g=this,k=0;k<d.LAYER_CLASS_COUNT;k++)b(k);this.tilingScheme.levels.length-1<e&&(this.tilingScheme.ensureMaxLod(e),this._viewChangeUpdate())}};e.prototype._hasFixedExtent=function(){return!!this._clippingExtent};e.prototype.layerViewByIndex=function(a,b){return this._layerViews[b][a]};e.prototype.numLayers=function(a){return this._layerViews[a].length};e.prototype.numTotalLayers=function(){return this._layerViews.reduce(function(a,b){return b.length+a},0)};e.prototype._updateTileTextures=
- function(){var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;)a.next().updateTexture();this._iteratorPool.release(a)};e.prototype._invalidateLayerData=function(a,b){var c=this._iteratorPool.acquire();for(c.reset(this.rootTiles);!c.done;)c.next().removeLayerAgent(a,b);for(c.reset(this.rootTiles);!c.done;)c.next().invalidateLayerData(a,b);this._iteratorPool.release(c)};e.prototype.requestTileData=function(a,b,c){var d=this;this.tilemapStats.tilesRequested++;var e=this.layerViewByIndex(b,
- c),f=e.layer;if(f.tilemapCache&&!G.isVectorTileLayerView(e)){var g=this.getTilemapTile(a),k=g.layerInfo[c][b];if(k.tilemap){if(!g.tileDataAvailable(a,b,c))return this.tilemapStats.tilesNotPresent++,this._dispatchDataEvent(a,"dataMissing",c,e,{notInTilemap:!0}),b=new B.Promise,b.reject(),b}else{k.tilemapRequest||(k.tilemapRequest=this.requestTilemap(g,b,c,e,f));var h,l=new B.Promise(function(){h&&h.cancel()});k.tilemapRequest.always(function(){k.tilemapRequest=null;if(!l.isCancelled()){var b=d._layerIndexByLayerViewId[c][e.uid];
- null!=b&&(g.tileDataAvailable(a,b,c)?(h=d._requestTileData(a,b,c,e),h.then(function(){return l.resolve()})):(d.tilemapStats.tilesNotPresent++,d._dispatchDataEvent(a,"dataMissing",c,e,{notInTilemap:!0}),l.reject()))}});return l}}return this._requestTileData(a,b,c,e)};e.prototype._requestTileData=function(a,b,c,d){this.tilemapStats.tileRequestsSent++;return c===I.LayerClass.ELEVATION?this._requestElevationTileData(a,b,c,d):this._requestMapTileData(a,b,c,d)};e.prototype._requestElevationTileData=function(a,
- b,c,d){function e(b){var e=g._layerIndexByLayerViewId[c][d.uid];null!=e?(e=a.layerInfo[c][e],e.rawData=b,a.pendingUpdates|=Z.DECODE_ELEVATION,e.pendingUpdates|=Z.DECODE_ELEVATION,g._pendingUpdates=!0):U.warn("TerrainSurface: received data from unknown layer %d %s",c,a.lij.toString())}function f(b){Y(b)||(g.tilemapStats.tileRequestErrors++,g._dispatchDataEvent(a,"dataMissing",c,d,b))}var g=this,k;G.isElevationLayerView(d)?(b=d.layer,G.useFetchTileForLayer(b)?(k=b.fetchTile(a.lij[0],a.lij[1],a.lij[2],
- I.ELEVATION_NODATA_VALUE),k.then(function(a){return e(a)},f)):(b=d.getTileUrl(a.lij[0],a.lij[1],a.lij[2]),k=this._streamDataSupplier.request(b,"binary"),k.then(function(a,b){b.url=a;e(b)},f))):V(!1,"_requestElevationTileData can only be called for elevation layer views");return k};e.prototype._requestMapTileData=function(a,b,c,d){function e(b){g._dispatchDataEvent(a,"dataArrived",c,d,b)}function f(b){Y(b)||(g._dispatchDataEvent(a,"dataMissing",c,d,b),g.tilemapStats.tileRequestErrors++)}var g=this;
- if(G.isVectorTileLayerView(d)){var k=d.tileHandler;b=d.schemeHelper.getCompatibleLevelRowCol(a.lij);b=k.getVectorTileWithLRC(b[0],b[1],b[2],0);b.then(e).catch(f).always(function(){g._vectorTileLayerRequests=k.ongoingRequestCount});this._vectorTileLayerRequests=k.ongoingRequestCount}else G.useFetchTileForLayer(d.layer)&&G.isTileLayerView(d)?(b=d.layer.fetchTile(a.lij[0],a.lij[1],a.lij[2]),b.then(e).catch(f)):(b=d.getTileUrl(a.lij[0],a.lij[1],a.lij[2]),null!=d.refreshInterval&&d.refreshTimestamp&&(b+=
- (-1<b.indexOf("?")?"\x26":"?")+"_ts\x3d"+d.refreshTimestamp),b=this._streamDataSupplier.request(b,"image"),b.then(function(a,b){return e(b)},f));return b};e.prototype.requestTilemap=function(a,b,c,d,e){var f=this,g=a.lij[0]+I.TILEMAP_SIZE_EXP,k=a.lij[1]<<I.TILEMAP_SIZE_EXP,h=a.lij[2]<<I.TILEMAP_SIZE_EXP;this.tilemapStats.tilemapRequestsSent++;this.tilemapStats.tilemapRequestsPending++;return e.tilemapCache.fetchTilemap(g,k,h,{timeout:6E3}).then(function(e){f.tilemapStats.tilemapRequestsPending--;
- b=f._layerIndexByLayerViewId[c][d.uid];null!=b&&(a.layerInfo[c][b].tilemap=e)}).catch(function(a){f.tilemapStats.tilemapRequestsPending--;f.tilemapStats.tilemapRequestErrors++})};e.prototype.getTilemapTile=function(a){var b=a.lij[0];return b>I.TILEMAP_SIZE_EXP?J.getTileNLevelsUp(a,I.TILEMAP_SIZE_EXP):this._topLevelTilemapOnlyTiles[b]};e.prototype._dispatchDataEvent=function(a,b,c,d,e){d=this._layerIndexByLayerViewId[c][d.uid];if(null!=d)a[b](d,c,e);else U.warn("TerrainSurface: received data from unknown layer")};
- e.prototype._updateTileOverlayParams=function(){if(this.rootTiles){var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;){var b=a.next();b.renderData&&this.overlayManager&&this.overlayManager.setOverlayParamsOfTile(b,b.renderData,this._curOverlayOpacity)}this._iteratorPool.release(a);this._renderer.setNeedsRender()}};e.prototype._updateOverlayOpacity=function(a){if(this.overlayManager&&(a=this.overlayManager.updateOpacity(a),!isNaN(a))){if(a!==this._curOverlayOpacity&&this.rootTiles){var b=
- this._iteratorPool.acquire();for(b.reset(this.rootTiles);!b.done;){var c=b.next();c.renderData&&c.renderData.overlayTexId&&(c.renderData.overlayOpacity=a)}this._iteratorPool.release(b)}this._curOverlayOpacity=a;this._renderer.setNeedsRender()}};e.prototype.getStats=function(){var a=0,b=0,c=0,d=[],e=this._iteratorPool.acquire();for(e.reset(this.rootTiles);!e.done;){var f=e.next();a++;f.renderData&&(b++,f.visible&&(c++,f=f.lij[0],d[f]=null!=d[f]?d[f]+1:1))}this._iteratorPool.release(e);return{numNodes:a,
- numLeaves:b,numVisible:c,numVisiblePerLevel:d}};e.prototype.getUsedMemory=function(){if(!this._view||!this._view.basemapTerrain)return 0;var a=this._view.basemapTerrain.getMemoryUsage(),b=0,c;for(c in a)b+=a[c];return b/1024/1024};e.prototype.getMemoryUsage=function(){0===Object.keys(this._memoryUsage).length&&this._updateMemoryUsage();return this._memoryUsage};e.prototype._updateMemoryUsage=function(){if(this.tilingScheme){var a=0,b=0,c=0,d=0,e=0,f=0,g=this._iteratorPool.acquire();g.reset(this.rootTiles);
- for(var k=this.tilingScheme.pixelSize,k=k[0]*k[1]*4;!g.done;){for(var h=g.next(),l=X(h),m=0,n=h.layerInfo[I.LayerClass.MAP];m<n.length;m++){var q=n[m],q=q.data,p=0,t=0;q instanceof S?p+=1.3*q.descriptor.width*q.descriptor.height*4:q instanceof HTMLImageElement?t+=k:q instanceof N&&(f+=q.getGpuMemoryUsage(),c+=q.getCpuMemoryUsage());h.renderData||l?(a+=t,d+=p):(b+=t,e+=p)}l=0;for(m=h.layerInfo[I.LayerClass.ELEVATION];l<m.length;l++)q=m[l],q=q.data,a+=q?k:0;h.renderData&&(q=h.renderData.texture,d+=
- q&&q.descriptor?1.3*q.descriptor.width*q.descriptor.height*4:0,h=h.renderData.estimateGeometryMemoryUsage(),f+=h,c+=h)}this._iteratorPool.release(g);this._memoryUsage={cpuVisibleImageData:a,cpuInvisibleImageData:b,cpuGeometryData:c,gpuVisibleImageData:d,gpuInvisibleImageData:e,gpuGeometryData:f}}};e.prototype.getTile=function(a){var b=a.split("/").map(function(a){return+a});if(0===b[0])return this.rootTiles.forEach(function(a){if(a.lij[1]===b[1]&&a.lij[2]===b[2])return a}),null;var c=Math.pow(2,b[0]),
- d=Math.floor(b[1]/c),e=Math.floor(b[2]/c),f;this.rootTiles.some(function(a){return a.lij[1]===d&&a.lij[2]===e?(f=a,!0):!1});if(f){for(c=1<<b[0]-1;f.lij[0]<b[0];){var g=b[1]&c?2:0;0<(b[2]&c)&&g++;if(!f.children[g])return console.log("Tile "+a+" doesn't exist, smallest ancestor is "+J.tile2str(f)),null;f=f.children[g];c>>=1}V(f.lij[0]===b[0]&&f.lij[1]===b[1]&&f.lij[2]===b[2],"not the right tile?");return f}return null};e.prototype.hasPendingUpdates=function(){if(this._streamDataSupplier.hasPendingDownloads()||
- 0!==this._vectorTileLayerRequests)return!0;var a=this._iteratorPool.acquire();for(a.reset(this.rootTiles);!a.done;)if(0<a.next().pendingUpdates)return this._iteratorPool.release(a),!0;this._iteratorPool.release(a);return!1};e.prototype.setBorders=function(a){this._renderer.setBorders(a)};e.prototype.setDisableRendering=function(a){this._renderer.setDisableRendering(a)};a([p.property({value:!1})],e.prototype,"cullBackFaces",null);a([p.property({readOnly:!0})],e.prototype,"extent",null);a([p.property({value:!1})],
- e.prototype,"frontMostTransparent",null);a([p.property({readOnly:!0})],e.prototype,"loaded",void 0);a([p.property({value:1})],e.prototype,"opacity",null);a([p.property({readOnly:!0})],e.prototype,"overlayManager",void 0);a([p.property({readOnly:!0})],e.prototype,"manifold",void 0);a([p.property()],e.prototype,"maxTextureScale",void 0);a([p.property({readOnly:!0})],e.prototype,"ready",null);a([p.property({value:1})],e.prototype,"renderOrder",null);a([p.property({readOnly:!0})],e.prototype,"rootTiles",
- void 0);a([p.property({value:!0})],e.prototype,"skirts",null);a([p.property({readOnly:!0,aliasOf:"tilingScheme.spatialReference"})],e.prototype,"spatialReference",void 0);a([p.property({value:I.DEFAULT_TILE_BACKGROUND})],e.prototype,"tileBackground",null);a([p.property({readOnly:!0})],e.prototype,"tilingScheme",void 0);a([p.property({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeLocked"})],e.prototype,"tilingSchemeLocked",void 0);a([p.property({readOnly:!0,aliasOf:"tilingSchemeLogic.tilingSchemeDone"})],
- e.prototype,"tilingSchemeDone",void 0);a([p.property({readOnly:!0})],e.prototype,"tilingSchemeLogic",void 0);a([p.property({value:!0})],e.prototype,"velvetOverground",null);a([p.property({value:!1})],e.prototype,"wireframe",null);return e=a([p.subclass("esri.views.3d.terrain.TerrainSurface")],e)}(p.declared(e,q.Evented));var ca=1.2,ga=80/180*Math.PI,da=I.MAX_ROOT_TILES,ka=12,Z=I.TileUpdateTypes,ea=K.create(),ja=[0,0,0],aa={spatialReference:null,tile:null,extent:null},fa={spatialReference:null,extent:null,
- scale:0};return r})},"esri/views/3d/terrain/OverlayManager":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/on ../../../Graphic ../../../core/Accessor ../../../core/Handles ../../../core/Logger ../../../core/accessorSupport/decorators ../../../geometry/Point ../../../symbols/SimpleMarkerSymbol ../lib/glMatrix ../state/utils/viewUtils ../support/aaBoundingRect ../support/debugFlags ../support/debugFlags ../support/earthUtils ../support/mathUtils ../support/projectionUtils ../webgl-engine/Stage ../webgl-engine/lib/Selector ../webgl-engine/lib/Texture".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A){var D=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]],E=b.getLogger("esri.views.3d.OverlayManager"),F,I=function(b){function g(){var a=null!==b&&b.apply(this,arguments)||this;a._handles=new d;a._overlaySR=null;a._renderSR=null;a._overlaySREqualsRenderSR=!0;a._connectedLayers={};a._scale=0;a._dirty=!1;a._isSpherical=!1;a._latestOriginId=0;a.opacity=0;return a}
- f(g,b);Object.defineProperty(g.prototype,"hasHighlights",{get:function(){return this._renderer.hasHighlights},enumerable:!0,configurable:!0});g.prototype.initialize=function(){var a=this;this._stage=this.view._stage;this._renderer=this._stage.getTextureGraphicsRenderer();this._renderer.onHasHighlightsChanged=function(){return a.onHasHighlightsChanged()};this._initialEmptyTexture=A.createEmpty("initialOverlayTexture");this.groundSelector=new C(this.view.viewingMode);this.groundSelector.enableBackfacesTerrain=
- !0;this.groundSelector.enableInvisibleTerrain=!0;this.groundSelector.enableHUDSelection=!1;this._stage.add(z.ModelContentType.TEXTURE,this._initialEmptyTexture);this._handles.add(this.view.watch(["pointsOfInterest.renderPointOfView","pointsOfInterest.centerOnSurfaceFrequent.location"],function(){return a.setOverlayDirty()}))};g.prototype.destroy=function(){for(var a in this._connectedLayers)this.unregisterLayerView(this._connectedLayers[a].layerView);this._disposeOverlays();this._stage.remove(z.ModelContentType.TEXTURE,
- this._initialEmptyTexture.id);this._handles&&(this._handles.destroy(),this._handles=null)};g.prototype.onHasHighlightsChanged=function(){this.setOverlayDirty();this.notifyChange("hasHighlights")};g.prototype.hasOverlays=function(){return!!this._overlays};g.prototype.setSpatialReference=function(a,b){(this._overlaySR=a)?(this._renderSR=this.view.renderSpatialReference,this._overlaySREqualsRenderSR=this._overlaySR.equals(this._renderSR),this._longitudeCyclical=(this._isSpherical=b)?a.isWebMercator?
- new m.Cyclical(-2.0037508342788905E7,2.0037508342788905E7):new m.Cyclical(-180,180):null):(this._disposeOverlays(),this._longitudeCyclical=null)};g.prototype.registerLayerView=function(a){var b=this,c=a.layer.uid;if(this._connectedLayers[c])E.warn("[OverlayManager#registerLayerView]: Layer "+c+" is already connected");else{var d=e(a,"draped-data-change",function(){return b.setOverlayDirty()});this._connectedLayers[c]={eventHandles:[d],layerView:a};if(a.setDrapingExtent&&this._overlays)for(c=0;c<this._overlays.length;c++)d=
- this._overlays[c],a.setDrapingExtent(c,d.extent,this._overlaySR,2048,d.renderLocalOrigin);this.setOverlayDirty();this._setLayerViewOverlayUpdating(a,this._dirty)}};g.prototype.unregisterLayerView=function(a){for(var b in this._connectedLayers){var c=this._connectedLayers[b];if(c.layerView===a){if(c.eventHandles)for(var d=0;d<c.eventHandles.length;d++)c.eventHandles[d].remove();delete this._connectedLayers[b];this.setOverlayDirty();a.destroyed||(a._overlayUpdating=!1,a._evaluateUpdatingState())}}};
- g.prototype.setOverlayDirty=function(){this._dirty||(this._setOverlayUpdating(!0),this._dirty=!0)};g.prototype._setLayerViewOverlayUpdating=function(a,b){if(!b||!a.suspended&&a.hasDraped)a._overlayUpdating=b,a._evaluateUpdatingState()};g.prototype._setOverlayUpdating=function(a){for(var b in this._connectedLayers)this._setLayerViewOverlayUpdating(this._connectedLayers[b].layerView,a);if(b=this.view._graphicsView)b._overlayUpdating=a,b._evaluateUpdatingState()};g.prototype.updateOverlay=function(){if(this._overlaySR){var a=
- this._computeOverlayExtents();if(a){this._overlays||this._initOverlays();for(var b=0;b<this._overlays.length;b++){var c=this._overlays[b],d;a:{d=a[b];for(var e=c.extent,f=q.TESTS_DISABLE_UPDATE_THROTTLE_THRESHOLDS?0:I.EXTENTS_DIFFER_THRESHOLD*Math.max(d[2]-d[0],d[3]-d[1],e[2]-e[0],e[3]-e[1]),g=0;4>g;g++)if(Math.abs(e[g]-d[g])>f){d=!0;break a}d=!1}if(d){n.vec4d.set(a[b],c.extent);c.renderLocalOrigin={id:"OV_"+this._latestOriginId++,vec3:u.center(c.extent,n.vec3d.create())};for(var k in this._connectedLayers)d=
- this._connectedLayers[k].layerView,d.setDrapingExtent&&d.setDrapingExtent(b,a[b],this._overlaySR,2048,c.renderLocalOrigin)}}this._setOverlayUpdating(!1);this._drawOverlays();this.terrainSurface._updateTileOverlayParams();this._dirty=!1}}};g.prototype.overlaysNeedUpdate=function(){return this._dirty&&!!this._overlaySR};g.prototype.updateOpacity=function(a){var b=1;if(this._overlays){var c=this._scale;a=this.view.renderCoordsHelper.getAltitude(a);3.5*a<c&&(b=Math.sqrt(m.clamp((a-c/10)/(c/3.5-c/10),
- 0,1)))}return b};g.prototype.setOverlayParamsOfTile=function(a,b,c){var d=a.extent;if(a=this._overlayForTile(a)){var e=a.extent;b.overlayTexScale[0]=(d[2]-d[0])/(e[2]-e[0]);b.overlayTexScale[1]=(d[3]-d[1])/(e[3]-e[1]);var f=d[0];if(this._longitudeCyclical){var f=this._longitudeCyclical.minimalMonotonic(e[0],f),g=this._longitudeCyclical.minimalMonotonic(e[0],d[2]);f>g&&(f=g-(d[2]-d[0]))}n.vec2d.set2((f-e[0])/(e[2]-e[0]),(d[1]-e[1])/(e[3]-e[1]),b.overlayTexOffset);b.overlayTexId=a.valid?a.texture.id:
- this._initialEmptyTexture.id;b.highlightOverlayTexId=a.highlightValid?a.highlightTexture.id:this._initialEmptyTexture.id;b.overlayOpacity=void 0!==c?c:1}else b.overlayTexId=null,b.highlightOverlayTexId=null};g.prototype.overlayPixelSizeInMapUnits=function(a){var b;this._overlays&&(this._overlays[0]&&this._pointIsInExtent(a,this._overlays[0].extent)?b=this._overlays[0].extent:this._overlays[1]&&(b=this._overlays[1].extent));return b?(b[2]-b[0])/2048:0};g.prototype._overlayForTile=function(a){var b=
- a.extent;a=a.clippingArea?u.intersection(b,a.clippingArea,H):b;return this._rectInsideRect(a,this._overlays[0].extent)?this._overlays[0]:this._rectanglesOverlap(a,this._overlays[1].extent)?this._overlays[1]:null};g.prototype._createEmptyOverlay=function(){var a=new A(null,"overlay",{wrapClamp:!0,mipmap:!0});this._stage.add(z.ModelContentType.TEXTURE,a);var b=new A(null,"highlightOverlay",{wrapClamp:!0,mipmap:!0});this._stage.add(z.ModelContentType.TEXTURE,b);return{extent:n.vec4d.create(),texture:a,
- valid:!1,highlightTexture:b,highlightValid:!1,renderLocalOrigin:{id:"O",vec3:[0,0,0]}}};g.prototype._initOverlays=function(){this._overlays=[this._createEmptyOverlay(),this._createEmptyOverlay()]};g.prototype._disposeOverlays=function(){if(this._overlays){var a=this._stage;this._overlays.forEach(function(b){a.remove(z.ModelContentType.TEXTURE,b.texture.id);a.remove(z.ModelContentType.TEXTURE,b.highlightTexture.id)});this._overlays=null}};g.prototype._intersectGroundFromView=function(a,b,c,d){var e=
- n.vec3d.createFrom(b*this.view.width,c*this.view.height,1);n.vec3d.unproject(e,a.viewMatrix,a.projectionMatrix,a.fullViewport,e);b=n.vec3d.createFrom(b*this.view.width,c*this.view.height,0);n.vec3d.unproject(b,a.viewMatrix,a.projectionMatrix,a.fullViewport,b);this.groundSelector.init([],b,e,null,a,null,!1);this.view.basemapTerrain.intersect(this.groundSelector,b,e);return this.groundSelector.minResult.getIntersectionPoint(d)};g.prototype._findHorizonBasedPointOfInterest=function(a,b,c){var d=.5;if("global"===
- this.view.viewingMode){d=n.vec3d.create(a.eye);n.vec3d.normalize(d);n.vec3d.negate(d);b=n.vec3d.length(b);b=Math.asin(b/n.vec3d.length(a.eye));var e=Math.acos(n.vec3d.dot(a.viewForward,d)),d=m.clamp((b-(e-.5*a.fovY))/a.fovY,0,1);b=m.clamp((-b-(e-.5*a.fovY))/a.fovY,0,1);d=1===d&&0===b?.5:b+.55*(d-b)}else d=n.mat4d.multiplyVec4(a.projectionMatrix,n.vec4d.createFrom(0,Math.tan(.5*Math.PI-Math.acos(-a.viewForward[2])),1,0))[1],d=m.clamp(.5+.5*d,0,1),d=1===d||0===d?.5:0<a.eye[2]?.55*d:1-.55*(1-d);return this._intersectGroundFromView(a,
- .5,d,c)?!0:!1};g.prototype._computeOverlayExtents=function(){var a=this.view.state.camera,b=this.terrainSurface.extent,d=n.vec3d.create(),e=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;this._findHorizonBasedPointOfInterest(a,this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,d)||n.vec3d.set(e,d);this._scale=this.view.renderCoordsHelper.getAltitude(a.eye);var f=n.vec3d.dist(a.eye,d),e=t.viewAngle(this.view.renderCoordsHelper,e,a.eye),e=Math.PI/2-Math.abs(e-Math.PI/
- 2);if(v.OVERLAY_SHOW_CENTER){var g=new p({color:[255,0,0],outline:{color:[255,255,255],width:2}}),k=new l;B.vectorToPoint(d,this._renderSR,k,this._overlaySR);g=new c({geometry:k,symbol:g});void 0!==F&&this.view.graphics.remove(F);this.view.graphics.add(g);F=g}this._overlaySREqualsRenderSR||B.vectorToVector(d,this._renderSR,d,this._overlaySR);g=1024*a.perPixelRatio*f*2;f=!1;k=Infinity;this._isSpherical&&(this._overlaySR.isWebMercator?(g/=Math.cos(B.webMercator.y2lat(d[1])),k=this.terrainSurface.extent[3],
- k*=.999):(f=!0,g/=x.metersPerDegree,k=90),g>=k&&(g=k,d[1]=0,this._overlaySR.isWebMercator&&(d[0]=0)));var h=1;f&&(h=1/Math.max(.2,Math.cos(Math.abs(m.deg2rad(d[1])))),180<g*h&&(h=180/g));var q=g*h,r=O[0];r[0]=d[0]-q;r[1]=d[1]-g;r[2]=d[0]+q;r[3]=d[1]+g;this._isSpherical&&this._shiftExtentToFitBounds(r,Infinity,k);f=O[1];n.vec4d.set(r,f);6*q>b[2]-b[0]?n.vec4d.set(b,f):e<=.25*Math.PI?(f[0]-=q,f[1]-=g,f[2]+=q,f[3]+=g):(B.vectorToVector(a.eye,this._renderSR,J,this._overlaySR),n.vec2d.subtract(d,J,H),a=
- -Math.atan2(H[1],H[0])+.125*Math.PI,0>a&&(a+=2*Math.PI),n.vec4d.scale(D[Math.floor(a/(.25*Math.PI))],2*g,H),H[0]*=h,H[2]*=h,n.vec4d.add(f,H,f));this._isSpherical&&(f[0]=this._longitudeCyclical.clamp(f[0]),f[2]=this._longitudeCyclical.clamp(f[2]),f[1]=Math.max(f[1],-k),f[3]=Math.min(f[3],k));!this._isSpherical&&b&&(a=u.intersection(r,b,N),b=u.intersection(f,b,S),u.contains(a,b)&&(f[2]=f[0],f[3]=f[1]));this.opacity=1;return O};g.prototype._drawOverlays=function(){for(var a=this._overlays[0].extent[2]-
- this._overlays[0].extent[0],b=this._renderer,c=0;c<this._overlays.length;c++){var d=this._overlays[c].extent,e=this._longitudeCyclical?d[2]>this._longitudeCyclical.max:!1,f=this._longitudeCyclical?d[0]<this._longitudeCyclical.min:!1;if(e||f){P.views=M;var f=void 0,f=e?this._longitudeCyclical.max-d[0]:this._longitudeCyclical.min-d[0],f=Math.round(f/(d[2]-d[0])*2048),g=P.views[0];n.vec4d.set4(0,0,f,2048,g.viewport);n.vec4d.set4(d[0],d[1],this._longitudeCyclical.max,d[3],g.extent);e||(g.extent[0]+=this._longitudeCyclical.range);
- g=P.views[1];n.vec4d.set4(f,0,2048-f,2048,g.viewport);n.vec4d.set4(this._longitudeCyclical.min,d[1],d[2],d[3],g.extent);e&&(g.extent[2]-=this._longitudeCyclical.range)}else P.views=G,n.vec4d.set(d,P.views[0].extent),n.vec4d.set4(0,0,2048,2048,P.views[0].viewport);P.width=2048;P.height=2048;P.pixelRatio=a/(d[2]-d[0]);this._overlays[c].valid=b.draw(this._overlays[c].texture,P);this._overlays[c].highlightValid=b.drawHighlights(this._overlays[c].highlightTexture,P)}};g.prototype._rectanglesOverlap=function(a,
- b){return this._longitudeCyclical?(this._longitudeCyclical.contains(b[0],b[2],a[0])||this._longitudeCyclical.contains(b[0],b[2],a[2])||this._longitudeCyclical.contains(a[0],a[2],b[0]))&&!(a[1]>b[3]||a[3]<b[1]):u.intersects(a,b)};g.prototype._rectInsideRect=function(a,b){return this._longitudeCyclical?this._longitudeCyclical.contains(b[0],b[2],a[0])&&this._longitudeCyclical.contains(b[0],b[2],a[2])&&a[1]>b[1]&&a[3]<b[3]:u.contains(b,a)};g.prototype._pointIsInExtent=function(a,b){if(this._longitudeCyclical)return this._longitudeCyclical.contains(b[0],
- b[2],a.x)&&a.y>=b[1]&&a.y<=b[3];var c=a.x;a=a.y;return c>b[0]&&c<b[2]&&a>b[1]&&a<b[3]};g.prototype._shiftExtentToFitBounds=function(a,b,c){var d=0,e=0;a[0]<-b?d=a[0]+b:a[2]>b&&(d=b-a[2]);a[1]<-c?e=a[1]+c:a[3]>c&&(e=c-a[3]);u.offset(a,d,e)};g.EXTENTS_DIFFER_THRESHOLD=1E-5;a([k.property()],g.prototype,"view",void 0);a([k.property()],g.prototype,"terrainSurface",void 0);a([k.property({type:Boolean})],g.prototype,"hasHighlights",null);return g=a([k.subclass("esri.views.3d.terrain.OverlayManager")],g)}(k.declared(g)),
- P={width:0,height:0,pixelRatio:0,views:null},G=[{viewport:n.vec4d.create(),extent:n.vec4d.create()}],M=[G[0],{viewport:n.vec4d.create(),extent:n.vec4d.create()}],H=n.vec4d.create(),J=n.vec3d.create(),O=[n.vec4d.create(),n.vec4d.create()],N=u.create(),S=u.create();return I})},"esri/views/3d/terrain/PlanarTile":function(){define(["./TileBase","./TileGeometryFactory","../../../core/ObjectPool","../support/mathUtils","../lib/glMatrix"],function(r,h,f,a,e){var c=e.vec3d.createFrom(0,0,1);e=function(a,
- d,b,e){r.call(this);this.tileUp=c;void 0!==a&&this.init(a,d,b,e)};e.prototype=new r;e.prototype.constructor=e;e.prototype.init=function(c,d,b,e){r.prototype.init.call(this,c,d,b,e);this.edgeLen=this.extent[2]-this.extent[0];this.curvatureHeight=0;this.centerAtSeaLevel[0]=a.lerp(this.extent[0],this.extent[2],.5);this.centerAtSeaLevel[1]=a.lerp(this.extent[1],this.extent[3],.5);this.centerAtSeaLevel[2]=0;this.updateRadiusAndCenter()};e.prototype.updateRadiusAndCenter=function(){r.prototype.updateRadiusAndCenter.call(this);
- var a=(this.extent[2]-this.extent[0])*Math.SQRT1_2,c=.5*(this.elevationBounds[0]-this.elevationBounds[1]);this.radius=Math.sqrt(a*a+c*c)};e.prototype.isVisible=function(a){if(!this.intersectsClippingArea)return!1;var c=this.extent[0],b=this.extent[1],e=this.elevationBounds[0],f=this.extent[2],g=this.extent[3],h=this.elevationBounds[1];return 0<a[0][0]*(0<a[0][0]?c:f)+a[0][1]*(0<a[0][1]?b:g)+a[0][2]*(0<a[0][2]?e:h)+a[0][3]||0<a[1][0]*(0<a[1][0]?c:f)+a[1][1]*(0<a[1][1]?b:g)+a[1][2]*(0<a[1][2]?e:h)+
- a[1][3]||0<a[2][0]*(0<a[2][0]?c:f)+a[2][1]*(0<a[2][1]?b:g)+a[2][2]*(0<a[2][2]?e:h)+a[2][3]||0<a[3][0]*(0<a[3][0]?c:f)+a[3][1]*(0<a[3][1]?b:g)+a[3][2]*(0<a[3][2]?e:h)+a[3][3]||0<a[4][0]*(0<a[4][0]?c:f)+a[4][1]*(0<a[4][1]?b:g)+a[4][2]*(0<a[4][2]?e:h)+a[4][3]||0<a[5][0]*(0<a[5][0]?c:f)+a[5][1]*(0<a[5][1]?b:g)+a[5][2]*(0<a[5][2]?e:h)+a[5][3]?!1:!0};e.prototype._numSubdivisionsAtLevel=[2,2,2,2,2,2,2,2];e.prototype.createGeometry=function(a,c,b,e){a.needsUpdate=!1;h.createPlanarGlobeTile(a.numVertsPerRow,
- this.extent,a.samplerData,c,b,a.clippingArea,e)};e.Pool=new f(e);return e})},"esri/views/3d/terrain/TileBase":function(){define("./terrainUtils ./tileUtils ./TerrainConst ./ElevationData ./TilePerLayerInfo ./ElevationTileAgent ./MapTileAgent ../support/mathUtils ../lib/glMatrix ../../../core/arrayUtils".split(" "),function(r,h,f,a,e,c,g,d,b,k){var l=b.vec3d,p=b.vec2d,n=b.vec4d,t=b.mat4d,u=r.weakAssert,q=l.create(),v=n.create(),x=n.create(),m=l.create(),B=g.AGENT_DONE,z=f.LayerClass.LAYER_CLASS_COUNT,
- C=f.LayerClass.MAP,A=f.LayerClass.ELEVATION,D=f.TileUpdateTypes;b=function(a,b,c){this.lij=[0,0,0];this.extent=n.create();this.extentWGS84Rad=n.create();this.centerAtSeaLevel=l.create();this.center=l.create();this.tileUp=m;this.elevationBounds=p.create();this.children=[null,null,null,null];this.layerInfo=Array(z);this.intersectsClippingArea=this.isWithinClippingArea=!0;this.clippingArea=null;this._maxTesselation=0};b.prototype.init=function(a,b,c,d){this.lij[0]=a[0];this.lij[1]=a[1];this.lij[2]=a[2];
- d.getExtent(a[0],a[1],a[2],this.extent,this.extentWGS84Rad);this.intersectsClippingArea=this.isWithinClippingArea=!0;this.clippingArea=null;this.radius=this.edgeLen=0;this.vlevel=a?a[0]:0;b&&b.elevationBounds?p.set(b.elevationBounds,this.elevationBounds):p.set2(0,0,this.elevationBounds);this.parent=b;for(a=0;4>a;a++)this.children[a]=null;this.pendingUpdates=0;this.renderData=null;this.renderOrder=this.screenDepth=0;this.visible=!1;this.parentSurface=c;for(a=0;a<z;a++)if(c){b=c.numLayers(a);var g;
- this.layerInfo[a]?(g=this.layerInfo[a],g.length=b):(g=Array(b),this.layerInfo[a]=g);for(var k=0;k<b;k++)g[k]=e.makeEmptyLayerInfo(a,g[k]),a==A&&this.findElevationBoundsForLayer(k,-1)}else this.layerInfo[a]=null;this.computeElevationBounds();this._maxTesselation=Math.min(d.pixelSize[0],f.MAX_TILE_TESSELATION)};b.prototype.dispose=function(){for(var a=0;a<z;a++)for(var b=this.layerInfo[a],c=0;c<b.length;c++)b[c].dispose()};b.prototype.updateScreenDepth=function(a){l.set(this.center,x);x[3]=1;t.multiplyVec4(a,
- x,x);this.screenDepth=x[2]/x[3]};b.prototype.shouldSplit=function(a,b){var c=this.lij[0];l.subtract(this.center,b,q);var e=l.length(q),f=this.edgeLen/(a[0]*e*2),e=this.edgeLen/(a[2]*e*2),g=a[1],k=a[3],h=a[4];a=a[5];return f<g?this.vlevel!==this.lij[0]?(this.vlevel=this.lij[0],D.VSPLITMERGE):D.NONE:c>=h?(b=c+Math.ceil(-d.log2(g/f)),b!==this.vlevel?(this.vlevel=b,D.VSPLITMERGE):D.NONE):6<c&&(l.scale(this.tileUp,l.dot(this.tileUp,q),v),l.subtract(v,q),l.length2(v)>this.radius*this.radius&&(l.scale(v,
- this.radius/l.length(v)),l.add(v,this.center),l.subtract(b,v,v),b=this.elevationBounds[1]-this.elevationBounds[0],Math.min(1,(Math.abs(l.dot(v,this.tileUp))+.5*b+this.curvatureHeight)/l.length(v))*e<.1/a*k))?D.NONE:D.SPLIT};b.prototype.decodeElevationData=function(b){var c;if(b instanceof ArrayBuffer)try{c=a.createFromLERC(this.lij,this.extent,b,f.noDataValueOpt)}catch(I){console.warn("Error decoding %s: %s",b.url,I.message)}else c=a.createFromFetchTileResult(this.lij,this.extent,b);return c};b.prototype.getWGS84Extent=
- function(){return this.extentWGS84Rad.map(d.rad2deg)};b.prototype.load=function(a){for(var b=0;b<z;b++)this.layerInfo[b]&&this._createOrUpdateAgents(0,b);a.loadTile(this)};b.prototype.unload=function(a){this.renderData&&a.unloadTile(this);for(a=0;a<z;a++)for(var b=this.layerInfo[a],d=0;d<b.length;d++){var e=b[d];e.loadingAgent&&e.loadingAgent!==B&&(e.loadingAgent.dispose(),(a===f.LayerClass.ELEVATION?c:g).Pool.release(e.loadingAgent),e.loadingAgent=null);e.pendingUpdates=0}this.pendingUpdates&=~f.TileUpdateTypes.UPDATE_GEOMETRY;
- this.pendingUpdates&=~f.TileUpdateTypes.UPDATE_TEXTURE};b.prototype.updateClippingStatus=function(a){if(k.equals(a,this.clippingArea))return!1;var b=this.intersectsClippingArea,c=this.isWithinClippingArea;a?(this.intersectsClippingArea=this.intersectsExtent(a),this.isWithinClippingArea=this.isWithinExtent(a)):this.isWithinClippingArea=this.intersectsClippingArea=!0;this.clippingArea=a;a=c&&this.isWithinClippingArea;b=!c&&!b&&!this.isWithinClippingArea&&!this.intersectsClippingArea;!this.renderData||
- a||b||this.updateGeometry();return!0};b.prototype.updateVisibility=function(a,b,c){a=(c||this.isVisible(a,b))&&this.intersectsClippingArea;if(a!==this.visible)for(this.visible=a,b=this.layerInfo[0],c=0;c<b.length;c++){var d=b[c];d.loadingAgent&&d.loadingAgent!==B&&d.loadingAgent.setSuspension(!a)}return a};b.prototype.getLayerInfo=function(a,b){return this.layerInfo[b][a]};b.prototype.hasLayerData=function(a,b){return(a=this.layerInfo[b][a])&&a.data&&!a.dataInvalidated};b.prototype.tileDataAvailable=
- function(a,b,c){return(b=this.layerInfo[c][b].tilemap)?"unavailable"!==b.getAvailability(a.lij[1],a.lij[2]):!0};b.prototype.requestLayerData=function(a,b,c){f.TILE_LOADING_DEBUGLOG&&console.log("tile %s layer %d/%d requested by tile %s",this.lij.toString(),b,a,c.tile.lij.toString());var d=this.layerInfo[b][a];if(-1<d.waitingAgents.indexOf(c))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),c.tile.lij.toString(),b,a),!0;
- if(d.data&&!d.dataInvalidated)return console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this.lij.toString(),c.tile.lij.toString(),b,a),d.waitingAgents.push(c),setTimeout(c.dataArrived.bind(c,this),0),!0;if(d.pendingUpdates&D.DECODE_ELEVATION)return d.waitingAgents.push(c),!0;d.waitingAgents.push(c);if(!d.requestPromise){var e=this.parentSurface.requestTileData(this,a,b);if(e.isFulfilled())return!1;a=function(){d.requestPromise===e&&(d.requestPromise=null)};d.requestPromise=
- e;e.then(a,a);return!!e}return!0};b.prototype.descendants=function(a){a||(a=[]);for(var b=0;4>b;b++){var c=this.children[b];c&&(c.descendants(a),a.unshift(this.children[b]))}return a};b.prototype.isLij=function(a){return this.lij[0]===a[0]&&this.lij[1]===a[1]&&this.lij[2]==a[2]};b.prototype.findByLij=function(a){if(this.isLij(a))return this;for(var b=0;4>b;b++){var c=this.children[b];if(c&&(c=c.findByLij(a)))return c}return null};b.prototype.unrequestLayerData=function(a,b,c){f.TILE_LOADING_DEBUGLOG&&
- console.log("tile %s layer %d/%d canceled by tile %s",this.lij.toString(),b,a,c.tile.lij.toString());var d=this.layerInfo[b][a],e=d.waitingAgents;c=e.indexOf(c);u(-1<c,"agent has not requested this piece of map data");e[c]=e[e.length-1];e.length--;1>e.length&&(e=d.requestPromise,c=!1,b===C&&(c=this.parentSurface.layerViewByIndex(a,C),c=r.isVectorTileLayerView(c)),c||u(e||d.rawData,"no pending operations on layerInfo that agents were waiting for"),e&&!e.isFulfilled()&&(e.cancel(),d.requestPromise=
- null),f.TILE_LOADING_DEBUGLOG&&console.log("tile %s layer %d/%d request/loading canceled",this.lij.toString(),b,a))};b.prototype.dataArrived=function(a,b,c){a=this.layerInfo[b][a];a.data=c;a.dataInvalidated=!1;for(c=0;c<a.waitingAgents.length;c++)a.waitingAgents[c].dataArrived(this);a.waitingAgents.length=0};b.prototype.dataMissing=function(a,b,c){c.notInTilemap||console.error("Tile %s layer %d/%d error",this.lij.toString(),b,a);a=this.layerInfo[b][a];a.dataMissing=!0;for(b=0;b<a.waitingAgents.length;b++)a.waitingAgents[b].dataMissing(this);
- a.waitingAgents.length=0};b.prototype.updateTexture=function(a){this.renderData&&(a?this.parentSurface._renderer.updateTileTexture(this):(this.pendingUpdates|=f.TileUpdateTypes.UPDATE_TEXTURE,this.parentSurface._pendingUpdates=!0))};b.prototype.invalidateLayerData=function(a,b){this.layerInfo[b][a].invalidateSourceData();this.restartAgents(b)};b.prototype.computeElevationBounds=function(){p.set2(Number.MAX_VALUE,-Number.MAX_VALUE,this.elevationBounds);for(var a=this.layerInfo[A],b=!1,c=0;c<a.length;c++){var d=
- a[c];d.elevationBounds&&(this.elevationBounds[0]=Math.min(this.elevationBounds[0],d.elevationBounds[0]),this.elevationBounds[1]=Math.max(this.elevationBounds[1],d.elevationBounds[1]),b=!0)}b||p.set2(0,0,this.elevationBounds);this.updateRadiusAndCenter()};b.prototype.updateRadiusAndCenter=function(){l.scale(this.tileUp,.5*(this.elevationBounds[0]+this.elevationBounds[1]),v);l.add(this.centerAtSeaLevel,v,this.center)};b.prototype.findElevationBoundsForLayer=function(a,b){var c=this.layerInfo[A][a];
- if(!c.elevationBounds||c.elevationBounds[2]<b)if(b=this.parentSurface.layerViewByIndex(a,A),h.fallsWithinLayer(this,b.layer,!1)){b=!1;if(c.data)p.set(c.data.bounds,v),v[2]=this.lij[0],b=!0;else{for(var d=this.parent,e=0,g=null,k=c.data;d&&(!k||e<f.ELEVATION_DESIRED_RESOLUTION_LEVEL);){e=this.vlevel-d.lij[0];g=k||g;k=d.layerInfo[A][a].data;if(!k&&g&&e>=f.ELEVATION_DESIRED_RESOLUTION_LEVEL)break;d=d.parent}if(k=k||g)k.computeMinMaxValue(this.lij[0],this.lij[1],this.lij[2],v),Infinity!==v[0]&&(v[2]=
- k.level,b=!0)}b&&(c.elevationBounds?l.set(v,c.elevationBounds):c.elevationBounds=[v[0],v[1],v[2]])}};b.prototype.updateGeometry=function(){this.pendingUpdates|=f.TileUpdateTypes.UPDATE_GEOMETRY;this.parentSurface._pendingUpdates=!0};b.prototype.modifyLayers=function(a,b,d){for(var k=b.length,h=this.layerInfo[d],l=Array(k),m=0;m<h.length;m++){var n=h[m];n.loadingAgent&&n.loadingAgent!==B&&(n.loadingAgent.dispose(),(d===f.LayerClass.ELEVATION?c:g).Pool.release(n.loadingAgent),n.loadingAgent=null);n.waitingAgents.length=
- 0}if(d===C)for(m=0;m<h.length;m++)void 0===a[m]&&h[m].dispose();for(m=0;m<k;m++)a=b[m],l[m]=-1<a?h[a]:e.makeEmptyLayerInfo(d);this.layerInfo[d]=l};b.prototype.restartAgents=function(a){if(this.renderData)if(this._createOrUpdateAgents(0,a),a===A){this.updateGeometry();a=this.layerInfo[a];for(var b=0;b<a.length;b++)a[b].pendingUpdates|=f.TileUpdateTypes.UPDATE_GEOMETRY;this.parentSurface._pendingUpdates=!0}else this.updateTexture(!0)};b.prototype.updateAgents=function(a){if(this.renderData){for(var b=
- this.layerInfo[a],c=0;c<b.length;c++){var d=b[c];d.loadingAgent===B&&(d.loadingAgent=null)}this._createOrUpdateAgents(0,a)}};b.prototype.removeLayerAgent=function(a,b){a=this.layerInfo[b][a];a.loadingAgent&&a.loadingAgent!==B&&a.loadingAgent.dispose();a.loadingAgent=null};b.prototype.agentDone=function(a,b){var c=this.layerInfo[b],d=c[a];d.loadingAgent=B;d.data||d.upsampleFromTile||a<c.length-1&&this._createOrUpdateAgents(a+1,b)};b.prototype._createOrUpdateAgents=function(a,b){var d;d=b===A?!1:!this.visible;
- for(var e=this.layerInfo[b];a<e.length;){var k=e[a],l=!1,m=this.parentSurface.layerViewByIndex(a,b);if(null!==k.loadingAgent&&k.loadingAgent!==B)l=k.loadingAgent.update();else if(k.loadingAgent!==B&&h.fallsWithinLayer(this,m.layer,!1)){var n=b===f.LayerClass.ELEVATION?c:g,q=n.Pool.acquire();(l=q.init(this,a,b,d))?k.loadingAgent=q:(q.dispose(),n.Pool.release(q),k.loadingAgent=B)}if(l&&!m.isTransparent)break;a++}};b.prototype.geometryState=function(a){var b,c=this._getElevationInfo(a?a.samplerData:
- null),e=this.lij[0],g=!1;c.samplerData?(b=this.vlevel-e,b=Math.max(e-c.maxTileLevel,f.ELEVATION_DESIRED_RESOLUTION_LEVEL-b),e=this._maxTesselation,b=d.clamp((e>>b)+1,2,e+1)):b=8>e?this._numSubdivisionsAtLevel[e]+1:2;e=this.clippingArea;if(!this.intersectsClippingArea||this.isWithinClippingArea)e=null;a?(a.numVertsPerRow!==b&&(a.numVertsPerRow=b,g=!0),c.changed&&(a.samplerData=c.samplerData,g=!0),k.equals(a.clippingArea,e)||(a.clippingArea=e,g=!0),a.needsUpdate=g):a={numVertsPerRow:b,samplerData:c.samplerData,
- needsUpdate:!0,clippingArea:e};return a};b.prototype._getElevationInfo=function(a){for(var b=this.layerInfo[A],c=b.length,d=Array(c),e=0,f=0,g=!1,k=0;k<c;k++){var l=b[k];if(l.upsampleFromTile){var l=l.upsampleFromTile.tile,m=l.layerInfo[A][k].data;a&&a[e]===m.samplerData||(g=!0);d[e++]=m.samplerData;f=Math.max(f,l.lij[0])}else l.data&&(m=this.parentSurface.layerViewByIndex(k,A),h.fallsWithinLayer(this,m.layer,!1)&&(a&&a[e]===l.data.samplerData||(g=!0),d[e++]=l.data.samplerData,f=this.lij[0]))}a&&
- a.length!==e&&(g=!0);0<e?d.length=e:d=null;return{changed:g,samplerData:d,maxTileLevel:f}};b.prototype.isWithinExtent=function(a){var b=this.extent;return b[0]>=a[0]&&a[2]>=b[2]&&b[1]>=a[1]&&a[3]>=b[3]};b.prototype.intersectsExtent=function(a){var b=this.extent;return b[2]>=a[0]&&a[2]>=b[0]&&b[3]>=a[1]&&a[3]>=b[1]};return b})},"esri/views/3d/terrain/terrainUtils":function(){define("require exports ../../../layers/BaseElevationLayer ../../../layers/BaseTileLayer ../../../layers/ElevationLayer ../../../layers/TiledLayer ../../../layers/TileLayer ../../../layers/VectorTileLayer ../../../layers/WMTSLayer ../../../support/basemapDefinitions ./terrainUtilsPlanar ./terrainUtilsSpherical".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){function n(a){return a&&"esri.views.3d.layers.TileLayerView3D"===a.declaredClass}function t(a){return a&&"esri.views.3d.layers.VectorTileLayerView3D"===a.declaredClass}function u(a){return a&&"esri.views.3d.layers.WMTSLayerView3D"===a.declaredClass}function q(a){return a&&"esri.views.3d.layers.ElevationLayerView3D"===a.declaredClass}function v(){B={};for(var a in k)k[a].baseMapLayers.forEach(function(a){B[a.url]=19});B["//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"]=
- 20}function x(a,b,c,d){return m["local"===d||"planar"===d?"planar":"spherical"].checkIfTileInfoSupportedForViewSR(a,b,c)}Object.defineProperty(h,"__esModule",{value:!0});var m={planar:l,spherical:p};h.weakAssert=function(a,b){a||console.warn("Terrain: "+b)};h.autoUpdateSkirtsVisibility=function(a,b){m[a.manifold].autoUpdateSkirtsVisibility(a,b)};h.isTiledLayer=function(d){return d&&(d.isInstanceOf(c)||d.isInstanceOf(a)||d.isInstanceOf(f)||d.isInstanceOf(b))};h.isVectorTileLayer=function(a){return a&&
- a.isInstanceOf(d)};h.isTileLayerView=n;h.isVectorTileLayerView=t;h.isWMTSLayerView=u;h.isElevationLayerView=q;h.isTiledLayerView=function(a){return a&&(n(a)||q(a)||t(a)||u(a))};h.useFetchTileForLayer=function(a){return a.fetchTile&&!(a.fetchTile===g.prototype.fetchTile||a.fetchTile===e.prototype.fetchTile)};var B=null;h.getKnownTiledServiceLevelCap=function(a){B||v();a=a&&a.replace(/https?:/,"");return a in B?B[a]:Infinity};h.prepareKnownTiledServiceLevelCaps=v;h.checkIfTileInfoSupportedForView=x;
- h.getTiledLayerInfo=function(a,c,e){var f,g;if(a.isInstanceOf(b)){if(a=a.activeLayer){var k=a.tileMatrixSet;if(k)f=k.tileInfo,g=k.fullExtent;else if(a=a.tileMatrixSets)if(a=a.find(function(a){return null==x(a.tileInfo,a.fullExtent,c,e)}))return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}}else f=a.isInstanceOf(d)?a.compatibleTileInfo256:a.tileInfo,g=a.fullExtent;return f&&g&&null==x(f,g,c,e)?{tileInfo:f,fullExtent:g}:{tileInfo:null,fullExtent:null}}})},"esri/layers/BaseElevationLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/Error ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/Extent ../geometry/SpatialReference ./Layer ./support/TileInfo".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){var p={id:"0/0/0",level:0,row:0,col:0,extent:null};return function(k){function h(){var a=null!==k&&k.apply(this,arguments)||this;a.tileInfo=l.create({spatialReference:b.WebMercator,size:256});a.fullExtent=new d(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,b.WebMercator);a.spatialReference=b.WebMercator;a.type="base-elevation";return a}f(h,k);h.prototype.getTileBounds=function(a,b,c,d){d=d||[0,0,0,0];p.level=a;p.row=b;p.col=c;p.extent=d;this.tileInfo.updateTileInfo(p);
- p.extent=null;return d};h.prototype.fetchTile=function(a,b,c,d){throw new e("BaseElevationLayer:fetchtile-not-implemented","fetchTile() is not implemented");};h.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return c.reject(new e("base-elevation-layer:view-not-supported","BaseElevationLayer is only supported in 3D"));case "3d":return c.create(function(a){return r(["../views/3d/layers/ElevationLayerView3D"],a)})}};a([g.property({type:l})],h.prototype,"tileInfo",void 0);a([g.property()],
- h.prototype,"fullExtent",void 0);a([g.property()],h.prototype,"spatialReference",void 0);a([g.property({readOnly:!0,value:"base-elevation"})],h.prototype,"type",void 0);return h=a([g.subclass("esri.layers.BaseElevationLayer")],h)}(g.declared(k))})},"esri/layers/BaseTileLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/Error ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/Extent ../geometry/SpatialReference ./Layer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./support/TileInfo".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u){var q={id:"0/0/0",level:0,row:0,col:0,extent:null};return function(h){function n(){var a=null!==h&&h.apply(this,arguments)||this;a.tileInfo=u.create({spatialReference:l.WebMercator,size:256});a.type="base-tile";a.fullExtent=new k(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,l.WebMercator);a.spatialReference=l.WebMercator;return a}f(n,h);n.prototype.getTileBounds=function(a,b,c,d){d=d||[0,0,0,0];q.level=a;q.row=b;q.col=c;q.extent=d;
- this.tileInfo.updateTileInfo(q);q.extent=null;return d};n.prototype.getTileUrl=function(a,b,c){throw new g("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented");};n.prototype.fetchTile=function(a,b,d,f){a=this.getTileUrl(a,b,d);var g={responseType:"image"};f&&f.timestamp&&(g.query={_ts:f.timestamp});return"string"===typeof a?c(a,e.mixin({allowImageDataAccess:f&&f.allowImageDataAccess||!1},g)).then(function(a){return a.data}):a.then(function(a){return c(a,g)}).then(function(a){return a.data})};
- n.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return d.create(function(a){return r(["../views/2d/layers/TiledLayerView2D"],a)});case "3d":return d.create(function(a){return r(["../views/3d/layers/TileLayerView3D"],a)})}};a([b.property({type:u})],n.prototype,"tileInfo",void 0);a([b.property({readOnly:!0,value:"base-tile"})],n.prototype,"type",void 0);a([b.property()],n.prototype,"fullExtent",void 0);a([b.property()],n.prototype,"spatialReference",void 0);return n=a([b.subclass("esri.layers.BaseTileLayer")],
- n)}(b.declared(p,n,t))})},"esri/layers/VectorTileLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/Error ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/urlUtils ../core/urlUtils ../core/accessorSupport/decorators ../geometry/Extent ../geometry/SpatialReference ./TiledLayer ./mixins/ArcGISCachedService ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/ScaleRangeLayer ./support/TileInfo ./support/TilemapCache ./support/vectorTileLayerLoader ../portal/support/jsonContext ../views/vectorTiles/SchemaHelper ../views/vectorTiles/style/StyleRepository".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E){return function(d){function h(a,b){a=d.call(this)||this;a.capabilities=null;a.currentStyleInfo=null;a.fullExtent=null;a.style=null;a.operationalLayerType="VectorTileLayer";a.tileInfo=null;a.tilemapCache=null;a.type="vector-tile";a.url=null;return a}f(h,d);h.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?e.mixin({},{url:a},b):a};h.prototype.load=function(){var a=this,b=this.loadFromPortal({supportedTypes:["Vector Tile Service"],
- supportsData:!1}).then(function(){if(a.portalItem&&a.portalItem.id){var b=a.portalItem.itemUrl+"/resources/styles/root.json";return c(b,{query:{f:"json"}}).then(function(c){c.data&&a.read({url:b},A.createForItem(a.portalItem))})}}).always(function(){return a.loadStyle()});this.addResolvingPromise(b);return this.when()};Object.defineProperty(h.prototype,"attributionDataUrl",{get:function(){var a=this.currentStyleInfo;return(a=a&&a.serviceUrl&&l.urlToObject(a.serviceUrl))?this._getDefaultAttribution(a.path):
- null},enumerable:!0,configurable:!0});h.prototype.readCapabilities=function(a,b){return{supportsExportTiles:!!(b&&b.hasOwnProperty("exportTilesAllowed")&&b.exportTilesAllowed),supportsTileMapIndexing:b.capabilities?-1!==b.capabilities.toLowerCase().indexOf("tilemap"):!1}};Object.defineProperty(h.prototype,"parsedUrl",{get:function(){return this.serviceUrl?k.urlToObject(this.serviceUrl):null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"serviceUrl",{get:function(){return this.currentStyleInfo&&
- this.currentStyleInfo.serviceUrl||null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"spatialReference",{get:function(){return this.tileInfo&&this.tileInfo.spatialReference||null},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"styleUrl",{get:function(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null},enumerable:!0,configurable:!0});h.prototype.writeStyleUrl=function(a,b){a&&l.isProtocolRelative(a)&&(a="https:"+a);b.styleUrl=a};h.prototype.readTileIndexType=
- function(a,b){return b.type};h.prototype.readTileIndexUrl=function(a,b){return l.join(this.serviceUrl,b.tileMap)};h.prototype.readTilemapCache=function(a,b){return b.capabilities&&-1<b.capabilities.indexOf("Tilemap")?new z({layer:this}):null};h.prototype.readTileServers=function(a,b){var c=this;a=b.tiles;this.serviceUrl&&a.forEach(function(a,b,d){d[b]=l.join(c.serviceUrl,a)});return a};h.prototype.readVersion=function(a,b){return b.version?parseFloat(b.version):parseFloat(b.currentVersion)};h.prototype.readCompatibleTileInfo256=
- function(a,b){return B.fromJSON(D.create256x256CompatibleTileInfo(b.tileInfo))};h.prototype.readCompatibleTileInfo512=function(a,b){return B.fromJSON(D.create512x512CompatibleTileInfo(b.tileInfo))};h.prototype.loadStyle=function(a){a=a||this.style||this.url;if(this._loadingPromise&&"string"===typeof a&&this.url===a)return this._loadingPromise;var b=this._loadingPromise;this._loadingPromise=this._getSourceAndStyle(a);b&&!b.isFulfilled()&&b.cancel();return this._loadingPromise};h.prototype.getTileUrl=
- function(a,b,c){var d=this.tileServers[b%this.tileServers.length];return d=d.replace(/\{z\}/gi,a.toString()).replace(/\{y\}/gi,b.toString()).replace(/\{x\}/gi,c.toString())};h.prototype.write=function(a,b){return b&&b.origin&&!this.styleUrl?(b.messages&&b.messages.push(new g("vectortilelayer:unsupported","VectorTileLayer ("+this.title+", "+this.id+") with style defined by JSON only are not supported",{layer:this})),null):this.inherited(arguments,[a,b])};h.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return b.create(function(a){return r(["../views/2d/layers/VectorTileLayerView2D"],
- a)});case "3d":return b.create(function(a){return r(["../views/3d/layers/VectorTileLayerView3D"],a)})}};h.prototype._getSourceAndStyle=function(a){var c=this;return a?C.loadMetadata(a).then(function(b){c._set("currentStyleInfo",{serviceUrl:b.serviceUrl,styleUrl:b.styleUrl,spriteUrl:b.spriteUrl,glyphsUrl:b.glyphsUrl,style:b.style,layerDefinition:b.layerDefinition});"string"===typeof a?(c.url=a,c.style=null):(c.url=null,c.style=a);c._set("styleRepository",new E(b.style,b));c.read(b.layerDefinition)}):
- b.reject(Error("invalid style!"))};h.prototype._getDefaultAttribution=function(a){var b=a.match(/^https?:\/\/(basemaps|basemapsbeta|basemapsdev)\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i);if(b&&(a=b[3]&&b[3].toLowerCase()))for(var b=b[2]||"",c=0,d=["World_Basemap","World_Basemap_v2","World_Basemap_GCS_v2","World_Basemap_WGS84"];c<d.length;c++){var e=d[c];if(-1<e.toLowerCase().indexOf(a))return l.normalize("//static.arcgis.com/attribution/Vector"+b+"/"+
- e)}};a([p.property({readOnly:!0,dependsOn:["currentStyleInfo"]})],h.prototype,"attributionDataUrl",null);a([p.property({readOnly:!0})],h.prototype,"capabilities",void 0);a([p.reader("capabilities",["exportTilesAllowed","capabilities"])],h.prototype,"readCapabilities",null);a([p.property({readOnly:!0})],h.prototype,"currentStyleInfo",void 0);a([p.property({type:n,readOnly:!0})],h.prototype,"fullExtent",void 0);a([p.property()],h.prototype,"style",void 0);a([p.property({readOnly:!0,dependsOn:["serviceUrl"]})],
- h.prototype,"parsedUrl",null);a([p.property({readOnly:!0,dependsOn:["currentStyleInfo"]})],h.prototype,"serviceUrl",null);a([p.property({type:t,dependsOn:["tileInfo"],readOnly:!0})],h.prototype,"spatialReference",null);a([p.property({readOnly:!0})],h.prototype,"styleRepository",void 0);a([p.property({type:String,readOnly:!0,dependsOn:["currentStyleInfo"],json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],h.prototype,"styleUrl",null);a([p.writer(["portal-item",
- "web-document"],"styleUrl")],h.prototype,"writeStyleUrl",null);a([p.property({readOnly:!0})],h.prototype,"tileIndexType",void 0);a([p.reader("tileIndexType",["tileIndexType","type"])],h.prototype,"readTileIndexType",null);a([p.property({readOnly:!0})],h.prototype,"tileIndexUrl",void 0);a([p.reader("tileIndexUrl",["tileIndexUrl","tileMap"])],h.prototype,"readTileIndexUrl",null);a([p.property({readOnly:!0,type:B})],h.prototype,"tileInfo",void 0);a([p.property({readOnly:!0,type:z})],h.prototype,"tilemapCache",
- void 0);a([p.reader("tilemapCache",["capabilities"])],h.prototype,"readTilemapCache",null);a([p.property({readOnly:!0})],h.prototype,"tileServers",void 0);a([p.reader("tileServers",["tiles"])],h.prototype,"readTileServers",null);a([p.property({json:{read:!1},readOnly:!0,value:"vector-tile"})],h.prototype,"type",void 0);a([p.property({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],h.prototype,"url",void 0);a([p.property({readOnly:!0})],
- h.prototype,"version",void 0);a([p.reader("version",["version","currentVersion"])],h.prototype,"readVersion",null);a([p.property({readOnly:!0})],h.prototype,"compatibleTileInfo256",void 0);a([p.reader("compatibleTileInfo256",["tileInfo"])],h.prototype,"readCompatibleTileInfo256",null);a([p.property({readOnly:!0})],h.prototype,"compatibleTileInfo512",void 0);a([p.reader("compatibleTileInfo512",["tileInfo"])],h.prototype,"readCompatibleTileInfo512",null);return h=a([p.subclass("esri.layers.VectorTileLayer")],
- h)}(p.declared(u,v,x,m,d,q))})},"esri/layers/support/vectorTileLayerLoader":function(){define("require exports dojo/has dojo/_base/lang ../../config ../../request ../../core/promiseUtils ../../core/urlUtils".split(" "),function(r,h,f,a,e,c,g,d){function b(a){if(a){var b=d.getOrigin(a);d.canUseXhr(b)||-1!==u.indexOf(b)||u.push(b);return a}}function k(a,b){var c=a.parsedUrl;if(null!=b.sources){var e=null;c&&(e=c.path.substring(0,c.path.lastIndexOf("/")),a.styleUrl=c.path);e||(e=(e=n(b,c))&&e.url);b.jsonUrl&&
- (a.styleUrl=b.jsonUrl);var c=b.sprite||null,f=b.glyphs||null;e&&(c&&!d.isAbsolute(c)&&(c=d.normalize(d.join(e,c))),f&&!d.isAbsolute(f)&&(f=d.normalize(d.join(e,f))));a.style=b;a.spriteUrl=c;a.glyphsUrl=f;return p(a,b)}if(b.hasOwnProperty("tileInfo"))return a.layerDefinition=b,a.serviceUrl=c.path,l(a,b)}function l(a,e){var f=a.parsedUrl;e=e.defaultStyles;d.isAbsolute(e)?a.styleUrl=d.normalize(e):a.styleUrl=d.normalize(d.join(f.path,e,"root.json"));b(a.styleUrl);return c(a.styleUrl,{responseType:"json"}).then(function(b){var c=
- b.data.sprite||null,e=b.data.glyphs||null,f=d.removeFile(a.styleUrl);c&&!d.isAbsolute(c)&&(c=d.normalize(d.join(f,c)));e&&!d.isAbsolute(e)&&(e=d.normalize(d.join(f,e)));a.spriteUrl=c;a.glyphsUrl=e;return a.style=b.data})}function p(a,e){var f=a.parsedUrl;(e=n(e,f))||g.reject("Source isn't available in the style object!");if(e.url)return a.serviceUrl=e.url,d.isAbsolute(a.serviceUrl)||(a.serviceUrl=d.join(f.path,a.serviceUrl)),b(a.serviceUrl),c(a.serviceUrl,{query:{f:"json"},responseType:"json"}).then(function(b){a.layerDefinition=
- t(b.data);return a});a.layerDefinition=t(e);return g.resolve(a)}function n(a,b){if(!a.sources)return null;var c=a.sources;a=null;if(c.esri)a=c.esri,b&&a.url&&!d.isAbsolute(a.url)&&(c=b.path.substring(0,b.path.lastIndexOf("/")),a.url=d.join(c,a.url));else{for(var e=0,f=Object.keys(c);e<f.length;e++)if(b=f[e],-1!==b.toLocaleLowerCase().indexOf("street")&&"vector"===a.type){a=c[b];break}if(!a)for(e=0,f=Object.keys(c);e<f.length&&(b=f[e],a=c[b],"vector"!==a.type);e++);}return a}function t(a){if(a.hasOwnProperty("tileInfo"))return a;
- for(var c={xmin:-2.0037507067161843E7,ymin:-2.0037507067161843E7,xmax:2.0037507067161843E7,ymax:2.0037507067161843E7,spatialReference:{wkid:102100}},d=(c.xmax-c.xmin)/512,e=[],f=a.hasOwnProperty("minzoom")?parseFloat(a.minzoom):0,g=a.hasOwnProperty("maxzoom")?parseFloat(a.maxzoom):16;f<g;f++){var k=d/Math.pow(2,f);e.push({level:f,scale:Math.floor(3779.527559055118*k),resolution:k})}a.tiles.forEach(b);return{capabilities:"TilesOnly",initialExtent:c,fullExtent:c,minScale:e[0].scale,maxScale:e[e.length-
- 1].scale,tiles:a.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-2.0037508342787E7,y:2.0037508342787E7},lods:e,spatialReference:{wkid:102100}}}}Object.defineProperty(h,"__esModule",{value:!0});var u=e.defaults&&e.defaults.io.corsEnabledServers||e.request.corsEnabledServers;h.loadMetadata=function(e){if(!e)return g.reject("invalid input URL!");var f={layerDefinition:null,parsedUrl:null,serviceUrl:null,style:null,styleUrl:null,url:null,spriteUrl:null,glyphsUrl:null};if("string"!==typeof e)return k(f,
- e).then(function(){return f});e=f.url=d.normalize(e);var h=f.parsedUrl=d.urlToObject(e);b(e);return c(h.path,{responseType:"json",query:a.mixin({f:"json"},h.query)}).then(function(a){return k(f,a.data)}).then(function(){return f})}})},"esri/portal/support/jsonContext":function(){define(["require","exports","../../core/urlUtils","../Portal"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.createForItem=function(e){return{origin:"portal-item",url:f.urlToObject(e.itemUrl),portal:e.portal||
- a.getDefault()}}})},"esri/views/vectorTiles/SchemaHelper":function(){define(["require","exports"],function(r,h){return function(){function f(a,e){this.lockedSchemaPixelSize=a;this.isWGS84=e}f.prototype.getCompatibleLevelRowCol=function(a){var e=a[0],c=a[1];a=a[2];this.isWGS84?(c>>=1,a>>=1):256===this.lockedSchemaPixelSize&&0<e&&(e--,c>>=1,a>>=1);return[e,c,a]};f.prototype.getSchemaShift=function(a,e){var c=0,f=0;if(256===this.lockedSchemaPixelSize||this.isWGS84)a[2]%2&&(c=2*e),a[1]%2&&(f=2*e);return[c,
- f]};f.prototype.adjustLevel=function(a){return this.isWGS84?a:256===this.lockedSchemaPixelSize?0<a?a-1:0:a};f.create256x256CompatibleTileInfo=function(a){if(!a)return null;if(256===a.rows&&256===a.cols)return a;for(var e=a.format,c=a.compressionQuality,f=a.dpi,d=a.origin,b=a.spatialReference,k=4326===b.wkid,h=[],p,n,t=a.lods.length,u=0;u<t;u++){var q=a.lods[u];p=q.scale;n=k?q.resolution:2*q.resolution;h.push({level:q.level,scale:p,resolution:n})}return{rows:256,cols:256,dpi:f,format:e,compressionQuality:c,
- origin:d,spatialReference:b,lods:h}};f.create512x512CompatibleTileInfo=function(a){if(!a||256===a.rows||256===a.cols)return null;for(var e=a.format,c=a.compressionQuality,f=a.dpi,d=a.origin,b=a.spatialReference,k=[],h,p,n=a.lods.length,t=0;t<n;t++){var u=a.lods[t];h=u.scale;p=.5*u.resolution;k.push({level:u.level,scale:h,resolution:p})}return{rows:512,cols:512,dpi:f,format:e,compressionQuality:c,origin:d,spatialReference:b,lods:k}};return f}()})},"esri/views/vectorTiles/style/StyleRepository":function(){define(["require",
- "exports","dojo/has","./StyleLayer"],function(r,h,f,a){return function(){function e(a,g){this.styleJSON=a;this.version=parseFloat(a.version);this.sprite=g?g.spriteUrl:a.sprite;this.glyphs=g?g.glyphsUrl:a.glyphs;if(f("stable-symbol-rendering")){var c=(a.layers||[]).filter(function(a){return a.layout&&a.layout["text-font"]})[0];c&&(a.layers||[]).forEach(function(a){a.layout&&a.layout["text-font"]&&(a.layout["text-font"]=c.layout["text-font"])})}this.layers=(a.layers||[]).map(e._create);this._identifyRefLayers()}
- e.prototype._identifyRefLayers=function(){for(var a=[],e=[],d=0,b=0,f=this.layers;b<f.length;b++){var h=f[b];if(1===h.type){var p=h,n=h.sourceLayer,n=n+("|"+JSON.stringify(h.minzoom)),n=n+("|"+JSON.stringify(h.maxzoom)),n=n+("|"+JSON.stringify(h.filter));if(p.hasDataDrivenFill||p.hasDataDrivenOutline)n+="|"+JSON.stringify(d);a.push({key:n,layer:h})}2===h.type&&(p=h,n=h.sourceLayer,n+="|"+JSON.stringify(h.minzoom),n+="|"+JSON.stringify(h.maxzoom),n+="|"+JSON.stringify(h.filter),n+="|"+JSON.stringify(h.layout&&
- h.layout["line-cap"]),n+="|"+JSON.stringify(h.layout&&h.layout["line-join"]),p.hasDataDrivenLine&&(n+="|"+JSON.stringify(d)),e.push({key:n,layer:h}));++d}this._assignRefLayers(a);this._assignRefLayers(e)};e.prototype._assignRefLayers=function(a){a.sort(function(a,b){return a.key<b.key?-1:a.key>b.key?1:0});for(var c,d,b=a.length,e=0;e<b;e++){var f=a[e];if(f.key===c)f.layer.refLayerId=d;else if(c=f.key,d=f.layer.id,1===f.layer.type&&!f.layer.getPaintProperty("fill-outline-color"))for(var h=e+1;h<b;h++){var n=
- a[h];if(n.key===c){if(n.layer.getPaintProperty("fill-outline-color")){a[e]=n;a[h]=f;d=n.layer.id;break}}else break}}};e._create=function(c,e,d){e=1-1/(d.length+1)*(1+e);switch(c.type){case "background":return new a.BackgroundStyleLayer(0,c,e);case "fill":return new a.FillStyleLayer(1,c,e);case "line":return new a.LineStyleLayer(2,c,e);case "symbol":return new a.SymbolStyleLayer(3,c,e);case "raster":throw Error("Unsupported vector tile raster layer");case "circle":return new a.CircleStyleLayer(4,c,
- e)}throw Error("Unknown vector tile layer");};return e}()})},"esri/views/vectorTiles/style/StyleLayer":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ./Filter ./StyleDefinition ./StyleProperty".split(" "),function(r,h,f,a,e,c,g){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a,d,e){this.type=a;this.id=d.id;this.source=d.source;this.sourceLayer=d["source-layer"];this.minzoom=d.minzoom;this.maxzoom=d.maxzoom;
- this.filter=d.filter;this.layout=d.layout;this.paint=d.paint;this.z=e;switch(a){case 0:this._layoutDefinition=c.StyleDefinition.backgroundLayoutDefinition;this._paintDefinition=c.StyleDefinition.backgroundPaintDefinition;break;case 1:this._layoutDefinition=c.StyleDefinition.fillLayoutDefinition;this._paintDefinition=c.StyleDefinition.fillPaintDefinition;break;case 2:this._layoutDefinition=c.StyleDefinition.lineLayoutDefinition;this._paintDefinition=c.StyleDefinition.linePaintDefinition;break;case 3:this._layoutDefinition=
- c.StyleDefinition.symbolLayoutDefinition;this._paintDefinition=c.StyleDefinition.symbolPaintDefinition;break;case 4:this._layoutDefinition=c.StyleDefinition.circleLayoutDefinition,this._paintDefinition=c.StyleDefinition.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout);this._paintProperties=this._parsePaint(this.paint)}a.prototype.getFeatureFilter=function(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=e.createFilter(this.filter)};a.prototype.getLayoutProperty=
- function(a){var b=this._layoutProperties;if(b)return b[a]};a.prototype.getPaintProperty=function(a){var b=this._paintProperties;if(b)return b[a]};a.prototype.getLayoutValue=function(a,c,d){var b,e=this._layoutProperties;e&&(e=e[a])&&(b=e.getValue(c,d));a=this._layoutDefinition[a];void 0===b&&(b=a["default"]);"enum"===a.type&&(b=a.values.indexOf(b));return b};a.prototype.getPaintValue=function(a,c,d){var b,e=this._paintProperties;e&&(e=e[a])&&(b=e.getValue(c,d));a=this._paintDefinition[a];void 0===
- b&&(b=a["default"]);"enum"===a.type&&(b=a.values.indexOf(b));return b};a.prototype._parseLayout=function(a){var b={},c;for(c in a){var d=this._layoutDefinition[c];d&&(b[c]=new g(c,d,a[c]))}return b};a.prototype._parsePaint=function(a){var b={},c;for(c in a){var d=this._paintDefinition[c];d&&(b[c]=new g(c,d,a[c]))}return b};return a}();h.StyleLayer=r;a=function(a){function b(b,c,d){return a.call(this,b,c,d)||this}f(b,a);return b}(r);h.BackgroundStyleLayer=a;a=function(a){function b(b,c,d){b=a.call(this,
- b,c,d)||this;b.hasDataDrivenFill=!1;(c=b.getPaintProperty("fill-color"))&&c.isDataDriven&&(b.hasDataDrivenFill=!0);(d=b.getPaintProperty("fill-opacity"))&&d.isDataDriven&&(b.hasDataDrivenFill=!0);b.hasDataDrivenOutline=!1;(d=b.getPaintProperty("fill-outline-color"))&&d.isDataDriven&&(b.hasDataDrivenOutline=!0);!d&&c&&c.isDataDriven&&(b.hasDataDrivenOutline=!0);return b}f(b,a);return b}(r);h.FillStyleLayer=a;a=function(a){function b(b,c,d){b=a.call(this,b,c,d)||this;b.hasDataDrivenLine=!1;(c=b.getPaintProperty("line-color"))&&
- c.isDataDriven&&(b.hasDataDrivenLine=!0);(c=b.getPaintProperty("line-opacity"))&&c.isDataDriven&&(b.hasDataDrivenLine=!0);(c=b.getPaintProperty("line-width"))&&c.isDataDriven&&(b.hasDataDrivenLine=!0);return b}f(b,a);return b}(r);h.LineStyleLayer=a;a=function(a){function b(b,c,d){b=a.call(this,b,c,d)||this;b.hasDataDrivenIcon=!1;(c=b.getPaintProperty("icon-color"))&&c.isDataDriven&&(b.hasDataDrivenIcon=!0);(c=b.getPaintProperty("icon-opacity"))&&c.isDataDriven&&(b.hasDataDrivenIcon=!0);(c=b.getLayoutProperty("icon-size"))&&
- c.isDataDriven&&(b.hasDataDrivenIcon=!0);b.hasDataDrivenText=!1;(c=b.getPaintProperty("text-color"))&&c.isDataDriven&&(b.hasDataDrivenText=!0);(c=b.getPaintProperty("text-opacity"))&&c.isDataDriven&&(b.hasDataDrivenText=!0);(c=b.getLayoutProperty("text-size"))&&c.isDataDriven&&(b.hasDataDrivenText=!0);return b}f(b,a);return b}(r);h.SymbolStyleLayer=a;r=function(a){function b(b,c,d){return a.call(this,b,c,d)||this}f(b,a);return b}(r);h.CircleStyleLayer=r;r=function(){return function(a,b,c){this.cap=
- a.getLayoutValue("line-cap",b,c);this.join=a.getLayoutValue("line-join",b,c);this.miterLimit=a.getLayoutValue("line-miter-limit",b,c);this.roundLimit=a.getLayoutValue("line-round-limit",b,c)}}();h.LineLayout=r;r=function(){return function(a,b,c,e){this.allowOverlap=a.getLayoutValue("icon-allow-overlap",b,e);this.ignorePlacement=a.getLayoutValue("icon-ignore-placement",b,e);this.optional=a.getLayoutValue("icon-optional",b,e);this.rotationAlignment=a.getLayoutValue("icon-rotation-alignment",b,e);this.size=
- a.getLayoutValue("icon-size",b,e);this.rotate=a.getLayoutValue("icon-rotate",b,e);this.padding=a.getLayoutValue("icon-padding",b,e);this.keepUpright=a.getLayoutValue("icon-keep-upright",b,e);this.offset=a.getLayoutValue("icon-offset",b,e);2===this.rotationAlignment&&(this.rotationAlignment=c?0:1)}}();h.IconLayout=r;r=function(){return function(a,b,c,e){this.allowOverlap=a.getLayoutValue("text-allow-overlap",b,e);this.ignorePlacement=a.getLayoutValue("text-ignore-placement",b,e);this.optional=a.getLayoutValue("text-optional",
- b,e);this.rotationAlignment=a.getLayoutValue("text-rotation-alignment",b,e);this.fontArray=a.getLayoutValue("text-font",b,e);this.maxWidth=a.getLayoutValue("text-max-width",b,e);this.lineHeight=a.getLayoutValue("text-line-height",b,e);this.letterSpacing=a.getLayoutValue("text-letter-spacing",b,e);this.justify=a.getLayoutValue("text-justify",b,e);this.anchor=a.getLayoutValue("text-anchor",b,e);this.maxAngle=a.getLayoutValue("text-max-angle",b,e);this.size=a.getLayoutValue("text-size",b,e);this.rotate=
- a.getLayoutValue("text-rotate",b,e);this.padding=a.getLayoutValue("text-padding",b,e);this.keepUpright=a.getLayoutValue("text-keep-upright",b,e);this.transform=a.getLayoutValue("text-transform",b,e);this.offset=a.getLayoutValue("text-offset",b,e);2===this.rotationAlignment&&(this.rotationAlignment=c?0:1)}}();h.TextLayout=r})},"esri/views/vectorTiles/style/Filter":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c){this._op=a;"$type"===e?(this._val=c instanceof
- Array?c.map(function(a){return f._types.indexOf(a)}):f._types.indexOf(c),this._op+=11):(this._key=e,this._val=c)}f.prototype.filter=function(a){switch(this._op){case 0:return this._val;case 1:return a.values[this._key]===this._val;case 2:return a.values[this._key]!==this._val;case 3:return a.values[this._key]<this._val;case 4:return a.values[this._key]>this._val;case 5:return a.values[this._key]<=this._val;case 6:return a.values[this._key]>=this._val;case 7:return-1!==this._val.indexOf(a.values[this._key]);
- case 8:return-1===this._val.indexOf(a.values[this._key]);case 9:for(var e=0,c=this._val;e<c.length;e++){var f=c[e];if(f.filter(a))return!0}return!1;case 10:e=0;for(c=this._val;e<c.length;e++)if(f=c[e],!f.filter(a))return!1;return!0;case 11:e=0;for(c=this._val;e<c.length;e++)if(f=c[e],f.filter(a))return!1;return!0;case 12:return a.type===this._val;case 13:return a.type!==this._val;case 14:return a.type<this._val;case 15:return a.type>this._val;case 16:return a.type>=this._val;case 17:return a.type<=
- this._val;case 18:return-1!==this._val.indexOf(a.type);case 19:return-1===this._val.indexOf(a.type)}};f.createFilter=function(a){if(!a)return new f(0,void 0,!0);var e=a[0];if(1>=a.length)return new f(0,void 0,"any"!==e);switch(e){case "\x3d\x3d":return new f(1,a[1],a[2]);case "!\x3d":return new f(2,a[1],a[2]);case "\x3e":return new f(4,a[1],a[2]);case "\x3c":return new f(3,a[1],a[2]);case "\x3e\x3d":return new f(6,a[1],a[2]);case "\x3c\x3d":return new f(5,a[1],a[2]);case "in":return new f(7,a[1],
- a.slice(2));case "!in":return new f(8,a[1],a.slice(2));case "any":return new f(9,void 0,a.slice(1).map(f.createFilter.bind(this)));case "all":return new f(10,void 0,a.slice(1).map(f.createFilter.bind(this)));case "none":return new f(11,void 0,a.slice(1).map(f.createFilter.bind(this)));default:throw Error("invalid operator: "+e);}};f._types=["Unknown","Point","LineString","Polygon"];return f}()})},"esri/views/vectorTiles/style/StyleDefinition":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,
- "__esModule",{value:!0});r=function(){function f(){}f.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};f.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};f.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"},"line-cap":{type:"enum",values:["butt","round","square"],"default":"butt"},"line-join":{type:"enum",values:["bevel","round","miter"],"default":"miter"},"line-miter-limit":{type:"number",
- "default":2},"line-round-limit":{type:"number","default":1.05}};f.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"},"symbol-placement":{type:"enum",values:["point","line"],"default":"point"},"symbol-spacing":{type:"number",minimum:1,"default":250},"symbol-avoid-edges":{type:"boolean","default":!1},"icon-image":{type:"string"},"icon-allow-overlap":{type:"boolean","default":!1},"icon-ignore-placement":{type:"boolean","default":!1},"icon-optional":{type:"boolean",
- "default":!1},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],"default":"auto"},"icon-size":{type:"number",minimum:0,"default":1},"icon-rotate":{type:"number","default":0},"icon-padding":{type:"number",minimum:0,"default":2},"icon-keep-upright":{type:"boolean","default":!1},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0]},"text-field":{type:"string"},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],"default":"auto"},"text-font":{type:"array",
- value:"string","default":["Open Sans Regular","Arial Unicode MS Regular"]},"text-size":{type:"number",minimum:0,"default":16},"text-max-width":{type:"number",minimum:0,"default":10},"text-line-height":{type:"number","default":1.2},"text-letter-spacing":{type:"number","default":0},"text-justify":{type:"enum",values:["left","center","right"],"default":"center"},"text-anchor":{type:"enum",values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),"default":"center"},
- "text-max-angle":{type:"number",minimum:0,"default":45},"text-rotate":{type:"number","default":0},"text-padding":{type:"number",minimum:0,"default":2},"text-keep-upright":{type:"boolean","default":!0},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],"default":"none"},"text-offset":{type:"array",value:"number",length:2,"default":[0,0]},"text-allow-overlap":{type:"boolean","default":!1},"text-ignore-placement":{type:"boolean","default":!1},"text-optional":{type:"boolean","default":!1}};
- f.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],"default":"visible"}};f.backgroundPaintDefinition={"background-opacity":{type:"number",minimum:0,maximum:1,"default":1},"background-color":{type:"color","default":[0,0,0,1]},"background-pattern":{type:"string"}};f.fillPaintDefinition={"fill-opacity":{type:"number",minimum:0,maximum:1,"default":1},"fill-antialias":{type:"boolean","default":!0},"fill-color":{type:"color","default":[0,0,0,1]},"fill-outline-color":{type:"color",
- "default":[0,0,0,0]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"fill-pattern":{type:"string"}};f.linePaintDefinition={"line-opacity":{type:"number",minimum:0,maximum:1,"default":1},"line-color":{type:"color","default":[0,0,0,1]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"line-width":{type:"number",
- minimum:0,"default":1},"line-gap-width":{type:"number",minimum:0,"default":0},"line-offset":{type:"number","default":0},"line-blur":{type:"number",minimum:0,"default":0},"line-dasharray":{type:"array",value:"number","default":[]},"line-pattern":{type:"string"}};f.symbolPaintDefinition={"icon-opacity":{type:"number",minimum:0,maximum:1,"default":1},"icon-color":{type:"color","default":[0,0,0,1]},"icon-halo-color":{type:"color","default":[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,"default":0},
- "icon-halo-blur":{type:"number",minimum:0,"default":0},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"text-opacity":{type:"number",minimum:0,maximum:1,"default":1},"text-color":{type:"color","default":[0,0,0,1]},"text-halo-color":{type:"color","default":[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,"default":0},"text-halo-blur":{type:"number",minimum:0,"default":0},"text-translate":{type:"array",
- value:"number",length:2,"default":[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"}};f.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,"default":1},"raster-hue-rotate":{type:"number","default":0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,"default":0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,"default":1},"raster-saturation":{type:"number",minimum:-1,maximum:1,"default":0},"raster-contrast":{type:"number",
- minimum:-1,maximum:1,"default":0},"raster-fade-duration":{type:"number",minimum:0,"default":300}};f.circlePaintDefinition={"circle-opacity":{type:"number",minimum:0,maximum:1,"default":1},"circle-radius":{type:"number",minimum:0,"default":5},"circle-color":{type:"color","default":[0,0,0,1]},"circle-blur":{type:"number",minimum:0,"default":0},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],"default":"map"},"circle-stroke-width":{type:"number",
- minimum:0,"default":0},"circle-stroke-color":{type:"color","default":[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,"default":1}};return f}();h.StyleDefinition=r})},"esri/views/vectorTiles/style/StyleProperty":function(){define(["require","exports","../../../Color","../GeometryUtils"],function(r,h,f,a){return function(){function e(a,f,d){this.isDataDriven=!1;switch(f.type){case "number":a=!0;break;case "color":a=!0;d=e._parseColor(d);break;case "array":a="number"===f.value;
- break;default:a=!1}null==d&&(d=f.default);a&&"interval"===d.type&&(a=!1);var b=d&&d.stops&&0<d.stops.length;if(this.isDataDriven=d&&!!d.property)if(b)switch(d.type){case "identity":this.getValue=this._buildIdentity(d,f);break;case "categorical":this.getValue=this._buildCategorical(d,f);break;default:this.getValue=a?this._buildInterpolate(d,f):this._buildInterval(d,f)}else this.getValue=this._buildIdentity(d,f);else this.getValue=b?a?this._buildZoomInterpolate(d):this._buildZoomInterval(d):this._buildSimple(d)}
- e.prototype._buildSimple=function(a){return function(){return a}};e.prototype._buildIdentity=function(a,f){return function(c,b){var d;b&&(d=b.values[a.property],"color"===f.type&&(d=e._parseColor(d)));return void 0!==d?d:void 0!==a.default?a.default:f.default}};e.prototype._buildCategorical=function(a,e){var c=this;return function(b,d){var f;d&&(f=d.values[a.property]);f=c._categorical(f,a.stops);return void 0!==f?f:void 0!==a.default?a.default:e.default}};e.prototype._buildInterval=function(a,e){var c=
- this;return function(b,d){var f;d&&(f=d.values[a.property]);return"number"===typeof f?c._interval(f,a.stops):void 0!==a.default?a.default:e.default}};e.prototype._buildInterpolate=function(a,e){var c=this;return function(b,d){var f;d&&(f=d.values[a.property]);return"number"===typeof f?c._interpolate(f,a.stops,a.base||1):void 0!==a.default?a.default:e.default}};e.prototype._buildZoomInterpolate=function(a){var c=this;return function(d){return c._interpolate(d,a.stops,a.base||1)}};e.prototype._buildZoomInterval=
- function(a){var c=this;return function(d){return c._interval(d,a.stops)}};e.prototype._categorical=function(a,e){for(var c=e.length,b=0;b<c;b++)if(e[b][0]===a)return e[b][1]};e.prototype._interval=function(a,e){for(var c=e.length,b=0,f=0;f<c;f++)if(e[f][0]<=a)b=f;else break;return e[b][1]};e.prototype._interpolate=function(c,e,d){for(var b,f,g=e.length,h=0;h<g;h++){var n=e[h];if(n[0]<=c)b=n;else{f=n;break}}if(b&&f){h=f[0]-b[0];c-=b[0];d=1===d?c/h:(Math.pow(d,c)-1)/(Math.pow(d,h)-1);if(Array.isArray(b[1])){b=
- b[1];f=f[1];c=[];for(h=0;h<b.length;h++)c.push(a.interpolate(b[h],f[h],d));return c}return a.interpolate(b[1],f[1],d)}if(b)return b[1];if(f)return f[1]};e._isEmpty=function(a){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0};e._parseColor=function(a){if(Array.isArray(a))return a;if("string"===typeof a){if(a=new f(a),!this._isEmpty(a))return f.toUnitRGBA(a)}else return a&&a.default&&(a.default=e._parseColor(a.default)),a&&a.stops&&(a.stops=a.stops.map(function(a){return[a[0],e._parseColor(a[1])]})),
- a};return e}()})},"esri/views/vectorTiles/GeometryUtils":function(){define(["require","exports"],function(r,h){function f(a,c){a%=c;return 0<=a?a:a+c}Object.defineProperty(h,"__esModule",{value:!0});h.C_INFINITY=Number.POSITIVE_INFINITY;h.C_PI=Math.PI;h.C_2PI=2*h.C_PI;h.C_PI_BY_2=h.C_PI/2;h.C_RAD_TO_256=128/h.C_PI;h.C_256_TO_RAD=h.C_PI/128;h.C_DEG_TO_256=256/360;h.C_DEG_TO_RAD=h.C_PI/180;h.C_SQRT2=1.414213562;h.C_SQRT2_INV=1/h.C_SQRT2;var a=1/Math.LN2;h.positiveMod=f;h.radToByte=function(a){return f(a*
- h.C_RAD_TO_256,256)};h.degToByte=function(a){return f(a*h.C_DEG_TO_256,256)};h.log2=function(e){return Math.log(e)*a};h.sqr=function(a){return a*a};h.clamp=function(a,c,f){return Math.min(Math.max(a,c),f)};h.interpolate=function(a,c,f){return a*(1-f)+c*f};h.between=function(a,c,f){return a>=c&&a<=f||a>=f&&a<=c}})},"esri/layers/WMTSLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../request ../core/Collection ../core/Error ../core/Handles ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/Extent ./Layer ./WebTileLayer ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./support/WMTSSublayer ./support/wmtsUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B){function z(a,b){return a.map(function(a){var c=new m;c.read(a,b);return c})}var C={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""};return function(h){function n(a,c){var d=h.call(this)||this;d._sublayersHandles=new b;d.copyright=null;d.customParameters=null;d.customLayerParameters=
- null;d.fullExtent=null;d.operationalLayerType="WebTiledLayer";d.resourceInfo=null;d.serviceMode="RESTful";d.sublayers=null;d.type="wmts";d.version="1.0.0";d.watch("activeLayer",function(a,b){b&&(b.layer=null);a&&(a.layer=d)},!0);d.watch("sublayers",function(a,c){c&&(c.forEach(function(a){a.layer=null}),d._sublayersHandles.removeAll(),d._sublayersHandles=null);a&&(a.forEach(function(a){a.layer=d}),d._sublayersHandles||(d._sublayersHandles=new b),d._sublayersHandles.add([a.on("after-add",function(a){a.item.layer=
- d}),a.on("after-remove",function(a){a.item.layer=null})]))},!0);return d}f(n,h);n.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?e.mixin({},{url:a},b):a};n.prototype.load=function(){var a=this;if("KVP"!==this.serviceMode&&"RESTful"!==this.serviceMode)console.error("WMTS mode could only be 'KVP' or 'RESTful'");else return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]}).then(function(){return a._fetchService()}).catch(function(){return k.reject(new d("wmtslayer:unsupported-service-data",
- "Invalid response from the WMTS service."))})),this.when()};Object.defineProperty(n.prototype,"activeLayer",{get:function(){return this._get("activeLayer")},set:function(a){this._set("activeLayer",a)},enumerable:!0,configurable:!0});n.prototype.readActiveLayerFromService=function(a,b,c){var d=this,e;this.activeLayer?b.layers.some(function(a){return a.id===d.activeLayer.id?(e=a,!0):!1}):(this.activeLayer=new m,e=b.layers[0]);this.activeLayer.read(e,c);return this.activeLayer};n.prototype.readActiveLayerFromItemOrWebDoc=
- function(a,b,c){return new m({id:b.wmtsInfo.layerIdentifier,tileMatrixSetId:b.wmtsInfo.tileMatrixSet})};n.prototype.writeActiveLayer=function(a,b){a=this.activeLayer;b.templateUrl=this.getUrlTemplate(a.id,a.tileMatrixSetId,a.imageFormat,a.styleId);b.wmtsInfo=e.mixin(b.wmtsInfo||{},{layerIdentifier:a.id,tileMatrixSet:a.tileMatrixSetId})};Object.defineProperty(n.prototype,"fullExtents",{get:function(){var a=[];this.activeLayer.tileMatrixSets.forEach(function(b){b.fullExtent&&a.push(b.fullExtent)});
- return a},enumerable:!0,configurable:!0});n.prototype.readServiceMode=function(a,b,c){return-1<b.templateUrl.indexOf("?")?"KVP":"RESTful"};n.prototype.readSublayersFromService=function(a,b,c){return z(b.layers,c)};Object.defineProperty(n.prototype,"supportedSpatialReferences",{get:function(){return this.activeLayer.tileMatrixSets.map(function(a){return a.tileInfo.spatialReference}).toArray()},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"title",{get:function(){return"Layer"===
- this._get("title")?this.activeLayer&&this.activeLayer.title:this._get("title")},set:function(a){this._set("title",a)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"url",{get:function(){return this._get("url")},set:function(a){a&&"/"===a.substr(-1)?this._set("url",a.slice(0,-1)):this._set("url",a)},enumerable:!0,configurable:!0});n.prototype.createWebTileLayer=function(a){var b=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,
- this.activeLayer.styleId),c=this._getTileMatrixSetById(a.tileMatrixSetId).tileInfo,d=a.fullExtent;a={layerIdentifier:a.id,tileMatrixSet:a.tileMatrixSetId,url:this.url};this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters);this.customParameters&&(a.customParameters=this.customParameters);return new t({fullExtent:d,urlTemplate:b,tileInfo:c,wmtsInfo:a})};n.prototype.fetchTile=function(a,b,d){a=this.getTileUrl(a,b,d);return c(a,{responseType:"image"}).then(function(a){return a.data})};
- n.prototype.findSublayerById=function(a){return this.sublayers.find(function(b){return b.id===a})};n.prototype.getTileUrl=function(a,b,c){var d=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId).tileInfo.lods[a],d=d.levelValue?d.levelValue:String(d.level);(a=this.resourceInfo?"":B.getTileUrlFromResourceUrls(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.styleId,a,b,c))||(a=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,
- this.activeLayer.styleId).replace(/\{level\}/gi,d).replace(/\{row\}/gi,b).replace(/\{col\}/gi,c));return a=this._appendCustomLayerParameters(a)};n.prototype.getUrlTemplate=function(a,b,c,d){var e="";if(!this.resourceInfo&&(e=B.getTileUrlTemplateFromResourceUrls(a,b,c,d)))return e;"KVP"===this.serviceMode?e=this.url+"?SERVICE\x3dWMTS\x26VERSION\x3d"+this.version+"\x26REQUEST\x3dGetTile\x26LAYER\x3d"+a+"\x26STYLE\x3d"+d+"\x26FORMAT\x3d"+c+"\x26TILEMATRIXSET\x3d"+b+"\x26TILEMATRIX\x3d{level}\x26TILEROW\x3d{row}\x26TILECOL\x3d{col}":
- "RESTful"===this.serviceMode&&(e="",C[c.toLowerCase()]&&(e=C[c.toLowerCase()]),e=this.url+a+"/"+d+"/"+b+"/{level}/{row}/{col}"+e);return e};n.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return k.create(function(a){return r(["../views/2d/layers/WMTSLayerView2D"],a)});case "3d":return k.create(function(a){return r(["../views/3d/layers/WMTSLayerView3D"],a)})}};n.prototype._fetchService=function(){var a=this;return k.resolve().then(function(){if(a.resourceInfo)return"KVP"===a.resourceInfo.serviceMode&&
- (a.url+=-1<a.url.indexOf("?")?"":"?"),{ssl:!1,data:a.resourceInfo};var b=a._getCapabilitiesUrl(a.serviceMode);return c(b,{responseType:"text",callbackParamName:"callback"}).catch(function(d){b=a._getCapabilitiesUrl("KVP"===a.serviceMode?"RESTful":"KVP");return c(b,{responseType:"text",callbackParamName:"callback"})})}).then(function(b){b.data=a.resourceInfo?B.parseResourceInfo(b.data):B.parseCapabilities(b.data,{serviceMode:a.serviceMode,url:a.url});b.data&&a.read(b.data,{origin:"service"})})};n.prototype._getTileMatrixSetById=
- function(a){return this.findSublayerById(this.activeLayer.id).tileMatrixSets.find(function(b){return b.id===a})};n.prototype._appendCustomParameters=function(a){if(this.customParameters)for(var b in this.customParameters)a+=(-1===a.indexOf("?")?"?":"\x26")+b+"\x3d"+encodeURIComponent(this.customParameters[b]);return a};n.prototype._appendCustomLayerParameters=function(a){if(this.customLayerParameters||this.customParameters){var b=e.clone(this.customParameters||{});e.mixin(b,this.customLayerParameters||
- {});for(var c in b)a+=(-1===a.indexOf("?")?"?":"\x26")+c+"\x3d"+encodeURIComponent(b[c])}return a};n.prototype._getCapabilitiesUrl=function(a){var b;this.url=this.url.split("?")[0];"KVP"===a?b=this.url+"?request\x3dGetCapabilities\x26service\x3dWMTS\x26version\x3d"+this.version:"RESTful"===a&&(b=this.url+"/"+this.version+"/WMTSCapabilities.xml");return b=this._appendCustomParameters(b)};a([l.property({type:m,dependsOn:["sublayers"],json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],n.prototype,
- "activeLayer",null);a([l.reader("service","activeLayer",["layers"])],n.prototype,"readActiveLayerFromService",null);a([l.reader(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],n.prototype,"readActiveLayerFromItemOrWebDoc",null);a([l.writer(["web-document","portal-item"],"activeLayer")],n.prototype,"writeActiveLayer",null);a([l.property()],n.prototype,"copyright",void 0);a([l.property({json:{origins:{"web-document":{read:{source:"wmtsInfo.customParameters"},write:{target:"wmtsInfo.customParameters"}},
- "portal-item":{read:{source:"wmtsInfo.customParameters"},write:{target:"wmtsInfo.customParameters"}}}}})],n.prototype,"customParameters",void 0);a([l.property({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],n.prototype,"customLayerParameters",void 0);a([l.property({type:p,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},
- "portal-item":{read:{source:"fullExtent"}}}}})],n.prototype,"fullExtent",void 0);a([l.property({readOnly:!0,dependsOn:["activeLayer"]})],n.prototype,"fullExtents",null);a([l.property()],n.prototype,"operationalLayerType",void 0);a([l.property()],n.prototype,"resourceInfo",void 0);a([l.property()],n.prototype,"serviceMode",void 0);a([l.reader(["portal-item","web-document"],"serviceMode",["templateUrl"])],n.prototype,"readServiceMode",null);a([l.property({type:g.ofType(m)})],n.prototype,"sublayers",
- void 0);a([l.reader("service","sublayers",["layers"])],n.prototype,"readSublayersFromService",null);a([l.property({readOnly:!0,dependsOn:["activeLayer"]})],n.prototype,"supportedSpatialReferences",null);a([l.property({dependsOn:["activeLayer"],json:{read:{source:"title"}}})],n.prototype,"title",null);a([l.property({json:{read:!1},readOnly:!0,value:"wmts"})],n.prototype,"type",void 0);a([l.property({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},
- "portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],n.prototype,"url",null);a([l.property()],n.prototype,"version",void 0);return n=a([l.subclass("esri.layers.WMTSLayer")],n)}(l.declared(n,u,q,v,x))})},"esri/layers/WebTileLayer":function(){define("dojo/_base/lang dojo/_base/url dojo/string ../core/Error ../core/MultiOriginJSONSupport ../core/urlUtils ../geometry/SpatialReference ../geometry/Extent ../geometry/Point ./TiledLayer ./mixins/OperationalLayer ./mixins/ScaleRangeLayer ./mixins/PortalLayer ./mixins/RefreshableLayer ./support/TileInfo ./support/LOD ./support/commonProperties".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){return k.createSubclass([l,e,p,n,t],{declaredClass:"esri.layers.WebTileLayer",normalizeCtorArgs:function(a,b){return"string"===typeof a?r.mixin({urlTemplate:a},b||{}):a},getDefaults:function(a){var c=new d(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,g.WebMercator);return r.mixin(this.inherited(arguments),{fullExtent:c,tileInfo:new u({size:256,dpi:96,format:"PNG8",compressionQuality:0,origin:new b({x:-2.0037508342787E7,y:2.0037508342787E7,
- spatialReference:g.WebMercator}),spatialReference:g.WebMercator,lods:[new q({level:0,scale:5.91657527591555E8,resolution:156543.033928}),new q({level:1,scale:2.95828763795777E8,resolution:78271.5169639999}),new q({level:2,scale:1.47914381897889E8,resolution:39135.7584820001}),new q({level:3,scale:7.3957190948944E7,resolution:19567.8792409999}),new q({level:4,scale:3.6978595474472E7,resolution:9783.93962049996}),new q({level:5,scale:1.8489297737236E7,resolution:4891.96981024998}),new q({level:6,scale:9244648.868618,
- resolution:2445.98490512499}),new q({level:7,scale:4622324.434309,resolution:1222.99245256249}),new q({level:8,scale:2311162.217155,resolution:611.49622628138}),new q({level:9,scale:1155581.108577,resolution:305.748113140558}),new q({level:10,scale:577790.554289,resolution:152.874056570411}),new q({level:11,scale:288895.277144,resolution:76.4370282850732}),new q({level:12,scale:144447.638572,resolution:38.2185141425366}),new q({level:13,scale:72223.819286,resolution:19.1092570712683}),new q({level:14,
- scale:36111.909643,resolution:9.55462853563415}),new q({level:15,scale:18055.954822,resolution:4.77731426794937}),new q({level:16,scale:9027.977411,resolution:2.38865713397468}),new q({level:17,scale:4513.988705,resolution:1.19432856685505}),new q({level:18,scale:2256.994353,resolution:.597164283559817}),new q({level:19,scale:1128.497176,resolution:.298582141647617})]})})},properties:{copyright:{type:String,value:"",json:{write:!0}},fullExtent:{json:{write:!0}},legendEnabled:{json:{read:{source:["showLegend"],
- reader:function(a,b){return null!=b.showLegend?b.showLegend:!0}},write:{target:"showLegend"}}},levelValues:{dependsOn:["tileInfo"],get:function(){var a=[];if(!this.tileInfo)return null;this.tileInfo.lods.forEach(function(b){a[b.level]=b.levelValue||b.level},this);return a}},operationalLayerType:"WebTiledLayer",popupEnabled:v.popupEnabled,refreshInterval:{json:{write:!0}},spatialReference:{type:g,value:g.WebMercator,json:{read:{source:["spatialReference","fullExtent.spatialReference"],reader:function(a,
- b){return a||b.fullExtent&&b.fullExtent.spatialReference&&g.fromJSON(b.fullExtent.spatialReference)}}}},subDomains:{type:[String],value:null,json:{write:!0}},tileInfo:{type:u,json:{write:!0}},tileServers:{value:null,dependsOn:["urlTemplate","subDomains"],get:function(){if(!this.urlTemplate)return null;var a=new h(this.urlTemplate),b=a.scheme?a.scheme+"://":"//",c=b+a.authority+"/",d=this.subDomains,e,f=[];-1===a.authority.indexOf("{subDomain}")&&f.push(c);d&&0<d.length&&1<a.authority.split(".").length&&
- d.forEach(function(c){-1<a.authority.indexOf("{subDomain}")&&(e=b+a.authority.replace(/\{subDomain\}/gi,c)+"/");f.push(e)},this);return f=f.map(function(a){"/"!==a.charAt(a.length-1)&&(a+="/");return a})}},type:{value:"web-tile",json:{read:!1}},urlPath:{dependsOn:["urlTemplate"],get:function(){if(!this.urlTemplate)return null;var a=this.urlTemplate,b=new h(a);return a.substring(((b.scheme?b.scheme+"://":"//")+b.authority+"/").length)}},urlTemplate:{type:String,json:{origins:{"portal-item":{read:{source:"url"}}},
- read:{source:["urlTemplate","templateUrl"],reader:function(a,b){return a||b.templateUrl}},write:{target:"templateUrl",writer:function(a,b,d){a&&c.isProtocolRelative(a)&&(a="https:"+a);b[d]=a?c.normalize(a):a}}}},url:{json:{write:!1}},wmtsInfo:{json:{write:!0}}},getTileUrl:function(a,b,c){a=this.levelValues[a];var d=this.tileServers[b%this.tileServers.length]+f.substitute(this.urlPath,{level:a,col:c,row:b});return d=d.replace(/\{level\}/gi,a).replace(/\{row\}/gi,b).replace(/\{col\}/gi,c)},load:function(){var b=
- this.loadFromPortal({supportedTypes:["WMTS"]}).then(function(){if(!this.urlTemplate)throw new a("layer:load","WebTileLayer (title: '"+this.title+"', id: '"+this.id+"') is missing the required 'urlTemplate' property value");}.bind(this));this.addResolvingPromise(b);return this}})})},"esri/layers/support/WMTSSublayer":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/paramHelper ../../core/Collection ../../core/JSONSupport ../../core/accessorSupport/decorators ../../geometry/Extent ./TileMatrixSet ./WMTSStyle".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){return function(e){function g(a){a=e.call(this)||this;a.fullExtent=null;a.imageFormats=null;a.id=null;a.layer=null;a.styles=null;a.tileMatrixSetId=null;a.tileMatrixSets=null;return a}f(g,e);h=g;Object.defineProperty(g.prototype,"description",{get:function(){return this._get("description")},set:function(a){this._set("description",a)},enumerable:!0,configurable:!0});g.prototype.readFullExtent=function(a,c,d){return(a=c.fullExtent)?b.fromJSON(a):null};Object.defineProperty(g.prototype,
- "imageFormat",{get:function(){var a=this._get("imageFormat");a||(a=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:"");return a},set:function(a){if(-1<a.indexOf("image/")||-1===this.imageFormats.indexOf(a))if(-1===a.indexOf("image/")&&(a="image/"+a),this.imageFormats&&-1===this.imageFormats.indexOf(a)){console.error("The layer doesn't support the format of "+a);return}this._set("imageFormat",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"styleId",{get:function(){var a=
- this._get("styleId");a||(a=this.styles&&this.styles.length?this.styles.getItemAt(0).id:"");return a},set:function(a){this._set("styleId",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"title",{get:function(){return this._get("title")},set:function(a){this._set("title",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"tileMatrixSet",{get:function(){var a=this;return this.tileMatrixSets.find(function(b){return b.id===a.tileMatrixSetId})},enumerable:!0,configurable:!0});
- g.prototype.clone=function(){var a=new h;this.hasOwnProperty("description")&&(a.description=this.description);this.hasOwnProperty("imageFormats")&&(a.imageFormats=this.imageFormats&&this.imageFormats.slice());this.hasOwnProperty("imageFormat")&&(a.imageFormat=this.imageFormat);this.hasOwnProperty("fullExtent")&&(a.fullExtent=this.fullExtent&&this.fullExtent.clone());this.hasOwnProperty("id")&&(a.id=this.id);this.hasOwnProperty("layer")&&(a.layer=this.layer);this.hasOwnProperty("styleId")&&(a.styleId=
- this.styleId);this.hasOwnProperty("styles")&&(a.styles=this.styles&&this.styles.clone());this.hasOwnProperty("tileMatrixSetId")&&(a.tileMatrixSetId=this.tileMatrixSetId);this.hasOwnProperty("tileMatrixSets")&&(a.tileMatrixSets=this.tileMatrixSets.clone());this.hasOwnProperty("title")&&(a.title=this.title);return a};a([d.property()],g.prototype,"description",null);a([d.property()],g.prototype,"fullExtent",void 0);a([d.reader("fullExtent",["fullExtent"])],g.prototype,"readFullExtent",null);a([d.property({dependsOn:["imageFormats"]})],
- g.prototype,"imageFormat",null);a([d.property({json:{read:{source:"formats"}}})],g.prototype,"imageFormats",void 0);a([d.property()],g.prototype,"id",void 0);a([d.property()],g.prototype,"layer",void 0);a([d.property()],g.prototype,"styleId",null);a([d.property({type:c.ofType(l),json:{read:{source:"styles"}}})],g.prototype,"styles",void 0);a([d.property({value:null,json:{write:{ignoreOrigin:!0}}})],g.prototype,"title",null);a([d.property()],g.prototype,"tileMatrixSetId",void 0);a([d.property({readOnly:!0,
- dependsOn:["tileMatrixSetId"]})],g.prototype,"tileMatrixSet",null);a([d.property({type:c.ofType(k),json:{read:{source:"tileMatrixSets"}}})],g.prototype,"tileMatrixSets",void 0);return g=h=a([d.subclass("esri.layers.support.WMTSSublayer")],g);var h}(d.declared(g))})},"esri/layers/support/TileMatrixSet":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/paramHelper ../../core/JSONSupport ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c,g){return function(c){function b(a){a=c.call(this)||this;a.fullExtent=null;a.id=null;a.tileInfo=null;return a}f(b,c);d=b;b.prototype.clone=function(){var a=new d;this.hasOwnProperty("fullExtent")&&(a.fullExtent=this.fullExtent&&this.fullExtent.clone());this.hasOwnProperty("id")&&(a.id=this.id);this.hasOwnProperty("tileInfo")&&(a.tileInfo=this.tileInfo&&this.tileInfo.clone());return a};a([g.property({json:{read:{source:"fullExtent"}}})],b.prototype,"fullExtent",void 0);a([g.property({json:{read:{source:"id"}}})],
- b.prototype,"id",void 0);a([g.property({json:{read:{source:"tileInfo"}}})],b.prototype,"tileInfo",void 0);return b=d=a([g.subclass("esri.layer.support.TileMatrixSet")],b);var d}(g.declared(c))})},"esri/layers/support/WMTSStyle":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/tsSupport/paramHelper ../../core/JSONSupport ../../core/accessorSupport/decorators".split(" "),function(r,h,f,a,e,c,g){return function(c){function b(a){a=
- c.call(this)||this;a.id=null;a.title=null;a.description=null;a.legendUrl=null;return a}f(b,c);d=b;b.prototype.clone=function(){var a=new d;this.hasOwnProperty("description")&&(a.description=this.description);this.hasOwnProperty("id")&&(a.id=this.id);this.hasOwnProperty("isDefault")&&(a.isDefault=this.isDefault);this.hasOwnProperty("keywords")&&(a.keywords=this.keywords&&this.keywords.slice());this.hasOwnProperty("legendUrl")&&(a.legendUrl=this.legendUrl);this.hasOwnProperty("title")&&(a.title=this.title);
- return a};a([g.property({json:{read:{source:"id"}}})],b.prototype,"id",void 0);a([g.property({json:{read:{source:"title"}}})],b.prototype,"title",void 0);a([g.property({json:{read:{source:"abstract"}}})],b.prototype,"description",void 0);a([g.property({json:{read:{source:"legendUrl"}}})],b.prototype,"legendUrl",void 0);a([g.property({json:{read:{source:"isDefault"}}})],b.prototype,"isDefault",void 0);a([g.property({json:{read:{source:"keywords"}}})],b.prototype,"keywords",void 0);return b=d=a([g.subclass("esri.layer.support.WMTSStyle")],
- b);var d}(g.declared(c))})},"esri/layers/support/wmtsUtils":function(){define("require exports ../../core/Error ../../geometry/Extent ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/WKIDUnitConversion ./TileInfo".split(" "),function(r,h,f,a,e,c,g,d){function b(a,b){return(a=b.getElementsByTagName(a))&&0<a.length?a[0]:null}function k(a,b){return Array.prototype.slice.call(b.getElementsByTagName(a)).map(function(a){return a.textContent})}function l(a,c){a.split("\x3e").forEach(function(a){c=
- b(a,c)});return c&&c.textContent}function p(a,c,d,e){var f;Array.prototype.slice.call(e.childNodes).some(function(e){if(-1<e.nodeName.indexOf(a)){var g=b(c,e),g=g&&g.textContent;return g===d||d.split(":")&&d.split(":")[1]===g?(f=e,!0):!1}});return f}function n(a){var b=[],c=A[a],d=Array.prototype.slice.call(c.getElementsByTagName("ResourceURL")),c=c.getElementsByTagName("Dimension"),e,f,g,h;c.length&&(e=l("Identifier",c[0]),f=k("Default",c[0])||k("Value",c[0]));1<c.length&&(g=l("Identifier",c[1]),
- h=k("Default",c[1])||k("Value",c[1]));C[a]={dimensions:f,dimensions2:h};d.forEach(function(a){var c=a.getAttribute("template");if(e&&f.length)if(-1<c.indexOf("{"+e+"}"))c=c.replace("{"+e+"}","{dimensionValue}");else{var d=c.toLowerCase().indexOf("{"+e.toLowerCase()+"}");-1<d&&(c=c.substring(0,d)+"{dimensionValue}"+c.substring(d+e.length+2))}g&&h.length&&(-1<c.indexOf("{"+g+"}")?c=c.replace("{"+g+"}","{dimensionValue2}"):(d=c.toLowerCase().indexOf("{"+g.toLowerCase()+"}"),-1<d&&(c=c.substring(0,d)+
- "{dimensionValue2}"+c.substring(d+g.length+2))));b.push({template:c,format:a.getAttribute("fomrat"),resourceType:a.getAttribute("resourceType")})});return b}function t(a,c){return Array.prototype.slice.call(a.getElementsByTagName("Style")).map(function(a){var d=b("LegendURL",a),e=b("Keywords",a),e=e&&k("Keyword",e),d=d&&d.getAttribute("xlink:href");c&&(d=d&&d.replace(/^http:/i,"https:"));return{abstract:l("Abstract",a),id:l("Identifier",a),isDefault:"true"===a.getAttribute("isDefault"),keywords:e,
- legendUrl:d,title:l("Title",a)}})}function u(a,b){return k("TileMatrixSet",a).map(function(c){return q(c,a,b)})}function q(a,c,e){c=p("TileMatrixSetLink","TileMatrixSet",a,c);c=k("TileMatrix",c);var f=p("TileMatrixSet","Identifier",a,e);e=v(f);var g=e.spatialReference,h=g.wkid,n=b("TileMatrix",f),n=[parseInt(l("TileWidth",n),10),parseInt(l("TileHeight",n),10)],t=[];c.length?c.forEach(function(b,c){b=p("TileMatrix","Identifier",b,f);t.push(m(b,h,c,a))}):Array.prototype.slice.call(f.getElementsByTagName("TileMatrix")).forEach(function(b,
- c){t.push(m(b,h,c,a))});c=x(f,e,n,t[0]);return{id:a,fullExtent:c,tileInfo:new d({dpi:96,spatialReference:g,size:n,origin:e,lods:t})}}function v(a){var d=l("SupportedCRS",a);d&&(d=d.toLowerCase());var f=parseInt(d.split(":").pop(),10);if(900913===f||3857===f)f=102100;var g=!1;if(-1<d.indexOf("crs84")||-1<d.indexOf("crs:84"))f=4326,g=!0;else if(-1<d.indexOf("crs83")||-1<d.indexOf("crs:83"))f=4269,g=!0;else if(-1<d.indexOf("crs27")||-1<d.indexOf("crs:27"))f=4267,g=!0;var k=new c({wkid:f});a=b("TileMatrix",
- a);var h=l("TopLeftCorner",a).split(" ");a=h[0].split("E").map(function(a){return Number(a)});var h=h[1].split("E").map(function(a){return Number(a)}),m=a[0],n=h[0],t;1<a.length&&(m=a[0]*Math.pow(10,a[1]));1<h.length&&(n=h[0]*Math.pow(10,h[1]));var q=g&&4326===f&&90===m&&-180===n;z.some(function(a,b){var c=Number(d.split(":").pop());if(c>=a[0]&&c<=a[1]||4326===f&&(!g||q))return t=new e(n,m,k),!0;b===z.length-1&&(t=new e(m,n,k));return!1});return t}function x(c,d,e,f){var g=b("BoundingBox",c),k,h;
- g&&(k=l("LowerCorner",g).split(" "),h=l("UpperCorner",g).split(" "));k&&1<k.length&&h&&1<h.length?(c=parseFloat(k[0]),e=parseFloat(k[1]),k=parseFloat(h[0]),h=parseFloat(h[1])):(c=b("TileMatrix",c),k=parseFloat(l("MatrixWidth",c)),g=parseFloat(l("MatrixHeight",c)),c=d.x,h=d.y,k=c+k*e[0]*f.resolution,e=h-g*e[1]*f.resolution);return new a(c,e,k,h,d.spatialReference)}function m(a,b,c,d){var e=l("Identifier",a);a=l("ScaleDenominator",a).split("E").map(function(a){return Number(a)});a=1<a.length?a[0]*Math.pow(10,
- a[1]):a[0];b=B(b,a,d);return{level:c,levelValue:e,scale:1.058267716535433*a,resolution:b}}function B(a,b,c){a=g.hasOwnProperty(String(a))?g.values[g[a]]:"default028mm"===c?6370997*Math.PI/180:6378137*Math.PI/180;return 7*b/25E3/a}Object.defineProperty(h,"__esModule",{value:!0});var z=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],
- [4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],
- [2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],
- [20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]],C=new Map,A=new Map;h.parseCapabilities=function(a,c){a=a.replace(/ows:/gi,"");a=(new DOMParser).parseFromString(a,"text/xml").documentElement;var d=b("Contents",a);if(!d)throw new f("wmtslayer:wmts-capabilities-xml-is-not-valid");
- var e=b("OperationsMetadata",a),e=(e=(e=e&&e.querySelector("[name\x3d'GetTile']"))&&e.getElementsByTagName("Get"))&&Array.prototype.slice.call(e),g=c.url&&-1<c.url.indexOf("https"),h=c.serviceMode,m,n,q;e&&e.length&&e.some(function(a){var c=b("Constraint",a);if(!c||p("AllowedValues","Value",h,c))return n=a.attributes[0].nodeValue,!0;if(!c||p("AllowedValues","Value","RESTful",c)||p("AllowedValues","Value","REST",c))q=a.attributes[0].nodeValue;else if(!c||p("AllowedValues","Value","KVP",c))m=a.attributes[0].nodeValue;
- return!1});n||(q?(n=q,h="RESTful"):m?(n=m,h="KVP"):n=b("ServiceMetadataURL",a).getAttribute("xlink:href"));c=n.indexOf("1.0.0/");-1===c&&"RESTful"===h?n+="/":-1<c&&(n=n.substring(0,c));"KVP"===h&&(n+=-1<c?"":"?");g&&(n=n.replace(/^http:/i,"https:"));c=l("ServiceIdentification\x3eAccessConstraints",a);a=Array.prototype.slice.call(d.getElementsByTagName("Layer")).map(function(a){var c=l("Identifier",a);A[c]=a;var e=l("Abstract",a),f=k("Format",a),h,m=b("WGS84BoundingBox",a);h=m?l("LowerCorner",m).split(" "):
- ["-180","-90"];m=m?l("UpperCorner",m).split(" "):["180","90"];h={xmin:parseFloat(h[0]),ymin:parseFloat(h[1]),xmax:parseFloat(m[0]),ymax:parseFloat(m[1]),spatialReference:{wkid:4326}};var m=t(a,g),n=l("Title",a);a=u(a,d);return{id:c,fullExtent:h,description:e,formats:f,styles:m,title:n,tileMatrixSets:a}});return{copyright:c,layers:a,tileUrl:n,serviceMode:h}};h.parseResourceInfo=function(a){a.layers.forEach(function(a){a.tileMatrixSets.forEach(function(a){var b=a.tileInfo;96!==b.dpi&&(b.lods.forEach(function(c){c.scale=
- 96*c.scale/b.dpi;c.resolution=B(b.spatialReference.wkid,90.71428571428571*c.scale/96,a.id)}),b.dpi=96)})});return a};h.getTileUrlFromResourceUrls=function(a,b,c,d,e,f){var g=n(a),k=C[a].dimensions&&C[a].dimensions[0];a=C[a].dimensions2&&C[a].dimensions2[0];var h="";g&&0<g.length&&(h=g[e%g.length].template.replace(/\{Style\}/gi,c).replace(/\{TileMatrixSet\}/gi,b).replace(/\{TileMatrix\}/gi,d).replace(/\{TileRow\}/gi,e).replace(/\{TileCol\}/gi,f).replace(/\{dimensionValue\}/gi,k).replace(/\{dimensionValue2\}/gi,
- a));return h};h.getTileUrlTemplateFromResourceUrls=function(a,b,c,d){c=n(a);var e="";if(c&&0<c.length){var f=C[a].dimensions&&C[a].dimensions[0];a=C[a].dimensions2&&C[a].dimensions2[0];e=c[0].template;e.indexOf(".xxx")===e.length-4&&(e=e.slice(0,e.length-4));e=e.replace(/\{Style\}/gi,d);e=e.replace(/\{TileMatrixSet\}/gi,b);e=e.replace(/\{TileMatrix\}/gi,"{level}");e=e.replace(/\{TileRow\}/gi,"{row}");e=e.replace(/\{TileCol\}/gi,"{col}");e=e.replace(/\{dimensionValue\}/gi,f);e=e.replace(/\{dimensionValue2\}/gi,
- a)}return e}})},"esri/views/3d/terrain/terrainUtilsPlanar":function(){define("require exports ../../../core/Error ../lib/glMatrix ../support/aaBoundingRect ./TerrainConst ./TilingScheme".split(" "),function(r,h,f,a,e,c,g){function d(b,c,d,e){a.vec3d.set(d,k);k[e]=c[e];e=a.vec3d.subtract(k,c);var f=a.vec3d.subtract(b,c,l),f=a.vec3d.dot(f,e),g=a.vec3d.dot(e,e);c=0>=f?c:g<=f?d:a.vec3d.add(c,a.vec3d.scale(e,f/g),k);b=a.vec3d.subtract(b,c,k);return Math.PI/2-Math.atan(b[2]/Math.sqrt(b[0]*b[0]+b[1]*b[1]))}
- function b(a,b){var c=a.getElevationBounds();a=a.extent;c=.5*(c[0]+c[1]);p[0]=a[0];p[1]=a[1];p[2]=c;n[0]=a[2];n[1]=a[3];n[2]=c;a=c=Infinity;b[0]<p[0]?c=d(b,p,n,0):b[0]>n[0]&&(c=d(b,n,p,0));b[1]<p[1]?a=d(b,p,n,1):b[1]>n[1]&&(a=d(b,n,p,1));return Math.min(c,a)}Object.defineProperty(h,"__esModule",{value:!0});var k=a.vec3d.create(),l=a.vec3d.create(),p=a.vec3d.create(),n=a.vec3d.create();h.autoUpdateSkirtsVisibility=function(a,c){var d,f=!0,g=a.extent,k=e.containsPoint(g,c);k?d=a.getElevation(c):(d=
- a.getElevationBounds(),d=.5*(d[0]+d[1]));d>c[2]?f=!1:k||(e.containsPointWithMargin(g,c,a.hideSkirtsDistanceFromExtentMargin*Math.min(g[2]-g[0],g[3]-g[1]))?b(a,c)>a.hideSkirtsMinimumCameraTilt&&(f=!1):f=!1);f!==a.skirts&&(a.skirts=f)};h.tiltOnEdge=d;h.tiltToExtentEdge=b;h.checkIfTileInfoSupportedForViewSR=function(a,b,d){if(a.spatialReference.isGeographic)return new f("tilingscheme:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes");var k=g.checkUnsupported(a);
- if(k)return k;var h=a.lods,k=h[0].resolution*Math.pow(2,h[0].level),l=[k*a.size[0],k*a.size[1]],n=[a.origin.x,a.origin.y];b=e.fromExtent(b);var p=e.create();g.computeRowColExtent(b,l,n,p);l=(p[2]-p[0])*(p[3]-p[1]);l>c.MAX_ROOT_TILES?(h=h[0].scale*Math.pow(2,h[0].level),k=Math.max((b[3]-b[1])/a.size[1],(b[2]-b[0])/a.size[0])*h/k,b=Math.floor(Math.log(k)/Math.log(10)),k=Math.ceil(k/Math.pow(10,b))*Math.pow(10,b),k=new f("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+
- Math.floor(h).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+k.toLocaleString()+".",{level0Scale:h,suggestedLevel0Scale:k,requiredNumRootTiles:l,allowedNumRootTiles:c.MAX_ROOT_TILES})):k=null;return k?k:d&&!a.spatialReference.equals(d)?new f("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene"):null}})},"esri/views/3d/terrain/TerrainConst":function(){define(["require","exports","../support/aaBoundingRect",
- "./TilingScheme"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});(function(a){a[a.MAP=0]="MAP";a[a.ELEVATION=1]="ELEVATION";a[a.LAYER_CLASS_COUNT=2]="LAYER_CLASS_COUNT"})(h.LayerClass||(h.LayerClass={}));(function(a){a[a.NONE=0]="NONE";a[a.SPLIT=1]="SPLIT";a[a.VSPLITMERGE=2]="VSPLITMERGE";a[a.MERGE=4]="MERGE";a[a.DECODE_ELEVATION=8]="DECODE_ELEVATION";a[a.UPDATE_GEOMETRY=16]="UPDATE_GEOMETRY";a[a.UPDATE_TEXTURE=32]="UPDATE_TEXTURE"})(h.TileUpdateTypes||(h.TileUpdateTypes={}));
- h.TILE_LOADING_DEBUGLOG=!1;h.MAX_ROOT_TILES=64;h.MAX_TILE_TESSELATION=512;h.ELEVATION_NODATA_VALUE=3.40282347E38/10;h.noDataValueOpt={noDataValue:h.ELEVATION_NODATA_VALUE};h.ELEVATION_DESIRED_RESOLUTION_LEVEL=4;h.TILEMAP_SIZE_EXP=5;h.TILEMAP_SIZE=1<<h.TILEMAP_SIZE_EXP;h.WEBMERCATOR_WORLD_EXTENT=f.create([0,0,0,0]);a.WebMercatorAuxiliarySphere.getExtent(0,0,0,h.WEBMERCATOR_WORLD_EXTENT);h.GEOGRAPHIC_WORLD_EXTENT=f.create([-180,-90,180,90]);h.TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR="Cannot extend surface to encompass all layers because it would result in too many root tiles.";
- h.TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR="Surface extent is too large for tile resolution at level 0.";h.DEFAULT_TILE_BACKGROUND="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA2JJREFUeNrs3d1O20AQgFFvRJInQLQBhHj/h0JVW34El1yQ2F73DVq3jTys55zrqUBbPrErZUSZ+vcOsto4AjK76Lqu1vr8+G3mPzjc3D/+eJj/Bcz/cd75R80fbu79BsAVCAQAAgABgABAACAAEAAIAAQAAgABQPOKfQAy83Ho+HnnHzXv49B4A4AAQAAgABAACAAEAAIAAYAAQAAgABAANM4+AKnZB4ifd/5R8/YB8AYAAYAAQAAgABAACAAEAAIAAYAAQAAgAGicfQBSsw8QP+/8o+btA+ANAAIAAYAAQAAgABAACAAEAAIAAYAAQADQOPsApGYfIH7e+UfN2wfAGwAEAAIAAYAAQAAgABAACAAEAAIAAXA201QdggAggH0AUrMPED8/jsPL03fns/y8fQC8AUAAIAAQAAgABAACAAGAAEAAIAAQAAgAGmcfgNTsA8TP2weImrcPgDcACAAEAAIAAYAAQAAgABAACAAEAAIAAUDj7AOQmn2A+Hn7AFHz9gHwBgABgABAACAAEAAIAAQAAgABgABgNS4cAf9pu9u3O1+m/n2aplKK/0j+TX86/tVP5+eZ3+729gFIfwWyDxA7bx8gat4+ANkJAAGAAEAAIAAQAAgABAACAAGAAEAAIABonn0AUrMPED9vHyBq3j4A3gAgABAACAAEAAIAAYAAQAAgABAA51VrdQgCAAHAsuwDkJp9gPj5vj+9vvx0PsvP2wfAGwAEAAIAAYAAQAAgABAACAAEAAIAAYAAoHH2AUjNPkD8vH2AqHn7AHgDgABAACAAEAAIAAQAAgABgABAACAAEAA0zj4AqdkHiJ+3DxA1bx8AbwAQACQ0DL0AyKuOowBwBYKUSikCIHUBAsAVCAQAAgABgABAALBy9gFIzT5A/Lx9gKj5y6trVyC8AUAAIAAQAAgAVq90Pg5N5gA2AsAVCAQAAgABgABAALB29gFIzT5A/Lx9gKj5q6+3rkB4A4AAQAAgABAACADWzB/IIHsCAsAVCARAlKlWhyAAEAAIABZjH4DU7APEz5+OH2+vT85n+fkvhztXILwBQAAgABAACAAEAGtWigBIHcBGALgCgQBAACAAyPMO9nHosxuHodZx5vB2t691HIdh/nx/Os7/Zsz/fvgXAAAA//8DAF1P1hM2ICMfAAAAAElFTkSuQmCC"})},
- "esri/views/3d/terrain/TilingScheme":function(){define(["../../../core/Error","../../../geometry/SpatialReference","../../../geometry/support/scaleUtils","../support/projectionUtils","../support/mathUtils"],function(r,h,f,a,e){var c=a.webMercator.x2lon,g=a.webMercator.y2lat,d=[0,0,0,0],b=function(a){var c=b._checkUnsupported(a);if(c)throw c;this.spatialReference=a.spatialReference;this._isWebMercator=this.spatialReference.isWebMercator;this._isWGS84=this.spatialReference.isWGS84;this.origin=[a.origin.x,
- a.origin.y];this.pixelSize=[a.size[0],a.size[1]];var d=a.lods.reduce(function(a,b,c){b.level<a.min&&(a.min=b.level,a.minIndex=c);a.max=Math.max(a.max,b.level);return a},{min:Infinity,minIndex:0,max:-Infinity}),e=a.lods[d.minIndex],f=Math.pow(2,e.level),c=e.resolution*f,e=e.scale*f;this.levels=Array(d.max+1);for(d=0;d<this.levels.length;d++)this.levels[d]={resolution:c,scale:e,tileSize:[c*a.size[0],c*a.size[1]]},c/=2,e/=2};b.prototype={getExtent:function(a,b,d,f,h){f=f||Array(4);var k=this.levels[a];
- a=k.tileSize[0];k=k.tileSize[1];f[0]=this.origin[0]+d*a;f[2]=f[0]+a;f[3]=this.origin[1]-b*k;f[1]=f[3]-k;h&&(this._isWebMercator?(h[0]=c(f[0]),h[1]=g(f[1]),h[2]=c(f[2]),h[3]=g(f[3])):this._isWGS84&&(h[0]=e.deg2rad(f[0]),h[1]=e.deg2rad(f[1]),h[2]=e.deg2rad(f[2]),h[3]=e.deg2rad(f[3])))},ensureMaxLod:function(a){for(;this.levels.length<=a;){var b=this.levels[this.levels.length-1],c=b.resolution/2;this.levels.push({resolution:c,scale:b.scale/2,tileSize:[c*this.pixelSize[0],c*this.pixelSize[1]]})}},capMaxLod:function(a){this.levels.length>
- a+1&&(this.levels.length=a+1)},getMaxLod:function(){return this.levels.length-1},scaleAtLevel:function(a){return this.levels[0].scale/Math.pow(2,a)},levelAtScale:function(a){var b=this.levels[0].scale;return a>=b?0:Math.log(b/a)*Math.LOG2E},compatibleWith:function(a){if(!(a instanceof b)){if(b._checkUnsupported(a))return!1;a=new b(a)}if(!a.spatialReference.equals(this.spatialReference)||a.pixelSize[0]!==this.pixelSize[0]||a.pixelSize[1]!==this.pixelSize[1])return!1;var c=Math.min(this.levels.length,
- a.levels.length)-1,d=this.levels[c].resolution,f=e.floatEqualAbsolute,g=.5*d;if(!f(a.origin[0],this.origin[0],g)||!f(a.origin[1],this.origin[1],g))return!1;g=.5*d/Math.pow(2,c)/Math.max(this.pixelSize[0],this.pixelSize[1])*12;return f(d,a.levels[c].resolution,g)},rootTilesInExtent:function(a,c,e){var f=this.levels[0].tileSize;b.computeRowColExtent(a,f,this.origin,d);a=d[1];var g=d[3],h=d[0],k=d[2],l=k-h,p=g-a;l*p>e&&(e=Math.floor(Math.sqrt(e)),p>e&&(a=a+Math.floor(.5*p)-Math.floor(.5*e),g=a+e),l>
- e&&(h=h+Math.floor(.5*l)-Math.floor(.5*e),k=h+e));e=Array((k-h)*(g-a));l=0;for(p=a;p<g;p++)for(var m=h;m<k;m++)e[l++]=[0,p,m];c&&(c[0]=this.origin[0]+h*f[0],c[1]=this.origin[1]-g*f[1],c[2]=this.origin[0]+k*f[0],c[3]=this.origin[1]-a*f[1]);return e}};b.computeRowColExtent=function(a,b,c,d){var e=.001*(a[2]-a[0]+(a[3]-a[1]));d[0]=Math.floor((a[0]+e-c[0])/b[0]);d[2]=Math.ceil((a[2]-e-c[0])/b[0]);d[1]=Math.floor((c[1]-a[3]+e)/b[1]);d[3]=Math.ceil((c[1]-a[1]-e)/b[1])};b.isPowerOfTwo=function(a){a=a.lods;
- var b=a[0].resolution*Math.pow(2,a[0].level);return!a.some(function(a){return!e.floatEqualRelative(a.resolution,b/Math.pow(2,a.level))})};b.hasGapInLevels=function(a){a=a.lods.map(function(a){return a.level});a.sort(function(a,b){return a-b});for(var b=1;b<a.length;b++)if(a[b]!==a[0]+b)return!0;return!1};b.tileSizeSupported=function(a){var b=a.size[1];return b===a.size[0]&&0===(b&b-1)&&128<=b&&512>=b};b._checkUnsupported=function(a){return a?1>a.lods.length?new r("tilingscheme:generic","Tiling scheme must have at least one level"):
- b.isPowerOfTwo(a)?null:new r("tilingscheme:power-of-two","Tiling scheme must be power of two"):new r("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")};b.checkUnsupported=function(a){var c=b._checkUnsupported(a);return c?c:b.hasGapInLevels(a)?new r("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):b.tileSizeSupported(a)?null:new r("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]")};b.fromExtent=
- function(a,c){var d=a[2]-a[0],e=a[3]-a[1],g=f.getMetersPerUnitForSR(c),h=1.2*Math.max(d,e);a=new b({size:[256,256],origin:{x:a[0]-.5*(h-d),y:a[3]+.5*(h-e)},lods:[{level:0,resolution:h/256,scale:1/(256/96*.0254/(h*g))}],spatialReference:c});a.ensureMaxLod(20);return a};b.WebMercatorAuxiliarySphereTileInfo={size:[256,256],origin:{x:-2.0037508342787E7,y:2.0037508342787E7},spatialReference:h.WebMercator,lods:[{level:0,resolution:156543.03392800014,scale:5.91657527591555E8}]};b.makeWebMercatorAuxiliarySphere=
- function(a){a=null!=a?a:19;var c=new b(b.WebMercatorAuxiliarySphereTileInfo);c.ensureMaxLod(a);return c};b.WebMercatorAuxiliarySphere=b.makeWebMercatorAuxiliarySphere(19);b.makeWGS84WithTileSize=function(a,c){c=null!=c?c:16;var d=256/a;a=new b({size:[a,a],origin:{x:-180,y:90},spatialReference:h.WGS84,lods:[{level:0,resolution:.703125*d,scale:2.95497598570834E8*d}]});a.ensureMaxLod(c);return a};return b})},"esri/views/3d/terrain/terrainUtilsSpherical":function(){define(["require","exports","../../../core/Error",
- "./TilingScheme"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.autoUpdateSkirtsVisibility=function(a,c){};h.checkIfTileInfoSupportedForViewSR=function(e,c,g){c=e.lods.length-1;if(e.spatialReference.isWebMercator){if(!a.makeWebMercatorAuxiliarySphere(c).compatibleWith(e))return new f("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else if(e.spatialReference.isWGS84){if(!a.makeWGS84WithTileSize(e.size[1],
- c).compatibleWith(e))return new f("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme")}else return new f("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(g&&!e.spatialReference.equals(g))return new f("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}})},"esri/views/3d/terrain/tileUtils":function(){define(["require",
- "exports","../support/PreallocArray","./UpsampleInfo"],function(r,h,f,a){function e(a,c,d,f){f=c.call(d,a,f);for(var b=0;4>b;b++){var g=a.children[b];g&&e(g,c,d,f)}}function c(a,c,d){if(Array.isArray(a))for(var b=0;b<a.length;b++)g(a[b],c,d);else g(a,c,d)}function g(a,d,e){for(var b=0;4>b;b++){var f=a.children[b];f&&c(f,d,e)}d.call(e,a)}Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(a){void 0===a&&(a=100);this.q=new f(a);this._last=null;this.done=!0}a.prototype.reset=function(a){this.q.clear();
- a&&this.q.pushEither(a);this._last=null;this.done=0===this.q.length};a.prototype.skip=function(){this._last=null;0===this.q.length&&(this.done=!0)};a.prototype.next=function(){if(this.done)return null;if(null!==this._last){var a=this._last.children;if(a[0])for(var b=4;0<=b;b--){var c=a[b];c&&this.q.push(c)}this._last=null}this._last=this.q.pop();0!==this.q.length||this._last.children[0]||(this.done=!0);return this._last};return a}();h.IteratorPreorder=r;r=function(){function a(a){void 0===a&&(a=100);
- this.q=new f(a);this.done=!0}a.prototype.reset=function(a){this.q.clear();this.q.pushEither(a);for(a=0;a<this.q.length;)for(var b=this.q.data[a++],c=0;4>c;c++){var d=b.children[c];d&&this.q.push(d)}this.done=0===this.q.length};a.prototype.next=function(){var a=this.q.pop();this.done=0===this.q.length;return a};return a}();h.IteratorPostorder=r;h.lij2str=function(a,c,d){return a+"/"+c+"/"+d};h.tile2str=function(a){return a.lij[0]+"/"+a.lij[1]+"/"+a.lij[2]};h.traverseTilesPreorder=function(a,c,d,f){if(Array.isArray(a))for(var b=
- 0;b<a.length;b++)e(a[b],c,d,f);else e(a,c,d,f)};h.traverseTilesPostorder=c;h.fallsWithinLayer=function(a,c,d){if(!c)return!1;var b=c.fullExtent,e=a.extent;if(d){if(e[0]<b.xmin||e[1]<b.ymin||e[2]>b.xmax||e[3]>b.ymax)return!1}else if(b.xmin>e[2]||b.ymin>e[3]||b.xmax<e[0]||b.ymax<e[1])return!1;a=a.parentSurface.tilingScheme.levels[a.lij[0]].scale;return 0<c.minScale&&a>1.00000001*c.minScale||0<c.maxScale&&a<.99999999*c.maxScale?!1:!0};h.isPosWithinTile=function(a,c){a=a.extent;return c[0]>=a[0]&&c[1]>=
- a[1]&&c[0]<=a[2]&&c[1]<=a[3]};h.getTileNLevelsUp=function(a,c){for(;0<c;)a=a.parent,c--;return a};h.nextTileInAncestry=function(a,c){var b=a.lij[0]-c.lij[0]-1,d=a.lij[2]>>b,e=0;a.lij[1]>>b&1&&(e+=2);d&1&&(e+=1);return c.children[e]};h.computeUpsampleInfoForAncestor=function(b,c){for(var d=1,e=0,f=0;b!==c;)if(d*=.5,e*=.5,f*=.5,b.lij[2]&1&&(e+=.5),0===(b.lij[1]&1)&&(f+=.5),b=b.parent,null==b)throw Error("tile was not a descendant of ancestorTile");b=a.Pool.acquire();b.init(c,e,f,d);return b};var d=
- [null];h.hasVisibleSiblings=function(a){Array.isArray(a)||(d[0]=a,a=d);for(var b=0;b<a.length;b++){var c=a[b],e=c.parent;if(e)for(var f=0;4>f;f++){var g=e.children[f];if(g&&g!==c&&g.visible)return!0}}return!1}})},"esri/views/3d/terrain/UpsampleInfo":function(){define(["require","exports","../../../core/ObjectPool","../lib/glMatrix"],function(r,h,f,a){var e=a.vec2d;return function(){function a(a,c,b,f){this.scale=0;this.tile=null;this.offset=e.create();void 0!==a&&this.init(a,c,b,f)}a.prototype.init=
- function(a,c,b,e){this.tile=a;this.offset[0]=c;this.offset[1]=b;this.scale=e};a.prototype.dispose=function(){this.tile=null;this.offset[0]=0;this.scale=this.offset[1]=0};a.Pool=new f(a);return a}()})},"esri/views/3d/terrain/ElevationData":function(){define(["require","exports","../../../layers/support/rasterFormats/LercCodec","../support/mathUtils","./TerrainConst"],function(r,h,f,a,e){return function(){function c(a,c,b,e){this.samplerData=null;this.level=a;this.i=c;this.j=b;this.extent=e}c.prototype.computeMinMaxValue=
- function(c,d,b,f){var g=Infinity,h=-Infinity;c-=this.level;var k=Math.pow(2,c);if(Math.floor(d/k)===this.i&&Math.floor(b/k)===this.j&&0<c){var t=this.samplerData.width,u=this.samplerData.pixelData,q=.5*e.ELEVATION_NODATA_VALUE;c=(t-1)/k;b=(b-this.j*k)*c;d=(d-this.i*k)*c;if(1>c){var k=Math.floor(b),v=Math.floor(d),r=k+v*t,m=u[r],B=u[r+1],z=u[r+t],r=u[r+t+1];if(m+B+z+r<q)return g=a.bilerp(m,B,z,r,b-k,d-v),h=a.bilerp(m,B,z,r,b-k+c,d-v),t=a.bilerp(m,B,z,r,b-k,d-v+c),c=a.bilerp(m,B,z,r,b-k+c,d-v+c),f[0]=
- Math.min(g,h,t,c),f[1]=Math.max(g,h,t,c),f;b=k;d=v;c=1}else b=Math.floor(b),d=Math.floor(d),c=Math.ceil(c);for(k=b;k<=b+c;k++)for(v=d;v<=d+c;v++)r=k+v*t,m=u[r],m<q?(g=Math.min(g,m),h=Math.max(h,m)):(g=0<g?0:g,h=0>h?0:h)}f[0]=g;f[1]=h;return f};c.createFromLERC=function(a,d,b,e){b=f.decode(b,e);a=new c(a[0],a[1],a[2],d);a.samplerData={pixelData:b.pixelData,width:b.width,height:b.height,minValue:b.minValue,maxValue:b.maxValue,noDataValue:b.noDataValue,safeWidth:.99999999*(b.width-1),dx:(b.width-1)/
- (a.extent[2]-a.extent[0]),dy:(b.width-1)/(a.extent[3]-a.extent[1]),x0:a.extent[0],y1:a.extent[3]};a.bounds=[a.samplerData.minValue,-3E38<a.samplerData.maxValue?a.samplerData.maxValue:0];return a};c.createFromFetchTileResult=function(a,d,b){a=new c(a[0],a[1],a[2],d);d=b.values;for(var e=b.noDataValue,f=Infinity,g=-Infinity,h=!0,t=0;t<d.length;t++){var u=d[t];u!==e&&(f=u<f?u:f,g=u>g?u:g,h=!1)}h&&(g=f=0);a.samplerData={pixelData:b.values,width:b.width,height:b.height,minValue:f,maxValue:g,noDataValue:e,
- safeWidth:.99999999*(b.width-1),dx:(b.width-1)/(a.extent[2]-a.extent[0]),dy:(b.width-1)/(a.extent[3]-a.extent[1]),x0:a.extent[0],y1:a.extent[3]};a.bounds=[f,g];return a};return c}()})},"esri/views/3d/terrain/TilePerLayerInfo":function(){define("require exports ./TerrainConst ./TileAgentBase ./UpsampleInfo ../../vectorTiles/VectorTileDisplayObject ../../webgl/Texture".split(" "),function(r,h,f,a,e,c,g){return function(){function d(a){this.waitingAgents=[];this.rawData=this.requestPromise=this.loadingAgent=
- this.upsampleFromTile=this.tilemapRequest=this.tilemap=this.data=null;this.pendingUpdates=0;this.elevationBounds=void 0;this.init(a)}d.prototype.init=function(a){this.waitingAgents.length=0;this.data=null;this.dataInvalidated=this.dataMissing=!1;this.rawData=this.requestPromise=this.loadingAgent=this.upsampleFromTile=this.tilemapRequest=this.tilemap=null;this.pendingUpdates=0;a===f.LayerClass.ELEVATION&&(this.elevationBounds=null)};d.prototype.invalidateSourceData=function(){this.tilemap=null;this.dataInvalidated=
- !0;this.dataMissing=!1;this.upsampleFromTile&&(e.Pool.release(this.upsampleFromTile),this.upsampleFromTile=null)};d.prototype.dispose=function(){this.loadingAgent&&this.loadingAgent!==a.AGENT_DONE&&(this.loadingAgent.dispose(),this.loadingAgent=null);this.requestPromise&&(this.requestPromise.cancel(),this.requestPromise=null);this.tilemap=null;this.tilemapRequest&&(this.tilemapRequest.cancel(),this.tilemapRequest=null);this.upsampleFromTile&&(e.Pool.release(this.upsampleFromTile),this.upsampleFromTile=
- null);this.rawData=null;this.pendingUpdates=0;this.disposeData()};d.prototype.disposeData=function(){var a=this.data;a&&(a instanceof g?a.dispose():a instanceof c&&a.dispose(),this.data=null)};d.makeEmptyLayerInfo=function(a,c){return c?(c.init(a),c):new d(a)};return d}()})},"esri/views/3d/terrain/TileAgentBase":function(){define(["require","exports","./tileUtils","./UpsampleInfo"],function(r,h,f,a){function e(c,d,b,f,h,p,n){if(!c.parent||6<n)return null;f*=.5;h*=.5;p*=.5;c.lij[2]&1&&(h+=.5);0===
- (c.lij[1]&1)&&(p+=.5);return c.parent.hasLayerData(d,b)?(d=a.Pool.acquire(),d.init(c.parent,h,p,f),d):e(c.parent,d,b,f,h,p,n+1)}var c=Error("Abstract method called on TileAgentBase");return function(){function g(){}g.prototype.init=function(c,b,e,f){this.tile=c;this.layerIdx=b;this.layerClass=e;this.suspended=f;this._tileLayerInfo=c.getLayerInfo(b,e);this._dataRequested=null;(c=this._findAncestorWithData())?(this._setUpsamplingTile(c.tile),a.Pool.release(c)):(this._tileLayerInfo.upsampleFromTile&&
- a.Pool.release(this._tileLayerInfo.upsampleFromTile),this._tileLayerInfo.upsampleFromTile=null);return this._requestNext(!0)};g.prototype.dispose=function(){this._dataRequested&&(this._dataRequested.unrequestLayerData(this.layerIdx,this.layerClass,this),this._dataRequested=null);this._tileLayerInfo=this.tile=null};g.prototype.setSuspension=function(a){a!==this.suspended&&((this.suspended=a)?this._dataRequested&&(this._dataRequested.unrequestLayerData(this.layerIdx,this.layerClass,this),this._dataRequested=
- null):this._tileLayerInfo.data||this.update())};g.prototype.update=function(){var c=this._findAncestorWithData();c&&this._tileLayerInfo.upsampleFromTile&&c.tile!==this._tileLayerInfo.upsampleFromTile.tile?this._setUpsamplingTile(c.tile):c&&a.Pool.release(c);return this._requestNext()};g.prototype.dataArrived=function(a){throw c;};g.prototype.dataMissing=function(a){this._dataRequested=null;this._tileLayerInfo.disposeData();this._requestNext()};g.prototype._agentDone=function(){this.tile.agentDone(this.layerIdx,
- this.layerClass);this.dispose()};g.prototype._requestNext=function(a){void 0===a&&(a=!1);if(this.suspended)return!0;var b=this._findNextDownload();if(this._dataRequested){if(b===this._dataRequested)return!0;this._dataRequested.unrequestLayerData(this.layerIdx,this.layerClass,this);this._dataRequested=null}b?b.requestLayerData(this.layerIdx,this.layerClass,this)&&(this._dataRequested=b):a||this._agentDone();return!!this._dataRequested};g.prototype._findNextDownload=function(){for(var a=this.layerIdx,
- b=this.layerClass,c=this.tile.parentSurface.layerViewByIndex(a,b),e=c.minDataLevel,h=c.maxDataLevel,n=this._desiredMinLevelDelta(),t=g.START_LOADING_LEVEL_DELTA+n,u=this._scaleRangeEnabled,q,v=this.tile,r=0,m=v.lij[0],B=this._tileLayerInfo.upsampleFromTile?this._tileLayerInfo.upsampleFromTile.tile.lij[0]:-1,z=this.tile.parentSurface,C=z.tilemapStats,A=z.getTilemapTile(v),D=!1;v&&(!u||f.fallsWithinLayer(v,c.layer,!1))&&v.lij[0]>=e;){var E=v.layerInfo[b][a];if(E.data&&r>=n){v.lij[0]>B&&this._setUpsamplingTile(v);
- E.dataInvalidated&&(q=v);break}if(A&&!A.tileDataAvailable(v,a,b))D=!0;else if(v.lij[0]<=h&&!E.data&&!E.dataMissing&&(q=v,r>=t))break;(v=v.parent)&&A&&(A=A.parent||z.getTilemapTile(v));r++}q&&m-q.lij[0]<n&&this._tileLayerInfo.upsampleFromTile&&(q=null);!q&&D&&C.tilesNotPresent++;return q};g.prototype._findAncestorWithData=function(){return e(this.tile,this.layerIdx,this.layerClass,1,0,0,0)};g.prototype._desiredMinLevelDelta=function(){throw c;};g.prototype._setUpsamplingTile=function(a){throw c;};
- g.prototype._unsetUpsamplingTile=function(){this._tileLayerInfo.upsampleFromTile&&a.Pool.release(this._tileLayerInfo.upsampleFromTile);this._tileLayerInfo.upsampleFromTile=null};g.START_LOADING_LEVEL_DELTA=4;g.AGENT_DONE=new g;return g}()})},"esri/views/vectorTiles/VectorTileDisplayObject":function(){define("require exports ../../core/tsSupport/extendsHelper ../../core/ObjectPool ../../core/libs/gl-matrix/mat4 ../../core/libs/gl-matrix/vec2 ../../geometry/support/spatialReferenceUtils ../2d/engine/DisplayObject ../2d/tiling/TileKey ./RenderBucket ../webgl/BufferObject".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){return function(d){function h(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];b=d.call(this)||this;b._renderBuckets=[];b._vectorTileData=null;b._symbolUpdateData=null;b.status=5;b.coords=[0,0];b.bounds=[0,0,0,0];b.tileTransform={transform:Float32Array[16],displayCoord:Float32Array[2]};b.stencilData={mask:0,reference:0};b.status=0;b.tileTransform.transform=e.create();b.tileTransform.displayCoord=c.create();0<a.length&&(f=b.acquire).call.apply(f,[b].concat(a));
- return b;var f}f(h,d);h.prototype.reset=function(){b.pool.release(this.key);this.refKey=this.key=null;this.coords[0]=0;this.coords[1]=0;this.bounds[0]=0;this.bounds[1]=0;this.bounds[2]=0;this.height=this.width=this.bounds[3]=0;this.resolution=null;this.rotation=0;this.id=this.client=this.styleLayers=this._vectorTileData=null;this.tileTransform.transform.fill(0);this.tileTransform.displayCoord.fill(0);this.stencilData.mask=0;this.stencilData.reference=0;this._renderBuckets.length=0;this._symbolUpdateData=
- null;this.status=0};h.prototype.acquire=function(a,b,c,d,e){this.key=a;this.refKey=b;b=c.lodAt(a.level).resolution;var f=c.size[0]*b,h=c.origin,k=a.col*f,l=a.row*f,n=c.spatialReference,q=0;n&&(n._isWrappable?n._isWrappable():n.isWrappable)&&(n=g.getInfo(n),q=n.valid[1]-n.valid[0]);k=h.x+k+a.world*q;h=h.y-l;this.coords[0]=k;this.coords[1]=h;this.bounds[0]=k;this.bounds[1]=h;this.bounds[2]=k+f;this.bounds[3]=h-f;this.widthInPixels=c.size[1];this.coordRange=4096;this.resolution=b;this.rotation=e;this.styleLayers=
- d;this.id=a.id;this.status=1};h.prototype.setData=function(a,b){this._vectorTileData=a;this.client=b;this.status=3};h.prototype.updateSymbolData=function(a){a&&(this._symbolUpdateData=a,this.requestRender())};h.prototype.dispose=function(){this.fillVertexArrayObject&&(this.fillVertexArrayObject.dispose(),this.fillVertexArrayObject=null);this.fillDDVertexArrayObject&&(this.fillDDVertexArrayObject.dispose(),this.fillDDVertexArrayObject=null);this.outlineVertexArrayObject&&(this.outlineVertexArrayObject.dispose(),
- this.outlineVertexArrayObject=null);this.outlineDDVertexArrayObject&&(this.outlineDDVertexArrayObject.dispose(),this.outlineDDVertexArrayObject=null);this.lineVertexArrayObject&&(this.lineVertexArrayObject.dispose(),this.lineVertexArrayObject=null);this.lineDDVertexArrayObject&&(this.lineDDVertexArrayObject.dispose(),this.lineDDVertexArrayObject=null);this.iconVertexArrayObject&&(this.iconVertexArrayObject.dispose(),this.iconVertexArrayObject=null);this.iconDDVertexArrayObject&&(this.iconDDVertexArrayObject.dispose(),
- this.iconDDVertexArrayObject=null);this.textVertexArrayObject&&(this.textVertexArrayObject.dispose(),this.textVertexArrayObject=null);this.textDDVertexArrayObject&&(this.textDDVertexArrayObject.dispose(),this.textDDVertexArrayObject=null);this.circleVertexArrayObject&&(this.circleVertexArrayObject.dispose(),this.circleVertexArrayObject=null);this.fillVertexBuffer&&(this.fillVertexBuffer.dispose(),this.fillVertexBuffer=null);this.fillDDVertexBuffer&&(this.fillDDVertexBuffer.dispose(),this.fillDDVertexBuffer=
- null);this.fillIndexBuffer&&(this.fillIndexBuffer.dispose(),this.fillIndexBuffer=null);this.outlineVertexBuffer&&(this.outlineVertexBuffer.dispose(),this.outlineVertexBuffer=null);this.outlineDDVertexBuffer&&(this.outlineDDVertexBuffer.dispose(),this.outlineDDVertexBuffer=null);this.outlineIndexBuffer&&(this.outlineIndexBuffer.dispose(),this.outlineIndexBuffer=null);this.lineVertexBuffer&&(this.lineVertexBuffer.dispose(),this.lineVertexBuffer=null);this.lineDDVertexBuffer&&(this.lineDDVertexBuffer.dispose(),
- this.lineDDVertexBuffer=null);this.lineIndexBuffer&&(this.lineIndexBuffer.dispose(),this.lineIndexBuffer=null);this.iconVertexBuffer&&(this.iconVertexBuffer.dispose(),this.iconVertexBuffer=null);this.iconDDVertexBuffer&&(this.iconDDVertexBuffer.dispose(),this.iconDDVertexBuffer=null);this.iconIndexBuffer&&(this.iconIndexBuffer.dispose(),this.iconIndexBuffer=null);this.textVertexBuffer&&(this.textVertexBuffer.dispose(),this.textVertexBuffer=null);this.textDDVertexBuffer&&(this.textDDVertexBuffer.dispose(),
- this.textDDVertexBuffer=null);this.textIndexBuffer&&(this.textIndexBuffer.dispose(),this.textIndexBuffer=null);this.circleVertexBuffer&&(this.circleVertexBuffer.dispose(),this.circleVertexBuffer=null);this.circleIndexBuffer&&(this.circleIndexBuffer.dispose(),this.circleIndexBuffer=null);this.texture&&(this.texture.dispose(),this.texture=null);this._renderBuckets.length=0;this.status=7};h.prototype.getCpuMemoryUsage=function(){return null!=this._vectorTileData&&this._vectorTileData.bufferData?this._vectorTileData.bufferData.reduce(function(a,
- b){return a+b.byteLength},0)+this._vectorTileData.bufferDataInfo.byteLength+this._vectorTileData.bucketDataInfo.byteLength:0};h.prototype.getGpuMemoryUsage=function(){var a=0;this.fillVertexBuffer&&(a+=this.fillVertexBuffer.size);this.fillDDVertexBuffer&&(a+=this.fillDDVertexBuffer.size);this.fillIndexBuffer&&(a+=this.fillIndexBuffer.size);this.outlineVertexBuffer&&(a+=this.outlineVertexBuffer.size);this.outlineDDVertexBuffer&&(a+=this.outlineDDVertexBuffer.size);this.outlineIndexBuffer&&(a+=this.outlineIndexBuffer.size);
- this.lineVertexBuffer&&(a+=this.lineVertexBuffer.size);this.lineDDVertexBuffer&&(a+=this.lineDDVertexBuffer.size);this.lineIndexBuffer&&(a+=this.lineIndexBuffer.size);this.iconVertexBuffer&&(a+=this.iconVertexBuffer.size);this.iconDDVertexBuffer&&(a+=this.iconDDVertexBuffer.size);this.iconIndexBuffer&&(a+=this.iconIndexBuffer.size);this.textVertexBuffer&&(a+=this.textVertexBuffer.size);this.textDDVertexBuffer&&(a+=this.textDDVertexBuffer.size);this.textIndexBuffer&&(a+=this.textIndexBuffer.size);
- this.circleVertexBuffer&&(a+=this.circleVertexBuffer.size);this.circleIndexBuffer&&(a+=this.circleIndexBuffer.size);this.texture&&(a+=this.texture.descriptor.width*this.texture.descriptor.height*4);return a};h.prototype.attach=function(a){if(4===this.status)return!0;this.status=3;if(!this._vectorTileData||!this._vectorTileData.bufferDataInfo)return this.status=4,!0;if(0===this._renderBuckets.length)for(var b=new Uint32Array(this._vectorTileData.bucketDataInfo),c=b.length,d=0;d<c;){var e=b[d],f=b[d+
- 1];if(0===f)f=new k.BackgroundRenderBucket,f.layerID=e,this._renderBuckets.push(f),d+=2;else if(1===f)f=new k.FillRenderBucket,f.layerID=e,f.triangleElementStart=b[d+2],f.triangleElementCount=b[d+3],f.outlineElementStart=b[d+4],f.outlineElementCount=b[d+5],this._renderBuckets.push(f),d+=6;else if(2===f)f=new k.LineRenderBucket,f.layerID=e,f.triangleElementStart=b[d+2],f.triangleElementCount=b[d+3],this._renderBuckets.push(f),d+=4;else if(3===f){f=new k.SymbolRenderBucket;f.layerID=e;f.isSDF=0!==b[d+
- 2];var g=d+3,e=b[g];g++;if(0<e)for(var h=void 0,n=void 0,p=void 0,t=0;t<e;t++)h=b[g],n=b[g+1],p=b[g+2],f.markerPerPageElementsMap.set(h,[n,p]),g+=3;var r=b[g];g++;if(0<r)for(p=n=h=void 0,t=0;t<r;t++)h=b[g],n=b[g+1],p=b[g+2],f.glyphPerPageElementsMap.set(h,[n,p]),g+=3;this._renderBuckets.push(f);d+=5+3*e+3*r}else 4===f?(f=new k.CircleRenderBucket,f.layerID=e,f.triangleElementStart=b[d+2],f.triangleElementCount=b[d+3],this._renderBuckets.push(f),d+=4):console.error("Bad bucket type!")}a=a.context;b=
- new Uint32Array(this._vectorTileData.bufferDataInfo);c=b.length;for(f=d=0;f<c;f+=2,d++)if(!(0>=b[f+1]||0===this._vectorTileData.bufferData[d].byteLength))switch(b[f]){case 1:this.fillVertexBuffer?this.fillVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.fillVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 2:this.fillDDVertexBuffer?this.fillDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.fillDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);
- break;case 3:this.fillIndexBuffer?this.fillIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.fillIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 4:this.outlineVertexBuffer?this.outlineVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.outlineVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 5:this.outlineDDVertexBuffer?this.outlineDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.outlineDDVertexBuffer=
- l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 6:this.outlineIndexBuffer?this.outlineIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.outlineIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 7:this.lineVertexBuffer?this.lineVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.lineVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 8:this.lineDDVertexBuffer?this.lineDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):
- this.lineDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 9:this.lineIndexBuffer?this.lineIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.lineIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 10:this.iconVertexBuffer?this.iconVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.iconVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 11:this.iconDDVertexBuffer?this.iconDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):
- this.iconDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 12:this.iconIndexBuffer?this.iconIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.iconIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 13:this.textVertexBuffer?this.textVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.textVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 14:this.textDDVertexBuffer?this.textDDVertexBuffer.setData(this._vectorTileData.bufferData[d]):
- this.textDDVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 15:this.textIndexBuffer?this.textIndexBuffer.setData(this._vectorTileData.bufferData[d]):this.textIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d]);break;case 16:this.circleVertexBuffer?this.circleVertexBuffer.setData(this._vectorTileData.bufferData[d]):this.circleVertexBuffer=l.createVertex(a,35044,this._vectorTileData.bufferData[d]);break;case 17:this.circleIndexBuffer?this.circleIndexBuffer.setData(this._vectorTileData.bufferData[d]):
- this.circleIndexBuffer=l.createIndex(a,35044,this._vectorTileData.bufferData[d])}this._vectorTileData=null;this.status=4;return!0};h.prototype.detach=function(a){this.client&&6!==this.status&&7!==this.status&&this.client.invoke("destructTileData",this.id);this.dispose();d.prototype.detach.call(this,a)};h.prototype.doRender=function(a){if(this.visible&&4===this.status){var b=a.context,c=a.renderer;if(b&&c){var d=a.drawphase;this._symbolUpdateData&&this._updateSymbolData(a);b.setStencilFunction(514,
- this.stencilData.reference,this.stencilData.mask);var e=this.styleLayers,f=void 0!==a.layerOpacity?a.layerOpacity:1;if(0!==f){var g,h=this._renderBuckets.length,k=0;if(0===d)for(k=h-1;0<=k;k--)g=this._renderBuckets[k],3!==g.type&&g.hasData()&&c.renderBucket(b,g,a.displayLevel,a.requiredLevel,d,this,e.layers[g.layerID],f);else for(k=0;k<h;k++)g=this._renderBuckets[k],g.hasData()&&c.renderBucket(b,g,a.displayLevel,a.requiredLevel,d,this,e.layers[g.layerID],f)}}}};h.prototype._updateSymbolData=function(a){if(!this._symbolUpdateData.bucketDataInfo)return!0;
- var b=new Uint32Array(this._symbolUpdateData.bucketDataInfo),c=b.length;if(0===c)return this._symbolUpdateData=null,!0;if(4!==this.status)return this.requestRender(),!1;a=a.context;for(var d=new Uint32Array(this._symbolUpdateData.bufferDataInfo),e=d.length,f=0,g=0;g<e;g+=2,f++)switch(d[g]){case 10:this.iconVertexBuffer&&(this.iconVertexBuffer.dispose(),this.iconVertexBuffer=null);this.iconVertexBuffer=l.createVertex(a,35044,this._symbolUpdateData.bufferData[f]);break;case 11:this.iconDDVertexBuffer&&
- (this.iconDDVertexBuffer.dispose(),this.iconDDVertexBuffer=null);this.iconDDVertexBuffer=l.createVertex(a,35044,this._symbolUpdateData.bufferData[f]);break;case 12:this.iconIndexBuffer&&(this.iconIndexBuffer.dispose(),this.iconIndexBuffer=null);this.iconIndexBuffer=l.createIndex(a,35044,this._symbolUpdateData.bufferData[f]);break;case 13:this.textVertexBuffer&&(this.textVertexBuffer.dispose(),this.textVertexBuffer=null);this.textVertexBuffer=l.createVertex(a,35044,this._symbolUpdateData.bufferData[f]);
- break;case 14:this.textDDVertexBuffer&&(this.textDDVertexBuffer.dispose(),this.textDDVertexBuffer=null);this.textDDVertexBuffer=l.createVertex(a,35044,this._symbolUpdateData.bufferData[f]);break;case 15:this.textIndexBuffer&&(this.textIndexBuffer.dispose(),this.textIndexBuffer=null),this.textIndexBuffer=l.createIndex(a,35044,this._symbolUpdateData.bufferData[f])}a=this._renderBuckets.length;for(d=0;d<a;d++)this._renderBuckets[d]instanceof k.SymbolRenderBucket&&(e=this._renderBuckets[d],e.markerPerPageElementsMap.clear(),
- e.glyphPerPageElementsMap.clear());for(a=0;a<c;){e=b[a];f=-1;g=this._renderBuckets.length;for(d=0;d<g;d++)if(this._renderBuckets[d].layerID===e){f=d;break}d=this._renderBuckets[f];d||(d=new k.SymbolRenderBucket,d.layerID=e,d.isSDF=0!==b[a+2],this._renderBuckets.push(d));var h=a+3,e=b[h];h++;if(0<e)for(var n=g=f=void 0,p=0;p<e;p++)f=b[h],g=b[h+1],n=b[h+2],d.markerPerPageElementsMap.set(f,[g,n]),h+=3;var t=b[h];h++;if(0<t)for(n=g=f=void 0,p=0;p<t;p++)f=b[h],g=b[h+1],n=b[h+2],d.glyphPerPageElementsMap.set(f,
- [g,n]),h+=3;a+=5+3*e+3*t}this.iconVertexArrayObject&&(this.iconVertexArrayObject.dispose(),this.iconVertexArrayObject=null);this.iconDDVertexArrayObject&&(this.iconDDVertexArrayObject.dispose(),this.iconDDVertexArrayObject=null);this.textVertexArrayObject&&(this.textVertexArrayObject.dispose(),this.textVertexArrayObject=null);this.textDDVertexArrayObject&&(this.textDDVertexArrayObject.dispose(),this.textDDVertexArrayObject=null);this._symbolUpdateData=null;return!0};h.pool=new a(h);return h}(d)})},
- "esri/core/libs/gl-matrix/mat4":function(){define(["./common"],function(r){var h={scalar:{},SIMD:{},create:function(){var f=new r.ARRAY_TYPE(16);f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},clone:function(f){var a=new r.ARRAY_TYPE(16);a[0]=f[0];a[1]=f[1];a[2]=f[2];a[3]=f[3];a[4]=f[4];a[5]=f[5];a[6]=f[6];a[7]=f[7];a[8]=f[8];a[9]=f[9];a[10]=f[10];a[11]=f[11];a[12]=f[12];a[13]=f[13];a[14]=f[14];a[15]=f[15];return a},copy:function(f,
- a){f[0]=a[0];f[1]=a[1];f[2]=a[2];f[3]=a[3];f[4]=a[4];f[5]=a[5];f[6]=a[6];f[7]=a[7];f[8]=a[8];f[9]=a[9];f[10]=a[10];f[11]=a[11];f[12]=a[12];f[13]=a[13];f[14]=a[14];f[15]=a[15];return f},fromValues:function(f,a,e,c,g,d,b,h,l,p,n,t,u,q,v,x){var k=new r.ARRAY_TYPE(16);k[0]=f;k[1]=a;k[2]=e;k[3]=c;k[4]=g;k[5]=d;k[6]=b;k[7]=h;k[8]=l;k[9]=p;k[10]=n;k[11]=t;k[12]=u;k[13]=q;k[14]=v;k[15]=x;return k},set:function(f,a,e,c,g,d,b,h,l,p,n,t,u,q,v,r,m){f[0]=a;f[1]=e;f[2]=c;f[3]=g;f[4]=d;f[5]=b;f[6]=h;f[7]=l;f[8]=
- p;f[9]=n;f[10]=t;f[11]=u;f[12]=q;f[13]=v;f[14]=r;f[15]=m;return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f}};h.scalar.transpose=function(f,a){if(f===a){var e=a[1],c=a[2],g=a[3],d=a[6],b=a[7],h=a[11];f[1]=a[4];f[2]=a[8];f[3]=a[12];f[4]=e;f[6]=a[9];f[7]=a[13];f[8]=c;f[9]=d;f[11]=a[14];f[12]=g;f[13]=b;f[14]=h}else f[0]=a[0],f[1]=a[4],f[2]=a[8],f[3]=a[12],f[4]=a[1],f[5]=a[5],f[6]=a[9],f[7]=a[13],
- f[8]=a[2],f[9]=a[6],f[10]=a[10],f[11]=a[14],f[12]=a[3],f[13]=a[7],f[14]=a[11],f[15]=a[15];return f};h.SIMD.transpose=function(f,a){var e,c,g,d,b,h;e=SIMD.Float32x4.load(a,0);c=SIMD.Float32x4.load(a,4);g=SIMD.Float32x4.load(a,8);a=SIMD.Float32x4.load(a,12);d=SIMD.Float32x4.shuffle(e,c,0,1,4,5);b=SIMD.Float32x4.shuffle(g,a,0,1,4,5);h=SIMD.Float32x4.shuffle(d,b,0,2,4,6);d=SIMD.Float32x4.shuffle(d,b,1,3,5,7);SIMD.Float32x4.store(f,0,h);SIMD.Float32x4.store(f,4,d);d=SIMD.Float32x4.shuffle(e,c,2,3,6,7);
- b=SIMD.Float32x4.shuffle(g,a,2,3,6,7);e=SIMD.Float32x4.shuffle(d,b,0,2,4,6);c=SIMD.Float32x4.shuffle(d,b,1,3,5,7);SIMD.Float32x4.store(f,8,e);SIMD.Float32x4.store(f,12,c);return f};h.transpose=r.USE_SIMD?h.SIMD.transpose:h.scalar.transpose;h.scalar.invert=function(f,a){var e=a[0],c=a[1],g=a[2],d=a[3],b=a[4],h=a[5],l=a[6],p=a[7],n=a[8],t=a[9],u=a[10],q=a[11],v=a[12],r=a[13],m=a[14];a=a[15];var B=e*h-c*b,z=e*l-g*b,C=e*p-d*b,A=c*l-g*h,D=c*p-d*h,E=g*p-d*l,F=n*r-t*v,I=n*m-u*v,P=n*a-q*v,G=t*m-u*r,M=t*a-
- q*r,H=u*a-q*m,J=B*H-z*M+C*G+A*P-D*I+E*F;if(!J)return null;J=1/J;f[0]=(h*H-l*M+p*G)*J;f[1]=(g*M-c*H-d*G)*J;f[2]=(r*E-m*D+a*A)*J;f[3]=(u*D-t*E-q*A)*J;f[4]=(l*P-b*H-p*I)*J;f[5]=(e*H-g*P+d*I)*J;f[6]=(m*C-v*E-a*z)*J;f[7]=(n*E-u*C+q*z)*J;f[8]=(b*M-h*P+p*F)*J;f[9]=(c*P-e*M-d*F)*J;f[10]=(v*D-r*C+a*B)*J;f[11]=(t*C-n*D-q*B)*J;f[12]=(h*I-b*G-l*F)*J;f[13]=(e*G-c*I+g*F)*J;f[14]=(r*z-v*A-m*B)*J;f[15]=(n*A-t*z+u*B)*J;return f};h.SIMD.invert=function(f,a){var e,c,g,d,b,h,l,p;b=SIMD.Float32x4.load(a,0);h=SIMD.Float32x4.load(a,
- 4);l=SIMD.Float32x4.load(a,8);p=SIMD.Float32x4.load(a,12);a=SIMD.Float32x4.shuffle(b,h,0,1,4,5);c=SIMD.Float32x4.shuffle(l,p,0,1,4,5);e=SIMD.Float32x4.shuffle(a,c,0,2,4,6);c=SIMD.Float32x4.shuffle(c,a,1,3,5,7);a=SIMD.Float32x4.shuffle(b,h,2,3,6,7);d=SIMD.Float32x4.shuffle(l,p,2,3,6,7);g=SIMD.Float32x4.shuffle(a,d,0,2,4,6);d=SIMD.Float32x4.shuffle(d,a,1,3,5,7);a=SIMD.Float32x4.mul(g,d);a=SIMD.Float32x4.swizzle(a,1,0,3,2);b=SIMD.Float32x4.mul(c,a);h=SIMD.Float32x4.mul(e,a);a=SIMD.Float32x4.swizzle(a,
- 2,3,0,1);b=SIMD.Float32x4.sub(SIMD.Float32x4.mul(c,a),b);h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(e,a),h);h=SIMD.Float32x4.swizzle(h,2,3,0,1);a=SIMD.Float32x4.mul(c,g);a=SIMD.Float32x4.swizzle(a,1,0,3,2);b=SIMD.Float32x4.add(SIMD.Float32x4.mul(d,a),b);p=SIMD.Float32x4.mul(e,a);a=SIMD.Float32x4.swizzle(a,2,3,0,1);b=SIMD.Float32x4.sub(b,SIMD.Float32x4.mul(d,a));p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(e,a),p);p=SIMD.Float32x4.swizzle(p,2,3,0,1);a=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,2,3,0,1),d);
- a=SIMD.Float32x4.swizzle(a,1,0,3,2);g=SIMD.Float32x4.swizzle(g,2,3,0,1);b=SIMD.Float32x4.add(SIMD.Float32x4.mul(g,a),b);l=SIMD.Float32x4.mul(e,a);a=SIMD.Float32x4.swizzle(a,2,3,0,1);b=SIMD.Float32x4.sub(b,SIMD.Float32x4.mul(g,a));l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(e,a),l);l=SIMD.Float32x4.swizzle(l,2,3,0,1);a=SIMD.Float32x4.mul(e,c);a=SIMD.Float32x4.swizzle(a,1,0,3,2);l=SIMD.Float32x4.add(SIMD.Float32x4.mul(d,a),l);p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(g,a),p);a=SIMD.Float32x4.swizzle(a,2,
- 3,0,1);l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(d,a),l);p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(g,a));a=SIMD.Float32x4.mul(e,d);a=SIMD.Float32x4.swizzle(a,1,0,3,2);h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(g,a));l=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,a),l);a=SIMD.Float32x4.swizzle(a,2,3,0,1);h=SIMD.Float32x4.add(SIMD.Float32x4.mul(g,a),h);l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(c,a));a=SIMD.Float32x4.mul(e,g);a=SIMD.Float32x4.swizzle(a,1,0,3,2);h=SIMD.Float32x4.add(SIMD.Float32x4.mul(d,a),h);
- p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(c,a));a=SIMD.Float32x4.swizzle(a,2,3,0,1);h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(d,a));p=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,a),p);e=SIMD.Float32x4.mul(e,b);e=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(e,2,3,0,1),e);e=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(e,1,0,3,2),e);a=SIMD.Float32x4.reciprocalApproximation(e);e=SIMD.Float32x4.sub(SIMD.Float32x4.add(a,a),SIMD.Float32x4.mul(e,SIMD.Float32x4.mul(a,a)));e=SIMD.Float32x4.swizzle(e,0,0,0,0);if(!e)return null;
- SIMD.Float32x4.store(f,0,SIMD.Float32x4.mul(e,b));SIMD.Float32x4.store(f,4,SIMD.Float32x4.mul(e,h));SIMD.Float32x4.store(f,8,SIMD.Float32x4.mul(e,l));SIMD.Float32x4.store(f,12,SIMD.Float32x4.mul(e,p));return f};h.invert=r.USE_SIMD?h.SIMD.invert:h.scalar.invert;h.scalar.adjoint=function(f,a){var e=a[0],c=a[1],g=a[2],d=a[3],b=a[4],h=a[5],l=a[6],p=a[7],n=a[8],t=a[9],u=a[10],q=a[11],v=a[12],r=a[13],m=a[14];a=a[15];f[0]=h*(u*a-q*m)-t*(l*a-p*m)+r*(l*q-p*u);f[1]=-(c*(u*a-q*m)-t*(g*a-d*m)+r*(g*q-d*u));f[2]=
- c*(l*a-p*m)-h*(g*a-d*m)+r*(g*p-d*l);f[3]=-(c*(l*q-p*u)-h*(g*q-d*u)+t*(g*p-d*l));f[4]=-(b*(u*a-q*m)-n*(l*a-p*m)+v*(l*q-p*u));f[5]=e*(u*a-q*m)-n*(g*a-d*m)+v*(g*q-d*u);f[6]=-(e*(l*a-p*m)-b*(g*a-d*m)+v*(g*p-d*l));f[7]=e*(l*q-p*u)-b*(g*q-d*u)+n*(g*p-d*l);f[8]=b*(t*a-q*r)-n*(h*a-p*r)+v*(h*q-p*t);f[9]=-(e*(t*a-q*r)-n*(c*a-d*r)+v*(c*q-d*t));f[10]=e*(h*a-p*r)-b*(c*a-d*r)+v*(c*p-d*h);f[11]=-(e*(h*q-p*t)-b*(c*q-d*t)+n*(c*p-d*h));f[12]=-(b*(t*m-u*r)-n*(h*m-l*r)+v*(h*u-l*t));f[13]=e*(t*m-u*r)-n*(c*m-g*r)+v*(c*
- u-g*t);f[14]=-(e*(h*m-l*r)-b*(c*m-g*r)+v*(c*l-g*h));f[15]=e*(h*u-l*t)-b*(c*u-g*t)+n*(c*l-g*h);return f};h.SIMD.adjoint=function(f,a){var e,c,g,d,b,h,l,p;e=SIMD.Float32x4.load(a,0);c=SIMD.Float32x4.load(a,4);g=SIMD.Float32x4.load(a,8);d=SIMD.Float32x4.load(a,12);h=SIMD.Float32x4.shuffle(e,c,0,1,4,5);b=SIMD.Float32x4.shuffle(g,d,0,1,4,5);a=SIMD.Float32x4.shuffle(h,b,0,2,4,6);b=SIMD.Float32x4.shuffle(b,h,1,3,5,7);h=SIMD.Float32x4.shuffle(e,c,2,3,6,7);c=SIMD.Float32x4.shuffle(g,d,2,3,6,7);e=SIMD.Float32x4.shuffle(h,
- c,0,2,4,6);c=SIMD.Float32x4.shuffle(c,h,1,3,5,7);h=SIMD.Float32x4.mul(e,c);h=SIMD.Float32x4.swizzle(h,1,0,3,2);g=SIMD.Float32x4.mul(b,h);d=SIMD.Float32x4.mul(a,h);h=SIMD.Float32x4.swizzle(h,2,3,0,1);g=SIMD.Float32x4.sub(SIMD.Float32x4.mul(b,h),g);d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,h),d);d=SIMD.Float32x4.swizzle(d,2,3,0,1);h=SIMD.Float32x4.mul(b,e);h=SIMD.Float32x4.swizzle(h,1,0,3,2);g=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,h),g);p=SIMD.Float32x4.mul(a,h);h=SIMD.Float32x4.swizzle(h,2,3,0,1);
- g=SIMD.Float32x4.sub(g,SIMD.Float32x4.mul(c,h));p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,h),p);p=SIMD.Float32x4.swizzle(p,2,3,0,1);h=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,2,3,0,1),c);h=SIMD.Float32x4.swizzle(h,1,0,3,2);e=SIMD.Float32x4.swizzle(e,2,3,0,1);g=SIMD.Float32x4.add(SIMD.Float32x4.mul(e,h),g);l=SIMD.Float32x4.mul(a,h);h=SIMD.Float32x4.swizzle(h,2,3,0,1);g=SIMD.Float32x4.sub(g,SIMD.Float32x4.mul(e,h));l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,h),l);l=SIMD.Float32x4.swizzle(l,2,3,0,
- 1);h=SIMD.Float32x4.mul(a,b);h=SIMD.Float32x4.swizzle(h,1,0,3,2);l=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,h),l);p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(e,h),p);h=SIMD.Float32x4.swizzle(h,2,3,0,1);l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(c,h),l);p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(e,h));h=SIMD.Float32x4.mul(a,c);h=SIMD.Float32x4.swizzle(h,1,0,3,2);d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(e,h));l=SIMD.Float32x4.add(SIMD.Float32x4.mul(b,h),l);h=SIMD.Float32x4.swizzle(h,2,3,0,1);d=SIMD.Float32x4.add(SIMD.Float32x4.mul(e,
- h),d);l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(b,h));h=SIMD.Float32x4.mul(a,e);h=SIMD.Float32x4.swizzle(h,1,0,3,2);d=SIMD.Float32x4.add(SIMD.Float32x4.mul(c,h),d);p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(b,h));h=SIMD.Float32x4.swizzle(h,2,3,0,1);d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(c,h));p=SIMD.Float32x4.add(SIMD.Float32x4.mul(b,h),p);SIMD.Float32x4.store(f,0,g);SIMD.Float32x4.store(f,4,d);SIMD.Float32x4.store(f,8,l);SIMD.Float32x4.store(f,12,p);return f};h.adjoint=r.USE_SIMD?h.SIMD.adjoint:
- h.scalar.adjoint;h.determinant=function(f){var a=f[0],e=f[1],c=f[2],g=f[3],d=f[4],b=f[5],h=f[6],l=f[7],p=f[8],n=f[9],t=f[10],u=f[11],q=f[12],v=f[13],r=f[14];f=f[15];return(a*b-e*d)*(t*f-u*r)-(a*h-c*d)*(n*f-u*v)+(a*l-g*d)*(n*r-t*v)+(e*h-c*b)*(p*f-u*q)-(e*l-g*b)*(p*r-t*q)+(c*l-g*h)*(p*v-n*q)};h.SIMD.multiply=function(f,a,e){var c=SIMD.Float32x4.load(a,0),g=SIMD.Float32x4.load(a,4),d=SIMD.Float32x4.load(a,8);a=SIMD.Float32x4.load(a,12);var b=SIMD.Float32x4.load(e,0),b=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,
- 0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,1,1,1,1),g),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,2,2,2,2),d),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,3,3,3,3),a))));SIMD.Float32x4.store(f,0,b);b=SIMD.Float32x4.load(e,4);b=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,1,1,1,1),g),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,2,2,2,2),d),
- SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,3,3,3,3),a))));SIMD.Float32x4.store(f,4,b);b=SIMD.Float32x4.load(e,8);b=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,1,1,1,1),g),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,2,2,2,2),d),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b,3,3,3,3),a))));SIMD.Float32x4.store(f,8,b);e=SIMD.Float32x4.load(e,12);c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,
- 0,0,0,0),c),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,1,1,1,1),g),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,2,2,2,2),d),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,3,3,3,3),a))));SIMD.Float32x4.store(f,12,c);return f};h.scalar.multiply=function(f,a,e){var c=a[0],g=a[1],d=a[2],b=a[3],h=a[4],l=a[5],p=a[6],n=a[7],t=a[8],u=a[9],q=a[10],v=a[11],r=a[12],m=a[13],B=a[14];a=a[15];var z=e[0],C=e[1],A=e[2],D=e[3];f[0]=z*c+C*h+A*t+D*r;f[1]=z*g+C*l+A*u+D*m;f[2]=z*d+C*
- p+A*q+D*B;f[3]=z*b+C*n+A*v+D*a;z=e[4];C=e[5];A=e[6];D=e[7];f[4]=z*c+C*h+A*t+D*r;f[5]=z*g+C*l+A*u+D*m;f[6]=z*d+C*p+A*q+D*B;f[7]=z*b+C*n+A*v+D*a;z=e[8];C=e[9];A=e[10];D=e[11];f[8]=z*c+C*h+A*t+D*r;f[9]=z*g+C*l+A*u+D*m;f[10]=z*d+C*p+A*q+D*B;f[11]=z*b+C*n+A*v+D*a;z=e[12];C=e[13];A=e[14];D=e[15];f[12]=z*c+C*h+A*t+D*r;f[13]=z*g+C*l+A*u+D*m;f[14]=z*d+C*p+A*q+D*B;f[15]=z*b+C*n+A*v+D*a;return f};h.multiply=r.USE_SIMD?h.SIMD.multiply:h.scalar.multiply;h.mul=h.multiply;h.scalar.translate=function(f,a,e){var c=
- e[0],g=e[1];e=e[2];var d,b,h,l,p,n,t,u,q,v,r,m;a===f?(f[12]=a[0]*c+a[4]*g+a[8]*e+a[12],f[13]=a[1]*c+a[5]*g+a[9]*e+a[13],f[14]=a[2]*c+a[6]*g+a[10]*e+a[14],f[15]=a[3]*c+a[7]*g+a[11]*e+a[15]):(d=a[0],b=a[1],h=a[2],l=a[3],p=a[4],n=a[5],t=a[6],u=a[7],q=a[8],v=a[9],r=a[10],m=a[11],f[0]=d,f[1]=b,f[2]=h,f[3]=l,f[4]=p,f[5]=n,f[6]=t,f[7]=u,f[8]=q,f[9]=v,f[10]=r,f[11]=m,f[12]=d*c+p*g+q*e+a[12],f[13]=b*c+n*g+v*e+a[13],f[14]=h*c+t*g+r*e+a[14],f[15]=l*c+u*g+m*e+a[15]);return f};h.SIMD.translate=function(f,a,e){var c=
- SIMD.Float32x4.load(a,0),g=SIMD.Float32x4.load(a,4),d=SIMD.Float32x4.load(a,8),b=SIMD.Float32x4.load(a,12);e=SIMD.Float32x4(e[0],e[1],e[2],0);a!==f&&(f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3],f[4]=a[4],f[5]=a[5],f[6]=a[6],f[7]=a[7],f[8]=a[8],f[9]=a[9],f[10]=a[10],f[11]=a[11]);c=SIMD.Float32x4.mul(c,SIMD.Float32x4.swizzle(e,0,0,0,0));g=SIMD.Float32x4.mul(g,SIMD.Float32x4.swizzle(e,1,1,1,1));d=SIMD.Float32x4.mul(d,SIMD.Float32x4.swizzle(e,2,2,2,2));a=SIMD.Float32x4.add(c,SIMD.Float32x4.add(g,SIMD.Float32x4.add(d,
- b)));SIMD.Float32x4.store(f,12,a);return f};h.translate=r.USE_SIMD?h.SIMD.translate:h.scalar.translate;h.scalar.scale=function(f,a,e){var c=e[0],g=e[1];e=e[2];f[0]=a[0]*c;f[1]=a[1]*c;f[2]=a[2]*c;f[3]=a[3]*c;f[4]=a[4]*g;f[5]=a[5]*g;f[6]=a[6]*g;f[7]=a[7]*g;f[8]=a[8]*e;f[9]=a[9]*e;f[10]=a[10]*e;f[11]=a[11]*e;f[12]=a[12];f[13]=a[13];f[14]=a[14];f[15]=a[15];return f};h.SIMD.scale=function(f,a,e){var c;e=SIMD.Float32x4(e[0],e[1],e[2],0);c=SIMD.Float32x4.load(a,0);SIMD.Float32x4.store(f,0,SIMD.Float32x4.mul(c,
- SIMD.Float32x4.swizzle(e,0,0,0,0)));c=SIMD.Float32x4.load(a,4);SIMD.Float32x4.store(f,4,SIMD.Float32x4.mul(c,SIMD.Float32x4.swizzle(e,1,1,1,1)));c=SIMD.Float32x4.load(a,8);SIMD.Float32x4.store(f,8,SIMD.Float32x4.mul(c,SIMD.Float32x4.swizzle(e,2,2,2,2)));f[12]=a[12];f[13]=a[13];f[14]=a[14];f[15]=a[15];return f};h.scale=r.USE_SIMD?h.SIMD.scale:h.scalar.scale;h.rotate=function(f,a,e,c){var g=c[0],d=c[1];c=c[2];var b=Math.sqrt(g*g+d*d+c*c),h,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G;if(Math.abs(b)<r.EPSILON)return null;
- b=1/b;g*=b;d*=b;c*=b;h=Math.sin(e);l=Math.cos(e);p=1-l;e=a[0];b=a[1];n=a[2];t=a[3];u=a[4];q=a[5];v=a[6];x=a[7];m=a[8];B=a[9];z=a[10];C=a[11];A=g*g*p+l;D=d*g*p+c*h;E=c*g*p-d*h;F=g*d*p-c*h;I=d*d*p+l;P=c*d*p+g*h;G=g*c*p+d*h;g=d*c*p-g*h;d=c*c*p+l;f[0]=e*A+u*D+m*E;f[1]=b*A+q*D+B*E;f[2]=n*A+v*D+z*E;f[3]=t*A+x*D+C*E;f[4]=e*F+u*I+m*P;f[5]=b*F+q*I+B*P;f[6]=n*F+v*I+z*P;f[7]=t*F+x*I+C*P;f[8]=e*G+u*g+m*d;f[9]=b*G+q*g+B*d;f[10]=n*G+v*g+z*d;f[11]=t*G+x*g+C*d;a!==f&&(f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);
- return f};h.scalar.rotateX=function(f,a,e){var c=Math.sin(e);e=Math.cos(e);var g=a[4],d=a[5],b=a[6],h=a[7],l=a[8],p=a[9],n=a[10],t=a[11];a!==f&&(f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3],f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);f[4]=g*e+l*c;f[5]=d*e+p*c;f[6]=b*e+n*c;f[7]=h*e+t*c;f[8]=l*e-g*c;f[9]=p*e-d*c;f[10]=n*e-b*c;f[11]=t*e-h*c;return f};h.SIMD.rotateX=function(f,a,e){var c=SIMD.Float32x4.splat(Math.sin(e));e=SIMD.Float32x4.splat(Math.cos(e));a!==f&&(f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3],
- f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);var g=SIMD.Float32x4.load(a,4);a=SIMD.Float32x4.load(a,8);SIMD.Float32x4.store(f,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(g,e),SIMD.Float32x4.mul(a,c)));SIMD.Float32x4.store(f,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,e),SIMD.Float32x4.mul(g,c)));return f};h.rotateX=r.USE_SIMD?h.SIMD.rotateX:h.scalar.rotateX;h.scalar.rotateY=function(f,a,e){var c=Math.sin(e);e=Math.cos(e);var g=a[0],d=a[1],b=a[2],h=a[3],l=a[8],p=a[9],n=a[10],t=a[11];a!==f&&(f[4]=a[4],
- f[5]=a[5],f[6]=a[6],f[7]=a[7],f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);f[0]=g*e-l*c;f[1]=d*e-p*c;f[2]=b*e-n*c;f[3]=h*e-t*c;f[8]=g*c+l*e;f[9]=d*c+p*e;f[10]=b*c+n*e;f[11]=h*c+t*e;return f};h.SIMD.rotateY=function(f,a,e){var c=SIMD.Float32x4.splat(Math.sin(e));e=SIMD.Float32x4.splat(Math.cos(e));a!==f&&(f[4]=a[4],f[5]=a[5],f[6]=a[6],f[7]=a[7],f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);var g=SIMD.Float32x4.load(a,0);a=SIMD.Float32x4.load(a,8);SIMD.Float32x4.store(f,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(g,
- e),SIMD.Float32x4.mul(a,c)));SIMD.Float32x4.store(f,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(g,c),SIMD.Float32x4.mul(a,e)));return f};h.rotateY=r.USE_SIMD?h.SIMD.rotateY:h.scalar.rotateY;h.scalar.rotateZ=function(f,a,e){var c=Math.sin(e);e=Math.cos(e);var g=a[0],d=a[1],b=a[2],h=a[3],l=a[4],p=a[5],n=a[6],t=a[7];a!==f&&(f[8]=a[8],f[9]=a[9],f[10]=a[10],f[11]=a[11],f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);f[0]=g*e+l*c;f[1]=d*e+p*c;f[2]=b*e+n*c;f[3]=h*e+t*c;f[4]=l*e-g*c;f[5]=p*e-d*c;f[6]=n*e-b*
- c;f[7]=t*e-h*c;return f};h.SIMD.rotateZ=function(f,a,e){var c=SIMD.Float32x4.splat(Math.sin(e));e=SIMD.Float32x4.splat(Math.cos(e));a!==f&&(f[8]=a[8],f[9]=a[9],f[10]=a[10],f[11]=a[11],f[12]=a[12],f[13]=a[13],f[14]=a[14],f[15]=a[15]);var g=SIMD.Float32x4.load(a,0);a=SIMD.Float32x4.load(a,4);SIMD.Float32x4.store(f,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(g,e),SIMD.Float32x4.mul(a,c)));SIMD.Float32x4.store(f,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,e),SIMD.Float32x4.mul(g,c)));return f};h.rotateZ=r.USE_SIMD?
- h.SIMD.rotateZ:h.scalar.rotateZ;h.fromTranslation=function(f,a){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=a[0];f[13]=a[1];f[14]=a[2];f[15]=1;return f};h.fromScaling=function(f,a){f[0]=a[0];f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=a[1];f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=a[2];f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.fromRotation=function(f,a,e){var c=e[0],g=e[1];e=e[2];var d=Math.sqrt(c*c+g*g+e*e),b;if(Math.abs(d)<r.EPSILON)return null;d=1/d;c*=d;
- g*=d;e*=d;d=Math.sin(a);a=Math.cos(a);b=1-a;f[0]=c*c*b+a;f[1]=g*c*b+e*d;f[2]=e*c*b-g*d;f[3]=0;f[4]=c*g*b-e*d;f[5]=g*g*b+a;f[6]=e*g*b+c*d;f[7]=0;f[8]=c*e*b+g*d;f[9]=g*e*b-c*d;f[10]=e*e*b+a;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.fromXRotation=function(f,a){var e=Math.sin(a);a=Math.cos(a);f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=a;f[6]=e;f[7]=0;f[8]=0;f[9]=-e;f[10]=a;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.fromYRotation=function(f,a){var e=Math.sin(a);a=Math.cos(a);f[0]=a;f[1]=
- 0;f[2]=-e;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=e;f[9]=0;f[10]=a;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.fromZRotation=function(f,a){var e=Math.sin(a);a=Math.cos(a);f[0]=a;f[1]=e;f[2]=0;f[3]=0;f[4]=-e;f[5]=a;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.fromRotationTranslation=function(f,a,e){var c=a[0],g=a[1],d=a[2],b=a[3],h=c+c,l=g+g,p=d+d;a=c*h;var n=c*l,c=c*p,t=g*l,g=g*p,d=d*p,h=b*h,l=b*l,b=b*p;f[0]=1-(t+d);f[1]=n+b;f[2]=c-l;f[3]=0;f[4]=
- n-b;f[5]=1-(a+d);f[6]=g+h;f[7]=0;f[8]=c+l;f[9]=g-h;f[10]=1-(a+t);f[11]=0;f[12]=e[0];f[13]=e[1];f[14]=e[2];f[15]=1;return f};h.getTranslation=function(f,a){f[0]=a[12];f[1]=a[13];f[2]=a[14];return f};h.getRotation=function(f,a){var e=a[0]+a[5]+a[10],c=0;0<e?(c=2*Math.sqrt(e+1),f[3]=.25*c,f[0]=(a[6]-a[9])/c,f[1]=(a[8]-a[2])/c,f[2]=(a[1]-a[4])/c):a[0]>a[5]&a[0]>a[10]?(c=2*Math.sqrt(1+a[0]-a[5]-a[10]),f[3]=(a[6]-a[9])/c,f[0]=.25*c,f[1]=(a[1]+a[4])/c,f[2]=(a[8]+a[2])/c):a[5]>a[10]?(c=2*Math.sqrt(1+a[5]-
- a[0]-a[10]),f[3]=(a[8]-a[2])/c,f[0]=(a[1]+a[4])/c,f[1]=.25*c,f[2]=(a[6]+a[9])/c):(c=2*Math.sqrt(1+a[10]-a[0]-a[5]),f[3]=(a[1]-a[4])/c,f[0]=(a[8]+a[2])/c,f[1]=(a[6]+a[9])/c,f[2]=.25*c);return f};h.fromRotationTranslationScale=function(f,a,e,c){var g=a[0],d=a[1],b=a[2],h=a[3],l=g+g,p=d+d,n=b+b;a=g*l;var t=g*p,g=g*n,u=d*p,d=d*n,b=b*n,l=h*l,p=h*p,h=h*n,n=c[0],q=c[1];c=c[2];f[0]=(1-(u+b))*n;f[1]=(t+h)*n;f[2]=(g-p)*n;f[3]=0;f[4]=(t-h)*q;f[5]=(1-(a+b))*q;f[6]=(d+l)*q;f[7]=0;f[8]=(g+p)*c;f[9]=(d-l)*c;f[10]=
- (1-(a+u))*c;f[11]=0;f[12]=e[0];f[13]=e[1];f[14]=e[2];f[15]=1;return f};h.fromRotationTranslationScaleOrigin=function(f,a,e,c,g){var d=a[0],b=a[1],h=a[2],l=a[3],p=d+d,n=b+b,t=h+h;a=d*p;var u=d*n,d=d*t,q=b*n,b=b*t,h=h*t,p=l*p,n=l*n,l=l*t,t=c[0],v=c[1];c=c[2];var r=g[0],m=g[1];g=g[2];f[0]=(1-(q+h))*t;f[1]=(u+l)*t;f[2]=(d-n)*t;f[3]=0;f[4]=(u-l)*v;f[5]=(1-(a+h))*v;f[6]=(b+p)*v;f[7]=0;f[8]=(d+n)*c;f[9]=(b-p)*c;f[10]=(1-(a+q))*c;f[11]=0;f[12]=e[0]+r-(f[0]*r+f[4]*m+f[8]*g);f[13]=e[1]+m-(f[1]*r+f[5]*m+f[9]*
- g);f[14]=e[2]+g-(f[2]*r+f[6]*m+f[10]*g);f[15]=1;return f};h.fromQuat=function(f,a){var e=a[0],c=a[1],g=a[2];a=a[3];var d=e+e,b=c+c,h=g+g,e=e*d,l=c*d,c=c*b,p=g*d,n=g*b,g=g*h,d=a*d,b=a*b;a*=h;f[0]=1-c-g;f[1]=l+a;f[2]=p-b;f[3]=0;f[4]=l-a;f[5]=1-e-g;f[6]=n+d;f[7]=0;f[8]=p+b;f[9]=n-d;f[10]=1-e-c;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f};h.frustum=function(f,a,e,c,g,d,b){var h=1/(e-a),l=1/(g-c),p=1/(d-b);f[0]=2*d*h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=2*d*l;f[6]=0;f[7]=0;f[8]=(e+a)*h;f[9]=(g+c)*l;f[10]=
- (b+d)*p;f[11]=-1;f[12]=0;f[13]=0;f[14]=b*d*2*p;f[15]=0;return f};h.perspective=function(f,a,e,c,g){a=1/Math.tan(a/2);var d=1/(c-g);f[0]=a/e;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=a;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=(g+c)*d;f[11]=-1;f[12]=0;f[13]=0;f[14]=2*g*c*d;f[15]=0;return f};h.perspectiveFromFieldOfView=function(f,a,e,c){var g=Math.tan(a.upDegrees*Math.PI/180),d=Math.tan(a.downDegrees*Math.PI/180),b=Math.tan(a.leftDegrees*Math.PI/180);a=Math.tan(a.rightDegrees*Math.PI/180);var h=2/(b+a),l=2/(g+d);f[0]=
- h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=l;f[6]=0;f[7]=0;f[8]=-((b-a)*h*.5);f[9]=(g-d)*l*.5;f[10]=c/(e-c);f[11]=-1;f[12]=0;f[13]=0;f[14]=c*e/(e-c);f[15]=0;return f};h.ortho=function(f,a,e,c,g,d,b){var h=1/(a-e),l=1/(c-g),p=1/(d-b);f[0]=-2*h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=-2*l;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=2*p;f[11]=0;f[12]=(a+e)*h;f[13]=(g+c)*l;f[14]=(b+d)*p;f[15]=1;return f};h.lookAt=function(f,a,e,c){var g,d,b,k,l,p,n,t,u=a[0],q=a[1];a=a[2];b=c[0];k=c[1];d=c[2];n=e[0];c=e[1];g=e[2];if(Math.abs(u-
- n)<r.EPSILON&&Math.abs(q-c)<r.EPSILON&&Math.abs(a-g)<r.EPSILON)return h.identity(f);e=u-n;c=q-c;n=a-g;t=1/Math.sqrt(e*e+c*c+n*n);e*=t;c*=t;n*=t;g=k*n-d*c;d=d*e-b*n;b=b*c-k*e;(t=Math.sqrt(g*g+d*d+b*b))?(t=1/t,g*=t,d*=t,b*=t):b=d=g=0;k=c*b-n*d;l=n*g-e*b;p=e*d-c*g;(t=Math.sqrt(k*k+l*l+p*p))?(t=1/t,k*=t,l*=t,p*=t):p=l=k=0;f[0]=g;f[1]=k;f[2]=e;f[3]=0;f[4]=d;f[5]=l;f[6]=c;f[7]=0;f[8]=b;f[9]=p;f[10]=n;f[11]=0;f[12]=-(g*u+d*q+b*a);f[13]=-(k*u+l*q+p*a);f[14]=-(e*u+c*q+n*a);f[15]=1;return f};h.str=function(f){return"mat4("+
- f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+", "+f[8]+", "+f[9]+", "+f[10]+", "+f[11]+", "+f[12]+", "+f[13]+", "+f[14]+", "+f[15]+")"};h.frob=function(f){return Math.sqrt(Math.pow(f[0],2)+Math.pow(f[1],2)+Math.pow(f[2],2)+Math.pow(f[3],2)+Math.pow(f[4],2)+Math.pow(f[5],2)+Math.pow(f[6],2)+Math.pow(f[7],2)+Math.pow(f[8],2)+Math.pow(f[9],2)+Math.pow(f[10],2)+Math.pow(f[11],2)+Math.pow(f[12],2)+Math.pow(f[13],2)+Math.pow(f[14],2)+Math.pow(f[15],2))};h.add=function(f,a,
- e){f[0]=a[0]+e[0];f[1]=a[1]+e[1];f[2]=a[2]+e[2];f[3]=a[3]+e[3];f[4]=a[4]+e[4];f[5]=a[5]+e[5];f[6]=a[6]+e[6];f[7]=a[7]+e[7];f[8]=a[8]+e[8];f[9]=a[9]+e[9];f[10]=a[10]+e[10];f[11]=a[11]+e[11];f[12]=a[12]+e[12];f[13]=a[13]+e[13];f[14]=a[14]+e[14];f[15]=a[15]+e[15];return f};h.subtract=function(f,a,e){f[0]=a[0]-e[0];f[1]=a[1]-e[1];f[2]=a[2]-e[2];f[3]=a[3]-e[3];f[4]=a[4]-e[4];f[5]=a[5]-e[5];f[6]=a[6]-e[6];f[7]=a[7]-e[7];f[8]=a[8]-e[8];f[9]=a[9]-e[9];f[10]=a[10]-e[10];f[11]=a[11]-e[11];f[12]=a[12]-e[12];
- f[13]=a[13]-e[13];f[14]=a[14]-e[14];f[15]=a[15]-e[15];return f};h.sub=h.subtract;h.multiplyScalar=function(f,a,e){f[0]=a[0]*e;f[1]=a[1]*e;f[2]=a[2]*e;f[3]=a[3]*e;f[4]=a[4]*e;f[5]=a[5]*e;f[6]=a[6]*e;f[7]=a[7]*e;f[8]=a[8]*e;f[9]=a[9]*e;f[10]=a[10]*e;f[11]=a[11]*e;f[12]=a[12]*e;f[13]=a[13]*e;f[14]=a[14]*e;f[15]=a[15]*e;return f};h.multiplyScalarAndAdd=function(f,a,e,c){f[0]=a[0]+e[0]*c;f[1]=a[1]+e[1]*c;f[2]=a[2]+e[2]*c;f[3]=a[3]+e[3]*c;f[4]=a[4]+e[4]*c;f[5]=a[5]+e[5]*c;f[6]=a[6]+e[6]*c;f[7]=a[7]+e[7]*
- c;f[8]=a[8]+e[8]*c;f[9]=a[9]+e[9]*c;f[10]=a[10]+e[10]*c;f[11]=a[11]+e[11]*c;f[12]=a[12]+e[12]*c;f[13]=a[13]+e[13]*c;f[14]=a[14]+e[14]*c;f[15]=a[15]+e[15]*c;return f};h.exactEquals=function(f,a){return f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]&&f[4]===a[4]&&f[5]===a[5]&&f[6]===a[6]&&f[7]===a[7]&&f[8]===a[8]&&f[9]===a[9]&&f[10]===a[10]&&f[11]===a[11]&&f[12]===a[12]&&f[13]===a[13]&&f[14]===a[14]&&f[15]===a[15]};h.equals=function(f,a){var e=f[0],c=f[1],g=f[2],d=f[3],b=f[4],h=f[5],l=f[6],p=f[7],
- n=f[8],t=f[9],u=f[10],q=f[11],v=f[12],x=f[13],m=f[14];f=f[15];var B=a[0],z=a[1],C=a[2],A=a[3],D=a[4],E=a[5],F=a[6],I=a[7],P=a[8],G=a[9],M=a[10],H=a[11],J=a[12],O=a[13],N=a[14];a=a[15];return Math.abs(e-B)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(B))&&Math.abs(c-z)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(z))&&Math.abs(g-C)<=r.EPSILON*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(d-A)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(b-D)<=r.EPSILON*Math.max(1,Math.abs(b),Math.abs(D))&&
- Math.abs(h-E)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(l-F)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(p-I)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(n-P)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(P))&&Math.abs(t-G)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(u-M)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(q-H)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(H))&&Math.abs(v-J)<=r.EPSILON*Math.max(1,Math.abs(v),Math.abs(J))&&Math.abs(x-
- O)<=r.EPSILON*Math.max(1,Math.abs(x),Math.abs(O))&&Math.abs(m-N)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(f-a)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(a))};return h})},"esri/core/libs/gl-matrix/common":function(){define([],function(){var r={EPSILON:1E-6};r.ARRAY_TYPE="undefined"!==typeof Float32Array?Float32Array:Array;r.RANDOM=Math.random;r.ENABLE_SIMD=!1;r.SIMD_AVAILABLE=r.ARRAY_TYPE===Float32Array&&"SIMD"in this;r.USE_SIMD=r.ENABLE_SIMD&&r.SIMD_AVAILABLE;r.setMatrixArrayType=
- function(f){r.ARRAY_TYPE=f};var h=Math.PI/180;r.toRadian=function(f){return f*h};r.equals=function(f,a){return Math.abs(f-a)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(a))};return r})},"esri/core/libs/gl-matrix/vec2":function(){define(["./common"],function(r){var h={create:function(){var f=new r.ARRAY_TYPE(2);f[0]=0;f[1]=0;return f},clone:function(f){var a=new r.ARRAY_TYPE(2);a[0]=f[0];a[1]=f[1];return a},fromValues:function(f,a){var e=new r.ARRAY_TYPE(2);e[0]=f;e[1]=a;return e},copy:function(f,a){f[0]=
- a[0];f[1]=a[1];return f},set:function(f,a,e){f[0]=a;f[1]=e;return f},add:function(f,a,e){f[0]=a[0]+e[0];f[1]=a[1]+e[1];return f},subtract:function(f,a,e){f[0]=a[0]-e[0];f[1]=a[1]-e[1];return f}};h.sub=h.subtract;h.multiply=function(f,a,e){f[0]=a[0]*e[0];f[1]=a[1]*e[1];return f};h.mul=h.multiply;h.divide=function(f,a,e){f[0]=a[0]/e[0];f[1]=a[1]/e[1];return f};h.div=h.divide;h.ceil=function(f,a){f[0]=Math.ceil(a[0]);f[1]=Math.ceil(a[1]);return f};h.floor=function(f,a){f[0]=Math.floor(a[0]);f[1]=Math.floor(a[1]);
- return f};h.min=function(f,a,e){f[0]=Math.min(a[0],e[0]);f[1]=Math.min(a[1],e[1]);return f};h.max=function(f,a,e){f[0]=Math.max(a[0],e[0]);f[1]=Math.max(a[1],e[1]);return f};h.round=function(f,a){f[0]=Math.round(a[0]);f[1]=Math.round(a[1]);return f};h.scale=function(f,a,e){f[0]=a[0]*e;f[1]=a[1]*e;return f};h.scaleAndAdd=function(f,a,e,c){f[0]=a[0]+e[0]*c;f[1]=a[1]+e[1]*c;return f};h.distance=function(f,a){var e=a[0]-f[0];f=a[1]-f[1];return Math.sqrt(e*e+f*f)};h.dist=h.distance;h.squaredDistance=function(f,
- a){var e=a[0]-f[0];f=a[1]-f[1];return e*e+f*f};h.sqrDist=h.squaredDistance;h.length=function(f){var a=f[0];f=f[1];return Math.sqrt(a*a+f*f)};h.len=h.length;h.squaredLength=function(f){var a=f[0];f=f[1];return a*a+f*f};h.sqrLen=h.squaredLength;h.negate=function(f,a){f[0]=-a[0];f[1]=-a[1];return f};h.inverse=function(f,a){f[0]=1/a[0];f[1]=1/a[1];return f};h.normalize=function(f,a){var e=a[0],c=a[1],e=e*e+c*c;0<e&&(e=1/Math.sqrt(e),f[0]=a[0]*e,f[1]=a[1]*e);return f};h.dot=function(f,a){return f[0]*a[0]+
- f[1]*a[1]};h.cross=function(f,a,e){a=a[0]*e[1]-a[1]*e[0];f[0]=f[1]=0;f[2]=a;return f};h.lerp=function(f,a,e,c){var g=a[0];a=a[1];f[0]=g+c*(e[0]-g);f[1]=a+c*(e[1]-a);return f};h.random=function(f,a){a=a||1;var e=2*r.RANDOM()*Math.PI;f[0]=Math.cos(e)*a;f[1]=Math.sin(e)*a;return f};h.transformMat2=function(f,a,e){var c=a[0];a=a[1];f[0]=e[0]*c+e[2]*a;f[1]=e[1]*c+e[3]*a;return f};h.transformMat2d=function(f,a,e){var c=a[0];a=a[1];f[0]=e[0]*c+e[2]*a+e[4];f[1]=e[1]*c+e[3]*a+e[5];return f};h.transformMat3=
- function(f,a,e){var c=a[0];a=a[1];f[0]=e[0]*c+e[3]*a+e[6];f[1]=e[1]*c+e[4]*a+e[7];return f};h.transformMat4=function(f,a,e){var c=a[0];a=a[1];f[0]=e[0]*c+e[4]*a+e[12];f[1]=e[1]*c+e[5]*a+e[13];return f};h.forEach=function(){var f=h.create();return function(a,e,c,g,d,b){e||(e=2);c||(c=0);for(g=g?Math.min(g*e+c,a.length):a.length;c<g;c+=e)f[0]=a[c],f[1]=a[c+1],d(f,f,b),a[c]=f[0],a[c+1]=f[1];return a}}();h.str=function(f){return"vec2("+f[0]+", "+f[1]+")"};h.exactEquals=function(f,a){return f[0]===a[0]&&
- f[1]===a[1]};h.equals=function(f,a){var e=f[0];f=f[1];var c=a[0];a=a[1];return Math.abs(e-c)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(f-a)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(a))};return h})},"esri/views/2d/engine/DisplayObject":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","./Evented"],function(r,h,f,a){return function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c._renderRequestedCalled=!1;c._attached=!1;c._opacity=1;c.renderRequested=
- !1;c._visible=!0;return c}f(c,a);Object.defineProperty(c.prototype,"attached",{get:function(){return this._attached},set:function(a){this._attached!==a&&((this._attached=a)?this.hasEventListener("attach")&&this.emit("attach"):this.hasEventListener("detach")&&this.emit("detach"))},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"opacity",{get:function(){return this._opacity},set:function(a){this._opacity!==a&&(this._opacity=a,this.requestRender())},enumerable:!0,configurable:!0});
- Object.defineProperty(c.prototype,"visible",{get:function(){return this._visible},set:function(a){this._visible!==a&&(this._visible=a,this.requestRender())},enumerable:!0,configurable:!0});c.prototype.attach=function(a){return!0};c.prototype.detach=function(a){};c.prototype.processRender=function(a){this._renderRequestedCalled=!1;this.doRender(a);this._renderRequestedCalled||(this.renderRequested=!1);this.hasEventListener("post-render")&&this.emit("post-render")};c.prototype.requestRender=function(){var a=
- this.renderRequested;this.renderRequested=this._renderRequestedCalled=!0;this.parent&&this.parent.requestChildRender(this);a!==this.renderRequested&&this.hasEventListener("will-render")&&this.emit("will-render")};c.prototype.dispose=function(){};return c}(a.Evented)})},"esri/views/2d/engine/Evented":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","dojo/aspect","dojo/on"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function c(){}
- c.prototype.on=function(c,d){return a.after(this,"on"+c,d,!0)};c.prototype.once=function(a,c){return e.once(this,a,c)};c.prototype.emit=function(a){e.emit(this,a,this)};c.prototype.hasEventListener=function(a){a="on"+a;return!(!this[a]||!this[a].after)};return c}();h.Evented=r;h.EventedMixin=function(c){return function(c){function d(){return null!==c&&c.apply(this,arguments)||this}f(d,c);d.prototype.on=function(b,c){return a.after(this,"on"+b,c,!0)};d.prototype.once=function(a,c){return e.once(this,
- a,c)};d.prototype.emit=function(a,c){e.emit(this,a,c)};d.prototype.hasEventListener=function(a){a="on"+a;return!(!this[a]||!this[a].after)};return d}(c)}})},"esri/views/vectorTiles/RenderBucket":function(){define(["require","exports","../../core/tsSupport/extendsHelper","../../core/tsSupport/decorateHelper"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});r=function(){return function(a){this.type=a}}();h.RenderBucket=r;a=function(a){function c(){var c=a.call(this,2)||this;c.triangleElementStart=
- 0;c.triangleElementCount=0;return c}f(c,a);c.prototype.hasData=function(){return 0<this.triangleElementCount};return c}(r);h.LineRenderBucket=a;a=function(a){function c(){var c=a.call(this,1)||this;c.triangleElementStart=0;c.triangleElementCount=0;c.outlineElementStart=0;c.outlineElementCount=0;return c}f(c,a);c.prototype.hasData=function(){return 0<this.triangleElementCount||0<this.outlineElementCount};return c}(r);h.FillRenderBucket=a;a=function(a){function c(){var c=a.call(this,3)||this;c.markerPerPageElementsMap=
- new Map;c.glyphPerPageElementsMap=new Map;c.isSDF=!1;return c}f(c,a);c.prototype.hasData=function(){return 0<this.markerPerPageElementsMap.size||0<this.glyphPerPageElementsMap.size};return c}(r);h.SymbolRenderBucket=a;a=function(a){function c(){var c=a.call(this,4)||this;c.triangleElementStart=0;c.triangleElementCount=0;return c}f(c,a);c.prototype.hasData=function(){return 0<this.triangleElementCount};return c}(r);h.CircleRenderBucket=a;r=function(a){function c(){return a.call(this,0)||this}f(c,a);
- c.prototype.hasData=function(){return!0};return c}(r);h.BackgroundRenderBucket=r})},"esri/views/3d/terrain/ElevationTileAgent":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/ObjectPool ./TerrainConst ./TileAgentBase ./UpsampleInfo".split(" "),function(r,h,f,a,e,c,g){return function(c){function b(){var a=null!==c&&c.apply(this,arguments)||this;a._scaleRangeEnabled=!1;return a}f(b,c);b.prototype.dataArrived=function(a){a!==this.tile?this._setUpsamplingTile(a):
- (this._unsetUpsamplingTile(),this.updateGeometry());this._dataRequested=null;this._requestNext()};b.prototype.updateGeometry=function(){this._tileLayerInfo.pendingUpdates|=e.TileUpdateTypes.UPDATE_GEOMETRY;this.tile.updateGeometry()};b.prototype._findAncestorWithData=function(){for(var a=this.layerClass,b=this.layerIdx,c=this.tile,d=c.vlevel,f;c&&!(c.layerInfo[a][b].data&&(f=c,d-c.lij[0]>=e.ELEVATION_DESIRED_RESOLUTION_LEVEL));)c=c.parent;return f?(a=g.Pool.acquire(),a.init(f,0,0,1),a):null};b.prototype._desiredMinLevelDelta=
- function(){return e.ELEVATION_DESIRED_RESOLUTION_LEVEL-(this.tile.vlevel-this.tile.lij[0])};b.prototype._setUpsamplingTile=function(a){this._unsetUpsamplingTile();var b=g.Pool.acquire();b.init(a,0,0,1);this._tileLayerInfo.upsampleFromTile=b;this.updateGeometry()};b.Pool=new a(b);return b}(c)})},"esri/views/3d/terrain/MapTileAgent":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/ObjectPool ./TileAgentBase ./tileUtils".split(" "),function(r,h,f,a,e,c){return function(e){function d(){var a=
- e.call(this)||this;a._scaleRangeEnabled=!0;return a}f(d,e);d.prototype.dataArrived=function(a){a!==this.tile?this._setUpsamplingTile(a):(this._unsetUpsamplingTile(),this.tile.updateTexture());this._dataRequested=null;a!==this.tile&&this._requestNext()};d.prototype._desiredMinLevelDelta=function(){return 0};d.prototype._setUpsamplingTile=function(a){this._tileLayerInfo.upsampleFromTile&&this._tileLayerInfo.upsampleFromTile.tile===a||(this._unsetUpsamplingTile(),this._tileLayerInfo.upsampleFromTile=
- c.computeUpsampleInfoForAncestor(this.tile,a),this.tile.updateTexture())};d.Pool=new a(d);return d}(e)})},"esri/views/3d/terrain/TileGeometryFactory":function(){define("require exports ../support/aaBoundingBox ../support/ArrayPool ../support/earthUtils ../support/mathUtils ./TerrainConst".split(" "),function(r,h,f,a,e,c,g){function d(a,b,d){for(var e=0;e<d.length;e++){var f=d[e];if(f){var h=f.safeWidth,k=f.width,l=f.pixelData,m=c.clamp(f.dy*(f.y1-b),0,h),f=c.clamp(f.dx*(a-f.x0),0,h),h=Math.floor(m),
- n=Math.floor(f),q=h*k+n,p=q+k,t=l[q],k=l[p],q=l[q+1],l=l[p+1];if(t+k+q+l<.5*g.ELEVATION_NODATA_VALUE)return m-=h,f-=n,a=t+(q-t)*f,a+(k+(l-k)*f-a)*m}}return null}function b(a,b,c,d){var e=0<(c&2),f=b+(d?1024:0)+(e?2048:0),g=n[f];if(!g){var g=b-1,h=b-1,k=b*b,l=2*g+2*h,m=g*h*6,q=6*l,p=6*(2*g+h-1);d&&(m*=2,q*=2,p*=2);for(var l=65536<k+l?new Uint32Array(m+q):new Uint16Array(m+q),t=0,u=0,v=m,r,x,z,B,X=0,Q=0;Q<=h;Q++){e&&(X=0===Q?p:Q===h?-p:0);for(var v=v+X,K=0;K<=g;K++)B=x=-1,0===Q&&(x=k+K,K!==g&&(B=t+
- 1)),K===g&&(x=k+g+Q,Q<h&&(B=t+g+1)),Q===h&&(x=k+g+h+(g-K),0<K&&(B=t-1)),0===K&&0<Q&&(x=k+2*g+h+(h-Q),B=t-(g+1)),-1<x&&(z=0===K&&1===Q?k:x+1,-1<B&&(r=t,d?(l[v+0]=r,l[v+1]=x,l[v+2]=x,l[v+3]=z,l[v+4]=z,l[v+5]=r,l[v+6]=z,l[v+7]=B,l[v+8]=B,l[v+9]=r,l[v+10]=r,l[v+11]=z,v+=12):(l[v+0]=r,l[v+1]=x,l[v+2]=z,l[v+3]=z,l[v+4]=B,l[v+5]=r,v+=6))),++t,K<g&&Q<h&&(r=Q*(g+1)+K,x=r+1,z=x+(g+1),B=z-1,d?(l[u+0]=r,l[u+1]=x,l[u+2]=x,l[u+3]=z,l[u+4]=z,l[u+5]=r,l[u+6]=z,l[u+7]=B,l[u+8]=B,l[u+9]=r,l[u+10]=r,l[u+11]=z,u+=12):
- (l[u+0]=r,l[u+1]=x,l[u+2]=z,l[u+3]=z,l[u+4]=B,l[u+5]=r,u+=6));v-=X}g={values:l,numSurfaceIndices:m,numSkirtIndices:q};n[f]=g}a.indices=g.values;a.numSurfaceIndices=g.numSurfaceIndices;a.numSkirtIndices=g.numSkirtIndices;a.numWithoutSkirtIndices=a.numSurfaceIndices+(c?6*(b-1)*(d?2:1):0)}function k(a,b,c,d){a<d[0]&&(d[0]=a);a>d[3]&&(d[3]=a);b<d[1]&&(d[1]=b);b>d[4]&&(d[4]=b);c<d[2]&&(d[2]=c);c>d[5]&&(d[5]=c)}function l(a,b,c,d,f){a*=e.earthRadius;for(var g=0;g<=b;g++)c[5*d]=0,c[5*d+1]=0,c[5*d+2]=a,k(0,
- 0,a,f),d++}Object.defineProperty(h,"__esModule",{value:!0});var p=new a.ArrayPool(Float32Array);h.releaseGeometry=function(a){p.put(a.vertexAttributes);a.vertexAttributes=null;a.indices=null};h.elevationSampler=d;h.createSphericalGlobeTile=function(a,g,h,n,r,A,D,E,F){var m=h[0],x=h[1],z=h[2],B=h[3],C=Math.max(.9,1-.5*(z-m));h=a-1;var J=a-1,O=a*a,N=p.get(5*(O+(2*h+2*J))),S=F.boundingBox;f.set(S,f.NEGATIVE_INFINITY);var R=g[2]-g[0],Y=g[3]-g[1],X=z-m,z=A[0],Q=A[1];A=A[2];for(var K=0;K<=h;K++){var L=
- K/h,V=m+L*X;t[K]=Math.sin(V);u[K]=Math.cos(V);q[K]=L;v[K]=g[0]+L*R}for(R=m=0;R<=J;R++){var X=R/J,K=c.lerp(x,B,X),V=Math.cos(K),U=Math.sin(K),ca=void 0;n?(ca=e.earthRadius/2*Math.log((1+U)/(1-U)),X=(ca-g[1])/Y):ca=180*K/Math.PI;for(K=0;K<=h;K++){var L=q[K],ga=t[K],da=u[K],ka=e.earthRadius;r&&(ka+=d(v[K],ca,r)||0);var da=da*V*ka,ga=ga*V*ka,ka=U*ka,Z=da-z,ea=ga-Q,ja=ka-A;k(Z,ea,ja,S);var aa=5*m;N[aa+0]=Z;N[aa+1]=ea;N[aa+2]=ja;N[aa+3]=L;N[aa+4]=X;aa=-1;0===R&&(aa=O+K);K===h&&(aa=O+h+R);R===J&&(aa=O+h+
- J+(h-K));0===K&&0<R&&(aa=O+2*h+J+(J-R));-1<aa&&(da=da*C-z,ga=ga*C-Q,ka=ka*C-A,k(da,ga,ka,S),aa*=5,N[aa+0]=da,N[aa+1]=ga,N[aa+2]=ka,N[aa+3]=L,N[aa+4]=X);++m}}n&&(g=!!(D&2),D&1&&l(-1,h,N,O,S),g&&l(1,h,N,O+h+J,S));F.numVertsPerRow=a;F.vertexAttributes=N;b(F,a,n?D:0,E)};h.createPlanarGlobeTile=function(a,c,e,g,h,l,n){var m=c[0],q=c[1],t=c[2]-m;c=c[3]-q;var u=.1*t,v=a-1,r=a-1,x=a*a,z=p.get(5*(x+(2*v+2*r))),B=n.boundingBox;f.set(B,f.NEGATIVE_INFINITY);for(var A=0,C=0;C<=r;C++){var D=C/r,Y=q+D*c;l&&(Y<l[1]?
- (Y=l[1],D=(Y-q)/c):Y>l[3]&&(Y=l[3],D=(Y-q)/c));for(var X=0;X<=v;X++){var Q=X/v,K=m+Q*t;l&&(K<l[0]?(K=l[0],Q=(K-m)/t):K>l[2]&&(K=l[2],Q=(K-m)/t));var L=e?d(K,Y,e)||0:0,K=K-g[0],V=Y-g[1],L=L-g[2];k(K,V,L,B);z[5*A]=K;z[5*A+1]=V;z[5*A+2]=L;z[5*A+3]=Q;z[5*A+4]=D;var U=-1;0===C&&(U=x+X);X===v&&(U=x+v+C);C===r&&(U=x+v+r+(v-X));0===X&&0<C&&(U=x+2*v+r+(r-C));-1<U&&(z[5*U]=K,z[5*U+1]=V,z[5*U+2]=L-u,z[5*U+3]=Q,z[5*U+4]=D,k(K,V,L-u,B));++A}}n.numVertsPerRow=a;n.vertexAttributes=z;b(n,a,0,h)};var n=[],t=Array(g.MAX_TILE_TESSELATION+
- 1),u=Array(g.MAX_TILE_TESSELATION+1),q=Array(g.MAX_TILE_TESSELATION+1),v=Array(g.MAX_TILE_TESSELATION+1)})},"esri/views/3d/support/ArrayPool":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function f(a,e){void 0===e&&(e=50);this.arrayConstructor=a;this.maxPoolSizePerCount=e;this.pool={}}f.prototype.get=function(a){var e=this.pool[a];e||(e={ptr:0,data:Array(this.maxPoolSizePerCount)},this.pool[a]=e);0<e.ptr?(a=e.data[--e.ptr],e.data[e.ptr]=
- null):a=new this.arrayConstructor(a);return a};f.prototype.put=function(a){var e=this.pool[a.length];e.ptr<e.data.length&&(e.data[e.ptr++]=a)};return f}();h.ArrayPool=r})},"esri/views/3d/terrain/SphericalTile":function(){define("./TileBase ./TileGeometryFactory ../../../core/ObjectPool ../support/mathUtils ../support/earthUtils ../lib/glMatrix".split(" "),function(r,h,f,a,e,c){var g=c.vec3d,d=e.earthRadius,b=function(a,b,c,e){c=d+c;var f=Math.cos(a);e[0]=Math.cos(b)*f*c;e[1]=Math.sin(b)*f*c;e[2]=
- Math.sin(a)*c};e=function(a,b,c,d){r.call(this);this.tileUp=g.create();this.obb=Array(8);this._isWebMercator=!1;for(var e=0;8>e;e++)this.obb[e]=g.create();void 0!==a&&this.init(a,b,c,d)};e.prototype=new r;e.prototype.constructor=e;e.prototype.init=function(c,e,f,h){r.prototype.init.call(this,c,e,f,h);this._isWebMercator=h.spatialReference.isWebMercator;e=this.extentWGS84Rad[0];f=this.extentWGS84Rad[1];h=this.extentWGS84Rad[2];var k=this.extentWGS84Rad[3];c=c[0];var l=a.lerp(f,k,.5),n=a.lerp(e,h,.5);
- this.edgeLen=(h-e)*Math.cos(0===c?0:Math.min(Math.abs(f),Math.abs(k)))*d;this.curvatureHeight=d-Math.sqrt(d*d-this.edgeLen*this.edgeLen/4);b(l,n,0,this.centerAtSeaLevel);g.set(this.centerAtSeaLevel,this.tileUp);g.normalize(this.tileUp);this._updateOBB();this.updateRadiusAndCenter()};e.prototype.isVisible=function(a,b){if(!this.intersectsClippingArea)return!1;if(9<this.lij[0]){b=this.obb;for(var c=0;6>c;c++){for(var d=0;8>d&&!(0>a[c][0]*b[d][0]+a[c][1]*b[d][1]+a[c][2]*b[d][2]+a[c][3]);d++);if(8===
- d)return!1}}else if(b=this.radius,c=this.center,a[0][0]*c[0]+a[0][1]*c[1]+a[0][2]*c[2]+a[0][3]>b||a[1][0]*c[0]+a[1][1]*c[1]+a[1][2]*c[2]+a[1][3]>b||a[2][0]*c[0]+a[2][1]*c[1]+a[2][2]*c[2]+a[2][3]>b||a[3][0]*c[0]+a[3][1]*c[1]+a[3][2]*c[2]+a[3][3]>b||a[4][0]*c[0]+a[4][1]*c[1]+a[4][2]*c[2]+a[4][3]>b||a[5][0]*c[0]+a[5][1]*c[1]+a[5][2]*c[2]+a[5][3]>b)return!1;return!0};e.prototype.computeElevationBounds=function(){r.prototype.computeElevationBounds.call(this);this._updateOBB()};e.prototype.updateRadiusAndCenter=
- function(){if(0===this.lij[0])g.set3(0,0,0,this.center),this.radius=d+this.elevationBounds[1];else{r.prototype.updateRadiusAndCenter.call(this);var a=Math.max(g.dist2(this.center,this.obb[0]),g.dist2(this.center,this.obb[1]));this.radius=Math.sqrt(a)}};e.prototype._numSubdivisionsAtLevel=[128,64,32,16,16,8,8,4];e.prototype.createGeometry=function(a,b,c,d){var e=this._isPole(this.lij[1],this.lij[0]);a.needsUpdate=!1;return h.createSphericalGlobeTile(a.numVertsPerRow,this.extent,this.extentWGS84Rad,
- this._isWebMercator,a.samplerData,b,e,c,d)};e.prototype._updateOBB=function(){var a=this.extentWGS84Rad,c=this.obb,e;for(e=0;2>e;e++){var f=this.elevationBounds[e],h=4*e;b(a[1],a[0],f,c[h++]);b(a[3],a[0],f,c[h++]);b(a[3],a[2],f,c[h++]);b(a[1],a[2],f,c[h++])}this._isWebMercator&&(a=this._isPole(this.lij[1],this.lij[0]),2===a?(g.set3(0,0,d,c[1]),g.set3(0,0,d,c[2]),g.set3(0,0,d,c[5]),g.set3(0,0,d,c[6])):1===a&&(g.set3(0,0,-d,c[0]),g.set3(0,0,-d,c[3]),g.set3(0,0,-d,c[4]),g.set3(0,0,-d,c[7])))};e.prototype._isPole=
- function(a,b){var c=0;a===(1<<b)-1&&(c+=1);0===a&&(c+=2);return c};e.Pool=new f(e);return e})},"esri/views/3d/terrain/SurfaceExtentHelper":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/arrayUtils ../../../core/Handles ../../../core/accessorSupport/decorators ../../../geometry/support/webMercatorUtils ../../../views/3d/support/aaBoundingRect ./TerrainConst ./terrainUtils".split(" "),function(r,
- h,f,a,e,c,g,d,b,k,l,p){function n(a,c){a&&!a.spatialReference.equals(c)&&(a=b.canProject(a.spatialReference,c)?b.project(a,c):null);return a}Object.defineProperty(h,"__esModule",{value:!0});r=function(b){function c(a){a=b.call(this,a)||this;a._changeListeners=new g;return a}f(c,b);c.prototype.initialize=function(){var a=this;this._changeListeners.add([this.layerViews.on("change",function(){return a.notifyChange("stencilEnabledExtents")})])};c.prototype.destroy=function(){this._changeListeners.destroy();
- this._changeListeners=null};Object.defineProperty(c.prototype,"layerViewsExtent",{get:function(){return this._computeLayerViewsExtent()},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"tiledLayersExtent",{get:function(){return this._computeTiledLayersExtent()},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"stencilEnabledExtents",{get:function(){return this._computeStencilEnabledExtents(this.layerViews,this.spatialReference)},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,
- "spatialReference",{set:function(a){this.tilingScheme||this._set("spatialReference",a)},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"tilingScheme",{set:function(a){this._set("tilingScheme",a);this._set("spatialReference",a.spatialReference)},enumerable:!0,configurable:!0});c.prototype._computeStencilEnabledExtents=function(a,b){var c=[],d=0;for(a=a.items;d<a.length;d++){var e=a[d].layer;"IntegratedMeshLayer"===e.operationalLayerType&&null!=b&&(e=n(e.fullExtent,b),null!=e&&c.push([e.xmin,
- e.ymin,e.xmax,e.ymax]))}return c};a([d.property({readOnly:!0})],c.prototype,"layerViewsExtent",null);a([d.property({readOnly:!0,dependsOn:["spatialReference","tilingScheme"]})],c.prototype,"tiledLayersExtent",null);a([d.property({readOnly:!0,dependsOn:["spatialReference"]})],c.prototype,"stencilEnabledExtents",null);a([d.property()],c.prototype,"spatialReference",null);a([d.property()],c.prototype,"tilingScheme",null);a([d.property()],c.prototype,"defaultTiledLayersExtent",void 0);a([d.property({constructOnly:!0})],
- c.prototype,"layers",void 0);a([d.property({constructOnly:!0})],c.prototype,"layerViews",void 0);return c=a([d.subclass()],c)}(d.declared(e));e=function(b){function c(){return null!==b&&b.apply(this,arguments)||this}f(c,b);c.prototype._computeLayerViewsExtent=function(){return this._getGlobalExtent()};c.prototype._computeTiledLayersExtent=function(){return this._getGlobalExtent()};c.prototype._getGlobalExtent=function(){return this.spatialReference.isWebMercator?l.WEBMERCATOR_WORLD_EXTENT:l.GEOGRAPHIC_WORLD_EXTENT};
- a([d.property({dependsOn:["spatialReference"]})],c.prototype,"layerViewsExtent",void 0);return c=a([d.subclass()],c)}(d.declared(r));h.SurfaceExtentHelperGlobal=e;r=function(b){function e(){return null!==b&&b.apply(this,arguments)||this}f(e,b);e.prototype.initialize=function(){var a=this;this._changeListeners.add([this.layers.on("change",function(){return a.notifyChange("tiledLayersExtent")}),this.layerViews.on("change",function(){return a.notifyChange("layerViewsExtent")})])};e.prototype._computeLayerViewsExtent=
- function(){var a=k.create(k.NEGATIVE_INFINITY),b=this.spatialReference;this.layerViews.forEach(function(c){c.isResolved()&&(c=c.fullExtentInViewSpatialReference||c.layer.fullExtent,(c=n(c,b))&&k.expand(a,c))});var d=k.allFinite(a)?a:null,e=this._get("layerViewsExtent");return c.equals(d,e)?e:d};e.prototype._computeTiledLayersExtent=function(){var a=this.tilingScheme;if(!a)return null;var b=this.spatialReference,d=k.create(k.NEGATIVE_INFINITY);this.layers.forEach(function(c){if(c.loaded&&p.isTiledLayer(c)){var e=
- p.getTiledLayerInfo(c,b,"local");c=e.tileInfo;e=e.fullExtent;c&&a.compatibleWith(c)&&e&&e.spatialReference.equals(b)&&k.expand(d,e)}});this.defaultTiledLayersExtent&&k.expand(d,this.defaultTiledLayersExtent);var e=k.allFinite(d)?d:null,f=this._get("tiledLayersExtent");return c.equals(e,f)?f:e};return e=a([d.subclass()],e)}(d.declared(r));h.SurfaceExtentHelperLocal=r})},"esri/views/3d/terrain/SurfaceTilingSchemeLogic":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/Handles ../../../core/accessorSupport/decorators ./terrainUtils ./TilingScheme".split(" "),
- function(r,h,f,a,e,c,g,d,b){return function(e){function h(a){a=e.call(this,a)||this;a._changeHandles=new c;return a}f(h,e);h.prototype.initialize=function(){var a=this;this._changeHandles.add(this.layers.on("change",function(){return a._update()}));this._changeHandles.add(this.extentHelper.watch("layerViewsExtent",function(){return a._setAdHocTilingScheme()}));this._update();this.tilingSchemeLocked||this._setAdHocTilingScheme()};h.prototype.destroy=function(){this._changeHandles.destroy();this._changeHandles=
- null};h.prototype._update=function(){var a=this;this._waitTask=null;if(!this.tilingSchemeLocked){this._set("tilingSchemeDone",!1);var c=this.layers.find(function(b){return d.isTiledLayer(b)?b.isFulfilled()?b.isRejected()?!1:!!d.getTiledLayerInfo(b,a.viewSpatialReference,a.manifold).tileInfo:!0:!1});if(c)if(c.isResolved()){var e=d.getTiledLayerInfo(c,this.viewSpatialReference,this.manifold).tileInfo,e=new b(e),c=d.getKnownTiledServiceLevelCap(c.url);Infinity>c&&e.capMaxLod(c);this._set("tilingSchemeDone",
- !0);this._lockTilingScheme(e)}else this._updateWhen(c);else this._set("tilingSchemeDone",!0)}};h.prototype._updateWhen=function(a){var b=this,c=a.when().always(function(){c===b._waitTask&&b._update()});this._waitTask=c};h.prototype._lockTilingScheme=function(a){var c=this;if("spherical"===this.manifold){var d=a.levels.length-1;a=a.spatialReference.isWebMercator?b.makeWebMercatorAuxiliarySphere(d):b.makeWGS84WithTileSize(a.pixelSize[0],d)}this.tilingSchemeLocked=!0;this.tilingScheme=a;this.extentHelper.tilingScheme=
- this.tilingScheme;this._updateTiledLayerExtent();this._changeHandles.removeAll();this._changeHandles.add(this.extentHelper.watch("tiledLayersExtent",function(){return c._updateTiledLayerExtent()}))};h.prototype._updateTiledLayerExtent=function(){this.extent=this.extentHelper.tiledLayersExtent};h.prototype._setAdHocTilingScheme=function(){if("spherical"===this.manifold)this.tilingScheme=this.extentHelper.spatialReference.isWebMercator?b.WebMercatorAuxiliarySphere:b.makeWGS84WithTileSize(256),this.extent=
- this.extentHelper.layerViewsExtent;else{var a=this.extentHelper.layerViewsExtent;a&&(this.tilingScheme=b.fromExtent(a,this.extentHelper.spatialReference),this.extent=a)}};a([g.property()],h.prototype,"tilingScheme",void 0);a([g.property()],h.prototype,"extent",void 0);a([g.property({value:!1})],h.prototype,"tilingSchemeLocked",void 0);a([g.property({readOnly:!0,value:!1})],h.prototype,"tilingSchemeDone",void 0);a([g.property({constructOnly:!0})],h.prototype,"viewSpatialReference",void 0);a([g.property({constructOnly:!0})],
- h.prototype,"layers",void 0);a([g.property({constructOnly:!0})],h.prototype,"extentHelper",void 0);a([g.property({constructOnly:!0})],h.prototype,"manifold",void 0);return h=a([g.subclass()],h)}(g.declared(e))})},"esri/views/3d/terrain/TerrainRenderer":function(){define("dojo/when ./tileUtils ./TerrainConst ./TileGeometryFactory ./TileRenderData ./ResourceCounter ./TileRenderer ../support/PreallocArray ../../../core/ObjectPool ../../../core/promiseUtils ../support/imageUtils ../webgl-engine/lib/ShaderVariations dojo/text!./TerrainMaterial.xml ../webgl-engine/materials/internal/MaterialUtil ../webgl-engine/lib/Util ../webgl-engine/lib/Geometry ../webgl-engine/lib/GeometryData ../lib/glMatrix ../webgl-engine/lib/RenderPass ../webgl-engine/lib/RenderSlot ../webgl-engine/lib/tracer ../../webgl/VertexArrayObject ../../webgl/BufferObject ../../webgl/Program ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/screenSizePerspectiveUtils ../webgl-engine/lib/glUtil3D ../../webgl/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G){var M=u.assert;u=x.vec2d;var H=x.vec3d,J=x.vec4d,O=x.mat4d.identity(),N=[2,2],S=B.OPAQUE_TERRAIN,R=B.TRANSPARENT_TERRAIN,Y=H.create(),X=u.create();x=function(q,u,v){function x(a,b){a=a.screenDepth;b=b.screenDepth;return a<b?-ba:a>b?ba:0}function B(a,b){return 0===a.tiles.length?-ba:0===b.tiles.length?ba:x(a.tiles.data[0],b.tiles.data[0])}u=u||256;var L,K=!1,V=null,Z=null,ea=null,ja={},aa,fa,qa=new b(e),T=new d(10,function(){return{root:null,
- tiles:new d(300)}}),ha=!0,ia=new h.IteratorPreorder,la=null,w=!0,ra=1,wa=!0,xa=!1,oa={mode:"none",width:1.5,falloff:1.5,wireOpacity:1,surfaceOpacity:0,color:[1,1,1,0],resolution:64},na=!1,Fa=!1,ua=!1,ba=1,za=!0,Pa=!0,Ga=null,ya=null,Ca=null,Ra=!1,Sa=[];this.updateTileBackground=function(a){Ca&&Ca.cancel();Ca=a?l.requestImage(a).catch(function(){return null}):k.resolve(null);this.renderTileBackground();return Ca};var Va=0,Qa=0,Za=0,Wa=0;this.resourceCounter=new c;this.castShadows=!0;this.clippingExtent=
- null;this.loaded=function(){};var $a=!1;this.needsRender=!0;this.receiveShadows=this.needsHighlight=this.didRender=!1;var Aa=new d(10),Ia=0,Ta=new d(30),fb=new b(function(){this.extent=J.create();this.maxLevel=this.minLevel=0;this.callback=null},!1);this.renderTileBackground=function(){if(aa&&Ca&&ya)return Ca.then(function(a){ya&&(Ra=!0,ya.setGridImage(a),V&&h.traverseTilesPreorder(V,function(a){ya.updateTileTexture(a)}.bind(this)))}.bind(this))};this.initializeRenderContext=function(a){aa=a.rctx;
- fa=a.rctx.gl;var b=function(a){r(a).then(function(){K=!0;this.setNeedsRender()}.bind(this)).catch(b)}.bind(this);b(this.renderTileBackground());L=a.textureRep;var c=a.shaderSnippets;a=a.programRep;c.vsTerrain||c._parse(n);var d=new p("terrain",["vsTerrain","fsTerrain"],null,a,c,aa);d.addDefine("Spherical","SPHERICAL");d.addDefine("Overlay","OVERLAY");d.addDefine("Atmosphere","ATMOSPHERE");d.addDefine("Wireframe","WIREFRAME");d.addDefine("TileBorders","TILE_BORDERS");d.addBinaryShaderSnippetSuffix("Wireframe",
- "Wireframe",[!1,!0]);d.addDefine("ReceiveShadows","RECEIVE_SHADOWS");d.addDefine("ScreenSizePerspective","SCREEN_SIZE_PERSPECTIVE");var e=new p("terrainNormal",["vsTerrainNormal","fsNormal"],null,a,c,aa);e.addDefine("Spherical","SPHERICAL");e.addDefine("AlphaZero","ALPHA_ZERO");ea={depth:a.get("depth"),depthShadowMap:a.get("depthShadowMap"),depthOnly:new D(aa,c.vsTerrainDepthOnly,c.fsTerrainDepthOnly,E.Default3D),highlight:new D(aa,c.vsTerrainHighlight,c.fsTerrainHighlight,E.Default3D)};Z={color:d,
- normal:e};this._updatePrograms();ya=new g(aa,u,a,this.resourceCounter,this.setNeedsRender.bind(this));this.renderTileBackground();Ga=P.createEmptyTexture(aa)};this.uninitializeRenderContext=function(a){null!=Ga&&(Ga.dispose(),Ga=null);ya&&(ya.dispose(),ya=null)};this._updatePrograms=function(){var a="spherical"===q,b="shader"===oa.mode;ea.color=Z.color.getProgram([a,!0,a&&Pa,b,na,b||na,this.receiveShadows,xa]);ea.normal=Z.normal.getProgram([a,!0]);this.setNeedsRender()};this.destroy=function(a){this.uninstall(a);
- Ca&&(Ca.cancel(),Ca=null)};this.install=function(a){a.addExternalRenderer([S,R],this)};this.uninstall=function(a){a.removeExternalRenderer(this)};this.setRootTiles=function(a){V=a;this.setNeedsRender()};this.setNeedsHighlight=function(a){this.needsHighlight=a;this.setNeedsRender()};this.setStencilEnabledLayerExtents=function(a){Sa=a;this.setNeedsRender()};this.setTileSize=function(a){u=a;ya&&(ya.tileSize=a);this.setNeedsRender()};this.loadTile=function(a){M(null===a.renderData);a.renderData=qa.acquire();
- a.renderData.init();var b=this.getLocalOriginOfTile(a);a.createGeometry(a.renderData.updateGeometryState(a),b,"debug"===oa.mode,a.renderData.geometryInfo);a.renderData.localOrigin=b;this._updateTileGeometryBuffers(a);Ra&&ya.updateTileTexture(a)};this.queryVisibleLevelRange=function(a,b,c,d){var e=fb.acquire();J.set(a,e.extent);e.minLevel=b?b:-Number.MAX_VALUE;e.maxLevel=null!=c?c:Number.MAX_VALUE;e.callback=d;Ta.push(e);this.setNeedsRender()};this.updateTileTexture=function(a){ya&&Ra&&ya.updateTileTexture(a)};
- this.updateTileGeometryNeedsUpdate=function(a){return a.renderData.updateGeometryState(a).needsUpdate};this._updateTileGeometry=function(a){for(var b=a.renderData.geometryState,c=a.layerInfo[f.LayerClass.ELEVATION],d=0;d<c.length;d++)c[d].pendingUpdates&=~f.TileUpdateTypes.UPDATE_GEOMETRY;return b.needsUpdate?(a.renderData.vao&&this._releaseTileGeometry(a),a.createGeometry(b,a.renderData.localOrigin,"debug"===oa.mode,a.renderData.geometryInfo),this._updateTileGeometryBuffers(a),!0):!1};this.updateTileGeometry=
- function(a){a.renderData.updateGeometryState(a);return this._updateTileGeometry(a)};this.unloadTile=function(a){this._releaseTileGeometry(a);a.renderData.texture&&a.renderData.texture.dispose();qa.release(a.renderData);a.renderData=null};this.getLocalOriginOfTile=function(a){if(10<=a.lij[0]){for(;7<a.lij[0];)a=a.parent;return a.centerAtSeaLevel}if("spherical"===q)return Y;for(;a.parent;)a=a.parent;return a.centerAtSeaLevel};this.setVisibility=function(a){w=a;this.setNeedsRender()};this.getStats=function(){return{numTilesRendered:Qa,
- numTilesCulled:Za,numTrianglesRendered:Va,numOriginsRendered:Wa}};this.setDisableRendering=function(a){Fa=!!a;this.setNeedsRender()};this.getOpacity=function(){return ra};this.getWireframeEnabled=function(){return"shader"===oa.mode};this.setDebugScreenSizePerspective=function(a){a!==xa&&(xa=a,this._updatePrograms())};this.setWireframe=function(a){a&&!0!==a||(a={mode:a?"shader":"none"});if(void 0!==a.mode&&oa.mode!==a.mode){var b="debug"===oa.mode,c="debug"===a.mode;oa.mode=a.mode;this._updatePrograms();
- b!==c&&V&&h.traverseTilesPreorder(V,function(a){a.renderData&&(a.renderData.vao&&this._releaseTileGeometry(a),a.createGeometry(a.renderData.updateGeometryState(a),a.renderData.localOrigin,c,a.renderData.geometryInfo),this._updateTileGeometryBuffers(a))}.bind(this))}for(var d in a)oa.hasOwnProperty(d)&&(oa[d]=a[d]),this.setNeedsRender();oa.resolution&&(oa.resolution=Math.min(oa.resolution,u),oa.resolution=1<<Math.round(Math.log(oa.resolution)/Math.LN2))};this.setOpacity=function(a){ra=a;this.setNeedsRender()};
- this.setDrawSkirts=function(a){wa=a;this.setNeedsRender()};this.setCullBackFaces=function(a){ua=a;this.setNeedsRender()};this.setRenderOrder=function(a){ba=a;this.setNeedsRender()};this.setBorders=function(a){na!==a&&(na=a,this._updatePrograms())};this.setFrontMostTransparent=function(a){za!==a&&(za=a,this.setNeedsRender())};this.setVelvetOverground=function(a){Pa!==a&&(Pa=a,this._updatePrograms())};this.setNeedsRender=function(){this.needsRender=!0;this.didRender=!1;ha=!0};this.resetNeedsRender=
- function(){this.didRender&&(this.needsRender=0!==Ta.length,this.didRender=!1)};var Ha=H.create();this.isTransparent=function(){return 1>ra||"shader"===oa.mode&&(1>oa.wireOpacity||1>oa.surfaceOpacity)};this._renderMaterialPass=function(a,b){var c=this.isTransparent(),d=a.shadowMap&&a.shadowMap.getEnableState();this.receiveShadows!=d&&(this.receiveShadows=d,this._updatePrograms());d=a.camera;aa.setDepthTestEnabled(!0);aa.setBlendingEnabled(c);c&&aa.setBlendFunctionSeparate(fa.SRC_ALPHA,fa.ONE_MINUS_SRC_ALPHA,
- fa.ONE,fa.ONE_MINUS_SRC_ALPHA);c&&za?(c=ea.depthOnly,aa.bindProgram(c),aa.setColorMask(!1,!1,!1,!1),aa.setDepthWriteEnabled(!0),this._renderTilesAuxiliary(a,c,b),aa.setColorMask(!0,!0,!0,!0),aa.setDepthFunction(fa.EQUAL),aa.setDepthWriteEnabled(!1)):aa.setDepthFunction(fa.LESS);c=ea.color;aa.bindProgram(c);c.setUniform1f("opacity",ra);if("shader"===oa.mode||na)c.setUniform1f("wireframe.width",oa.width),c.setUniform1f("wireframe.falloff",Math.min(oa.width,oa.falloff)),c.setUniform1f("wireframe.wireOpacity",
- oa.wireOpacity*ra),c.setUniform1f("wireframe.surfaceOpacity",oa.surfaceOpacity*ra),c.setUniform4fv("wireframe.color",oa.color);d=a.camera;a.shadowMap&&a.shadowMap.bind(c);a.ssaoHelper&&a.ssaoHelper.setUniforms(c);c.setUniform1i("tex",4);c.setUniform1i("overlayTex",5);c.setUniformMatrix4fv("viewNormal",d.viewInverseTransposeMatrix);c.setUniformMatrix4fv("proj",d.projectionMatrix);a.lightingData.helper.setUniforms(c,!0);d=d.viewMatrix;H.set3(d[12],d[13],d[14],Ha);H.normalize(Ha);c.setUniform3fv("viewDirection",
- Ha);for(Wa=Va=Za=Qa=0;Aa.length<Aa.data.length&&0<Ta.length;)d=Ta.pop(),Aa.push(d);Ia=Aa.length;this._renderTiles(a,c,b);aa.setBlendingEnabled(!1);aa.setDepthFunction(fa.LESS);aa.setDepthWriteEnabled(!0);for(a=0;a<Aa.length;a++)b=Aa.data[a],fb.release(b),b.callback(a>=Ia),b.callback=null;Aa.clear();0<Qa&&!$a&&($a=!0,this.loaded&&this.loaded())};this._renderDepthPass=function(a,b,c){var d=a.camera;aa.bindProgram(b);aa.setBlendingEnabled(!1);aa.setDepthTestEnabled(!0);aa.setDepthFunction(fa.LESS);b.setUniformMatrix4fv("model",
- O);b.setUniformMatrix4fv("viewNormal",d.viewInverseTransposeMatrix);X[0]=d.near;X[1]=d.far;b.setUniform2fv("nearFar",X);this._renderTilesAuxiliary(a,b,c)};this._renderNormalPass=function(a,b){var c=a.camera,d=ea.normal;aa.bindProgram(d);aa.setBlendingEnabled(!1);aa.setDepthTestEnabled(!0);aa.setDepthFunction(fa.LESS);d.setUniformMatrix4fv("viewNormal",c.viewInverseTransposeMatrix);this._renderTilesAuxiliary(a,d,b)};this._renderHighlightPass=function(a,b){var c=ea.highlight;aa.bindProgram(c);aa.setBlendingEnabled(!1);
- aa.setDepthTestEnabled(!0);aa.setDepthFunction(fa.LESS);var d=a.offscreenRenderingHelper;aa.bindTexture(d.getDepthTexture(),6);c.setUniform1i("depthTex",6);c.setUniform4f("highlightViewportPixelSz",0,0,1/d.width,1/d.height);this._renderTilesAuxiliary(a,c,b,!0)};this.render=function(a){if(K&&!Fa&&w&&V&&Ra){var b=this.isTransparent()?R:S;if(a.slot===b){z.trace("# BEGIN RENDER TERRAIN");b=a.pass;aa.setFaceCullingEnabled(ua);var c=1===a.lightingData.helper.globalFactor;b===m.MATERIAL?this._renderMaterialPass(a,
- this._updatePerOriginTileData()):b===m.MATERIAL_DEPTH_SHADOWMAP&&this.castShadows&&c?this._renderDepthPass(a,ea.depthShadowMap,this._updatePerOriginTileData()):b===m.MATERIAL_DEPTH?this._renderDepthPass(a,ea.depth,this._updatePerOriginTileData()):b===m.MATERIAL_NORMAL?this._renderNormalPass(a,this._updatePerOriginTileData()):b===m.MATERIAL_HIGHLIGHT&&this.needsHighlight&&(this._renderHighlightPass(a,this._updatePerOriginTileData()),aa.clear(aa.gl.DEPTH_BUFFER_BIT));ua&&aa.setFaceCullingEnabled(!1);
- z.trace("# END RENDER TERRAIN");return!0}}};this._updatePerOriginTileData=function(){if(!ha)return T;la=null;this._renderCollectOrigins();if(0!==ba){for(var a=0;a<T.length;a++)this._sortFrontToBack(T.data[a].tiles,x);this._sortFrontToBack(T,B)}ha=!1;return T};this._renderCollectOrigins=function(){T.clear();for(var a=0;a<V.length;a++){var b=V[a],c=T.next();c.root=b;c.origin="spherical"===q?Y:b.centerAtSeaLevel;c.tiles.clear();this._renderCollectOriginsForRoot(c)}return!0};this._renderCollectOriginsForRoot=
- function(a){for(ia.reset(a.root);!ia.done;){var b=ia.next(),c=b.renderData;if(c&&!b.visible)Za++,ia.skip();else{var d=T.peek();if(7===b.lij[0]){if(d===a||0!==d.tiles.length)d=T.next(),d.tiles.clear();d.root=b;d.origin=b.centerAtSeaLevel}if(c){10<=b.lij[0]?T.peek().tiles.push(b):a.tiles.push(b);if(!la||b.vlevel>la.vlevel)la=b;ia.skip()}}}};this._sortFrontToBack=function(a,b){a.sort(b)};this._updateStencilReadStateForTile=function(a,b){if(a.stencilRenderingHelper&&a.stencilRenderingHelper.getEnableState()){for(var c=
- !1,d=0;d<Sa.length;d++)if(b.intersectsExtent(Sa[d])){c=!0;break}c?a.stencilRenderingHelper.enableStencilRead():a.stencilRenderingHelper.disableStencilRead()}};this._renderTilesAuxiliary=function(a,b,c,d){var e=a.camera,f=e.viewMatrix,g=a.rctx;b.setUniformMatrix4fv("proj",e.projectionMatrix);d&&b.setUniform1i("overlayTex",5);for(e=0;e<c.length;e++){var h=c.data[e];b.setUniform3fv("origin",h.origin);t.bindView(h.origin,f,b);for(var k=0;k<h.tiles.length;k++){var l=h.tiles.data[k],m=l.renderData;d&&(m.highlightOverlayTexId?
- ab(b,m,m.highlightOverlayTexId):g.bindTexture(Ga,5));this._updateStencilReadStateForTile(a,l);g.bindVAO(m.vao);G.assertCompatibleVertexAttributeLocations(m.vao,b);l=m.vao.indexBuffer.size;wa||(l=m.geometryInfo.numWithoutSkirtIndices);g.drawElements(fa.TRIANGLES,l,m.vao.indexBuffer.indexType,0)}}g.bindVAO(null);g.stencilRenderingHelper&&g.stencilRenderingHelper.disableStencilRead()};this._renderTiles=function(a,b,c){var d=a.camera.viewMatrix;if(xa){var e=I.getSettings(q);e.update({distance:v.distanceToSurface,
- fovY:v.fovY});t.bindScreenSizePerspective(e,b,"screenSizePerspective")}for(e=0;e<c.length;e++){var f=c.data[e];b.setUniform3fv("origin",f.origin);t.bindView(f.origin,d,b);a.shadowMap&&a.shadowMap.bindView(b,f.origin);Wa++;var g=f.tiles;if(0!==g.length){var h=fa.TRIANGLES;"debug"===oa.mode&&(h=fa.LINES);var k=la,l;k?(k=k.vlevel,l=u/oa.resolution):(k=16,l=u/64);for(var m=0;m<g.length;m++){var n=g.data[m],f=n.renderData;this._updateStencilReadStateForTile(a,n);z.trace("# RENDER TILE "+n.lij[0]+"/"+n.lij[1]+
- "/"+n.lij[2]+", screenDepth:"+n.screenDepth);b.setUniform2fv("texOffset",f.texOffset);b.setUniform1f("texScale",f.texScale);aa.bindTexture(f.textureReference||f.texture,4);f.overlayTexId?ab(b,f,f.overlayTexId):(b.setUniform2fv("overlayTexOffset",N),aa.bindTexture(Ga,5));("shader"===oa.mode||na)&&b.setUniform1f("wireframe.subdivision",l*(1<<k-n.vlevel));var p=f.vao.indexBuffer.size;wa||(p=f.geometryInfo.numWithoutSkirtIndices);aa.bindVAO(f.vao);G.assertCompatibleVertexAttributeLocations(f.vao,b);aa.drawElements(h,
- p,f.vao.indexBuffer.indexType,0);n.renderOrder=Qa;Qa++;Va+=p/3;f=n.extent;n=n.lij[0];for(p=0;p<Ia;){var r=Aa.data[p],x=r.extent;n>=r.minLevel&&n<=r.maxLevel&&x[0]<=f[2]&&x[2]>=f[0]&&x[1]<=f[3]&&x[3]>=f[1]?(Aa.swap(p,Ia-1),Ia--):p++}}}}aa.bindVAO(null);a.stencilRenderingHelper&&a.stencilRenderingHelper.disableStencilRead()};var ab=function(a,b,c){var d=ja[c];d||(d=L.aquire(c).getGLTexture(),M(d),ja[c]=d);a.setUniform2fv("overlayTexOffset",b.overlayTexOffset);a.setUniform2fv("overlayTexScale",b.overlayTexScale);
- a.setUniform1f("overlayOpacity",b.overlayOpacity);aa.bindTexture(d,5)},gb=H.create(),Ja=H.create(),Xa=H.create(),hb=this.clippingExtent;this.intersect=function(a,b,c){if(V&&(!a.isSelection||!this.isTransparent())&&a.enableTerrain){H.subtract(c,b,gb);var d=a.getMinResult(),e=a.getMaxResult();ia.reset(V);for(var f={};!ia.done;){var g=ia.next();if(null!==g.renderData){if(a.enableInvisibleTerrain){if(!g.visible&&hb&&!g.intersectsExtent(hb))continue}else if(!g.visible)continue;var k=g.renderData.geometryInfo;
- Q.getData().getAttribute("terrain").data=k.vertexAttributes;Q.getData()._indices.terrain=k.indices;var l=k.boundingBox;H.set3(l[0],l[1],l[2],Q.boundingInfo.bbMin);H.set3(l[3],l[4],l[5],Q.boundingInfo.bbMax);Q.boundingInfo.indices=k.indices;Q.boundingInfo.positionData=Q.getData().getAttribute("terrain");k=g.renderData.localOrigin;H.subtract(b,k,Ja);H.subtract(c,k,Xa);t.intersectTriangleGeometry(Q,f,void 0,a,Ja,Xa,function(b,c,f){if((wa||!(3*f>=g.renderData.geometryInfo.numWithoutSkirtIndices))&&0<=
- b&&(a.enableBackfacesTerrain||0>H.dot(c,gb))){if(void 0===d.dist||b<d.dist)f=h.lij2str(g.lij[0],g.lij[1],g.lij[2]),d.set(void 0,f,b,c,void 0),d.setIntersector("terrain");if(void 0===e.dist||b>e.dist)f=h.lij2str(g.lij[0],g.lij[1],g.lij[2]),e.set(void 0,f,b,c,void 0),e.setIntersector("terrain")}})}}}};this._updateTileGeometryBuffers=function(a){a=a.renderData;var b=a.geometryInfo.indices;a.vao=new C(aa,E.Default3D,{geometry:F.Pos3Tex},{geometry:A.createVertex(aa,fa.STATIC_DRAW,a.geometryInfo.vertexAttributes)},
- A.createIndex(aa,fa.STATIC_DRAW,b));this.setNeedsRender()};this._releaseTileGeometry=function(b){b=b.renderData;b.vao.dispose(!0);b.vao=null;a.releaseGeometry(b.geometryInfo);this.setNeedsRender()}};v=new v({terrain:{data:null,size:5}},{terrain:null});var Q=new q(v,"tmpTerrainGeometry",{bbMin:H.create(),bbMax:H.create(),indices:null,positionData:null,getBBMin:function(){return this.bbMin},getBBMax:function(){return this.bbMax},getPrimitiveIndices:function(){},getChildren:function(){},getIndices:function(){return this.indices},
- getPosition:function(){return this.positionData}});x.TileRenderData=e;return x})},"esri/views/3d/terrain/TileRenderData":function(){define(["require","exports","../lib/glMatrix","../support/aaBoundingBox"],function(r,h,f,a){var e=f.vec2d;return function(){function c(){this.overlayTexOffset=e.create();this.texOffset=e.create();this.geometryInfo={indices:null,vertexAttributes:null,boundingBox:a.create(a.NEGATIVE_INFINITY),numSurfaceIndices:0,numSkirtIndices:0,numWithoutSkirtIndices:0,numVertsPerRow:0};
- this.init()}c.prototype.init=function(){var c=this.geometryInfo;c.indices=null;c.vertexAttributes=null;a.set(c.boundingBox,a.NEGATIVE_INFINITY);c.numSurfaceIndices=0;c.numSkirtIndices=0;c.numWithoutSkirtIndices=0;c.numVertsPerRow=0;this.textureReference=this.texture=this.vao=this.geometryState=null;e.set2(0,0,this.texOffset);this.texScale=1;this.highlightOverlayTexId=this.overlayTexId=null;this.overlayTexScale=[1,1];this.overlayOpacity=1;this.localOrigin=null};c.prototype.updateGeometryState=function(a){return this.geometryState=
- a.geometryState(this.geometryState)};c.prototype.estimateGeometryMemoryUsage=function(){var a=this.geometryInfo;return a.indices.byteLength+a.vertexAttributes.byteLength};return c}()})},"esri/views/3d/terrain/ResourceCounter":function(){define(["require","exports"],function(r,h){return function(){function f(){this._numTileTexturesComposited=0}Object.defineProperty(f.prototype,"numTileTexturesComposited",{get:function(){return this._numTileTexturesComposited},enumerable:!0,configurable:!0});f.prototype.incrementNumTileTexturesComposited=
- function(){this._numTileTexturesComposited++};f.prototype.resetNumTileTexturesComposited=function(){this._numTileTexturesComposited=0};return f}()})},"esri/views/3d/terrain/TileRenderer":function(){define("require exports ../lib/glMatrix ./TerrainConst ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/DefaultVertexBufferLayouts ../../vectorTiles/tileRendererHelper3D ../../vectorTiles/VectorTileDisplayObject ../../webgl/BufferObject ../../webgl/FramebufferObject ../../webgl/Texture ../../webgl/Util ../../webgl/VertexArrayObject".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n){var t=f.vec2d,u=Array(20),q=[0,0];return function(){function f(a,d,f,g,h){this._gridTex=null;this.tileSize=256;this._context=a;this.tileSize=d;this._resourceCounter=g;this._setNeedsRender=h;a.capabilities.textureFilterAnisotropic&&(this._maxAnisotropy=Math.min(8,a.parameters.maxMaxAnisotropy));d=new Float32Array(20);d[0]=-1;d[1]=-1;d[2]=0;d[3]=0;d[4]=0;d[5]=1;d[6]=-1;d[7]=0;d[8]=1;d[9]=0;d[10]=-1;d[11]=1;d[12]=0;d[13]=0;d[14]=1;d[15]=1;d[16]=1;d[17]=0;d[18]=1;d[19]=
- 1;this._vaoQuad=new n(a,e.Default3D,{geometry:c.Pos3Tex},{geometry:b.createVertex(a,35044,d)});this._blendLayersProgram=f.get("blendLayers")}f.prototype.dispose=function(){this._fbo&&(this._fbo.dispose(),this._fbo=null);this._vaoQuad&&(this._vaoQuad.dispose(),this._vaoQuad=null);this._gridTex&&(this._gridTex.dispose(),this._gridTex=null);this._blendLayersProgram&&(this._blendLayersProgram.dispose(),this._blendLayersProgram=null);this._context&&(this._context=null)};f.prototype.updateTileTexture=function(b){for(var c=
- a.LayerClass.MAP,d=b.layerInfo[c],e=0;e<d.length;e++)d[e].pendingUpdates&=~a.TileUpdateTypes.UPDATE_TEXTURE;if(b.renderData){var f,e=b.renderData,g,h=0,k=!0;for(g=0;g<d.length;g++){f=d[g];var l=b.parentSurface.layerViewByIndex(g,c);u[g]=l.fullOpacity;if(f.data||f.upsampleFromTile)if(h++,!l.isTransparent){k=!1;break}}g===d.length&&g--;0===h&&this._gridTex?(e.textureReference=this._gridTex,t.set2(0,0,e.texOffset),e.texScale=1):1!==h||k?(this._composeMapLayers(b,d,g,k,u),e.textureReference=null,t.set2(0,
- 0,e.texOffset),e.texScale=1):(f=d[g],f.data?(c=f,t.set2(0,0,e.texOffset),e.texScale=1):(b=f.upsampleFromTile,c=b.tile.layerInfo[c][g],t.set(b.offset,e.texOffset),e.texScale=b.scale),c&&(c.data instanceof HTMLImageElement&&(c.data=this._buildTexture(c.data)),e.textureReference=c.data));this._setNeedsRender()}};f.prototype.setGridImage=function(a){this._gridTex=this._buildTexture(a)};f.prototype._buildTexture=function(a){var b={target:3553,pixelFormat:6408,dataType:5121,wrapMode:33071,samplingMode:9729,
- maxAnisotropy:this._maxAnisotropy,flipped:!0,hasMipmap:!0},c=this._context,d;if(a)try{d=new l(c,b,a)}catch(C){b.width=b.height=this.tileSize,d=new l(c,b),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}else b.width=b.height=this.tileSize,d=new l(c,b);c.bindTexture(d);d.generateMipmap();return d};f.prototype._drawVectorData=function(a,b,c,d,e,f,h,k,l){void 0===l&&(l=1);g(this._context,c,a,b.renderer,b.schemeHelper,c[0],d,e,0,f,h,k,l)};f.prototype._drawRasterData=
- function(a,b,c,d){void 0===d&&(d=1);var e=this._context,f=this._blendLayersProgram,g=this._vaoQuad;e.bindProgram(f);e.bindVAO(g);p.assertCompatibleVertexAttributeLocations(g,f);e.bindTexture(a,0);f.setUniform1i("tex",0);f.setUniform1f("scale",b);f.setUniform2f("offset",c[0],c[1]);f.setUniform1f("opacity",d);e.drawArrays(5,0,p.vertexCount(g,"geometry"))};f.prototype._composeMapLayers=function(b,c,e,f,g){var h=a.LayerClass.MAP,l=this._context;b.renderData.texture||(b.renderData.texture=this._buildTexture());
- var m=b.renderData.texture,n=this._fbo;n&&n.width===m.descriptor.width&&n.height===m.descriptor.height||(this._fbo=n=k.create(l,{colorTarget:0,depthStencilTarget:1,width:m.descriptor.width,height:m.descriptor.height}));var p=l.gl;l.bindFramebuffer(n);l.setViewport(0,0,this.tileSize,this.tileSize);l.setClearColor(0,0,0,0);l.setClearDepth(1);l.clear(p.COLOR_BUFFER_BIT|p.DEPTH_BUFFER_BIT);l.setDepthTestEnabled(!1);l.setBlendFunctionSeparate(1,771,1,771);l.setBlendEquation(32774);l.setBlendingEnabled(!0);
- var t,u,v;for(f&&this._gridTex&&this._drawRasterData(this._gridTex,1,q);0<=e;e--)if(f=null,n=c[e],n.data?(f=n,t=q,u=1):n.upsampleFromTile&&(u=n.upsampleFromTile,f=u.tile.layerInfo[h][e],v=u.tile.lij[0],t=u.offset,u=u.scale),f){if(f.data instanceof HTMLImageElement||f.data instanceof HTMLCanvasElement)f.data=this._buildTexture(f.data);f.data instanceof d?(n=b.parentSurface.layerViewByIndex(e,h),this._drawVectorData(f.data,n,b.lij,m.descriptor.width,m.descriptor.height,u,t,v,g[e])):this._drawRasterData(f.data,
- u,t,g[e])}l.bindTexture(m);p.copyTexImage2D(l.gl.TEXTURE_2D,0,m.descriptor.pixelFormat,0,0,m.descriptor.width,m.descriptor.height,0);m.generateMipmap();l.bindFramebuffer(null);l.setBlendFunctionSeparate(770,771,1,771);l.setBlendingEnabled(!1);this._resourceCounter.incrementNumTileTexturesComposited()};return f}()})},"esri/views/vectorTiles/tileRendererHelper3D":function(){define(["require","exports","dojo/has","../../core/libs/gl-matrix/mat4","../../core/libs/gl-matrix/vec3"],function(r,h,f,a,e){var c=
- {extent:{xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:{wkid:102100,isWrappable:!0},intersects:function(a){return!1}},center:[0,0],scale:1,resolution:1,rotation:0,width:1,height:1,pixelRatio:1,size:[256,256],spatialReference:{wkid:102100,isWrappable:!0},worldScreenWidth:1,viewpoint:{},toMap:function(a,b,c){return null},toScreen:function(a,b,c){return null},clone:function(){return null},copy:function(a){return this},toJSON:function(){return null}},g=e.create();return function(d,b,e,h,p,n,t,u,q,v,r,
- m,B){q=[b[0],b[1],b[2]];for(var k=v;1>k;k*=2)q[0]--,q[1]>>=1,q[2]>>=1;b={context:d,state:c,stationary:!0,pixelRatio:1,displayLevel:p.adjustLevel(n),requiredLevel:p.adjustLevel(b[0]),drawphase:0,renderer:h,layerOpacity:B,painter:null};if(t!==u)throw Error("It is expected that tiles are square!");n=1/v;B=p.getSchemaShift(q,n);k=B[1];e.tileTransform.displayCoord[0]=-1-2*n*r[0]-B[0];e.tileTransform.displayCoord[1]=1+2*n*(1-r[1]-v)+k;v=e.tileTransform.transform;a.identity(v);p.isWGS84&&512===p.lockedSchemaPixelSize&&
- (n*=2);0===m&&(n/=2);p=.25*n/t;g.set([p,-p,1]);a.scale(v,v,g);d.setBlendFunctionSeparate(1,771,1,771);d.setClearDepth(1);d.clear(d.gl.DEPTH_BUFFER_BIT);b.state.size=[t,u];b.state.width=t;b.state.height=u;h.setStateParams(b.state,b.pixelRatio,q[0]);e.attach(b);d.setFaceCullingEnabled(!1);d.setDepthFunction(515);d.setBlendingEnabled(!1);d.setDepthTestEnabled(!0);d.setDepthWriteEnabled(!0);e.processRender(b);d.setDepthWriteEnabled(!1);d.setBlendingEnabled(!0);b.drawphase=1;e.processRender(b);b.drawphase=
- 2;e.processRender(b);f("esri-vector-tiles-debug")&&h.renderTileInfo(d,e);d.setDepthWriteEnabled(!0);d.setDepthTestEnabled(!1);d.setFaceCullingEnabled(!0)}})},"esri/core/libs/gl-matrix/vec3":function(){define(["./common"],function(r){var h={create:function(){var f=new r.ARRAY_TYPE(3);f[0]=0;f[1]=0;f[2]=0;return f},clone:function(f){var a=new r.ARRAY_TYPE(3);a[0]=f[0];a[1]=f[1];a[2]=f[2];return a},fromValues:function(f,a,e){var c=new r.ARRAY_TYPE(3);c[0]=f;c[1]=a;c[2]=e;return c},copy:function(f,a){f[0]=
- a[0];f[1]=a[1];f[2]=a[2];return f},set:function(f,a,e,c){f[0]=a;f[1]=e;f[2]=c;return f},add:function(f,a,e){f[0]=a[0]+e[0];f[1]=a[1]+e[1];f[2]=a[2]+e[2];return f},subtract:function(f,a,e){f[0]=a[0]-e[0];f[1]=a[1]-e[1];f[2]=a[2]-e[2];return f}};h.sub=h.subtract;h.multiply=function(f,a,e){f[0]=a[0]*e[0];f[1]=a[1]*e[1];f[2]=a[2]*e[2];return f};h.mul=h.multiply;h.divide=function(f,a,e){f[0]=a[0]/e[0];f[1]=a[1]/e[1];f[2]=a[2]/e[2];return f};h.div=h.divide;h.ceil=function(f,a){f[0]=Math.ceil(a[0]);f[1]=
- Math.ceil(a[1]);f[2]=Math.ceil(a[2]);return f};h.floor=function(f,a){f[0]=Math.floor(a[0]);f[1]=Math.floor(a[1]);f[2]=Math.floor(a[2]);return f};h.min=function(f,a,e){f[0]=Math.min(a[0],e[0]);f[1]=Math.min(a[1],e[1]);f[2]=Math.min(a[2],e[2]);return f};h.max=function(f,a,e){f[0]=Math.max(a[0],e[0]);f[1]=Math.max(a[1],e[1]);f[2]=Math.max(a[2],e[2]);return f};h.round=function(f,a){f[0]=Math.round(a[0]);f[1]=Math.round(a[1]);f[2]=Math.round(a[2]);return f};h.scale=function(f,a,e){f[0]=a[0]*e;f[1]=a[1]*
- e;f[2]=a[2]*e;return f};h.scaleAndAdd=function(f,a,e,c){f[0]=a[0]+e[0]*c;f[1]=a[1]+e[1]*c;f[2]=a[2]+e[2]*c;return f};h.distance=function(f,a){var e=a[0]-f[0],c=a[1]-f[1];f=a[2]-f[2];return Math.sqrt(e*e+c*c+f*f)};h.dist=h.distance;h.squaredDistance=function(f,a){var e=a[0]-f[0],c=a[1]-f[1];f=a[2]-f[2];return e*e+c*c+f*f};h.sqrDist=h.squaredDistance;h.length=function(f){var a=f[0],e=f[1];f=f[2];return Math.sqrt(a*a+e*e+f*f)};h.len=h.length;h.squaredLength=function(f){var a=f[0],e=f[1];f=f[2];return a*
- a+e*e+f*f};h.sqrLen=h.squaredLength;h.negate=function(f,a){f[0]=-a[0];f[1]=-a[1];f[2]=-a[2];return f};h.inverse=function(f,a){f[0]=1/a[0];f[1]=1/a[1];f[2]=1/a[2];return f};h.normalize=function(f,a){var e=a[0],c=a[1],g=a[2],e=e*e+c*c+g*g;0<e&&(e=1/Math.sqrt(e),f[0]=a[0]*e,f[1]=a[1]*e,f[2]=a[2]*e);return f};h.dot=function(f,a){return f[0]*a[0]+f[1]*a[1]+f[2]*a[2]};h.cross=function(f,a,e){var c=a[0],g=a[1];a=a[2];var d=e[0],b=e[1];e=e[2];f[0]=g*e-a*b;f[1]=a*d-c*e;f[2]=c*b-g*d;return f};h.lerp=function(f,
- a,e,c){var g=a[0],d=a[1];a=a[2];f[0]=g+c*(e[0]-g);f[1]=d+c*(e[1]-d);f[2]=a+c*(e[2]-a);return f};h.hermite=function(f,a,e,c,g,d){var b=d*d,h=b*(2*d-3)+1,l=b*(d-2)+d,p=b*(d-1);d=b*(3-2*d);f[0]=a[0]*h+e[0]*l+c[0]*p+g[0]*d;f[1]=a[1]*h+e[1]*l+c[1]*p+g[1]*d;f[2]=a[2]*h+e[2]*l+c[2]*p+g[2]*d;return f};h.bezier=function(f,a,e,c,g,d){var b=1-d,h=b*b,l=d*d,p=h*b,h=3*d*h,b=3*l*b;d*=l;f[0]=a[0]*p+e[0]*h+c[0]*b+g[0]*d;f[1]=a[1]*p+e[1]*h+c[1]*b+g[1]*d;f[2]=a[2]*p+e[2]*h+c[2]*b+g[2]*d;return f};h.random=function(f,
- a){a=a||1;var e=2*r.RANDOM()*Math.PI,c=2*r.RANDOM()-1,g=Math.sqrt(1-c*c)*a;f[0]=Math.cos(e)*g;f[1]=Math.sin(e)*g;f[2]=c*a;return f};h.transformMat4=function(f,a,e){var c=a[0],g=a[1];a=a[2];var d=e[3]*c+e[7]*g+e[11]*a+e[15],d=d||1;f[0]=(e[0]*c+e[4]*g+e[8]*a+e[12])/d;f[1]=(e[1]*c+e[5]*g+e[9]*a+e[13])/d;f[2]=(e[2]*c+e[6]*g+e[10]*a+e[14])/d;return f};h.transformMat3=function(f,a,e){var c=a[0],g=a[1];a=a[2];f[0]=c*e[0]+g*e[3]+a*e[6];f[1]=c*e[1]+g*e[4]+a*e[7];f[2]=c*e[2]+g*e[5]+a*e[8];return f};h.transformQuat=
- function(f,a,e){var c=a[0],g=a[1],d=a[2];a=e[0];var b=e[1],h=e[2];e=e[3];var l=e*c+b*d-h*g,p=e*g+h*c-a*d,n=e*d+a*g-b*c,c=-a*c-b*g-h*d;f[0]=l*e+c*-a+p*-h-n*-b;f[1]=p*e+c*-b+n*-a-l*-h;f[2]=n*e+c*-h+l*-b-p*-a;return f};h.rotateX=function(f,a,e,c){var g=[],d=[];g[0]=a[0]-e[0];g[1]=a[1]-e[1];g[2]=a[2]-e[2];d[0]=g[0];d[1]=g[1]*Math.cos(c)-g[2]*Math.sin(c);d[2]=g[1]*Math.sin(c)+g[2]*Math.cos(c);f[0]=d[0]+e[0];f[1]=d[1]+e[1];f[2]=d[2]+e[2];return f};h.rotateY=function(f,a,e,c){var g=[],d=[];g[0]=a[0]-e[0];
- g[1]=a[1]-e[1];g[2]=a[2]-e[2];d[0]=g[2]*Math.sin(c)+g[0]*Math.cos(c);d[1]=g[1];d[2]=g[2]*Math.cos(c)-g[0]*Math.sin(c);f[0]=d[0]+e[0];f[1]=d[1]+e[1];f[2]=d[2]+e[2];return f};h.rotateZ=function(f,a,e,c){var g=[],d=[];g[0]=a[0]-e[0];g[1]=a[1]-e[1];g[2]=a[2]-e[2];d[0]=g[0]*Math.cos(c)-g[1]*Math.sin(c);d[1]=g[0]*Math.sin(c)+g[1]*Math.cos(c);d[2]=g[2];f[0]=d[0]+e[0];f[1]=d[1]+e[1];f[2]=d[2]+e[2];return f};h.forEach=function(){var f=h.create();return function(a,e,c,g,d,b){e||(e=3);c||(c=0);for(g=g?Math.min(g*
- e+c,a.length):a.length;c<g;c+=e)f[0]=a[c],f[1]=a[c+1],f[2]=a[c+2],d(f,f,b),a[c]=f[0],a[c+1]=f[1],a[c+2]=f[2];return a}}();h.angle=function(f,a){f=h.fromValues(f[0],f[1],f[2]);a=h.fromValues(a[0],a[1],a[2]);h.normalize(f,f);h.normalize(a,a);a=h.dot(f,a);return 1<a?0:Math.acos(a)};h.str=function(f){return"vec3("+f[0]+", "+f[1]+", "+f[2]+")"};h.exactEquals=function(f,a){return f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]};h.equals=function(f,a){var e=f[0],c=f[1];f=f[2];var g=a[0],d=a[1];a=a[2];return Math.abs(e-
- g)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(c-d)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(f-a)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(a))};return h})},"esri/views/3d/terrain/TilemapOnlyTile":function(){define(["require","exports","./TerrainConst","./TilePerLayerInfo"],function(r,h,f,a){return function(){function e(a){this.parent=null;this.lij=a;this.layerInfo=Array(f.LayerClass.LAYER_CLASS_COUNT)}e.prototype.tileDataAvailable=function(a,e,d){return(e=this.layerInfo[d][e].tilemap)?
- "unavailable"!==e.getAvailability(a.lij[1],a.lij[2]):!0};e.prototype.modifyLayers=function(c,e,d){c=e.length;for(var b=this.layerInfo[d],f=Array(c),g=0;g<c;g++){var h=e[g];f[g]=-1<h?b[h]:new a(d)}this.layerInfo[d]=f};return e}()})},"esri/views/support/WebGLRequirements":function(){define(["require","exports","../../core/Error","../../core/sniff"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.check=function(){var e=null;a("esri-webgl")?a("esri-webgl-major-performance-caveat")?
- e=new f("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check if your GPU is blacklisted."):a("esri-webgl-high-precision-fragment")?a("esri-webgl-vertex-shader-samplers")?a("esri-webgl-element-index-uint")||(e=new f("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.")):e=new f("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):
- e=new f("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):e=new f("webgl:required","WebGL is required but not supported.");return e}})},"esri/views/ui/3d/DefaultUI3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/accessorSupport/decorators ../DefaultUI".split(" "),function(r,h,f,a,e,c){return function(c){function d(){var a=c.call(this)||
- this;a.components=["attribution","zoom","navigation-toggle","compass"];return a}f(d,c);a([e.property()],d.prototype,"components",void 0);return d=a([e.subclass("esri.views.ui.3d.DefaultUI3D")],d)}(e.declared(c))})},"esri/views/ui/DefaultUI":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper dojo/dom-geometry ../../core/watchUtils ../../core/accessorSupport/decorators ./Component ./UI ../../widgets/Attribution ../../widgets/Compass ../../widgets/NavigationToggle ../../widgets/Zoom".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n){return function(b){function h(a){a=b.call(this)||this;a._defaultPositionLookup=null;a.components=[];return a}f(h,b);h.prototype.initialize=function(){this._handles.add([c.init(this,"components",this._componentsWatcher.bind(this)),c.init(this,"view",this._updateViewAwareWidgets.bind(this))])};h.prototype._findComponentPosition=function(a){if(!this._defaultPositionLookup){var b=e.isBodyLtr();this._defaultPositionLookup={attribution:"manual",compass:b?"top-left":"top-right",
- "navigation-toggle":b?"top-left":"top-right",zoom:b?"top-left":"top-right"}}return this._defaultPositionLookup[a]};h.prototype._removeComponents=function(a){var b=this;a.forEach(function(a){if(a=b.find(a))b.remove(a),a.destroy()})};h.prototype._updateViewAwareWidgets=function(a){var b=this;this.components.forEach(function(c){(c=(c=b.find(c))&&c.widget)&&void 0!==c.view&&c.set("view",a)})};h.prototype._componentsWatcher=function(a,b){this._removeComponents(b);this._addComponents(a)};h.prototype._addComponents=
- function(a){var b=this;this.initialized&&a.forEach(function(a){return b.add(b._createComponent(a),b._findComponentPosition(a))})};h.prototype._createComponent=function(a){var b=this._createWidget(a);if(b)return new d({id:a,node:b})};h.prototype._createWidget=function(a){if("attribution"===a)return this._createAttribution();if("compass"===a)return this._createCompass();if("navigation-toggle"===a)return this._createNavigationToggle();if("zoom"===a)return this._createZoom()};h.prototype._createAttribution=
- function(){return new k({view:this.view})};h.prototype._createCompass=function(){return new l({view:this.view})};h.prototype._createNavigationToggle=function(){return new p({view:this.view})};h.prototype._createZoom=function(){return new n({view:this.view})};a([g.property()],h.prototype,"components",void 0);return h=a([g.subclass("esri.views.ui.DefaultUI")],h)}(g.declared(b))})},"esri/views/ui/Component":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper dojo/dom dojo/dom-class ../../core/Accessor ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c,g,d){return function(b){function g(){var a=null!==b&&b.apply(this,arguments)||this;a.widget=null;return a}f(g,b);g.prototype.destroy=function(){this.widget&&this.widget.destroy();this.node=null};Object.defineProperty(g.prototype,"id",{get:function(){return this._get("id")||this.get("node.id")},set:function(a){this._set("id",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"node",{set:function(a){var b=this._get("node");a!==b&&(a&&c.add(a,"esri-component"),
- b&&c.remove(b,"esri-component"),this._set("node",a))},enumerable:!0,configurable:!0});g.prototype.castNode=function(a){if(!a)return this._set("widget",null),null;if("string"===typeof a||a&&"nodeType"in a)return this._set("widget",null),e.byId(a);a&&"function"===typeof a.render&&!a.domNode&&(a.domNode=document.createElement("div"));this._set("widget",a);return a.domNode};a([d.property()],g.prototype,"id",null);a([d.property()],g.prototype,"node",null);a([d.cast("node")],g.prototype,"castNode",null);
- a([d.property({readOnly:!0})],g.prototype,"widget",void 0);return g=a([d.subclass("esri.views.ui.Component")],g)}(d.declared(g))})},"esri/views/ui/UI":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper dojo/dom-class dojo/dom-construct dojo/dom-style dojo/_base/lang ../../core/Accessor ../../core/Evented ../../core/Handles ../../core/watchUtils ../../core/accessorSupport/decorators ./Component".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,
- p,n,t){function u(a){return"object"!==typeof a||a&&a.isInstanceOf&&a.isInstanceOf(t)||!("component"in a||"index"in a||"position"in a)?null:a}var q={left:0,top:0,bottom:0,right:0},v={bottom:30,top:15,right:15,left:15};return function(b){function h(){var a=b.call(this)||this;a._cornerNameToContainerLookup={};a._positionNameToContainerLookup={};a._components=[];a._handles=new l;a._componentToKey=new Map;a.padding=v;a.view=null;a._initContainers();return a}f(h,b);h.prototype.initialize=function(){this._handles.add([p.init(this,
- "view.padding, container",this._applyViewPadding.bind(this)),p.init(this,"padding",this._applyUIPadding.bind(this))])};h.prototype.destroy=function(){this.container=null;this._components.forEach(function(a){a.destroy()});this._components.length=0;this._handles.destroy();this._componentToKey.clear();this._componentToKey=null};Object.defineProperty(h.prototype,"container",{set:function(a){var b=this._get("container");a!==b&&(a&&(e.add(a,"esri-ui"),this._attachContainers(a)),b&&(e.remove(b,"esri-ui"),
- g.set(b,{top:"",bottom:"",left:"",right:""}),c.empty(b)),this._set("container",a))},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"height",{get:function(){var a=this.get("view.height")||0;if(0===a)return a;var b=this._getViewPadding();return Math.max(a-(b.top+b.bottom),0)},enumerable:!0,configurable:!0});h.prototype.castPadding=function(a){return"number"===typeof a?{bottom:a,top:a,right:a,left:a}:d.mixin({},v,a)};Object.defineProperty(h.prototype,"width",{get:function(){var a=
- this.get("view.width")||0;if(0===a)return a;var b=this._getViewPadding();return Math.max(a-(b.left+b.right),0)},enumerable:!0,configurable:!0});h.prototype.add=function(a,b){var c=this,d,e;if(Array.isArray(a))a.forEach(function(a){return c.add(a,b)});else{var f=u(a);f&&(d=f.index,b=f.position,a=f.component,e=f.key);b&&"object"===typeof b&&(d=b.index,e=b.key,b=b.position);!a||b&&!this._isValidPosition(b)||(a&&a.isInstanceOf&&a.isInstanceOf(t)||(a=new t({node:a})),this._place({component:a,position:b,
- index:d}),this._components.push(a),e&&this._componentToKey.set(a,e))}};h.prototype.remove=function(a,b){var c=this;if(a){if(Array.isArray(a))return a.map(function(a){return c.remove(a,b)});var d=this.find(a);if(d){var e=this._componentToKey;if(!e.has(a)||e.get(a)===b)return e=this._components.indexOf(d),d.node.parentNode&&d.node.parentNode.removeChild(d.node),this._componentToKey.delete(a),this._components.splice(e,1)[0]}}};h.prototype.empty=function(a){var b=this;if(Array.isArray(a))return a.map(function(a){return b.empty(a)}).reduce(function(a,
- b){return a.concat(b)});a=a||"manual";if("manual"===a)return Array.prototype.slice.call(this._manualContainer.children).filter(function(a){return!e.contains(a,"esri-ui-corner")}).map(function(a){return b.remove(a)});if(this._isValidPosition(a))return Array.prototype.slice.call(this._cornerNameToContainerLookup[a].children).map(this.remove,this)};h.prototype.move=function(a,b){var c=this;Array.isArray(a)&&a.forEach(function(a){return c.move(a,b)});if(a){var d,e=u(a)||u(b);e&&(d=e.index,b=e.position,
- a=e.component||a);(!b||this._isValidPosition(b))&&(a=this.remove(a))&&this.add(a,{position:b,index:d})}};h.prototype.find=function(a){return a?a&&a.isInstanceOf&&a.isInstanceOf(t)?this._findByComponent(a):"string"===typeof a?this._findById(a):this._findByNode(a.domNode||a):null};h.prototype._getViewPadding=function(){return this.get("view.padding")||q};h.prototype._attachContainers=function(a){c.place(this._manualContainer,a);c.place(this._innerContainer,a)};h.prototype._initContainers=function(){var a=
- c.create("div",{className:"esri-ui-inner-container esri-ui-corner-container"}),b=c.create("div",{className:"esri-ui-inner-container esri-ui-manual-container"}),e=c.create("div",{className:"esri-ui-top-left esri-ui-corner"},a),f=c.create("div",{className:"esri-ui-top-right esri-ui-corner"},a),g=c.create("div",{className:"esri-ui-bottom-left esri-ui-corner"},a),h=c.create("div",{className:"esri-ui-bottom-right esri-ui-corner"},a);this._innerContainer=a;this._manualContainer=b;this._cornerNameToContainerLookup=
- {"top-left":e,"top-right":f,"bottom-left":g,"bottom-right":h};this._positionNameToContainerLookup=d.mixin({manual:b},this._cornerNameToContainerLookup)};h.prototype._isValidPosition=function(a){return!!this._positionNameToContainerLookup[a]};h.prototype._place=function(a){var b=a.component,c=a.index;a=this._positionNameToContainerLookup[a.position||"manual"];var d;-1<c?(d=Array.prototype.slice.call(a.children),0===c?this._placeComponent(b,a,"first"):c>=d.length?this._placeComponent(b,a,"last"):this._placeComponent(b,
- d[c],"before")):this._placeComponent(b,a,"last")};h.prototype._placeComponent=function(a,b,d){var e=a.widget;e&&!e._started&&"function"===typeof e.postMixInProperties&&"function"===typeof e.buildRendering&&"function"===typeof e.postCreate&&"function"===typeof e.startup&&a.widget.startup();c.place(a.node,b,d)};h.prototype._applyViewPadding=function(){var a=this.container;a&&g.set(a,this._toPxPosition(this._getViewPadding()))};h.prototype._applyUIPadding=function(){this._innerContainer&&g.set(this._innerContainer,
- this._toPxPosition(this.padding))};h.prototype._toPxPosition=function(a){return{top:this._toPxUnit(a.top),left:this._toPxUnit(a.left),right:this._toPxUnit(a.right),bottom:this._toPxUnit(a.bottom)}};h.prototype._toPxUnit=function(a){return 0===a?0:a+"px"};h.prototype._findByComponent=function(a){var b=null,c;this._components.some(function(d){(c=d===a)&&(b=d);return c});return b};h.prototype._findById=function(a){var b=null,c;this._components.some(function(d){(c=d.id===a)&&(b=d);return c});return b};
- h.prototype._findByNode=function(a){var b=null,c;this._components.some(function(d){(c=d.node===a)&&(b=d);return c});return b};a([n.property()],h.prototype,"container",null);a([n.property({dependsOn:["view.height"]})],h.prototype,"height",null);a([n.property()],h.prototype,"padding",void 0);a([n.cast("padding")],h.prototype,"castPadding",null);a([n.property()],h.prototype,"view",void 0);a([n.property({dependsOn:["view.width"]})],h.prototype,"width",null);return h=a([n.subclass("esri.views.ui.UI")],
- h)}(n.declared(b,k))})},"esri/widgets/Attribution":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Attribution/nls/Attribution ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Attribution/AttributionViewModel ./support/widget".split(" "),function(r,h,f,a,e,c,g,d,b,k){return function(d){function h(a){a=d.call(this)||this;a._isOpen=!1;a._attributionTextOverflowed=!1;a._prevSourceNodeHeight=0;a.iconClass="esri-icon-description";
- a.itemDelimiter=" | ";a.label=e.widgetLabel;a.view=null;a.viewModel=new b;return a}f(h,d);h.prototype.postInitialize=function(){var a=this;this.own(c.on(this,"viewModel.items","change",function(){return a.scheduleRender()}))};Object.defineProperty(h.prototype,"attributionText",{get:function(){return this.viewModel.items.reduce(function(a,b){-1===a.indexOf(b.text)&&a.push(b.text);return a},[]).join(this.itemDelimiter)},enumerable:!0,configurable:!0});h.prototype.render=function(){var a=(b={},b["esri-attribution--open"]=
- this._isOpen,b);return k.tsx("div",{bind:this,class:"esri-attribution esri-widget",classes:a,onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),k.tsx("div",{class:"esri-attribution__powered-by"},"Powered by ",k.tsx("a",{target:"_blank",href:"http://www.esri.com/",class:"esri-attribution__link"},"Esri")));var b};h.prototype._renderSourcesNode=function(){var a=this._isOpen,b=this._isInteractive(),c=this.attributionText,a=(d={},d["esri-attribution__sources--open"]=a,d["esri-interactive"]=
- b,d);return k.tsx("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,bind:this,class:"esri-attribution__sources",classes:a,innerHTML:c,role:b?"button":void 0,tabIndex:b?0:-1});var d};h.prototype._afterSourcesNodeCreate=function(a){this._prevSourceNodeHeight=a.clientWidth};h.prototype._afterSourcesNodeUpdate=function(a){var b=!1,c=a.clientHeight;a=a.scrollWidth>=a.clientWidth;var d=this._attributionTextOverflowed!==a;this._attributionTextOverflowed=a;d&&(b=!0);
- this._isOpen&&(a=c<this._prevSourceNodeHeight,this._prevSourceNodeHeight=c,a&&(this._isOpen=!1,b=!0));b&&this.scheduleRender()};h.prototype._toggleState=function(){this._isInteractive()&&(this._isOpen=!this._isOpen)};h.prototype._isInteractive=function(){return this._isOpen||this._attributionTextOverflowed};a([g.property({dependsOn:["viewModel.items.length","itemDelimiter"],readOnly:!0}),k.renderable()],h.prototype,"attributionText",null);a([g.property()],h.prototype,"iconClass",void 0);a([g.property(),
- k.renderable()],h.prototype,"itemDelimiter",void 0);a([g.property()],h.prototype,"label",void 0);a([g.aliasOf("viewModel.view")],h.prototype,"view",void 0);a([g.property({type:b}),k.renderable(["state","view.size"])],h.prototype,"viewModel",void 0);a([k.accessibleHandler()],h.prototype,"_toggleState",null);return h=a([g.subclass("esri.widgets.Attribution")],h)}(g.declared(d))})},"esri/widgets/Attribution/AttributionViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Collection ../../core/Handles ../../core/lang ../../core/watchUtils ../../core/accessorSupport/decorators ../../geometry/Extent ../../geometry/support/webMercatorUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){return function(e){function h(a){a=e.call(this,a)||this;a._handles=new g;a._pendingAttributionItemsByLayerId={};a._attributionDataByLayerId={};a.items=new c;a.view=null;a._updateAttributionItems=a._updateAttributionItems.bind(a);return a}f(h,e);h.prototype.initialize=function(){this._handles.add(b.init(this,"view",this._viewWatcher))};h.prototype.destroy=function(){this._handles.destroy();this.view=this._handles=null};Object.defineProperty(h.prototype,"state",{get:function(){return this.get("view.ready")?
- "ready":"disabled"},enumerable:!0,configurable:!0});h.prototype._viewWatcher=function(a){var c=this,d=this._handles;d&&d.remove();a&&(d.add([a.allLayerViews.on("change",function(a){c._addLayerViews(a.added);0<a.removed.length&&(a.removed.forEach(function(a){d.remove(a.uid)}),c._updateAttributionItems())}),b.init(a,"stationary",this._updateAttributionItems)]),this._addLayerViews(a.allLayerViews))};h.prototype._addLayerViews=function(a){var c=this;a.forEach(function(a){c._handles.has(a.uid)||c._handles.add(b.init(a,
- "suspended",c._updateAttributionItems),a.uid)})};h.prototype._updateAttributionItems=function(){var a=this,b=[];this._getActiveLayerViews().forEach(function(c){var d=c.layer;if(!d.hasAttributionData){if(c=d.get("copyright")){var e=a._findItem(b,{layer:d,text:c});e||b.push({text:c,layer:d})}}else if(d&&d.tileInfo){var f=a._attributionDataByLayerId;if(f[d.uid]){if(c=a._getDynamicAttribution(f[d.uid],a.view,d))(e=a._findItem(b,{layer:d,text:c}))||b.push({text:c,layer:d})}else{var g=a._pendingAttributionItemsByLayerId;
- a._inProgress(g[d.uid])||(g[d.uid]=d.fetchAttributionData().then(function(b){b=a._createContributionIndex(b,a._isBingLayer(d));delete g[d.uid];f[d.uid]=b;a._updateAttributionItems()}))}}});this._itemsChanged(this.items,b)&&(this.items.removeAll(),this.items.addMany(b))};h.prototype._itemsChanged=function(a,b){return a.length!==b.length||a.some(function(a,c){return a.text!==b[c].text})};h.prototype._inProgress=function(a){return a&&!a.isFulfilled()};h.prototype._getActiveLayerViews=function(){return this.get("view.allLayerViews").filter(function(a){return!a.suspended&&
- a.get("layer.attributionVisible")})};h.prototype._findItem=function(a,b){var c=b.layer,d=b.text,e;a.some(function(a){var b=a.layer===c&&a.text===d;b&&(e=a);return b});return e};h.prototype._isBingLayer=function(a){return-1!==a.declaredClass.toLowerCase().indexOf("vetiledlayer")};h.prototype._createContributionIndex=function(a,b){a=a.contributors;var c={};if(!a)return c;a.forEach(function(a,e){var f=a.coverageAreas;f&&f.forEach(function(f){var g=f.bbox,h=f.zoomMin-(b&&f.zoomMin?1:0),k=f.zoomMax-(b&&
- f.zoomMax?1:0);a={extent:p.geographicToWebMercator(new l({xmin:g[1],ymin:g[0],xmax:g[3],ymax:g[2]})),attribution:a.attribution||"",score:d.isDefined(f.score)?f.score:100,id:e};for(f=h;f<=k;f++)c[f]=c[f]||[],c[f].push(a)})});c.maxKey=Math.max.apply(null,Object.keys(c));return c};h.prototype._getDynamicAttribution=function(a,b,c){var e=b.extent;b=c.tileInfo.scaleToZoom(b.scale);b=Math.min(a.maxKey,Math.round(b));if(!e||!d.isDefined(b)||-1>=b)return"";a=a[b];var f=e.center.clone().normalize(),g={};return a.filter(function(a){var b=
- !g[a.id]&&a.extent.contains(f);b&&(g[a.id]=!0);return b}).sort(function(a,b){return b.score-a.score||a.objectId-b.objectId}).map(function(a){return a.attribution}).join(", ")};a([k.property({readOnly:!0,type:c})],h.prototype,"items",void 0);a([k.property({dependsOn:["view.ready"],readOnly:!0})],h.prototype,"state",null);a([k.property()],h.prototype,"view",void 0);return h=a([k.subclass("esri.widgets.Attribution.AttributionViewModel")],h)}(k.declared(e))})},"esri/widgets/Compass":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Compass/nls/Compass ../core/accessorSupport/decorators ./Widget ./Compass/CompassViewModel ./support/widget".split(" "),
- function(r,h,f,a,e,c,g,d,b){return function(g){function h(a){a=g.call(this)||this;a.activeMode=null;a.iconClass="esri-icon-locate-circled";a.label=e.widgetLabel;a.modes=null;a.view=null;a.viewModel=new d;return a}f(h,g);h.prototype.reset=function(){};h.prototype.render=function(){var a=this.viewModel.orientation,c=this.viewModel.state,d="disabled"===c,f="compass"===("rotation"===c?"rotation":"compass"),c=(g={},g["esri-disabled"]=d,g["esri-compass--active"]="device-orientation"===this.viewModel.activeMode,
- g["esri-interactive"]=!d,g),g=(h={},h["esri-icon-compass"]=f,h["esri-icon-dial"]=!f,h);return b.tsx("div",{bind:this,class:"esri-compass esri-widget-button esri-widget",classes:c,onclick:this._start,onkeydown:this._start,role:"button",tabIndex:d?-1:0,"aria-label":e.reset,title:e.reset},b.tsx("span",{"aria-hidden":"true",class:"esri-compass__icon",classes:g,styles:this._toRotationTransform(a)}),b.tsx("span",{class:"esri-icon-font-fallback-text"},e.reset));var g,h};h.prototype._start=function(){var a=
- this.viewModel;a.nextMode();a.startMode()};h.prototype._toRotationTransform=function(a){return{transform:"rotateZ("+a.z+"deg)"}};a([c.aliasOf("viewModel.activeMode")],h.prototype,"activeMode",void 0);a([c.property()],h.prototype,"iconClass",void 0);a([c.property()],h.prototype,"label",void 0);a([c.aliasOf("viewModel.modes")],h.prototype,"modes",void 0);a([c.aliasOf("viewModel.view")],h.prototype,"view",void 0);a([c.property({type:d}),b.renderable(["viewModel.orientation","viewModel.state"])],h.prototype,
- "viewModel",void 0);a([c.aliasOf("viewModel.reset")],h.prototype,"reset",null);a([b.accessibleHandler()],h.prototype,"_start",null);return h=a([c.subclass("esri.widgets.Compass")],h)}(c.declared(g))})},"esri/widgets/Compass/CompassViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Handles ../../core/Logger ../../core/promiseUtils ../../core/watchUtils ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){var l=g.getLogger("esri.widgets.CompassViewModel");return function(e){function g(a){a=e.call(this,a)||this;a._handles=new c;a.canUseHeading=!1;a.orientation={x:0,y:0,z:0};a.view=null;a._updateForCamera=a._updateForCamera.bind(a);a._updateForRotation=a._updateForRotation.bind(a);a._updateRotationWatcher=a._updateRotationWatcher.bind(a);a._updateViewHeading=a._updateViewHeading.bind(a);a._checkHeadingSupport=a._checkHeadingSupport.bind(a);a._canUseHeading();return a}f(g,
- e);g.prototype.initialize=function(){this._handles.add(b.init(this,"view",this._updateRotationWatcher))};g.prototype.destroy=function(){this._removeCheckHeadingListener();this._removeOrientationListener();this._handles.destroy();this.view=this._handles=null};Object.defineProperty(g.prototype,"activeMode",{get:function(){var a=this._get("activeMode");return a?a:(a=this.modes)?a[0]:"none"},set:function(a){this.stopMode();this._set("activeMode",a);void 0===a&&this._clearOverride("activeMode")},enumerable:!0,
- configurable:!0});Object.defineProperty(g.prototype,"canShowNorth",{get:function(){var a=this.get("view.spatialReference");return a&&(a.isWebMercator||a.isWGS84)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"modes",{get:function(){return this._get("modes")||["reset"]},set:function(a){this._set("modes",a);void 0===a&&this._clearOverride("modes")},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"state",{get:function(){return this.get("view.ready")?this.canShowNorth?
- "compass":"rotation":"disabled"},enumerable:!0,configurable:!0});g.prototype.previousMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a-1))};g.prototype.nextMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a+1))};g.prototype.startMode=function(){var a=this.activeMode;"reset"===a&&this.reset();"device-orientation"===a&&(this._removeOrientationListener(),this._addOrientationListener())};g.prototype.stopMode=function(){"device-orientation"===
- this.activeMode&&this._removeOrientationListener()};g.prototype.reset=function(){if(this.get("view.ready")){var a={};"2d"===this.view.type?a.rotation=0:a.heading=0;this.view.goTo(a)}};g.prototype._supportsDeviceOrientation=function(){return"DeviceOrientationEvent"in window};g.prototype._paginateMode=function(a){var b=this.modes;this.activeMode=b[(a+b.length)%b.length]};g.prototype._supportsHeading=function(a){var b="number"===typeof a.webkitCompassHeading;return"number"===typeof a.compassHeading||
- b||!1};g.prototype._getAccuracy=function(a){return a.compassAccuracy||a.webkitCompassAccuracy||0};g.prototype._getHeading=function(a){return a.webkitCompassHeading||a.compassHeading||void 0};g.prototype._removeCheckHeadingListener=function(){this._supportsDeviceOrientation()&&window.removeEventListener("deviceorientation",this._checkHeadingSupport)};g.prototype._checkHeadingSupport=function(a){this._supportsHeading(a)&&this._set("canUseHeading",!0);this._removeCheckHeadingListener()};g.prototype._canUseHeading=
- function(){var a=this;this._supportsDeviceOrientation()&&(window.addEventListener("deviceorientation",this._checkHeadingSupport),d.after(500).then(function(){a._removeCheckHeadingListener()}))};g.prototype._getHeadingAdjustment=function(a,b){if("orientation"in window){b=window.orientation;if("number"!==typeof b)return a;a+=b;return 360<a?a-360:0>a?a+360:a}return a};g.prototype._updateViewHeading=function(a){var b=this.view,c=this._getHeading(a),d=this._getAccuracy(a);!b||!b.stationary||"number"!==
- typeof c||0>c||360<c||50<d||(a=this._getHeadingAdjustment(c,a),"3d"===b.type&&(c=b.camera.clone(),c.heading=a,b.camera=c),"2d"===b.type&&(b.rotation=a))};g.prototype._removeOrientationListener=function(){this.canUseHeading&&window.removeEventListener("deviceorientation",this._updateViewHeading)};g.prototype._addOrientationListener=function(){var a=this.canShowNorth;this.canUseHeading?a?window.addEventListener("deviceorientation",this._updateViewHeading):l.warn("device-orientation mode requires 'canShowNorth' to be true"):
- l.warn("The deviceorientation event is not supported in this browser")};g.prototype._updateForRotation=function(a){void 0!==a&&null!==a&&(this.orientation={z:a})};g.prototype._updateForCamera=function(a){a&&(this.orientation={x:0,y:0,z:-a.heading})};g.prototype._updateRotationWatcher=function(a){this._handles.removeAll();a&&("2d"===a.type?this._handles.add(b.init(this,"view.rotation",this._updateForRotation)):this._handles.add(b.init(this,"view.camera",this._updateForCamera)))};a([k.property({dependsOn:["modes"]})],
- g.prototype,"activeMode",null);a([k.property({dependsOn:["view.spatialReference.isWebMercator","view.spatialReference.wkid"],readOnly:!0})],g.prototype,"canShowNorth",null);a([k.property({readOnly:!0})],g.prototype,"canUseHeading",void 0);a([k.property({dependsOn:["canUseHeading"]})],g.prototype,"modes",null);a([k.property()],g.prototype,"orientation",void 0);a([k.property({dependsOn:["view.ready","canShowNorth"],readOnly:!0})],g.prototype,"state",null);a([k.property()],g.prototype,"view",void 0);
- a([k.property()],g.prototype,"previousMode",null);a([k.property()],g.prototype,"nextMode",null);a([k.property()],g.prototype,"startMode",null);a([k.property()],g.prototype,"stopMode",null);a([k.property()],g.prototype,"reset",null);return g=a([k.subclass("esri.widgets.CompassViewModel")],g)}(k.declared(e))})},"esri/widgets/NavigationToggle":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./NavigationToggle/nls/NavigationToggle ../core/accessorSupport/decorators ./Widget ./NavigationToggle/NavigationToggleViewModel ./support/widget".split(" "),
- function(r,h,f,a,e,c,g,d,b){return function(g){function h(a){a=g.call(this)||this;a.iconClass="esri-icon-pan2";a.label=e.widgetLabel;a.view=null;a.viewModel=new d;return a}f(h,g);Object.defineProperty(h.prototype,"layout",{set:function(a){"horizontal"!==a&&(a="vertical");this._set("layout",a)},enumerable:!0,configurable:!0});h.prototype.toggle=function(){};h.prototype.render=function(){var a="disabled"===this.get("viewModel.state"),c="pan"===this.get("viewModel.navigationMode"),d=(f={},f["esri-disabled"]=
- a,f["esri-navigation-toggle--horizontal"]="horizontal"===this.layout,f),f=(g={},g["esri-navigation-toggle__button--active"]=c,g),c=(h={},h["esri-navigation-toggle__button--active"]=!c,h);return b.tsx("div",{bind:this,class:"esri-navigation-toggle esri-widget",classes:d,onclick:this._toggle,onkeydown:this._toggle,tabIndex:a?-1:0,"aria-label":e.toggle,title:e.toggle},b.tsx("div",{class:b.join("esri-navigation-toggle__button esri-widget-button","esri-navigation-toggle__button--pan"),classes:f},b.tsx("span",
- {class:"esri-icon-pan"})),b.tsx("div",{class:b.join("esri-navigation-toggle__button esri-widget-button","esri-navigation-toggle__button--rotate"),classes:c},b.tsx("span",{class:"esri-icon-rotate"})));var f,g,h};h.prototype._toggle=function(){this.toggle()};a([c.property()],h.prototype,"iconClass",void 0);a([c.property()],h.prototype,"label",void 0);a([c.property({value:"vertical"}),b.renderable()],h.prototype,"layout",null);a([c.aliasOf("viewModel.view"),b.renderable()],h.prototype,"view",void 0);
- a([c.property({type:d}),b.renderable(["viewModel.state","viewModel.navigationMode"])],h.prototype,"viewModel",void 0);a([c.aliasOf("viewModel.toggle")],h.prototype,"toggle",null);a([b.accessibleHandler()],h.prototype,"_toggle",null);return h=a([c.subclass("esri.widgets.NavigationToggle")],h)}(c.declared(g))})},"esri/widgets/NavigationToggle/NavigationToggleViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Handles ../../core/watchUtils ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c,g,d){return function(b){function e(a){a=b.call(this,a)||this;a._handles=new c;a.navigationMode="pan";a.view=null;a.toggle=a.toggle.bind(a);return a}f(e,b);e.prototype.initialize=function(){this._handles.add(g.when(this,"view.inputManager",this._setNavigationMode.bind(this)))};e.prototype.destroy=function(){this._handles.destroy();this.view=this._handles=null};Object.defineProperty(e.prototype,"state",{get:function(){return this.get("view.ready")&&"3d"===this.view.type?"ready":
- "disabled"},enumerable:!0,configurable:!0});e.prototype.toggle=function(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate",this._setNavigationMode())};e.prototype._setNavigationMode=function(){this.get("view.inputManager").primaryDragAction="pan"===this.navigationMode?"pan":"rotate"};a([d.property({dependsOn:["view.ready"],readOnly:!0})],e.prototype,"state",null);a([d.property()],e.prototype,"navigationMode",void 0);a([d.property()],e.prototype,"view",void 0);
- a([d.property()],e.prototype,"toggle",null);return e=a([d.subclass("esri.widgets.NavigationToggleViewModel")],e)}(d.declared(e))})},"esri/widgets/Zoom":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Zoom/nls/Zoom ../core/accessorSupport/decorators ./Widget ./Zoom/IconButton ./Zoom/ZoomViewModel ./support/widget".split(" "),function(r,h,f,a,e,c,g,d,b,k){return function(g){function h(a){a=g.call(this)||this;a.iconClass="esri-icon-zoom-in-magnifying-glass";
- a.label=e.widgetLabel;a.view=null;a.viewModel=new b;return a}f(h,g);h.prototype.postInitialize=function(){this._zoomInButton=new d({action:this.zoomIn,iconClass:"esri-icon-plus",title:e.zoomIn});this._zoomOutButton=new d({action:this.zoomOut,iconClass:"esri-icon-minus",title:e.zoomOut})};Object.defineProperty(h.prototype,"layout",{set:function(a){"horizontal"!==a&&(a="vertical");this._set("layout",a)},enumerable:!0,configurable:!0});h.prototype.render=function(){var a=this.viewModel,b=(c={},c["esri-zoom--horizontal"]=
- "horizontal"===this.layout,c);this._zoomInButton.enabled="ready"===a.state&&a.canZoomIn;this._zoomOutButton.enabled="ready"===a.state&&a.canZoomOut;return k.tsx("div",{class:"esri-zoom esri-widget",classes:b},this._zoomInButton.render(),this._zoomOutButton.render());var c};h.prototype.zoomIn=function(){};h.prototype.zoomOut=function(){};a([c.property()],h.prototype,"iconClass",void 0);a([c.property()],h.prototype,"label",void 0);a([c.property({value:"vertical"}),k.renderable()],h.prototype,"layout",
- null);a([c.aliasOf("viewModel.view"),k.renderable()],h.prototype,"view",void 0);a([c.property({type:b}),k.renderable(["viewModel.canZoomIn","viewModel.canZoomOut","viewModel.state"])],h.prototype,"viewModel",void 0);a([c.aliasOf("viewModel.zoomIn")],h.prototype,"zoomIn",null);a([c.aliasOf("viewModel.zoomOut")],h.prototype,"zoomOut",null);return h=a([c.subclass("esri.widgets.Zoom")],h)}(c.declared(g))})},"esri/widgets/Zoom/IconButton":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/accessorSupport/decorators ../Widget ../support/widget".split(" "),
- function(r,h,f,a,e,c,g){return function(c){function b(){var a=null!==c&&c.apply(this,arguments)||this;a.enabled=!0;a.iconClass="";a.title="";return a}f(b,c);b.prototype.render=function(){var a=this.enabled?0:-1,b=(c={},c["esri-disabled"]=!this.enabled,c["esri-interactive"]=this.enabled,c),c=(d={},d[this.iconClass]=!!this.iconClass,d);return g.tsx("div",{bind:this,class:"esri-widget-button esri-widget",classes:b,onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:a,title:this.title},
- g.tsx("span",{"aria-hidden":"true",role:"presentation",class:"esri-icon",classes:c}),g.tsx("span",{class:"esri-icon-font-fallback-text"},this.title));var c,d};b.prototype._triggerAction=function(){this.action.call(this)};a([e.property()],b.prototype,"action",void 0);a([e.property(),g.renderable()],b.prototype,"enabled",void 0);a([e.property({readOnly:!1}),g.renderable()],b.prototype,"iconClass",void 0);a([e.property(),g.renderable()],b.prototype,"title",void 0);a([g.accessibleHandler()],b.prototype,
- "_triggerAction",null);return b=a([e.subclass("esri.widgets.IconButton")],b)}(e.declared(c))})},"esri/widgets/Zoom/ZoomViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/accessorSupport/decorators ./ZoomConditions2D ./ZoomConditions3D".split(" "),function(r,h,f,a,e,c,g,d){return function(b){function e(a){a=b.call(this,a)||this;a.canZoomIn=null;a.canZoomOut=null;a.zoomIn=a.zoomIn.bind(a);a.zoomOut=
- a.zoomOut.bind(a);return a}f(e,b);e.prototype.destroy=function(){this.view=null};Object.defineProperty(e.prototype,"state",{get:function(){return this.get("view.ready")?"ready":"disabled"},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"view",{set:function(a){a?"2d"===a.type?this._zoomConditions=new g({view:a}):"3d"===a.type&&(this._zoomConditions=new d):this._zoomConditions=null;this._set("view",a)},enumerable:!0,configurable:!0});e.prototype.zoomIn=function(){this.canZoomIn&&
- this._zoomToFactor(.5)};e.prototype.zoomOut=function(){this.canZoomOut&&this._zoomToFactor(2)};e.prototype._zoomToFactor=function(a){if("ready"===this.state){var b=this.view;"3d"===this.view.type?b.goTo({zoomFactor:1/a}):b.goTo({scale:this.get("view.scale")*a})}};a([c.property()],e.prototype,"_zoomConditions",void 0);a([c.property({aliasOf:"_zoomConditions.canZoomIn",readOnly:!0})],e.prototype,"canZoomIn",void 0);a([c.property({aliasOf:"_zoomConditions.canZoomOut",readOnly:!0})],e.prototype,"canZoomOut",
- void 0);a([c.property({dependsOn:["view.ready"],readOnly:!0})],e.prototype,"state",null);a([c.property()],e.prototype,"view",null);a([c.property()],e.prototype,"zoomIn",null);a([c.property()],e.prototype,"zoomOut",null);return e=a([c.subclass("esri.widgets.Zoom.ZoomViewModel")],e)}(c.declared(e))})},"esri/widgets/Zoom/ZoomConditions2D":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){return function(e){function d(){return null!==e&&e.apply(this,arguments)||this}f(d,e);Object.defineProperty(d.prototype,"canZoomIn",{get:function(){var a=this.get("view.scale"),c=this.get("view.constraints.effectiveMaxScale");return 0===c||a>c},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"canZoomOut",{get:function(){var a=this.get("view.scale"),c=this.get("view.constraints.effectiveMinScale");return 0===c||a<c},enumerable:!0,configurable:!0});a([c.property({dependsOn:["view.ready",
- "view.scale"],readOnly:!0})],d.prototype,"canZoomIn",null);a([c.property({dependsOn:["view.ready","view.scale"],readOnly:!0})],d.prototype,"canZoomOut",null);a([c.property()],d.prototype,"view",void 0);return d=a([c.subclass("esri.widgets.Zoom.ZoomConditions2D")],d)}(c.declared(e))})},"esri/widgets/Zoom/ZoomConditions3D":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){return function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.canZoomIn=!0;a.canZoomOut=!0;return a}f(d,e);a([c.property({readOnly:!0})],d.prototype,"canZoomIn",void 0);a([c.property({readOnly:!0})],d.prototype,"canZoomOut",void 0);return d=a([c.subclass("esri.widgets.Zoom.ZoomConditions3D")],d)}(c.declared(e))})},"esri/layers/graphics/controllers/I3SOnDemandController":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/has dojo/errors/CancelError dojo/promise/all ../../../core/Accessor ../../../core/Evented ../../../core/Handles ../../../core/Logger ../../../core/Promise ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../core/sql/WhereClause ../../../layers/IntegratedMeshLayer ../../../layers/SceneLayer ../../../views/3d/layers/SceneLayerView3D ../../../views/3d/layers/i3s/I3SIndexTraversal ../../../views/3d/layers/i3s/I3SLodHandling ../../../views/3d/layers/i3s/I3SNodeLoader ../../../views/3d/layers/i3s/I3SUtil ../../../views/3d/layers/i3s/I3SViewportQueries ../../../views/3d/layers/i3s/IdleQueue ../../../views/3d/lib/glMatrix ../../../views/3d/support/projectionUtils ../../../views/3d/support/PromiseLightweight ../../../views/3d/support/ResourceController".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G){function M(a,b){return a.length===b.length&&a.every(function(a){return 0<=H(b,a.name)})}function H(a,b){b=b.toLowerCase();for(var c=0;c<a.length;c++)if(a[c].name.toLowerCase()===b)return c;return-1}var J=l.getLogger("esri.layers.graphics.controllers.I3SOnDemandController");return function(b){function d(a){a=b.call(this)||this;a.nodeIndex={};a.screenSizeFactor=0;a.updating=!0;a.updatingPercentage=0;a._lodFactorProperty=null;a._isIdle=
- !1;a._cameraDirty=!0;a._alwaysLoadEverythingModeEnabled=!1;a._uncompressedTextureDownsamplingEnabled=!1;a._processLambda=null;a._loadingNodes=new Map;a._updatingNodes=new Map;a._dirtyNodes=!1;a._numUnloadedNodes=0;a._progressMaxNumNodes=1;a._unloadedMemoryEstimate=0;a._poi=null;a._requiredAttributesDirty=!0;a._updatesDisabled=!1;a.disableCache=!1;a._restartNodeLoading=!1;a._fields=null;a._attributeStorageInfo=null;a._handles=new k;a._idleQueue=new E.IdleQueue;a._errorCount=0;return a}f(d,b);Object.defineProperty(d.prototype,
- "isMeshPyramid",{get:function(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store.lodType},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"streamDataSupplier",{get:function(){return this.layerView.view.resourceController.registerClient(this.layerView,G.ClientType.SCENE,{trackRequests:!0})},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"parsedDefinitionExpression",{get:function(){if(this.layer instanceof x&&this.layer.definitionExpression)try{var a=
- q.create(this.layer.definitionExpression);if(!a.isStandardized())return J.error("definitionExpression is using non standard function"),null;var b=[],c=a.getFields();A.findFieldsCaseInsensitive(c,this.layer.fields,{missingFields:b});return 0<b.length?(J.error("definitionExpression references unknown fields: "+b.join(", ")),null):a}catch(X){return J.error("Failed to parse definitionExpression: "+X),null}else return null},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"definitionExpressionFields",
- {get:function(){if(this.parsedDefinitionExpression){var a=this.parsedDefinitionExpression.getFields();return A.findFieldsCaseInsensitive(a,this._fields)}return null},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"crsVertex",{get:function(){return A.getVertexCrs(this.layer)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"crsIndex",{get:function(){return A.getIndexCrs(this.layer)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"rootNodeVisible",
- {get:function(){var a=this._rootNodeId&&this.nodeIndex[this._rootNodeId];return a&&this._viewportQueries?this._viewportQueries.isNodeVisible(a):!0},enumerable:!0,configurable:!0});d.prototype.initialize=function(){var a=this;this.updateEventListener={needsUpdate:function(){return a._needsAnimationFrameHandler()},idleFrame:function(b){return a._processLogError(b)},idleBegin:function(){a._updateIdleState(!0)},idleEnd:function(){a._updateIdleState(!1)}};this.updateEventListenerWhileSuspended={idleBegin:function(){return a._startNodeLoadingWhileSuspended()}};
- this._lodHandling=new z(this.layerViewRequiredFunctions,this.layerViewOptionalFunctions,function(){return a._evaluateUpdatingState()});this.layerView._controller=this;var b=this.layer;this._defaultGeometrySchema=b.store.defaultGeometrySchema;this._rootNodeUrl=b.store.rootNode;var c=this._rootNodeUrl.split("/");this._rootNodeId=c[c.length-1];this.disableCache=e("disable-feature:idb-cache");b instanceof x?("mesh"===b.geometryType?this._lodFactorProperty="qualitySettings.sceneService.3dObject.lodFactor":
- "point"===b.geometryType&&(this._lodFactorProperty="qualitySettings.sceneService.point.lodFactor"),this._fields=b.fields,this._attributeStorageInfo=b.attributeStorageInfo):b instanceof v&&(this._lodFactorProperty="qualitySettings.sceneService.integratedMesh.lodFactor");b=g([this.layer.when(),this.layerView.when()]).then(function(){if(!a.destroyed&&a.layerView&&!a.layerView.destroyed){var b=a.layerView.view;a.setClippingArea(b.clippingArea);a._centerOnSurface=b.pointsOfInterest.centerOnSurfaceFrequent;
- a._handles.add(a._centerOnSurface.watch("renderLocation",function(){return a._pointOfInterestChanged()}));var c=a.layerView.view.resourceController;c.getMemoryEvents().on("quality-changed",function(){return a._setCameraDirty()});var d=!1;a._processLambda=a._frame.bind(a);a._handles.add(t.init(a.layerView,"suspended",function(b){d&&(c.deregisterIdleFrameWorker(a),a.restartNodeLoading());b?(c.registerIdleFrameWorker(a,a.updateEventListenerWhileSuspended),c.deregisterFrameWorker(a._processLambda)):(c.registerIdleFrameWorker(a,
- a.updateEventListener),c.registerFrameWorker(a._processLambda));d=!0}),"layerview");a._handles.add(a.layer.watch("elevationInfo",function(b){return a._elevationInfoChanged(b)}),"layer");a.layerView instanceof m&&a._handles.add([t.init(a.layerView,"alwaysLoadEverythingModeEnabled",function(b){a._alwaysLoadEverythingModeEnabled=b;a.restartNodeLoading()}),t.init(a.layerView,"uncompressedTextureDownsamplingEnabled",function(b){a._uncompressedTextureDownsamplingEnabled=b;a.restartNodeLoading()})],"layer");
- a._handles.add(b.state.watch("camera",function(){return a._setCameraDirty()}));a._lodFactorProperty&&a._handles.add(a.layerView.view.watch(a._lodFactorProperty,function(){return a._setCameraDirty()}),"quality")}});this.addResolvingPromise(b);this.when(function(){return a._startNodeLoading()})};d.prototype.destroy=function(){this.layerView.view.resourceController.deregisterIdleFrameWorker(this);this.layerView.view.resourceController.deregisterFrameWorker(this._processLambda);this.layerView.view.resourceController.deregisterClient(this.layerView);
- this._handles.destroy();this._nodeLoader=null};d.prototype._getRequiredAttributes=function(){if(!(null!=this._attributeStorageInfo&&this.layer instanceof x&&this._fields))return[];var a=Object.create(null);this.layer.renderer&&this.layer.renderer.collectRequiredFields(a);this.layer.labelsVisible&&this.layer.labelingInfo&&this.layer.labelingInfo.forEach(function(b){b._collectRequiredFields(a)});if(null!=this.definitionExpressionFields)for(var b=0,c=this.definitionExpressionFields;b<c.length;b++)a[c[b]]=
- !0;var d=this._attributeStorageInfo,e=this._fields,f=this.layer.objectIdField;return Object.keys(a).map(function(a){var b=H(d,a);a=H(e,a);return 0<=b&&0<=a?{index:b,name:e[a].name,field:e[a],attributeStorageInfo:d[b]}:null}).filter(function(a){return null!=a&&a.name!==f}).sort(function(a,b){return b.index-a.index}).filter(function(a,b,c){return 0===b||c[b-1].index!==a.index})};d.prototype._requiredFieldsChange=function(){this._requiredAttributesDirty=!0;this.restartNodeLoading()};d.prototype._labelingChanged=
- function(){var a=this._requiredAttributes,b=this._getRequiredAttributes();M(a,b)||this._requiredFieldsChange()};d.prototype.setClippingArea=function(a){var b=[];I.extentToBoundingBox(a,b,this.layerView.view.renderSpatialReference)?this._clippingArea=b:this._clippingArea=null};d.prototype._pointOfInterestChanged=function(){this._poi&&(this._calculatePointOfInterest(this._poi),this._viewportQueries&&this._viewportQueries.updatePointOfInterest(this._poi),this._indexLoader&&(this._indexLoader.progressiveLoadPenalty=
- 10*this._viewportQueries.distCameraToPOI(),this._indexLoader.requestReload()))};d.prototype._calculatePointOfInterest=function(a){void 0===a&&(a=F.vec3d.create());var b=this._centerOnSurface.renderLocation,c=F.vec3d.create();F.vec3d.subtract(b,this.camPos,c);F.vec3d.normalize(c);var d=this.layerView.view.renderCoordsHelper,e=F.vec3d.create();d.worldUpAtPosition(b,e);c=Math.acos(F.vec3d.dot(e,c))-.5*Math.PI;F.vec3d.lerp(this.camPos,b,Math.max(0,Math.min(1,c/(.5*Math.PI))),a);return a};d.prototype.updateClippingArea=
- function(a){this.setClippingArea(a);this._cameraDirty=!0;this._viewportQueries&&this._viewportQueries.updateExtent(this._clippingArea)};d.prototype._setCameraDirty=function(){this._cameraDirty=!0;this._evaluateUpdatingState()};d.prototype.getBaseUrl=function(){return this.layer.parsedUrl.path};d.prototype.updateElevationChanged=function(a,b,c){A.findIntersectingNodes(a,b,this.nodeIndex.root,this.crsIndex,this.nodeIndex,c);for(a=0;a<c.length;a++)b=c.data[a],this._viewportQueries.invalidateCache(b.id),
- b.id===this._rootNodeId&&this.notifyChange("rootNodeVisible");c.length&&this.restartNodeLoading()};d.prototype._elevationInfoChanged=function(a){this._viewportQueries.invalidateCache();this._initViewData()};d.prototype.restartNodeLoading=function(){this._restartNodeLoading=!0;this._evaluateUpdatingState()};d.prototype.schedule=function(a){return this._idleQueue.push(a)};d.prototype.getUnloadedMemoryEstimate=function(){return.8*this._unloadedMemoryEstimate*this._getLodDropFactor()};d.prototype._needsAnimationFrameHandler=
- function(){return!0};d.prototype._frame=function(a){null!==this._viewportQueries&&this._viewportQueries.setCameraIdle(!this._cameraDirty);this.layerView.visible&&this._processLogError(a,!1)};d.prototype._processLogError=function(a,b){void 0===b&&(b=!0);try{this._process(a,b)}catch(Y){50>this._errorCount?J.error("Error during processing: "+Y):50===this._errorCount&&J.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}};d.prototype._process=function(a,
- b){this._restartNodeLoading&&(this.cancelNodeLoading(),this._startNodeLoading());if(null!=this._nodeLoader&&null!=this._indexLoader){this._updateViewData();var c=this._indexLoader.isLoading();this._processIndex()&&(b=!1);c||this._dirtyNodes?b=this._processNodes(a,b):this._unloadedMemoryEstimate=this._numUnloadedNodes=0;for(;0<this._idleQueue.length()&&(b||!a.done());)b=!1,this._idleQueue.process();this._evaluateUpdatingState();this._lodHandling.lodGlobalHandling()}};d.prototype._processIndex=function(){var a=
- Math.min(10-this._indexLoader.getNumLoading(),this._getAvailableLoadTokens(1));return 0<a?this._indexLoader.update(a):!1};d.prototype._processNodes=function(a,b){var c=this,d=Math.min(5-this._loadingNodes.size,this._getAvailableLoadTokens(2));if(0>=d)return this._dirtyNodes=!0,!1;d=this._collectUpdates(d);d.cancel.forEach(this._cancelNodeIdLoading,this);d.update.forEach(function(d){if(b||!a.done())b=!1,c._updateLoadedNode(d.id)});d.add.forEach(function(d,e){if(b||!a.done())b=!1,c._loadNode(c.nodeIndex[e])});
- this._dirtyNodes=0<d.update.length||0<d.add.size;return b};d.prototype._cancelNodeLoading=function(){var a=this;this._loadingNodes.forEach(function(b,c){return a._cancelNodeIdLoading(c)});this._loadingNodes.clear();this._updatingNodes.forEach(function(b,c){return a._updatingNodes.get(c).cancel()});this._updatingNodes.clear()};d.prototype._cancelNodeIdLoading=function(a){this._loadingNodes.get(a).cancel();this._loadingNodes.delete(a)};d.prototype._getAvailableLoadTokens=function(a){return Math.floor((12-
- 1*this._indexLoader.getNumLoading()-2*this._loadingNodes.size)/a)};d.prototype._collectUpdates=function(a){var b=this,c=new Map,d=[],e=A.mapToKeys(this._loadingNodes),f=Number.NEGATIVE_INFINITY,g=0,h=0,k=0,l=0,m=0;this._numUnloadedNodes=0;this._indexLoader.traverseVisible(function(n){var q=b.nodeIndex[n.id];if(!q)return f=Math.max(f,b._indexLoader.entryPriority(n)),!0;if(q.failed||!q.featureData||0===q.featureData.length)return!0;if(b.layerViewRequiredFunctions.isBundleLoaded(q))return g+=q.memory,
- ++h,b._shouldLoadNode(q)||(m+=q.memory),b._needsUpdate(q)&&d.push({prio:b._indexLoader.entryPriority(q),id:q.id}),!0;q.memory&&(g+=q.memory,++h);if(!b._shouldLoadNode(q))return!0;++b._numUnloadedNodes;q.memory?l+=q.memory:++k;if(b._loadingNodes.has(q.id))return e=e.filter(function(a){return a!==q.id}),!0;A.buildTopNodeMap(c,a,q.id,b._indexLoader.entryPriority(n));return!0});this._unloadedMemoryEstimate=l-m;3<h&&(this._unloadedMemoryEstimate+=k*g/h);this._unloadedMemoryEstimate=Math.max(0,this._unloadedMemoryEstimate);
- c.forEach(function(a,b){a<f&&c.delete(b)});d.sort(function(a,b){return b.prio-a.prio});return{update:d,add:c,cancel:e}};d.prototype._evaluateUpdatingState=function(){var a=(this._indexLoader?this._indexLoader.getNumPending():0)+3*this._numUnloadedNodes+2*this._loadingNodes.size,b=!(!(0<a||0<this._updatingNodes.size||this._indexLoader&&this._indexLoader.isLoading()||this._restartNodeLoading||this._cameraDirty||0<this._idleQueue.length()||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling)&&
- this._isIdle);0===a&&(this._progressMaxNumNodes=1);this._progressMaxNumNodes=Math.max(a,this._progressMaxNumNodes);b!==this._get("updating")&&this._set("updating",b);a=100*a/this._progressMaxNumNodes;a!==this._get("updatingPercentage")&&this._set("updatingPercentage",a)};d.prototype._initViewData=function(){var a=this.layerView.view,b=a.state.camera,c=a.renderCoordsHelper;this.camPos=F.vec3d.create(a.pointsOfInterest.renderPointOfView);this.screenSizeFactor=1/b.perPixelRatio;this._poi=this._calculatePointOfInterest();
- var d=(this._lodFactorProperty&&this.layerView.view.get(this._lodFactorProperty)||1)*this._getLodMemoryFactor();this._viewportQueries=new D(this.crsIndex,c,b,this._poi,this._clippingArea,null!=this.layerViewOptionalFunctions.traversalOptions?this.layerViewOptionalFunctions.traversalOptions.errorMetricPreference:null,a.elevationProvider,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(this.layer,d),screenspaceErrorBias:d,angleDependentLoD:.5>d,disableLod:this._alwaysLoadEverythingModeEnabled});
- this._cameraDirty=!1;this.notifyChange("rootNodeVisible")};d.prototype._updateViewData=function(){if(this._cameraDirty&&this._indexLoader){var a=this.layerView.view,b=a.state.camera;this.camPos=F.vec3d.create(a.pointsOfInterest.renderPointOfView);this.screenSizeFactor=1/b.perPixelRatio;this._poi=this._calculatePointOfInterest(this._poi);this._viewportQueries.updateCamera(b);this._viewportQueries.updatePointOfInterest(this._poi);a=(this._lodFactorProperty&&this.layerView.view.get(this._lodFactorProperty)||
- 1)*this._getLodMemoryFactor();this._viewportQueries.updateScreenSpaceErrorBias(a);this._indexLoader.progressiveLoadPenalty=10*this._viewportQueries.distCameraToPOI();this._indexLoader.requestReload();this._alwaysLoadEverythingModeEnabled||this._removeInvisibleNodes();this._cameraDirty=!1;this.notifyChange("rootNodeVisible")}};d.prototype._getProgressiveLoadFactor=function(a,b){return a instanceof x&&"mesh"===a.geometryType?(a=1<=b&&e("enable-feature:progressive-3dobject"))?.05:1:a instanceof v?(a=
- 1<=b&&!e("disable-feature:progressive-im"))?.2:1:1};d.prototype._getLodMemoryFactor=function(){return this.layerView.view.resourceController.getMemoryFactor()};d.prototype._getLodDropFactor=function(){return Math.min(this._getLodMemoryFactor(),.5)/.5};d.prototype._startNodeLoadingWhileSuspended=function(){this._initViewData();this._alwaysLoadEverythingModeEnabled&&this.layerView.visible&&!this.layerView.get("parent.suspended")||this._removeInvisibleNodes()};d.prototype.isGeometryVisible=function(a){return this._viewportQueries.isGeometryVisible(a)};
- d.prototype._shouldLoadNode=function(a){if(!this._lodHandling.shouldLoadNode(a))return!1;var b=this._getLodDropFactor();return 0<b&&0<this._viewportQueries.maxDistance&&this._lodHandling.childrenEmpty(a)&&this._viewportQueries.distToPOI(a)>this._viewportQueries.maxDistance*b?!1:a.obb?this._viewportQueries.isGeometryVisible(a):!0};d.prototype._startNodeLoading=function(){var a=this;this._restartNodeLoading=!1;if(!this._updatesDisabled&&null!=this.streamDataSupplier){this._initViewData();null!=this.layerViewOptionalFunctions.getLoadedAttributes&&
- this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1,this._handles.add([this.layer.watch("renderer",function(){return a._requiredFieldsChange()}),this.layer.watch("definitionExpression",function(){return a._requiredFieldsChange()}),this.layer.watch("labelsVisible",function(){return a._labelingChanged()}),this.layer.watch("labelingInfo",function(){return a._labelingChanged()})],"requiredAttributes"));var b=this.layerViewOptionalFunctions.textureOptions,
- c=C.TextureFormat.Normal;b&&b.useCompressedTextures?c=C.TextureFormat.Compressed:this._uncompressedTextureDownsamplingEnabled&&(c=C.TextureFormat.Downsampled);b=this._defaultGeometrySchema;this._nodeLoader=new C(this.streamDataSupplier,J,b,this._requiredAttributes,{textureFormat:c,loadTextureData:this.layerView instanceof m&&this.layerView.rendererNeedsTextures,loadFeatureData:!this.isMeshPyramid||null==b||null==b.ordering});c=10*this._viewportQueries.distCameraToPOI();this._indexLoader=new B(this.getBaseUrl(),
- this._rootNodeUrl,this._rootNodeId,c,this.nodeIndex,this.streamDataSupplier,this._viewportQueries,J);this._alwaysLoadEverythingModeEnabled||this._removeInvisibleNodes();this._lodHandling.startNodeLoading(function(b){return a._viewportQueries.isNodeVisible(b)},function(b){return a._viewportQueries.isGeometryVisible(b)},function(b){return a._indexLoader.nodeTraversalState(b)},this.nodeIndex,this._rootNodeId,{maxLodLevel:this._viewportQueries.maxLodLevel});this.layerViewOptionalFunctions.additionalStartNodeLoadingHandler&&
- this.layerViewOptionalFunctions.additionalStartNodeLoadingHandler();this._evaluateUpdatingState()}};d.prototype.isNodeLoading=function(){return null!=this._nodeLoader&&null!=this._indexLoader};d.prototype.cancelNodeLoading=function(){this.isNodeLoading()&&(this._indexLoader.cancel(),this._nodeLoader.cancel(),this.streamDataSupplier.cancelAll(),this._idleQueue.cancelAll(),this._cancelNodeLoading(),this._poi=this._indexLoader=this._nodeLoader=null,this.layerViewOptionalFunctions.additionalCancelNodeLoadingHandler&&
- this.layerViewOptionalFunctions.additionalCancelNodeLoadingHandler(),this._evaluateUpdatingState())};d.prototype._removeInvisibleNodes=function(){for(var a=this.layerViewRequiredFunctions.getAddedNodeIDs(),b=this._getLodDropFactor(),c=this._viewportQueries.maxDistance*b,b=0<b&&0<c,d=0;d<a.length;d++){var e=this.nodeIndex[a[d]];if(!this._viewportQueries.isGeometryVisible(e)||b&&this._lodHandling.childrenEmpty(e)&&this._viewportQueries.distToPOI(e)>c)this._lodHandling.setLodGlobalDirty(),this.layerViewRequiredFunctions.removeNodeData(e)}};
- d.prototype._needsUpdate=function(a){if(null==a.featureData||0===a.featureData.length||this._updatingNodes.has(a.id))return!1;var b=this.layerViewOptionalFunctions.getLoadedAttributes;a=null!=b?b(a):void 0;return null!=a&&a!==this._requiredAttributes};d.prototype._updateLoadedNode=function(a){var b=this,d=this.nodeIndex[a],e=d.baseUrl,f=this.layerViewOptionalFunctions.getLoadedAttributes(d),e=M(f,this._requiredAttributes)?n.resolve(this.layerViewOptionalFunctions.getAttributeData(d)):this._nodeLoader.loadAttributes(d,
- e,this._requiredAttributes);this._updatingNodes.set(a,e);e.then(function(a){return b.schedule().then(function(){return b.layerViewOptionalFunctions.setAttributeData(d,b._requiredAttributes,a)})}).catch(function(a){a instanceof c||b.layerViewOptionalFunctions.setAttributeData(d,b._requiredAttributes,{})}).always(function(){b._updatingNodes.delete(a);b._evaluateUpdatingState()});this._evaluateUpdatingState()};d.prototype._loadNode=function(a){var b=this,c=new P.Promise;this._loadingNodes.set(a.id,c);
- this._evaluateUpdatingState();this._loadAndAddBundle(a).always(function(){b._loadingNodes.delete(a.id);b._evaluateUpdatingState();c.done()});return c};d.prototype._loadAndAddBundle=function(a){var b=this;1!==a.featureData.length&&J.warn("Node ${node.id} has ${node.featureData.length} bundles. Only the first bundle will be loaded.");return this._loadCached(a).then(function(c){if(!c)return b._loadUncached(a)}).catch(function(d){if(!(d instanceof c))return b._loadUncached(a)})};d.prototype._loadCached=
- function(a){var b=this,c=this.disableCache?null:this.layerViewOptionalFunctions.loadCachedBundle,d=this.disableCache?null:this.layerViewOptionalFunctions.addCachedBundle;return c&&d?this.schedule().then(function(){return c(a,function(a,c){return b._nodeLoader.loadTextures(a,c)})}).then(function(c){if(null==c)return!1;var e=b._requiredAttributes;return b.schedule().then(function(){return b._nodeLoader.loadAttributes(a,a.baseUrl,e)}).then(function(a){return b.schedule({loadedAttributes:e,attributeData:a})}).then(function(b){return d(a,
- c,b)}).then(function(){b._lodHandling.lodSwapBundleLoaded(a);return!0})}):n.resolve(!1)};d.prototype._loadUncached=function(a){var b=this;return this.schedule().then(function(){return b._nodeLoader.loadBundleData(a,0)}).then(function(a){return b.schedule(a)}).then(function(c){return b.layerViewRequiredFunctions.addBundle(a,c)}).then(function(){return b._lodHandling.lodSwapBundleLoaded(a)}).catch(function(b){b instanceof c||(J.error("Failed to load node '"+a.id+"' bundle 0: "+b),a.failed=!0)})};d.prototype._updateIdleState=
- function(a){a!==this._isIdle&&(this._isIdle=a,this._viewportQueries&&this._viewportQueries.setCameraIdle(!0),this._evaluateUpdatingState())};a([u.property({readOnly:!0})],d.prototype,"isMeshPyramid",null);a([u.property({readOnly:!0})],d.prototype,"streamDataSupplier",null);a([u.property({readOnly:!0,dependsOn:["layer.definitionExpression"]})],d.prototype,"parsedDefinitionExpression",null);a([u.property({readOnly:!0,dependsOn:["parsedDefinitionExpression"]})],d.prototype,"definitionExpressionFields",
- null);a([u.property({readOnly:!0})],d.prototype,"crsVertex",null);a([u.property({readOnly:!0})],d.prototype,"crsIndex",null);a([u.property({readOnly:!0})],d.prototype,"nodeIndex",void 0);a([u.property()],d.prototype,"camPos",void 0);a([u.property()],d.prototype,"screenSizeFactor",void 0);a([u.property()],d.prototype,"layerView",void 0);a([u.property()],d.prototype,"layerViewRequiredFunctions",void 0);a([u.property()],d.prototype,"layerViewOptionalFunctions",void 0);a([u.property()],d.prototype,"layer",
- void 0);a([u.property({readOnly:!0})],d.prototype,"updating",void 0);a([u.property({readOnly:!0})],d.prototype,"updatingPercentage",void 0);a([u.property({readOnly:!0})],d.prototype,"rootNodeVisible",null);return d=a([u.subclass("esri.layers.graphics.controllers.I3SOnDemandController")],d)}(u.declared(d,p,b))})},"esri/core/sql/WhereClause":function(){define(["require","exports","../../moment","./StandardizedFunctions","./WhereGrammar"],function(r,h,f,a,e){function c(a){return Array.isArray(a)?a:[a]}
- function g(a){return null!==a?!0!==a:null}function d(a,b){if(null==a)return null;for(var c=!1,d=0;d<b.length;d++){var e=b[d];if(null==e)c=null;else if(a===e){c=!0;break}}return c}function b(a,b,c){if(null==a)return null;for(var d="",e=0,f=0;f<b.length;f++){var g=b.charAt(f);switch(e){case 0:g===c?e=1:d=0<="-[]/{}()*+?.\\^$|".indexOf(g)?d+("\\"+g):"%"===g?d+".*":"_"===g?d+".":d+g;break;case 1:d=0<="-[]/{}()*+?.\\^$|".indexOf(g)?d+("\\"+g):d+g,e=0}}return(new RegExp("^"+d+"$")).test(a)}function k(a){return a instanceof
- Date?a.valueOf():a}function l(a,b,c){if(null==b||null==c)return null;b=k(b);c=k(c);switch(a){case "\x3c\x3e":return b!==c;case "\x3d":return b===c;case "\x3e":return b>c;case "\x3c":return b<c;case "\x3e\x3d":return b>=c;case "\x3c\x3d":return b<=c}}function p(a){for(var b=[],c={},d=0;d<a.length;d++){var e=a[d],f=e.toLowerCase();void 0===c[f]&&(b.push(e),c[f]=1)}return b}return function(){function h(){this.parameters=this.parseTree=null}h.create=function(a){var b=new h;b.parseTree=e.WhereGrammar.parse(a);
- return b};h.prototype.isStandardized=function(){var b=!0;this.visitAll(this.parseTree,function(c){b&&"function"===c.type&&(b=a.isStandardized(c.name,c.args.value.length))});return b};h.prototype.setVariablesDictionary=function(a){this.parameters=a};h.prototype.testFeature=function(a){return!!this.evaluateNode(this.parseTree,a)};h.prototype.calculateValue=function(a){return this.evaluateNode(this.parseTree,a)};h.prototype.getFunctions=function(){var a=[];this.visitAll(this.parseTree,function(b){"function"===
- b.type&&a.push(b.name.toLowerCase())});return p(a)};h.prototype.getFields=function(){var a=[];this.visitAll(this.parseTree,function(b){"column_ref"===b.type&&a.push(b.column)});return p(a)};h.prototype.getVariables=function(){var a=[];this.visitAll(this.parseTree,function(b){"param"===b.type&&a.push(b.value.toLowerCase())});return p(a)};h.prototype.featureValue=function(a,b,c){a=a&&"object"===typeof a.attributes?a.attributes:a;var d=a[b];if(void 0!==d)return d;for(var e in a)if(b.toLowerCase()===
- e.toLowerCase())return c.column=e,a[e];return null};h.prototype.visitAll=function(a,b){if(null!=a)switch(b(a),a.type){case "when_clause":this.visitAll(a.operand,b);this.visitAll(a.value,b);break;case "case_expression":for(var c=0,d=a.clauses;c<d.length;c++){var e=d[c];this.visitAll(e,b)}"simple"===a.format&&this.visitAll(a.operand,b);null!==a.else&&this.visitAll(a.else,b);break;case "expr_list":c=0;for(a=a.value;c<a.length;c++)e=a[c],this.visitAll(e,b);break;case "unary_expr":this.visitAll(a.expr,
- b);break;case "binary_expr":this.visitAll(a.left,b);this.visitAll(a.right,b);break;case "function":this.visitAll(a.args,b)}};h.prototype.evaluateNode=function(e,h){switch(e.type){case "case_expression":if("simple"===e.format)for(var n=k(this.evaluateNode(e.operand,h)),p=0;p<e.clauses.length;p++){if(n===k(this.evaluateNode(e.clauses[p].operand,h)))return this.evaluateNode(e.clauses[p].value,h)}else for(p=0;p<e.clauses.length;p++)if(!0===this.evaluateNode(e.clauses[p].operand,h))return this.evaluateNode(e.clauses[p].value,
- h);return null!==e.else?this.evaluateNode(e.else,h):null;case "param":return this.parameters[e.value.toLowerCase()];case "expr_list":n=[];p=0;for(e=e.value;p<e.length;p++){var t=e[p];n.push(this.evaluateNode(t,h))}return n;case "unary_expr":return g(this.evaluateNode(e.expr,h));case "binary_expr":switch(e.operator){case "AND":return n=this.evaluateNode(e.left,h),h=this.evaluateNode(e.right,h),null!=n&&null!=h?!0===n&&!0===h:!1===n||!1===h?!1:null;case "OR":return n=this.evaluateNode(e.left,h),h=this.evaluateNode(e.right,
- h),null!=n&&null!=h?!0===n||!0===h:!0===n||!0===h?!0:null;case "IS":if("null"!==e.right.type)throw Error("Unsupported RHS for IS");return null===this.evaluateNode(e.left,h);case "ISNOT":if("null"!==e.right.type)throw Error("Unsupported RHS for IS");return null!==this.evaluateNode(e.left,h);case "IN":return n=c(this.evaluateNode(e.right,h)),d(this.evaluateNode(e.left,h),n);case "NOT IN":return n=c(this.evaluateNode(e.right,h)),g(d(this.evaluateNode(e.left,h),n));case "BETWEEN":return n=this.evaluateNode(e.left,
- h),h=this.evaluateNode(e.right,h),null==n||null==h[0]||null==h[1]?null:n>=h[0]&&n<=h[1];case "NOTBETWEEN":return n=this.evaluateNode(e.left,h),h=this.evaluateNode(e.right,h),null==n||null==h[0]||null==h[1]?null:n<h[0]||n>h[1];case "LIKE":return b(this.evaluateNode(e.left,h),this.evaluateNode(e.right,h),e.escape);case "NOT LIKE":return g(b(this.evaluateNode(e.left,h),this.evaluateNode(e.right,h),e.escape));case "\x3c\x3e":case "\x3c":case "\x3e":case "\x3e\x3d":case "\x3c\x3d":case "\x3d":return l(e.operator,
- this.evaluateNode(e.left,h),this.evaluateNode(e.right,h));case "*":return this.evaluateNode(e.left,h)*this.evaluateNode(e.right,h);case "-":return this.evaluateNode(e.left,h)-this.evaluateNode(e.right,h);case "+":return this.evaluateNode(e.left,h)+this.evaluateNode(e.right,h);case "/":return this.evaluateNode(e.left,h)/this.evaluateNode(e.right,h)}throw Error("Not Supported Operator "+e.operator);case "null":case "bool":case "string":case "number":return e.value;case "date":return f(e.value,["YYYY-M-D"]).toDate();
- case "timestamp":return f(e.value,["YYYY-M-D H:m:s","YYYY-M-D H:mZ","YYYY-M-D H:m:sZ","YYYY-M-D H:m","YYYY-m-d"]).toDate();case "column_ref":return"CURRENT_DATE"===e.column.toUpperCase()?(t=new Date,t.setHours(0,0,0,0),t):"CURRENT_TIMESTAMP"===e.column.toUpperCase()?new Date:this.featureValue(h,e.column,e);case "function":return h=this.evaluateNode(e.args,h),a.evaluateFunction(e.name,h)}throw Error("Unsupported sql syntax "+e.type);};return h}()})},"esri/core/sql/StandardizedFunctions":function(){define(["require",
- "exports","dojo/regexp"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});h.evaluateFunction=function(e,c){var f=a[e.toLowerCase()];if(null==f)throw Error("Function Not Recognised");if(c.length<f.minParams||c.length>f.maxParams)throw Error("Invalid Parameter count for call to "+e.toUpperCase());return f.evaluate(c)};h.isStandardized=function(e,c){e=a[e.toLowerCase()];return null!=e&&c>=e.minParams&&c<=e.maxParams};var a={extract:{minParams:2,maxParams:2,evaluate:function(a){var c=
- a[0];a=a[1];if(null==a)return null;if(a instanceof Date)switch(c.toUpperCase()){case "SECOND":return a.getSeconds();case "MINUTE":return a.getMinutes();case "HOUR":return a.getHours();case "DAY":return a.getDate();case "MONTH":return a.getMonth()+1;case "YEAR":return a.getFullYear()}throw Error("Invalid Parameter for call to EXTRACT");}},substring:{minParams:2,maxParams:3,evaluate:function(a){if(2===a.length){var c=a[0],e=a[1];return null==c||null==e?null:c.toString().substring(e-1)}if(3===a.length)return c=
- a[0],e=a[1],a=a[2],null==c||null==e||null==a?null:0>=a?"":c.toString().substring(e-1,e+a-1)}},position:{minParams:2,maxParams:2,evaluate:function(a){var c=a[0];a=a[1];return null==c||null==a?null:a.indexOf(c)+1}},trim:{minParams:2,maxParams:3,evaluate:function(a){var c=3===a.length,e=c?a[1]:" ",c=c?a[2]:a[1];if(null==e||null==c)return null;e="("+f.escapeString(e)+")";switch(a[0]){case "BOTH":return c.replace(new RegExp("^"+e+"*|"+e+"*$","g"),"");case "LEADING":return c.replace(new RegExp("^"+e+"*",
- "g"),"");case "TRAILING":return c.replace(new RegExp(e+"*$","g"),"")}throw Error("Invalid Parameter for call to TRIM");}},abs:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.abs(a[0])}},ceiling:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.ceil(a[0])}},floor:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.floor(a[0])}},log:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.log(a[0])}},log10:{minParams:1,
- maxParams:1,evaluate:function(a){return null==a[0]?null:Math.log(a[0])*Math.LOG10E}},sin:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.sin(a[0])}},cos:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.cos(a[0])}},tan:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.tan(a[0])}},asin:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.asin(a[0])}},acos:{minParams:1,maxParams:1,evaluate:function(a){return null==
- a[0]?null:Math.acos(a[0])}},atan:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:Math.atan(a[0])}},sign:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:0<a[0]?1:0>a[1]?-1:0}},power:{minParams:2,maxParams:2,evaluate:function(a){return null==a[0]||null==a[1]?null:Math.pow(a[0],a[1])}},mod:{minParams:2,maxParams:2,evaluate:function(a){return null==a[0]||null==a[1]?null:a[0]%a[1]}},round:{minParams:1,maxParams:2,evaluate:function(a){var c=a[0];a=2===a.length?
- Math.pow(10,a[1]):1;return null==c?null:Math.round(c*a)/a}},truncate:{minParams:1,maxParams:2,evaluate:function(a){return null==a[0]?null:1===a.length?parseInt(a[0].toFixed(0),10):parseFloat(a[0].toFixed(a[1]))}},char_length:{minParams:1,maxParams:1,evaluate:function(a){return"string"===typeof a[0]||a[0]instanceof String?a[0].length:0}},concat:{minParams:1,maxParams:Infinity,evaluate:function(a){for(var c="",e=0;e<a.length;e++){if(null==a[e])return null;c+=a[e].toString()}return c}},lower:{minParams:1,
- maxParams:1,evaluate:function(a){return null==a[0]?null:a[0].toString().toLowerCase()}},upper:{minParams:1,maxParams:1,evaluate:function(a){return null==a[0]?null:a[0].toString().toUpperCase()}}}})},"esri/core/sql/WhereGrammar":function(){define(["require","exports","./sql92grammar"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(){}a.parse=function(a){return f.parse(a)};return a}();h.WhereGrammar=r})},"esri/core/sql/sql92grammar":function(){define([],function(){function r(h,
- f,a,e){this.message=h;this.expected=f;this.found=a;this.location=e;this.name="SyntaxError";"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}(function(h,f){function a(){this.constructor=h}a.prototype=f.prototype;h.prototype=new a})(r,Error);r.buildMessage=function(h,f){function a(a){return a.charCodeAt(0).toString(16).toUpperCase()}function e(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,
- "\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+a(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+a(b)})}function c(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(b){return"\\x0"+a(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+a(b)})}var g={literal:function(a){return'"'+e(a.text)+'"'},"class":function(a){var b=
- "",d;for(d=0;d<a.parts.length;d++)b+=a.parts[d]instanceof Array?c(a.parts[d][0])+"-"+c(a.parts[d][1]):c(a.parts[d]);return"["+(a.inverted?"^":"")+b+"]"},any:function(a){return"any character"},end:function(a){return"end of input"},other:function(a){return a.description}};return"Expected "+function(a){var b=Array(a.length),c;for(c=0;c<a.length;c++){var d=c,e;e=a[c];e=g[e.type](e);b[d]=e}b.sort();if(0<b.length){for(a=c=1;c<b.length;c++)b[c-1]!==b[c]&&(b[a]=b[c],a++);b.length=a}switch(b.length){case 1:return b[0];
- case 2:return b[0]+" or "+b[1];default:return b.slice(0,-1).join(", ")+", or "+b[b.length-1]}}(h)+" but "+(f?'"'+e(f)+'"':"end of input")+" found."};return{SyntaxError:r,parse:function(h,f){function a(a,b){return{type:"literal",text:a,ignoreCase:b}}function e(a,b,c){return{type:"class",parts:a,inverted:b,ignoreCase:c}}function c(a){var b=Ya[a],c;if(!b){for(c=a-1;!Ya[c];)c--;b=Ya[c];for(b={line:b.line,column:b.column};c<a;)10===h.charCodeAt(c)?(b.line++,b.column=1):b.column++,c++;Ya[a]=b}return b}
- function g(a,b){var d=c(a),e=c(b);return{start:{offset:a,line:d.line,column:d.column},end:{offset:b,line:e.line,column:e.column}}}function d(a){y<Da||(y>Da&&(Da=y,wb=[]),wb.push(a))}function b(){var a,b,c;a=y;b=T();b!==w?(b=l(),b!==w?(c=T(),c!==w?a=b:(y=a,a=w)):(y=a,a=w)):(y=a,a=w);return a}function k(){var a,b,c,d,e,f,g,h;a=y;b=l();if(b!==w){c=[];d=y;e=T();e!==w?(f=aa(),f!==w?(g=T(),g!==w?(h=l(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);for(;d!==w;)c.push(d),d=y,e=T(),e!==w?
- (f=aa(),f!==w?(g=T(),g!==w?(h=l(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);if(c!==w){a={type:"expr_list"};b=[b];for(d=0;d<c.length;d++)b.push(c[d][3]);a.value=b}else y=a,a=w}else y=a,a=w;return a}function l(){var a,b,c,d,e,f,g,h;a=y;b=p();if(b!==w){c=[];d=y;e=T();e!==w?(f=U(),f!==w?(g=T(),g!==w?(h=p(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);for(;d!==w;)c.push(d),d=y,e=T(),e!==w?(f=U(),f!==w?(g=T(),g!==w?(h=p(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):
- (y=d,d=w)):(y=d,d=w);c!==w?a=b=la(b,c):(y=a,a=w)}else y=a,a=w;return a}function p(){var a,b,c,d,e,f,g,h;a=y;b=n();if(b!==w){c=[];d=y;e=T();e!==w?(f=V(),f!==w?(g=T(),g!==w?(h=n(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);for(;d!==w;)c.push(d),d=y,e=T(),e!==w?(f=V(),f!==w?(g=T(),g!==w?(h=n(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);c!==w?a=b=la(b,c):(y=a,a=w)}else y=a,a=w;return a}function n(){var a,b,c,e,f;a=y;b=L();b===w&&(b=y,33===h.charCodeAt(y)?(c=xa,
- y++):(c=w,0===W&&d(oa)),c!==w?(e=y,W++,61===h.charCodeAt(y)?(f=na,y++):(f=w,0===W&&d(Fa)),W--,f===w?e=void 0:(y=e,e=w),e!==w?b=c=[c,e]:(y=b,b=w)):(y=b,b=w));b!==w?(c=T(),c!==w?(e=n(),e!==w?a=b={type:"unary_expr",operator:"NOT",expr:e}:(y=a,a=w)):(y=a,a=w)):(y=a,a=w);if(a===w)if(a=y,b=v(),b!==w)if(c=T(),c!==w){var g,l,m;c=[];e=y;f=T();f!==w?(g=t(),g!==w?(l=T(),l!==w?(m=v(),m!==w?e=f=[f,g,l,m]:(y=e,e=w)):(y=e,e=w)):(y=e,e=w)):(y=e,e=w);if(e!==w)for(;e!==w;)c.push(e),e=y,f=T(),f!==w?(g=t(),g!==w?(l=
- T(),l!==w?(m=v(),m!==w?e=f=[f,g,l,m]:(y=e,e=w)):(y=e,e=w)):(y=e,e=w)):(y=e,e=w);else c=w;c!==w&&(c={type:"arithmetic",tail:c});c===w&&(c=y,e=q(),e!==w?(f=T(),f!==w?(f=fa(),f!==w?(f=T(),f!==w?(f=k(),f!==w?(g=T(),g!==w?(g=qa(),g!==w?c=e={op:e,right:f}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w),c===w&&(c=y,e=q(),e!==w?(f=T(),f!==w?(f=fa(),f!==w?(f=T(),f!==w?(f=qa(),f!==w?c=e={op:e,right:{type:"expr_list",value:[]}}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w),
- c===w&&(c=y,e=q(),e!==w?(f=T(),f!==w?(f=F(),f!==w?c=e={op:e,right:f}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w))),c===w&&(c=y,f=L(),f!==w?(e=T(),e!==w?(e=ca(),e!==w?(g=T(),g!==w?(g=v(),g!==w?(l=T(),l!==w?(l=V(),l!==w?(f=T(),f!==w?(f=v(),f!==w?c=f={op:"NOT"+e,right:{type:"expr_list",value:[g,f]}}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w),c===w&&(c=y,f=ca(),f!==w?(e=T(),e!==w?(e=v(),e!==w?(g=T(),g!==w?(g=V(),g!==w?(l=T(),l!==w?(l=v(),l!==w?c=f={op:f,right:{type:"expr_list",
- value:[e,l]}}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)),c===w&&(c=y,e=Q(),e!==w?(f=T(),f!==w?(f=L(),f!==w?(f=T(),f!==w?(f=v(),f!==w?c=e={op:e+"NOT",right:f}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w),c===w&&(c=y,e=Q(),e!==w?(f=T(),f!==w?(f=v(),f!==w?c=e={op:e,right:f}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)),c===w&&(c=y,e=u(),e!==w?(f=T(),f!==w?(f=P(),f!==w?(g=T(),g!==w?(g=y,h.substr(y,6).toLowerCase()===gd?(l=h.substr(y,6),y+=6):(l=w,0===W&&d(hd)),l!==w?(l=y,
- W++,m=D(),W--,m===w?l=void 0:(y=l,l=w),l!==w?g="ESCAPE":(y=g,g=w)):(y=g,g=w),g!==w?(g=T(),g!==w?(g=G(),g!==w?c=e={op:e,right:f,escape:g.value}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w)):(y=c,c=w),c===w&&(c=y,e=u(),e!==w?(f=T(),f!==w?(f=P(),f!==w?c=e={op:e,right:f,escape:""}:(y=c,c=w)):(y=c,c=w)):(y=c,c=w))))));c===w&&(c=null);c!==w?(a=b,b=c,""==b||void 0==b||null==b?b=a:(c=null,b=c="arithmetic"==b.type?la(a,b.tail):ia(b.op,a,b.right,b.escape)),a=b):(y=a,a=w)}else y=a,a=w;else y=
- a,a=w;return a}function t(){var a;h.substr(y,2)===ua?(a=ua,y+=2):(a=w,0===W&&d(ba));a===w&&(62===h.charCodeAt(y)?(a=za,y++):(a=w,0===W&&d(Pa)),a===w&&(h.substr(y,2)===Ga?(a=Ga,y+=2):(a=w,0===W&&d(ya)),a===w&&(h.substr(y,2)===Ca?(a=Ca,y+=2):(a=w,0===W&&d(Ra)),a===w&&(60===h.charCodeAt(y)?(a=Sa,y++):(a=w,0===W&&d(Va)),a===w&&(61===h.charCodeAt(y)?(a=na,y++):(a=w,0===W&&d(Fa)),a===w&&(h.substr(y,2)===Qa?(a=Qa,y+=2):(a=w,0===W&&d(Za))))))));return a}function u(){var a,b,c,d;a=a=y;b=L();b!==w?(c=T(),c!==
- w?(d=K(),d!==w?a=b=[b,c,d]:(y=a,a=w)):(y=a,a=w)):(y=a,a=w);a!==w&&(a=a[0]+" "+a[2]);a===w&&(a=K());return a}function q(){var a,b,c,d;a=a=y;b=L();b!==w?(c=T(),c!==w?(d=X(),d!==w?a=b=[b,c,d]:(y=a,a=w)):(y=a,a=w)):(y=a,a=w);a!==w&&(a=a[0]+" "+a[2]);a===w&&(a=X());return a}function v(){var a,b,c,d,e,f,g,h;a=y;b=m();if(b!==w){c=[];d=y;e=T();e!==w?(f=x(),f!==w?(g=T(),g!==w?(h=m(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);for(;d!==w;)c.push(d),d=y,e=T(),e!==w?(f=x(),f!==w?(g=T(),g!==
- w?(h=m(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);c!==w?a=b=la(b,c):(y=a,a=w)}else y=a,a=w;return a}function x(){var a;43===h.charCodeAt(y)?(a=Wa,y++):(a=w,0===W&&d($a));a===w&&(45===h.charCodeAt(y)?(a=Aa,y++):(a=w,0===W&&d(Ia)));return a}function m(){var a,b,c,d,e,f,g,h;a=y;b=z();if(b!==w){c=[];d=y;e=T();e!==w?(f=B(),f!==w?(g=T(),g!==w?(h=z(),h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);for(;d!==w;)c.push(d),d=y,e=T(),e!==w?(f=B(),f!==w?(g=T(),g!==w?(h=z(),
- h!==w?d=e=[e,f,g,h]:(y=d,d=w)):(y=d,d=w)):(y=d,d=w)):(y=d,d=w);c!==w?a=b=la(b,c):(y=a,a=w)}else y=a,a=w;return a}function B(){var a;42===h.charCodeAt(y)?(a=Ta,y++):(a=w,0===W&&d(fb));a===w&&(47===h.charCodeAt(y)?(a=Ha,y++):(a=w,0===W&&d(ab)));return a}function z(){var a,b,c,e,f,g,m;m=G();if(m===w){var n,q,p,t;n=y;var r,u,v,x;r=y;u=O();u!==w?(v=N(),v!==w?(x=S(),x!==w?r=u=parseFloat(u+v+x):(y=r,r=w)):(y=r,r=w)):(y=r,r=w);r===w&&(r=y,u=O(),u!==w?(v=N(),v!==w?r=u=parseFloat(u+v):(y=r,r=w)):(y=r,r=w),
- r===w&&(r=y,u=O(),u!==w?(v=S(),v!==w?r=u=parseFloat(u+v):(y=r,r=w)):(y=r,r=w),r===w&&(r=y,u=O(),u!==w&&(u=parseFloat(u)),r=u)));q=r;q!==w?(p=y,W++,t=A(),W--,t===w?p=void 0:(y=p,p=w),p!==w?n=q={type:"number",value:q}:(y=n,n=w)):(y=n,n=w);m=n;if(m===w){var z,B;z=y;var za,L,K,V;za=y;h.substr(y,4).toLowerCase()===id?(L=h.substr(y,4),y+=4):(L=w,0===W&&d(jd));L!==w?(K=y,W++,V=D(),W--,V===w?K=void 0:(y=K,K=w),K!==w?za=L=[L,K]:(y=za,za=w)):(y=za,za=w);B=za;B!==w&&(B={type:"bool",value:!0});z=B;if(z===w){z=
- y;var ra,Pa,U,Ga;ra=y;h.substr(y,5).toLowerCase()===kd?(Pa=h.substr(y,5),y+=5):(Pa=w,0===W&&d(ld));Pa!==w?(U=y,W++,Ga=D(),W--,Ga===w?U=void 0:(y=U,U=w),U!==w?ra=Pa=[Pa,U]:(y=ra,ra=w)):(y=ra,ra=w);B=ra;B!==w&&(B={type:"bool",value:!1});z=B}m=z;if(m===w){var ba,Q,R,ya,ca;Q=y;h.substr(y,4).toLowerCase()===md?(R=h.substr(y,4),y+=4):(R=w,0===W&&d(nd));R!==w?(ya=y,W++,ca=D(),W--,ca===w?ya=void 0:(y=ya,ya=w),ya!==w?Q=R=[R,ya]:(y=Q,Q=w)):(y=Q,Q=w);ba=Q;ba!==w&&(ba={type:"null",value:null});m=ba;if(m===w){var Y,
- wa,Ca,Ra;Y=y;var aa,Sa,xa,oa;aa=y;h.substr(y,4).toLowerCase()===od?(Sa=h.substr(y,4),y+=4):(Sa=w,0===W&&d(pd));Sa!==w?(xa=y,W++,oa=D(),W--,oa===w?xa=void 0:(y=xa,xa=w),xa!==w?aa=Sa="DATE":(y=aa,aa=w)):(y=aa,aa=w);wa=aa;wa!==w?(Ca=T(),Ca!==w?(Ra=P(),Ra!==w?Y=wa={type:"date",value:Ra.value}:(y=Y,Y=w)):(y=Y,Y=w)):(y=Y,Y=w);m=Y;if(m===w){var ea,Va,ja,ha;ea=y;var ia,Aa,ua,la;ia=y;h.substr(y,9).toLowerCase()===qd?(Aa=h.substr(y,9),y+=9):(Aa=w,0===W&&d(rd));Aa!==w?(ua=y,W++,la=D(),W--,la===w?ua=void 0:(y=
- ua,ua=w),ua!==w?ia=Aa="TIMESTAMP":(y=ia,ia=w)):(y=ia,ia=w);Va=ia;Va!==w?(ja=T(),ja!==w?(ha=P(),ha!==w?ea=Va={type:"timestamp",value:ha.value}:(y=ea,ea=w)):(y=ea,ea=w)):(y=ea,ea=w);m=ea}}}}}a=m;if(a===w){var na,Ia,Fa,Qa,$a,Ta,Wa,Za,hb,ab,Tb,fb;na=y;var Ha,Da,bb,gb;Ha=y;h.substr(y,7).toLowerCase()===sd?(Da=h.substr(y,7),y+=7):(Da=w,0===W&&d(td));Da!==w?(bb=y,W++,gb=D(),W--,gb===w?bb=void 0:(y=bb,bb=w),bb!==w?Ha=Da="EXTRACT":(y=Ha,Ha=w)):(y=Ha,Ha=w);Ia=Ha;if(Ia!==w)if(Fa=T(),Fa!==w)if(Qa=fa(),Qa!==w)if($a=
- T(),$a!==w){var Ka,Ja,Xa,cb,Vb;Ja=y;h.substr(y,4).toLowerCase()===ud?(Xa=h.substr(y,4),y+=4):(Xa=w,0===W&&d(vd));Xa!==w?(cb=y,W++,Vb=D(),W--,Vb===w?cb=void 0:(y=cb,cb=w),cb!==w?Ja=Xa="YEAR":(y=Ja,Ja=w)):(y=Ja,Ja=w);Ka=Ja;if(Ka===w){var lb,jb,ib,Ub;lb=y;h.substr(y,5).toLowerCase()===wd?(jb=h.substr(y,5),y+=5):(jb=w,0===W&&d(xd));jb!==w?(ib=y,W++,Ub=D(),W--,Ub===w?ib=void 0:(y=ib,ib=w),ib!==w?lb=jb="MONTH":(y=lb,lb=w)):(y=lb,lb=w);Ka=lb;if(Ka===w){var mb,vb,Hb,kb;mb=y;h.substr(y,3).toLowerCase()===
- yd?(vb=h.substr(y,3),y+=3):(vb=w,0===W&&d(zd));vb!==w?(Hb=y,W++,kb=D(),W--,kb===w?Hb=void 0:(y=Hb,Hb=w),Hb!==w?mb=vb="DAY":(y=mb,mb=w)):(y=mb,mb=w);Ka=mb;if(Ka===w){var nb,Ya,Ib,ub;nb=y;h.substr(y,4).toLowerCase()===Ad?(Ya=h.substr(y,4),y+=4):(Ya=w,0===W&&d(Bd));Ya!==w?(Ib=y,W++,ub=D(),W--,ub===w?Ib=void 0:(y=Ib,Ib=w),Ib!==w?nb=Ya="HOUR":(y=nb,nb=w)):(y=nb,nb=w);Ka=nb;if(Ka===w){var ob,Wb,Jb,wb;ob=y;h.substr(y,6).toLowerCase()===Cd?(Wb=h.substr(y,6),y+=6):(Wb=w,0===W&&d(Dd));Wb!==w?(Jb=y,W++,wb=D(),
- W--,wb===w?Jb=void 0:(y=Jb,Jb=w),Jb!==w?ob=Wb="MINUTE":(y=ob,ob=w)):(y=ob,ob=w);Ka=ob;if(Ka===w){var pb,Xb,Kb,Eb;pb=y;h.substr(y,6).toLowerCase()===Ed?(Xb=h.substr(y,6),y+=6):(Xb=w,0===W&&d(Fd));Xb!==w?(Kb=y,W++,Eb=D(),W--,Eb===w?Kb=void 0:(y=Kb,Kb=w),Kb!==w?pb=Xb="SECOND":(y=pb,pb=w)):(y=pb,pb=w);Ka=pb}}}}}Ta=Ka;Ta!==w?(Wa=T(),Wa!==w?(Za=ga(),Za!==w?(hb=T(),hb!==w?(ab=l(),ab!==w?(Tb=T(),Tb!==w?(fb=qa(),fb!==w?na=Ia={type:"function",name:"extract",args:{type:"expr_list",value:[{type:"string",value:Ta},
- ab]}}:(y=na,na=w)):(y=na,na=w)):(y=na,na=w)):(y=na,na=w)):(y=na,na=w)):(y=na,na=w)):(y=na,na=w)}else y=na,na=w;else y=na,na=w;else y=na,na=w;else y=na,na=w;a=na;if(a===w){var ta,pc,Fb,Gb,yc,Yb,zc,Ac,Bc,Zb,Cc,Ea,xb,qc,rc,sc;ta=y;var qb,$b,Lb,Dc;qb=y;h.substr(y,9).toLowerCase()===Gd?($b=h.substr(y,9),y+=9):($b=w,0===W&&d(Hd));$b!==w?(Lb=y,W++,Dc=D(),W--,Dc===w?Lb=void 0:(y=Lb,Lb=w),Lb!==w?qb=$b="SUBSTRING":(y=qb,qb=w)):(y=qb,qb=w);pc=qb;if(pc!==w)if(Fb=T(),Fb!==w)if(Gb=fa(),Gb!==w)if(yc=T(),yc!==w)if(Yb=
- l(),Yb!==w)if(zc=T(),zc!==w)if(Ac=ga(),Ac!==w)if(Bc=T(),Bc!==w)if(Zb=l(),Zb!==w)if(Cc=T(),Cc!==w){Ea=y;var rb,ac,Mb,Ec;rb=y;h.substr(y,3).toLowerCase()===Id?(ac=h.substr(y,3),y+=3):(ac=w,0===W&&d(Jd));ac!==w?(Mb=y,W++,Ec=D(),W--,Ec===w?Mb=void 0:(y=Mb,Mb=w),Mb!==w?rb=ac="FOR":(y=rb,rb=w)):(y=rb,rb=w);xb=rb;xb!==w?(qc=T(),qc!==w?(rc=l(),rc!==w?(sc=T(),sc!==w?Ea=xb=[xb,qc,rc,sc]:(y=Ea,Ea=w)):(y=Ea,Ea=w)):(y=Ea,Ea=w)):(y=Ea,Ea=w);Ea===w&&(Ea=null);Ea!==w?(xb=qa(),xb!==w?ta=pc={type:"function",name:"substring",
- args:{type:"expr_list",value:Ea?[Yb,Zb,Ea[2]]:[Yb,Zb]}}:(y=ta,ta=w)):(y=ta,ta=w)}else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;else y=ta,ta=w;a=ta;if(a===w){var ma,yb,bc,cc,dc,La,ec,zb,fc,gc,Fc,tc,Gc,Hc;ma=y;yb=da();yb!==w?(bc=T(),bc!==w?(cc=fa(),cc!==w?(dc=T(),dc!==w?(La=I(),La===w&&(La=null),La!==w?(ec=T(),ec!==w?(zb=l(),zb!==w?(fc=T(),fc!==w?(gc=ga(),gc!==w?(Fc=T(),Fc!==w?(tc=l(),tc!==w?(Gc=T(),Gc!==w?(Hc=
- qa(),Hc!==w?ma=yb={type:"function",name:"trim",args:{type:"expr_list",value:[{type:"string",value:null==La?"BOTH":La},zb,tc]}}:(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w);ma===w&&(ma=y,yb=da(),yb!==w?(bc=T(),bc!==w?(cc=fa(),cc!==w?(dc=T(),dc!==w?(La=I(),La===w&&(La=null),La!==w?(ec=T(),ec!==w?(zb=l(),zb!==w?(fc=T(),fc!==w?(gc=qa(),gc!==w?ma=yb={type:"function",name:"trim",args:{type:"expr_list",
- value:[{type:"string",value:null==La?"BOTH":La},zb]}}:(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w)):(y=ma,ma=w));a=ma;if(a===w){var va,uc,Ic,Jc,Kc,vc,Lc,Mc,Nc,wc,Oc,Pc;va=y;var sb,hc,Nb,Qc;sb=y;h.substr(y,8).toLowerCase()===Kd?(hc=h.substr(y,8),y+=8):(hc=w,0===W&&d(Ld));hc!==w?(Nb=y,W++,Qc=D(),W--,Qc===w?Nb=void 0:(y=Nb,Nb=w),Nb!==w?sb=hc="POSITION":(y=sb,sb=w)):(y=sb,sb=w);uc=sb;uc!==w?(Ic=T(),Ic!==w?(Jc=fa(),Jc!==w?(Kc=T(),Kc!==w?(vc=l(),
- vc!==w?(Lc=T(),Lc!==w?(Mc=X(),Mc!==w?(Nc=T(),Nc!==w?(wc=l(),wc!==w?(Oc=T(),Oc!==w?(Pc=qa(),Pc!==w?va=uc={type:"function",name:"position",args:{type:"expr_list",value:[vc,wc]}}:(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w)):(y=va,va=w);a=va;if(a===w){var Ba,ic,Rc,Sc,Tc,Ab,Uc,Vc;Ba=y;var Ma,Ob,Pb,Ua;Ma=y;Ma=Ob=C();if(Ma===w)if(Ma=y,96===h.charCodeAt(y)?(Ob=Wc,y++):(Ob=w,0===W&&d(Xc)),Ob!==w){Pb=[];Yc.test(h.charAt(y))?
- (Ua=h.charAt(y),y++):(Ua=w,0===W&&d(Zc));if(Ua!==w)for(;Ua!==w;)Pb.push(Ua),Yc.test(h.charAt(y))?(Ua=h.charAt(y),y++):(Ua=w,0===W&&d(Zc));else Pb=w;Pb!==w?(96===h.charCodeAt(y)?(Ua=Wc,y++):(Ua=w,0===W&&d(Xc)),Ua!==w?Ma=Ob=Pb.join(""):(y=Ma,Ma=w)):(y=Ma,Ma=w)}else y=Ma,Ma=w;ic=Ma;ic!==w?(Rc=T(),Rc!==w?(Sc=fa(),Sc!==w?(Tc=T(),Tc!==w?(Ab=k(),Ab===w&&(Ab=null),Ab!==w?(Uc=T(),Uc!==w?(Vc=qa(),Vc!==w?Ba=ic={type:"function",name:ic,args:Ab?Ab:{type:"expr_list",value:[]}}:(y=Ba,Ba=w)):(y=Ba,Ba=w)):(y=Ba,Ba=
- w)):(y=Ba,Ba=w)):(y=Ba,Ba=w)):(y=Ba,Ba=w)):(y=Ba,Ba=w);a=Ba;if(a===w){var jc,pa,Bb,kc,Cb,lc,db,Na,Qb,$c,ad;pa=y;Bb=ka();if(Bb!==w)if(kc=T(),kc!==w)if(Cb=l(),Cb!==w)if(lc=T(),lc!==w){db=[];for(Na=H();Na!==w;)db.push(Na),Na=H();db!==w?(Na=T(),Na!==w?(Qb=Z(),Qb!==w?pa=Bb={type:"case_expression",format:"simple",operand:Cb,clauses:db,else:null}:(y=pa,pa=w)):(y=pa,pa=w)):(y=pa,pa=w)}else y=pa,pa=w;else y=pa,pa=w;else y=pa,pa=w;else y=pa,pa=w;if(pa===w)if(pa=y,Bb=ka(),Bb!==w)if(kc=T(),kc!==w)if(Cb=l(),Cb!==
- w)if(lc=T(),lc!==w){db=[];for(Na=H();Na!==w;)db.push(Na),Na=H();db!==w?(Na=T(),Na!==w?(Qb=J(),Qb!==w?($c=T(),$c!==w?(ad=Z(),ad!==w?pa=Bb={type:"case_expression",format:"simple",operand:Cb,clauses:db,else:Qb.value}:(y=pa,pa=w)):(y=pa,pa=w)):(y=pa,pa=w)):(y=pa,pa=w)):(y=pa,pa=w)}else y=pa,pa=w;else y=pa,pa=w;else y=pa,pa=w;else y=pa,pa=w;jc=pa;if(jc===w){var sa,Db,mc,eb,Oa,Rb,bd,cd;sa=y;Db=ka();if(Db!==w)if(mc=T(),mc!==w){eb=[];for(Oa=M();Oa!==w;)eb.push(Oa),Oa=M();eb!==w?(Oa=T(),Oa!==w?(Rb=Z(),Rb!==
- w?sa=Db={type:"case_expression",format:"searched",clauses:eb,else:null}:(y=sa,sa=w)):(y=sa,sa=w)):(y=sa,sa=w)}else y=sa,sa=w;else y=sa,sa=w;if(sa===w)if(sa=y,Db=ka(),Db!==w)if(mc=T(),mc!==w){eb=[];for(Oa=M();Oa!==w;)eb.push(Oa),Oa=M();eb!==w?(Oa=T(),Oa!==w?(Rb=J(),Rb!==w?(bd=T(),bd!==w?(cd=Z(),cd!==w?sa=Db={type:"case_expression",format:"searched",clauses:eb,else:Rb.value}:(y=sa,sa=w)):(y=sa,sa=w)):(y=sa,sa=w)):(y=sa,sa=w)):(y=sa,sa=w)}else y=sa,sa=w;else y=sa,sa=w;jc=sa}a=jc;if(a===w){var Sb,tb,
- xc,nc,oc;tb=y;xc=A();if(xc!==w){nc=[];for(oc=E();oc!==w;)nc.push(oc),oc=E();nc!==w?tb=xc+=nc.join(""):(y=tb,tb=w)}else y=tb,tb=w;Sb=tb;Sb!==w&&(Sb={type:"column_ref",table:"",column:Sb});a=Sb;a===w&&(a=F(),a===w&&(a=y,b=fa(),b!==w?(c=T(),c!==w?(e=l(),e!==w?(f=T(),f!==w?(g=qa(),g!==w?(e.paren=!0,a=b=e):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)))}}}}}}}return a}function C(){var a,b,c,d;a=y;b=A();if(b!==w){c=[];for(d=D();d!==w;)c.push(d),d=D();c!==w?a=b+=c.join(""):(y=a,a=w)}else y=a,a=w;
- return a}function A(){var a;gb.test(h.charAt(y))?(a=h.charAt(y),y++):(a=w,0===W&&d(Ja));return a}function D(){var a;Xa.test(h.charAt(y))?(a=h.charAt(y),y++):(a=w,0===W&&d(hb));return a}function E(){var a;ib.test(h.charAt(y))?(a=h.charAt(y),y++):(a=w,0===W&&d(Tb));return a}function F(){var a,b,c;a=y;64===h.charCodeAt(y)?(b=Ub,y++):(b=w,0===W&&d(Vb));b!==w?(c=C(),c!==w?a=b=[b,c]:(y=a,a=w)):(y=a,a=w);a!==w&&(a={type:"param",value:a[1]});return a}function I(){var a,b,c;a=y;h.substr(y,7).toLowerCase()===
- Md?(b=h.substr(y,7),y+=7):(b=w,0===W&&d(Nd));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="LEADING":(y=a,a=w)):(y=a,a=w);a===w&&(a=y,h.substr(y,8).toLowerCase()===Od?(b=h.substr(y,8),y+=8):(b=w,0===W&&d(Pd)),b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="TRAILING":(y=a,a=w)):(y=a,a=w),a===w&&(a=y,h.substr(y,4).toLowerCase()===Qd?(b=h.substr(y,4),y+=4):(b=w,0===W&&d(Rd)),b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="BOTH":(y=a,a=w)):(y=a,a=w)));return a}function P(){var a;
- a=G();a===w&&(a=F());return a}function G(){var a,b,c;a=y;39===h.charCodeAt(y)?(b=jb,y++):(b=w,0===W&&d(bb));b===w&&(h.substr(y,2)===cb?(b=cb,y+=2):(b=w,0===W&&d(vb)));if(b!==w){b=[];c=y;h.substr(y,2)===kb?(c=kb,y+=2):(c=w,0===W&&d(Eb));c!==w&&(c="'");c===w&&(Fb.test(h.charAt(y))?(c=h.charAt(y),y++):(c=w,0===W&&d(Gb)));for(;c!==w;)b.push(c),c=y,h.substr(y,2)===kb?(c=kb,y+=2):(c=w,0===W&&d(Eb)),c!==w&&(c="'"),c===w&&(Fb.test(h.charAt(y))?(c=h.charAt(y),y++):(c=w,0===W&&d(Gb)));b!==w?(39===h.charCodeAt(y)?
- (c=jb,y++):(c=w,0===W&&d(bb)),c!==w?a=b={type:"string",value:b.join("")}:(y=a,a=w)):(y=a,a=w)}else y=a,a=w;return a}function M(){var a,b,c;a=y;b=ea();b!==w?(b=T(),b!==w?(b=l(),b!==w?(c=T(),c!==w?(c=ja(),c!==w?(c=T(),c!==w?(c=l(),c!==w?a=b={type:"when_clause",operand:b,value:c}:(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w);return a}function H(){var a,b,c;a=y;b=ea();b!==w?(b=T(),b!==w?(b=l(),b!==w?(c=T(),c!==w?(c=ja(),c!==w?(c=T(),c!==w?(c=l(),c!==w?a=b={type:"when_clause",
- operand:b,value:c}:(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w)):(y=a,a=w);return a}function J(){var a,b;a=y;var c,e;b=y;h.substr(y,4).toLowerCase()===Sd?(c=h.substr(y,4),y+=4):(c=w,0===W&&d(Td));c!==w?(c=y,W++,e=D(),W--,e===w?c=void 0:(y=c,c=w),c!==w?b="ELSE":(y=b,b=w)):(y=b,b=w);b!==w?(b=T(),b!==w?(b=l(),b!==w?a={type:"else_clause",value:b}:(y=a,a=w)):(y=a,a=w)):(y=a,a=w);return a}function O(){var a,b,c;a=R();a===w&&(a=y,45===h.charCodeAt(y)?(b=Aa,y++):(b=w,0===W&&d(Ia)),b===
- w&&(43===h.charCodeAt(y)?(b=Wa,y++):(b=w,0===W&&d($a))),b!==w?(c=R(),c!==w?a=b=b[0]+c:(y=a,a=w)):(y=a,a=w));return a}function N(){var a,b;a=y;46===h.charCodeAt(y)?(b=dd,y++):(b=w,0===W&&d(ed));b!==w?(b=R(),b===w&&(b=null),b!==w?a="."+(null!=b?b:""):(y=a,a=w)):(y=a,a=w);return a}function S(){var a,b,c;b=a=y;Ud.test(h.charAt(y))?(c=h.charAt(y),y++):(c=w,0===W&&d(Vd));c!==w?(Wd.test(h.charAt(y))?(c=h.charAt(y),y++):(c=w,0===W&&d(Xd)),c===w&&(c=null),c!==w?b="e"+(null===c?"":c):(y=b,b=w)):(y=b,b=w);b!==
- w?(c=R(),c!==w?a=b+c:(y=a,a=w)):(y=a,a=w);return a}function R(){var a,b;a=[];b=Y();if(b!==w)for(;b!==w;)a.push(b),b=Y();else a=w;a!==w&&(a=a.join(""));return a}function Y(){var a;fd.test(h.charAt(y))?(a=h.charAt(y),y++):(a=w,0===W&&d(Yd));return a}function X(){var a,b,c;a=y;h.substr(y,2).toLowerCase()===Zd?(b=h.substr(y,2),y+=2):(b=w,0===W&&d($d));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="IN":(y=a,a=w)):(y=a,a=w);return a}function Q(){var a,b,c;a=y;h.substr(y,2).toLowerCase()===ae?
- (b=h.substr(y,2),y+=2):(b=w,0===W&&d(be));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="IS":(y=a,a=w)):(y=a,a=w);return a}function K(){var a,b,c;a=y;h.substr(y,4).toLowerCase()===ce?(b=h.substr(y,4),y+=4):(b=w,0===W&&d(de));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="LIKE":(y=a,a=w)):(y=a,a=w);return a}function L(){var a,b,c;a=y;h.substr(y,3).toLowerCase()===ee?(b=h.substr(y,3),y+=3):(b=w,0===W&&d(fe));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="NOT":(y=
- a,a=w)):(y=a,a=w);return a}function V(){var a,b,c;a=y;h.substr(y,3).toLowerCase()===ge?(b=h.substr(y,3),y+=3):(b=w,0===W&&d(he));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="AND":(y=a,a=w)):(y=a,a=w);return a}function U(){var a,b,c;a=y;h.substr(y,2).toLowerCase()===ie?(b=h.substr(y,2),y+=2):(b=w,0===W&&d(je));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="OR":(y=a,a=w)):(y=a,a=w);return a}function ca(){var a,b,c;a=y;h.substr(y,7).toLowerCase()===ke?(b=h.substr(y,7),y+=7):
- (b=w,0===W&&d(le));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="BETWEEN":(y=a,a=w)):(y=a,a=w);return a}function ga(){var a,b,c;a=y;h.substr(y,4).toLowerCase()===me?(b=h.substr(y,4),y+=4):(b=w,0===W&&d(ne));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="FROM":(y=a,a=w)):(y=a,a=w);return a}function da(){var a,b,c;a=y;h.substr(y,4).toLowerCase()===oe?(b=h.substr(y,4),y+=4):(b=w,0===W&&d(pe));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="TRIM":(y=a,a=w)):(y=a,a=
- w);return a}function ka(){var a,b,c;a=y;h.substr(y,4).toLowerCase()===qe?(b=h.substr(y,4),y+=4):(b=w,0===W&&d(re));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="CASE":(y=a,a=w)):(y=a,a=w);return a}function Z(){var a,b,c;a=y;h.substr(y,3).toLowerCase()===se?(b=h.substr(y,3),y+=3):(b=w,0===W&&d(te));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="END":(y=a,a=w)):(y=a,a=w);return a}function ea(){var a,b,c;a=y;h.substr(y,4).toLowerCase()===ue?(b=h.substr(y,4),y+=4):(b=w,0===W&&
- d(ve));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="WHEN":(y=a,a=w)):(y=a,a=w);return a}function ja(){var a,b,c;a=y;h.substr(y,4).toLowerCase()===we?(b=h.substr(y,4),y+=4):(b=w,0===W&&d(xe));b!==w?(b=y,W++,c=D(),W--,c===w?b=void 0:(y=b,b=w),b!==w?a="THEN":(y=a,a=w)):(y=a,a=w);return a}function aa(){var a;44===h.charCodeAt(y)?(a=ye,y++):(a=w,0===W&&d(ze));return a}function fa(){var a;40===h.charCodeAt(y)?(a=Ae,y++):(a=w,0===W&&d(Be));return a}function qa(){var a;41===h.charCodeAt(y)?
- (a=Ce,y++):(a=w,0===W&&d(De));return a}function T(){var a,b;a=[];for(b=ha();b!==w;)a.push(b),b=ha();return a}function ha(){var a;Ee.test(h.charAt(y))?(a=h.charAt(y),y++):(a=w,0===W&&d(Fe));return a}function ia(a,b,c,d){a={type:"binary_expr",operator:a,left:b,right:c};void 0!==d&&(a.escape=d);return a}function la(a,b){for(var c=0;c<b.length;c++)a=ia(b[c][1],a,b[c][3]);return a}f=void 0!==f?f:{};var w={},ra={start:b},wa=b,xa="!",oa=a("!",!1),na="\x3d",Fa=a("\x3d",!1),ua="\x3e\x3d",ba=a("\x3e\x3d",!1),
- za="\x3e",Pa=a("\x3e",!1),Ga="\x3c\x3d",ya=a("\x3c\x3d",!1),Ca="\x3c\x3e",Ra=a("\x3c\x3e",!1),Sa="\x3c",Va=a("\x3c",!1),Qa="!\x3d",Za=a("!\x3d",!1),Wa="+",$a=a("+",!1),Aa="-",Ia=a("-",!1),Ta="*",fb=a("*",!1),Ha="/",ab=a("/",!1),gb=/^[A-Za-z_\x80-\uFFFF]/,Ja=e([["A","Z"],["a","z"],"_",["\u0080","\uffff"]],!1,!1),Xa=/^[A-Za-z0-9_]/,hb=e([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ib=/^[A-Za-z0-9_.\x80-\uFFFF]/,Tb=e([["A","Z"],["a","z"],["0","9"],"_",".",["\u0080","\uffff"]],!1,!1),Ub="@",Vb=a("@",!1),
- jb="'",bb=a("'",!1),cb="N'",vb=a("N'",!1),kb="''",Eb=a("''",!1),Fb=/^[^']/,Gb=e(["'"],!0,!1),dd=".",ed=a(".",!1),fd=/^[0-9]/,Yd=e([["0","9"]],!1,!1),Ud=/^[eE]/,Vd=e(["e","E"],!1,!1),Wd=/^[+\-]/,Xd=e(["+","-"],!1,!1),md="null",nd=a("NULL",!0),id="true",jd=a("TRUE",!0),kd="false",ld=a("FALSE",!0),Zd="in",$d=a("IN",!0),ae="is",be=a("IS",!0),ce="like",de=a("LIKE",!0),gd="escape",hd=a("ESCAPE",!0),ee="not",fe=a("NOT",!0),ge="and",he=a("AND",!0),ie="or",je=a("OR",!0),ke="between",le=a("BETWEEN",!0),me=
- "from",ne=a("FROM",!0),Id="for",Jd=a("FOR",!0),Gd="substring",Hd=a("SUBSTRING",!0),sd="extract",td=a("EXTRACT",!0),oe="trim",pe=a("TRIM",!0),Kd="position",Ld=a("POSITION",!0),qd="timestamp",rd=a("TIMESTAMP",!0),od="date",pd=a("DATE",!0),Md="leading",Nd=a("LEADING",!0),Od="trailing",Pd=a("TRAILING",!0),Qd="both",Rd=a("BOTH",!0),ud="year",vd=a("YEAR",!0),wd="month",xd=a("MONTH",!0),yd="day",zd=a("DAY",!0),Ad="hour",Bd=a("HOUR",!0),Cd="minute",Dd=a("MINUTE",!0),Ed="second",Fd=a("SECOND",!0),qe="case",
- re=a("CASE",!0),se="end",te=a("END",!0),ue="when",ve=a("WHEN",!0),we="then",xe=a("THEN",!0),Sd="else",Td=a("ELSE",!0),ye=",",ze=a(",",!1),Ae="(",Be=a("(",!1),Ce=")",De=a(")",!1),Ee=/^[ \t\n\r]/,Fe=e([" ","\t","\n","\r"],!1,!1),Wc="`",Xc=a("`",!1),Yc=/^[^`]/,Zc=e(["`"],!0,!1),y=0,Ya=[{line:1,column:1}],Da=0,wb=[],W=0,ub;if("startRule"in f){if(!(f.startRule in ra))throw Error("Can't start parsing from rule \""+f.startRule+'".');wa=ra[f.startRule]}ub=wa();if(ub!==w&&y===h.length)return ub;ub!==w&&y<
- h.length&&d({type:"end"});throw function(a,b,c){return new r(r.buildMessage(a,b),a,b,c)}(wb,Da<h.length?h.charAt(Da):null,Da<h.length?g(Da,Da+1):g(Da,Da));}}})},"esri/layers/IntegratedMeshLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../core/Error ../core/promiseUtils ../core/accessorSupport/decorators ./Layer ./mixins/SceneService ../symbols/support/ElevationInfo".split(" "),function(r,h,f,a,e,c,g,d,b,k,l){return function(b){function h(a,
- c){a=b.call(this)||this;a.geometryType="mesh";a.operationalLayerType="IntegratedMeshLayer";a.type="integrated-mesh";a.profile="mesh-pyramids";a.elevationInfo=null;return a}f(h,b);h.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?e.mixin({},{url:a},b):a};h.prototype.load=function(){var a=this,b=this.loadFromPortal({supportedTypes:["Scene Service"]}).always(function(){return a._fetchService()}).then(function(){return a._verifyRootNodeAndUpdateExtent()});this.addResolvingPromise(b);
- return this.when()};h.prototype.importLayerViewModule=function(a){switch(a.type){case "2d":return g.reject(new c("integrated-mesh-layer:view-not-supported","IntegratedMeshLayer is only supported in 3D"));case "3d":return g.create(function(a){return r(["../views/3d/layers/SceneLayerView3D"],a)})}};h.prototype._validateLayer=function(a){if(a.layerType&&"IntegratedMesh"!==a.layerType)throw new c("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:a.layerType});
- if(isNaN(this.version.major)||isNaN(this.version.minor))throw new c("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(1<this.version.major)throw new c("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});};a([d.shared("esri.layers.IntegratedMeshLayer")],h.prototype,"declaredClass",void 0);a([d.property({type:String,readOnly:!0})],
- h.prototype,"geometryType",void 0);a([d.property()],h.prototype,"operationalLayerType",void 0);a([d.property({json:{read:!1},readOnly:!0})],h.prototype,"type",void 0);a([d.property({type:l,json:{origins:{service:{read:{source:"elevationInfo"}}},read:{source:"layerDefinition.elevationInfo"},write:{target:"layerDefinition.elevationInfo"}}})],h.prototype,"elevationInfo",void 0);return h=a([d.subclass()],h)}(d.declared(b,k))})},"esri/layers/mixins/SceneService":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../request ../../core/Error ../../core/Logger ../../core/MultiOriginJSONSupport ../../core/promiseUtils ../../core/urlUtils ../../core/accessorSupport/decorators ../../geometry/Extent ../../geometry/HeightModelInfo ../../geometry/SpatialReference ../Layer ./ArcGISService ./OperationalLayer ./PortalLayer ../support/arcgisLayerUrl".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m){var B=g.getLogger("esri.layers.mixins.SceneService");return function(d){function g(){var a=null!==d&&d.apply(this,arguments)||this;a.blendMode=null;a.spatialReference=null;a.fullExtent=null;a.heightModelInfo=null;a.version={major:Number.NaN,minor:Number.NaN,versionString:""};a.copyright=null;a.sublayerTitleMode="item-title";a.title=null;a.layerId=null;return a}f(g,d);g.prototype.readSpatialReference=function(a,b){return this._readSpatialReference(b)};
- g.prototype._readSpatialReference=function(a){if(null!=a.spatialReference)return t.fromJSON(a.spatialReference);a=a.store;a=(a=a.indexCRS||a.geographicCRS)&&parseInt(a.substring(a.lastIndexOf("/")+1,a.length),10);return null!=a?new t(a):null};g.prototype.readFullExtent=function(a,b){a=b.store;b=this._readSpatialReference(b);return null==b||null==a||null==a.extent?null:new p({xmin:a.extent[0],ymin:a.extent[1],xmax:a.extent[2],ymax:a.extent[3],spatialReference:b})};g.prototype.readVersion=function(a,
- b){a=b.store;b=null!=a.version?a.version.toString():"";a={major:Number.NaN,minor:Number.NaN,versionString:b};b=b.split(".");2<=b.length&&(a.major=parseInt(b[0],10),a.minor=parseInt(b[1],10));return a};g.prototype.readCopyright=function(a,b){return b.copyrightText};g.prototype.readTitlePortalItem=function(a,b){return"item-title"!==this.sublayerTitleMode?void 0:a};g.prototype.readTitleService=function(a,b){a=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return m.titleFromUrlAndName(this.url,
- b.name);b=b.name||m.parse(this.url).title;"item-title-and-service-name"===this.sublayerTitleMode&&a&&(b=a+" - "+b);return m.cleanTitle(b)};g.prototype.readLayerId=function(a,b){return b.id};Object.defineProperty(g.prototype,"url",{set:function(a){a=m.sanitizeUrlWithLayerId(this,a,B);this._set("url",a.url);null!=a.layerId&&this._set("layerId",a.layerId)},enumerable:!0,configurable:!0});g.prototype.writeUrl=function(a,b){m.writeUrlWithLayerId(this,a,"layers",b)};Object.defineProperty(g.prototype,"parsedUrl",
- {get:function(){var a=this._get("url");if(!a)return null;a=k.urlToObject(a);null!=this.layerId&&m.match.test(a.path)&&(a.path=a.path+"/layers/"+this.layerId);return a},enumerable:!0,configurable:!0});g.prototype.readRootNode=function(a,b){return b.store.rootNode};g.prototype._verifyRootNodeAndUpdateExtent=function(){var a=this;return this._fetchRootNode().then(function(b){return a._updateExtentFromRootNode(b)})};g.prototype._updateExtentFromRootNode=function(a){if(null!=this.fullExtent&&!this.fullExtent.hasZ&&
- null!=a&&Array.isArray(a.mbs)&&4===a.mbs.length){var b=a.mbs[2];a=a.mbs[3];this.fullExtent.zmin=b-a;this.fullExtent.zmax=b+a}};g.prototype._fetchRootNode=function(){if(!this.rootNode)return b.resolve();var a=k.join(this.parsedUrl.path,this.rootNode);return e(a,{query:{f:"json"},responseType:"json"}).then(function(a){return a.data}).catch(function(b){throw new c("sceneservice:root-node-missing","Root node missing.",{error:b,url:a});})};g.prototype._fetchService=function(){var a=this;return(null==this.layerId&&
- /SceneServer\/*$/i.test(this.url)?this._fetchFirstLayerId().then(function(b){null!=b&&(a.layerId=b)}):b.resolve()).then(function(){return a._fetchServiceLayer()})};g.prototype._fetchFirstLayerId=function(){return e(this.url,{query:{f:"json"},callbackParamName:"callback",responseType:"json"}).then(function(a){if(a.data&&Array.isArray(a.data.layers)&&0<a.data.layers.length)return a.data.layers[0].id})};g.prototype._fetchServiceLayer=function(){var a=this;return e(this.parsedUrl.path,{query:{f:"json"},
- responseType:"json"}).then(function(b){b.ssl&&(a.url=a.url.replace(/^http:/i,"https:"));b=b.data;a.read(b,{origin:"service",url:a.parsedUrl});a._validateLayer(b)})};g.prototype._validateLayer=function(a){};g.prototype.createGraphicsController=function(a){var c=this;a.layer=this;var d=b.create(function(a){return r(["../graphics/controllers/I3SOnDemandController"],a)}).then(function(b){return new b(a)});d.then(function(a){c.emit("graphics-controller-create",{graphicsController:a})});return d};a([l.shared({id:{json:{origins:{service:{read:!1},
- "portal-item":{read:!1}}}}})],g.prototype,"properties",void 0);a([l.property({type:t})],g.prototype,"spatialReference",void 0);a([l.reader("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],g.prototype,"readSpatialReference",null);a([l.property({type:p})],g.prototype,"fullExtent",void 0);a([l.reader("fullExtent",["store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],g.prototype,"readFullExtent",null);a([l.property({readOnly:!0,type:n})],g.prototype,
- "heightModelInfo",void 0);a([l.property({readOnly:!0})],g.prototype,"version",void 0);a([l.reader("version",["store.version"])],g.prototype,"readVersion",null);a([l.property({type:String})],g.prototype,"copyright",void 0);a([l.reader("copyright",["copyrightText"])],g.prototype,"readCopyright",null);a([l.property({type:String})],g.prototype,"sublayerTitleMode",void 0);a([l.property({type:String})],g.prototype,"title",void 0);a([l.reader("portal-item","title")],g.prototype,"readTitlePortalItem",null);
- a([l.reader("service","title",["name"])],g.prototype,"readTitleService",null);a([l.property({type:Number})],g.prototype,"layerId",void 0);a([l.reader("service","layerId",["id"])],g.prototype,"readLayerId",null);a([l.property()],g.prototype,"url",null);a([l.writer("url")],g.prototype,"writeUrl",null);a([l.property({dependsOn:["layerId"]})],g.prototype,"parsedUrl",null);a([l.property()],g.prototype,"store",void 0);a([l.property({type:String})],g.prototype,"rootNode",void 0);a([l.reader("rootNode",["store.rootNode"])],
- g.prototype,"readRootNode",null);return g=a([l.subclass("esri.layers.mixins.SceneService")],g)}(l.declared(u,q,d,v,x))})},"esri/layers/SceneLayer":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang dojo/promise/all ../PopupTemplate ../request ../core/Error ../core/Logger ../core/promiseUtils ../core/urlUtils ../core/accessorSupport/decorators ../core/accessorSupport/PropertyOrigin ../core/accessorSupport/utils ./FeatureLayer ./Layer ./mixins/SceneService ./support/commonProperties ./support/commonProperties ./support/FeatureReduction ./support/FeatureReductionSelection ./support/Field ./support/fieldUtils ./support/LabelClass ./support/labelingInfo ./support/RangeInfo ../portal/PortalItem ../renderers/support/jsonUtils ../renderers/support/styleUtils ../renderers/support/typeUtils ../symbols/support/ElevationInfo ../tasks/support/Query".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G,M,H,J,O){function N(a,b,c){a&&((a=G.read(a,b,c)||void 0)||R.error("Failed to create renderer",{rendererDefinition:a,layer:this,context:c}));return a}var S=["3DObject","Point"],R=k.getLogger("esri.layers.SceneLayer"),Y={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},
- X={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"};return function(h){function k(a,b){a=h.call(this)||this;a.featureReduction=null;a.rangeInfos=null;a.operationalLayerType="ArcGISSceneServiceLayer";a.type="scene";a.fields=[];a.definitionExpression=null;a.elevationInfo=null;a.labelsVisible=!1;a.labelingInfo=null;a.legendEnabled=!0;a.cachedDrawingInfo={color:!1};a.popupEnabled=!0;a.popupTemplate=null;a.objectIdField=null;a.objectIdFilter=null;a._fieldUsageInfo={};a.screenSizePerspectiveEnabled=
- !0;return a}f(k,h);k.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?e.mixin({},{url:a},b):a};k.prototype.getField=function(a){return D.getField(a,this.fields)};Object.defineProperty(k.prototype,"geometryType",{get:function(){return X[this.profile]||"mesh"},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"renderer",{set:function(a){D.fixRendererFields(a,this.fields);this._set("renderer",a)},enumerable:!0,configurable:!0});k.prototype.readCachedDrawingInfo=function(a,
- b){if(null==a||"object"!==typeof a)a={};null==a.color&&(a.color=!1);return a};k.prototype.readObjectIdField=function(a,b){!a&&b.fields&&b.fields.some(function(b){"esriFieldTypeOID"===b.type&&(a=b.name);return!!a});return a||void 0};k.prototype.readProfile=function(a,b){a=b.store.profile;if(null!=a&&Y[a])return Y[a];R.error("Unknown or missing profile",{profile:a,layer:this});return"mesh-pyramids"};k.prototype.readNormalReferenceFrame=function(a,b){return b.store.normalReferenceFrame};k.prototype.load=
- function(){var a=this,b=this.loadFromPortal({supportedTypes:["Scene Service"]}).always(function(){return a._fetchService()}).then(function(){return c([a._verifyRootNodeAndUpdateExtent(),a._setCompanionFeatureLayer()])}).then(function(){return a._applyCompanionOverrides()}).then(function(){return a._populateFieldUsageInfo()}).then(function(){return M.loadStyleRenderer(a,{origin:"service"})}).then(function(){return D.fixRendererFields(a.renderer,a.fields)});this.addResolvingPromise(b);return this.when()};
- k.prototype.createLayerView=function(a){var b=this;return(null==this.profile||"mesh-pyramids"===this.profile?l.create(function(a){return r(["../views/3d/layers/SceneLayerView3D"],a)}):l.create(function(a){return r(["../views/3d/layers/SceneLayerGraphicsView3D"],a)})).then(function(c){return new c({view:a,layer:b})})};k.prototype.createQuery=function(){var a=new O;"mesh"!==this.geometryType&&(a.returnGeometry=!0,a.returnZ=!0);a.where=this.definitionExpression||"1\x3d1";a.sqlFormat="standard";return a};
- k.prototype.queryExtent=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryExtent(a||b.createQuery())})};k.prototype.queryFeatureCount=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryFeatureCount(a||b.createQuery())})};k.prototype.queryFeatures=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryFeatures(a||b.createQuery())}).then(function(a){if(a&&a.features)for(var c=
- 0,d=a.features;c<d.length;c++){var e=d[c];e.layer=b;e.sourceLayer=b}return a})};k.prototype.queryObjectIds=function(a){var b=this;return this._getAssociatedLayerForQuery().then(function(c){return c.queryObjectIds(a||b.createQuery())})};k.prototype.getFieldUsageInfo=function(a){return this._fieldUsageInfo[a]||{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}};k.prototype._getAssociatedLayerForQuery=function(){var a=this;if(!this.loaded)return this.load().then(function(){return a._getAssociatedLayerForQuery()});
- var c=this.associatedLayer;return null!=c?l.resolve(c):l.reject(new b("scenelayer:query-not-available","SceneLayer queries are not available without associated feature layer"))};k.prototype.hasCachedStatistics=function(a){return null!=this.statisticsInfo&&this.statisticsInfo.some(function(b){return b.name===a})};k.prototype.queryCachedStatistics=function(a){if(!this.hasCachedStatistics(a))return l.reject(new b("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available"));
- for(var c=0,e=this.statisticsInfo;c<e.length;c++){var f=e[c];if(f.name===a)return a=p.join(this.parsedUrl.path,f.href),d(a,{query:{f:"json"},responseType:"json"}).then(function(a){return a.data})}};k.prototype.graphicChanged=function(a){this.emit("graphic-update",a)};k.prototype._validateLayer=function(a){if(a.layerType&&-1===S.indexOf(a.layerType))throw new b("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:a.layerType});if(isNaN(this.version.major)||
- isNaN(this.version.minor))throw new b("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(1<this.version.major)throw new b("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});a=this.normalReferenceFrame;var c=this.spatialReference,d=!1,e=!1;if(null==a)e=d=!0;else switch(c=c&&c.isGeographic,a){case "east-north-up":case "earth-centered":d=
- !0;e=c;break;case "vertex-reference-frame":d=!0;e=!c;break;default:d=!1}if(!d)throw new b("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!e)throw new b("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.");};k.prototype._populateFieldUsageInfo=function(){this._fieldUsageInfo={};if(this.fields)for(var a=function(a){var c=!(!b.attributeStorageInfo||!b.attributeStorageInfo.some(function(b){return b.name===
- a.name})),d=!!(b.associatedLayer&&b.associatedLayer.fields&&b.associatedLayer.fields.some(function(b){return b&&a.name===b.name}));b._fieldUsageInfo[a.name]={supportsLabelingInfo:c,supportsRenderer:c,supportsPopupTemplate:c||d,supportsLayerQuery:d}},b=this,c=0,d=this.fields;c<d.length;c++)a(d[c])};k.prototype._applyCompanionOverrides=function(){if(this.associatedLayer){if(this.associatedLayer.fields)for(var a=0,b=this.associatedLayer.fields;a<b.length;a++){var c=b[a];this.getField(c.name)||this.fields.push(c.clone())}a=
- ["popupTemplate","popupEnabled"];b=u.getProperties(this);for(c=0;c<a.length;c++){var d=a[c];this._buddyIsMoreImportant(d)&&(b.setDefaultOrigin(this.associatedLayer.originOf(d)),b.set(d,this.associatedLayer[d]),b.setDefaultOrigin("user"))}}};k.prototype._setCompanionFeatureLayer=function(){var a=this;return this._fetchCompanionFeatureLayer().then(function(b){a.associatedLayer=b})};k.prototype._fetchCompanionFeatureLayer=function(){var a=this;return-1===["mesh-pyramids","points"].indexOf(this.profile)?
- l.resolve(null):(this.portalItem&&this.portalItem.isResolved()?this._fetchCompanionFeatureLayerFromRelatedItems(this.portalItem):this._fetchCompanionFeatureLayerFromUrl()).then(function(a){return a.load()}).catch(function(b){null==a.attributeStorageInfo?R.warn("Companion FeatureLayer could not be loaded and no binary attributes found. Popups will not work for this SceneLayer: "+a.title):R.info("Companion FeatureLayer could not be loaded. Falling back to binary attributes for Popups on this SceneLayer: "+
- a.title);return null})};k.prototype._fetchCompanionFeatureLayerFromRelatedItems=function(a){var b=this;return a.fetchRelatedItems({relationshipType:"Service2Data",direction:"forward"}).then(function(a){return(a=a.filter(function(a){return"Feature Service"===a.type})[0])?b._fetchCompanionFeatureLayerFromPortalItem(new P({id:a.id,portal:a.portal})):l.reject()}).catch(function(){return b._fetchCompanionFeatureLayerFromUrl()})};k.prototype._fetchCompanionFeatureLayerFromPortalItem=function(a){var b=this;
- return a.load().then(function(a){return b._findMatchingCompanionSublayerUrl(a.url)}).then(function(b){return l.resolve(new q({url:b,portalItem:a}))})};k.prototype._fetchCompanionFeatureLayerFromUrl=function(){return this._findMatchingCompanionSublayerUrl().then(function(a){return l.resolve(new q({url:a}))})};k.prototype._findMatchingCompanionSublayerUrl=function(a){var b=this.parsedUrl.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);if(!b)return l.reject();null==a&&(a=b[1]+"/FeatureServer");
- var e=a.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1");a={query:{f:"json"},responseType:"json"};var f=b[1]+"/SceneServer",g=parseInt(b[2],10),b=d(f,a).catch(function(a){return{layers:null}});a=d(e,a);return c([a,b]).then(function(a){var b=a[0];a=a[1];a=a.data&&a.data.layers;b=b.data&&b.data.layers;if(!Array.isArray(b))throw Error("expected layers array");if(Array.isArray(a))for(var c=0;c<Math.min(a.length,b.length);c++){if(a[c].id===g)return e+"/"+b[c].id}else if(g<b.length)return e+"/"+b[g].id;
- throw Error("could not find matching associated sublayer");})};k.prototype._buddyIsMoreImportant=function(a){if(!this.associatedLayer)return!1;var b=t.nameToId(this.originOf(a));a=t.nameToId(this.associatedLayer.originOf(a));return null!=a&&a<=t.OriginId.SERVICE?null==b||b<t.OriginId.SERVICE:null!=a&&a<=t.OriginId.PORTAL_ITEM?null==b||b<t.OriginId.PORTAL_ITEM:!1};a([n.shared("esri.layers.SceneLayer")],k.prototype,"declaredClass",void 0);a([n.property({types:{key:"type",base:z.default,typeMap:{selection:C.default}},
- json:{origins:{"web-scene":{read:{source:"layerDefinition.featureReduction"},write:{target:"layerDefinition.featureReduction"}}}}})],k.prototype,"featureReduction",void 0);a([n.property({type:[I.default],json:{read:!1,origins:{"web-scene":{read:{source:"layerDefinition.rangeInfos"},write:{target:"layerDefinition.rangeInfos"}}}}})],k.prototype,"rangeInfos",void 0);a([n.property()],k.prototype,"associatedLayer",void 0);a([n.property()],k.prototype,"operationalLayerType",void 0);a([n.property({json:{read:!1},
- readOnly:!0})],k.prototype,"type",void 0);a([n.property({type:[A]})],k.prototype,"fields",void 0);a([n.property({readOnly:!0})],k.prototype,"attributeStorageInfo",void 0);a([n.property({readOnly:!0})],k.prototype,"statisticsInfo",void 0);a([n.property({type:String,json:{origins:{service:{read:!1,write:!1}},read:{source:"layerDefinition.definitionExpression"},write:{target:"layerDefinition.definitionExpression"}}})],k.prototype,"definitionExpression",void 0);a([n.property({type:J,json:{origins:{service:{read:{source:"elevationInfo"}}},
- read:{source:"layerDefinition.elevationInfo"},write:{target:"layerDefinition.elevationInfo"}}})],k.prototype,"elevationInfo",void 0);a([n.property({type:String,dependsOn:["profile"]})],k.prototype,"geometryType",null);a([n.property(m.labelsVisible)],k.prototype,"labelsVisible",void 0);a([n.property({type:[E],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:F.reader},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",
- reader:F.reader},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],k.prototype,"labelingInfo",void 0);a([n.property({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],k.prototype,"legendEnabled",void 0);a([n.property({types:H.types,json:{origins:{service:{read:{source:"drawingInfo.renderer",reader:N}}},read:{source:"layerDefinition.drawingInfo.renderer",reader:N},write:{target:"layerDefinition.drawingInfo.renderer"}},value:null})],
- k.prototype,"renderer",null);a([n.property({json:{read:!1}})],k.prototype,"cachedDrawingInfo",void 0);a([n.reader("service","cachedDrawingInfo")],k.prototype,"readCachedDrawingInfo",null);a([n.property(m.popupEnabled)],k.prototype,"popupEnabled",void 0);a([n.property({type:g,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],k.prototype,"popupTemplate",void 0);a([n.property({type:String,json:{read:!1}})],k.prototype,"objectIdField",void 0);a([n.reader("service","objectIdField",["objectIdField",
- "fields"])],k.prototype,"readObjectIdField",null);a([n.property()],k.prototype,"objectIdFilter",void 0);a([n.property({type:String,json:{read:!1}})],k.prototype,"profile",void 0);a([n.reader("service","profile",["store.profile"])],k.prototype,"readProfile",null);a([n.property({readOnly:!0,type:String,json:{read:!1}})],k.prototype,"normalReferenceFrame",void 0);a([n.reader("service","normalReferenceFrame",["store.normalReferenceFrame"])],k.prototype,"readNormalReferenceFrame",null);a([n.property(B.screenSizePerspectiveEnabled)],
- k.prototype,"screenSizePerspectiveEnabled",void 0);return k=a([n.subclass()],k)}(n.declared(v,x))})},"esri/layers/support/RangeInfo":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/JSONSupport ../../core/accessorSupport/decorators".split(" "),function(r,h,f,a,e,c){Object.defineProperty(h,"__esModule",{value:!0});r=function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.name=null;a.field=null;a.currentRangeExtent=
- null;a.fullRangeExtent=null;a.type="rangeInfo";return a}f(d,e);a([c.property({type:String,json:{read:!0,write:!0}})],d.prototype,"name",void 0);a([c.property({type:String,json:{read:!0,write:!0}})],d.prototype,"field",void 0);a([c.property({type:[Number],json:{read:!0,write:!0}})],d.prototype,"currentRangeExtent",void 0);a([c.property({type:[Number],json:{read:!0,write:!0}})],d.prototype,"fullRangeExtent",void 0);a([c.property({type:String,readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",
- void 0);return d=a([c.subclass("esri.layers.support.RangeInfo")],d)}(c.declared(e));h.RangeInfo=r;h.default=r})},"esri/views/3d/layers/SceneLayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/has dojo/_base/lang dojo/errors/CancelError ../../../Graphic ../../../core/arrayUtils ../../../core/Collection ../../../core/lang ../../../core/Logger ../../../core/promiseUtils ../../../core/requireUtils ../../../core/scheduling ../../../core/watchUtils ../../../core/workers ../../../core/accessorSupport/decorators ../../../geometry/support/scaleUtils ../../../layers/IntegratedMeshLayer ../../../renderers/support/diffUtils ../../../symbols/FillSymbol3DLayer ../../../symbols/Symbol3D ../../../symbols/support/unitConversionUtils ../../../tasks/support/Query ./LayerView3D ./SceneLayerWorker ./graphics/graphicUtils ./i3s/Highlights ./i3s/I3SElevationProvider ./i3s/I3SGeometryUtil ./i3s/I3SQueryEngine ./i3s/I3SUtil ./i3s/IDBCache ./support/attributeUtils ./support/edgeUtils ./support/LayerViewUpdatingPercentage ../lib/glMatrix ../support/aaBoundingBox ../support/orientedBoundingBox ../support/projectionUtils ../webgl-engine/Stage ../webgl-engine/lib/Geometry ../webgl-engine/lib/Layer ../webgl-engine/lib/Object3D ../webgl-engine/lib/PreinterleavedGeometryData ../webgl-engine/lib/Texture ../webgl-engine/lib/Util ../webgl-engine/lib/TextureBackedBuffer/BufferManager ../webgl-engine/materials/DefaultMaterial module".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G,M,H,J,O,N,S,R,Y,X,Q,K,L,V,U,ca,ga,da,ka,Z,ea,ja,aa){function fa(a,b,c,d,e){var f=!1,g;b.encoding===O.DDS_ENCODING_STRING?g=ka.DDS_ENCODING:f=!(Z.isPowerOfTwo(a.width)&&Z.isPowerOfTwo(a.height));c=((a=b.usedByEngineMats.some(function(a){return a.getParams().atlasRegions})||b.atlas)?d:c)&&!f;return{mipmap:c,wrapClamp:a||!b.wrap,disableAnisotropy:a&&c&&e,encoding:g,noUnpackFlip:!0}}function qa(a){return a.data instanceof ArrayBuffer}
- function T(a,b){for(var c=1024,d=0;d<a.length;d++)var e=a[d],c=c+(e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0));for(a=0;a<b.length;a++)d=b[a],d.data instanceof ArrayBuffer&&(c+=d.data.byteLength);return c}var ha=V.ModelContentType,ia=p.getLogger("esri.views.3d.layers.SceneLayerView3D"),la=[1,1,1,1],w=[.8,.8,.8],ra=[.5,.5,.5];h=function(h){function p(){var a=null!==h&&h.apply(this,arguments)||this;a._queryEngine=null;a._highlights=new G(a);a._elevationProvider=null;a._worker=
- new I;a._workerThread=null;a._controllerCreated=!1;a._idbCache=new N.IDBCache("esri-scenelayer-cache","geometries",8);a._cancelCount=0;a._hasColors=!1;a._hasTextures=!1;a._hasData=!1;a.alwaysLoadEverythingModeEnabled=!1;a._cacheKeySuffix=null;a._definitionExpressionErrors=0;a._maxDefinitionExpressionErrors=20;return a}f(p,h);Object.defineProperty(p.prototype,"hasTexturesOrVertexColors",{get:function(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"},enumerable:!0,
- configurable:!0});Object.defineProperty(p.prototype,"rendererNeedsTextures",{get:function(){return O.rendererNeedsTextures(this.layer.renderer)},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"elevationOffset",{get:function(){var a=null!=this.layer?this.layer.elevationInfo:null;if(null!=a&&"absolute-height"===a.mode){var b=m.getMetersPerVerticalUnitForSR(this.layer.spatialReference),c=D.getMetersPerUnit(a.unit);return(a.offset||0)*c/b}return 0},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,
- "uncompressedTextureDownsamplingEnabled",{get:function(){return this.view.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled&&!this._useCompressedTextures},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"_useCompressedTextures",{get:function(){var a=this.layer.version,a=!e("trident")||1<a.major||1===a.major&&3<a.minor;return this.view._stage.has("s3tc")&&a},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"_enableMipMaps",{get:function(){return!this.uncompressedTextureDownsamplingEnabled},
- enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"_enableAtlasMipMaps",{get:function(){return this._enableMipMaps&&this.view._stage.has("standardDerivatives")},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"_atlasBiasCompensationEnabled",{get:function(){return!this.view._stage.has("shaderTextureLOD")&&this._enableAtlasMipMaps},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"_disableAtlasAnisotropy",{get:function(){return this._atlasBiasCompensationEnabled},
- enumerable:!0,configurable:!0});p.prototype.initialize=function(){var a=this;v.open(t.getAbsMid("./SceneLayerWorker",r,aa),{client:this}).then(function(b){a.destroyed?b.close():a._workerThread=b});O.checkSceneLayerValid(this.layer);O.checkSceneLayerCompatibleWithView(this.layer,this.view);this._initGraphicsController();this.geoMemoryEstimate=this.texMemoryEstimate=this.gpuMemoryEstimate=0;this._stage=this.view._stage;this._isIntegratedMesh()||(this._edgeView=this._stage.view.getEdgeView());this._texId2Meta=
- new Map;this._nodeId2Meta=new Map;this._addThisLayerToStage();this._elevationProvider=new M({layerView:this,stageLayer:this._stageLayer});this.handles.add([q.init(this.view,"clippingArea",function(){return a._clippingAreaChanged()}),q.init(this.layer,"renderer",function(b){return a._rendererChange(b)}),q.init(this.layer,"objectIdFilter",function(){return a._filterChange()}),q.init(this.layer,"elevationInfo",function(){return a._elevationInfoChanged()}),q.init(this.layer,"rangeInfos",function(b){return a._rangeInfosChanged(b)}),
- q.init(this,"_controller.parsedDefinitionExpression",function(){return a._filterChange()}),q.watch(this,"fullOpacity",function(b){return a._opacityChange(b)}),q.watch(this,["elevationOffset","rendererNeedsTextures"],function(){return a._reloadAll()}),q.watch(this,"uncompressedTextureDownsamplingEnabled",function(){return a._reloadAll()}),q.init(this,"suspended",function(b){return a.setVisibility(!b)})],"sceneLayerHandles");this._idbCache.init();this._cacheKeySuffix=O.getCacheKeySuffix(this.layer.spatialReference,
- this.view.renderSpatialReference);this._componentColorManager=this._hasSymbolColors()?new ea.BufferManager(this._stage.view.renderingContext):null};p.prototype.destroy=function(){this.handles.remove("sceneLayerHandles");this._workerThread&&(this._workerThread.close(),this._workerThread=null);this._removeThisLayerFromStage();this._stage=null;this._idbCache&&(this._idbCache.destroy(),this._idbCache=null);null!=this._controller&&(this._controller.destroy(),this._controller=null);this._highlights.destroy();
- this._nodeId2Meta=this._texId2Meta=null;this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)};p.prototype.canResume=function(){return this.inherited(arguments)&&(!this._controller||this._controller.rootNodeVisible)};p.prototype.isUpdating=function(){return this._controllerCreated?!(!this._controller||!this._controller.updating):!0};p.prototype.memEstimateTextureAdded=
- function(a){a=a.getEstimatedTexMemRequiredMB();this.gpuMemoryEstimate+=a;this.texMemoryEstimate+=a;return a};p.prototype.memEstimateTextureRemoved=function(a){a=a.getEstimatedTexMemRequiredMB();this.gpuMemoryEstimate-=a;this.texMemoryEstimate-=a;9.5367431640625E-7>this.gpuMemoryEstimate&&(this.texMemoryEstimate=this.gpuMemoryEstimate=0)};p.prototype.memEstimateGeometryAdded=function(a){a=a.estimateGpuMemoryUsage()/1048576;this.gpuMemoryEstimate+=a;this.geoMemoryEstimate+=a;return a};p.prototype.memEstimateGeometryRemoved=
- function(a){a=a.estimateGpuMemoryUsage()/1048576;this.gpuMemoryEstimate-=a;this.geoMemoryEstimate-=a;9.5367431640625E-7>this.gpuMemoryEstimate&&(this.texMemoryEstimate=this.gpuMemoryEstimate=0)};p.prototype._isBundleLoaded=function(a){return this._nodeId2Meta.has(a.id)};p.prototype._initGraphicsController=function(){var a=this;this.layer.createGraphicsController({layerView:this,layerViewRequiredFunctions:{addBundle:function(b,c){return a._addBundle(b,c)},isBundleLoaded:function(b){return a._isBundleLoaded(b)},
- getMemoryUsage:function(){return a.view.resourceController.getUsedMemory()},removeNodeData:function(b){return a._removeNodeDataFromStage(b.id)},getAddedNodeIDs:function(){return a._getAddedNodeIDs()}},layerViewOptionalFunctions:{setPolygonOffset:function(b,c){return a._setPolygonOffset(b,c?!0:!1)},textureOptions:{useCompressedTextures:this._useCompressedTextures},getLoadedAttributes:function(b){return a._getLoadedAttributes(b)},getAttributeData:function(b){return a._getAttributeData(b)},setAttributeData:function(b,
- c,d){return a._setAttributeData(b,c,d)},additionalCancelNodeLoadingHandler:function(){return a._cancel()},loadCachedBundle:function(b,c){return a._loadCachedBundle(b,c)},addCachedBundle:function(b,c,d){return a._addCachedBundle(b,c,d)}}}).then(function(b){a._controller=b;b.watch("rootNodeVisible",function(){a.notifyChange("suspended")})}).always(function(){a._controllerCreated=!0;a.notifyChange("updating")})};p.prototype.getUsedMemory=function(){return this.gpuMemoryEstimate};p.prototype.getUnloadedMemory=
- function(){return this._controller?this._controller.getUnloadedMemoryEstimate():0};p.prototype.removeCachedData=function(){this._removeAllNodeDataFromStage()};p.prototype.setVisibility=function(a){var b=this;this._nodeId2Meta.forEach(function(c){c=c.engineObject;c.setHidden(c.geometryRecords[0],!a);b._edgeView&&b._edgeView.updateObjectVisibility(c,a)});if(a){var c=this._isIntegratedMesh()?"im":"scene";this.view.elevationProvider.register(c,this._elevationProvider);this.visibleGeometryChanged()}else this.visibleGeometryChanged(),
- this.view.elevationProvider.unregister(this._elevationProvider)};p.prototype.getStats=function(){var a={nodesInIndex:0,knownFeatures:0,activeMaterials:0,"Total GPU Memory Estimate":this.gpuMemoryEstimate+"MB","Geometry Memory Estimate":this.geoMemoryEstimate+"MB","Texture Memory Estimate":this.texMemoryEstimate+"MB"};if(!this._controller)return a;a.nodesInIndex=Object.keys(this._controller.nodeIndex).length;return a};p.prototype._addThisLayerToStage=function(){for(var a=this._stage,b=new Uint8Array(256),
- c=0;c<b.length;c++)b[c]=255;this._whiteTexture=new ka(b,"white",{width:8,height:8});a.add(ha.TEXTURE,this._whiteTexture);b=this.layer.id;this._stageLayer=b=new ca(b,{},b);a.add(ha.LAYER,b);this._stage.addToViewContent([b.id])};p.prototype._removeThisLayerFromStage=function(){if(null!=this._stageLayer){var a=this._stage;a.remove(ha.TEXTURE,this._whiteTexture.id);this._removeAllNodeDataFromStage();Z.assert(0===this._nodeId2Meta.size);Z.assert(0===this._texId2Meta.size);a.remove(ha.LAYER,this._stageLayer.id);
- this._stageLayer=void 0;this.gpuMemoryEstimate=0}};p.prototype._getLoadedAttributes=function(a){if(a=this._nodeId2Meta.get(a.id))return a.loadedAttributes};p.prototype._getAttributeData=function(a){if(a=this._nodeId2Meta.get(a.id))return a.attributeData};p.prototype._setAttributeData=function(a,b,c){var d=this._nodeId2Meta.get(a.id);d&&(d.loadedAttributes=b,d.attributeData=c,this._setObjectSymbology(d),this._applyFilters(a),this.visibleGeometryChanged(d.engineObject))};p.prototype._getAddedNodeIDs=
- function(){return O.mapToKeys(this._nodeId2Meta)};p.prototype._calcEngineMaterialTransparencyParams=function(a,b,c){var d=this.fullOpacity,e=1-Z.clamp(Z.fallbackIfUndefined(b.transparency,0),0,1);a=1>e||1>d||a&&l.endsWith(a.channels,"a")||!0===b.useVertexColorAlpha||c;return{opacity:e,layerOpacity:d,transparent:a}};p.prototype._calcEngineMaterialDoubleSidedParams=function(a){return null!=a.doubleSided?a.doubleSided:!0};p.prototype._calcEngineMaterialCullFaceParams=function(a){return a.cullFace?a.cullFace:
- null!=a.doubleSided?a.doubleSided?"none":"back":"none"};p.prototype._getMaterialParameters=function(a,b,d,e){var f;null!=a&&(f=(f=this._texId2Meta.get(b))&&f.engineTex?f.engineTex.id:this._whiteTexture.id);b=d.params;var g=Z.fallbackIfUndefined(b.diffuse,w);"standard"!==d.type&&ia.warn("Unknown material type '"+d.type+"', must be 'standard'");d=this._isIntegratedMesh();e={ambient:g,diffuse:g,specular:Z.fallbackIfUndefined(b.specular,ra),atlasRegions:b.vertexRegions,textureId:f,vertexColors:this._hasVertexColors(),
- componentIndices:this._hasSymbolColors(),componentColorBuffer:this._hasSymbolColors()&&e?e.textureBuffer:null,flipV:!1,doubleSided:this._calcEngineMaterialDoubleSidedParams(b),cullFace:this._calcEngineMaterialCullFaceParams(b),writeStencil:d,receiveSSAO:!d,groundNormalShading:d,compressedNormals:!d};d||(a=this._calcEngineMaterialTransparencyParams(a,b),c.mixin(e,a));return e};p.prototype._createEngineMaterial=function(a,b,c,d,e,f,g){var h=null!=b?this._getI3STexEncoding(b):null;g=this._getMaterialParameters(b,
- c,d,g);g=new ja(g,e);g.metadata={i3sMatId:e,i3sTexId:c,i3sTex:b,i3sMatParams:d.params};if(null!=b){(d=this._texId2Meta.get(c))?d.usedByEngineMats.push(g):(d={id:c,usedByEngineMats:[g],images:b.images,encoding:h,atlas:!0===b.atlas,wrap:"none"!==b.wrap[0]||"none"!==b.wrap[1]},this._texId2Meta.set(c,d));a:{for(b=0;b<f.length;b++)if(h=f[b],h.i3sTexId===c){c=h.data;break a}c=null}null!=c&&null==d.engineTex&&(f=fa(c,d,this._enableMipMaps,this._enableAtlasMipMaps,this._disableAtlasAnisotropy),d.engineTex=
- new ka(c,d.id,f),this._stage.add(ha.TEXTURE,d.engineTex),a.memory+=this.memEstimateTextureAdded(d.engineTex));if(null!=d.engineTex)for(a=d.engineTex.id,c=0,f=d.usedByEngineMats;c<f.length;c++)f[c].setParameterValues({textureId:a})}return g};p.prototype._getI3STexEncoding=function(a){var b=O.getAppropriateTextureEncoding(a.encoding,this._useCompressedTextures);return-1<b?a.encoding[b]:a.encoding};p.prototype._getVertexBufferLayout=function(a,b){var c=a.params.materialID,d=b.materialDefinitions[c];
- Z.assert(void 0!==d,"geometry wants unknown material "+c);a=a.params.textureID||"none";var e;"none"!==a&&(null!=b.textureDefinitions&&null!=b.textureDefinitions[a]||ia.warn("textureDefinitions missing in shared resource"),e=b.textureDefinitions[a]);b=this._getMaterialParameters(e,a,d);return ja.getVertexBufferLayout(b)};p.prototype._createEngineMat=function(a,b,c,d,e){var f=b.params.materialID,g=c.materialDefinitions[f];Z.assert(void 0!==g,"geometry wants unknown material "+f);b=b.params.textureID||
- "none";var h;"none"!==b&&(null!=c.textureDefinitions&&null!=c.textureDefinitions[b]||ia.warn("textureDefinitions missing in shared resource"),h=c.textureDefinitions[b]);return this._createEngineMaterial(a,h,b,g,f,d,e)};p.prototype._getObjectIdField=function(){return this.layer.objectIdField||"OBJECTID"};p.prototype._findGraphicNodeAndIndex=function(a){var b=S.attributeLookup(a.attributes,this._getObjectIdField()),c=null;this._nodeId2Meta.forEach(function(a,d){var e=null==c?a.featureIds.indexOf(b):
- -1;-1!==e&&(c={node:a.node,nodeId:d,index:e})});return c};p.prototype._getGraphicIndices=function(a,b){a=this._nodeId2Meta.get(a.id);if(!a)return[];for(var c=[],d=this._getObjectIdField(),e=0;e<b.length;e++){var f=S.attributeLookup(b[e].attributes,d),f=a.featureIds.indexOf(f);-1!==f&&c.push(f)}return c};p.prototype.whenGraphicBounds=function(a){a=this._findGraphicNodeAndIndex(a);if(null!=a){var b=this._nodeId2Meta.get(a.nodeId).engineObject;a=this._boundingBoxCornerPoints(a.index,b,new Float64Array(24));
- if(L.bufferToBuffer(a,this.view.renderSpatialReference,0,a,this.view.spatialReference,0,8))return b=Q.create(Q.NEGATIVE_INFINITY),Q.expandBuffer(b,a,0,8),n.resolve({boundingBox:b,screenSpaceObjects:[]})}return n.reject()};p.prototype.whenGraphicAttributes=function(a,b){var c=this;return O.whenGraphicAttributes(this.layer,[a],this._getObjectIdField(),b,function(){var b=c._findGraphicNodeAndIndex(a);return{node:b.node,indices:[b.index]}},{ignoreUnavailableFields:!0,populateObjectId:!0}).then(function(a){return a[0]})};
- p.prototype.getGraphicsFromStageObject=function(a,b){if(this.layer instanceof B)return n.reject();var c=this._getMetadata(a);a=a.getComponentFromTriangleNr(0,b);return null!=a&&null!=c.featureIds&&a<c.featureIds.length?(c=this._createGraphic(a,c),n.resolve(c)):n.reject()};p.prototype._getMetadata=function(a){a=a.getMetadata();return this._nodeId2Meta.get(a.i3sNode)};p.prototype._getCacheKey=function(a){return a.baseUrl+this._cacheKeySuffix};p.prototype._cachingEnabled=function(){return!this._controller.disableCache&&
- 0===this.elevationOffset&&null!=this._cacheKeySuffix};p.prototype._cancel=function(){this._cancelCount=this._cancelCount+1|0};p.prototype._handleCancelled=function(a){if(0<(this._cancelCount-a|0))throw new g;};p.prototype._loadCachedBundle=function(a,b){var c=this,d=this._cancelCount;return this._cachingEnabled()?this._idbCache.get(this._getCacheKey(a)).then(function(e){if(null==e)return null;c._handleCancelled(d);if(e.nodeVersion!==a.version)return c._idbCache.remove(c._getCacheKey(a)),null;a.obb=
- K.clone(e.nodeObb);var f=function(a){if(null==a.data)return!0;var b=c._getI3STexEncoding(e.sharedResource.textureDefinitions[a.i3sTexId]);return a.encoding!==b};return c.rendererNeedsTextures&&e.textureData.some(f)?b(e.allGeometryData,e.sharedResource).then(function(b){e.textureData=b;b.every(qa)&&c._idbCache.put(c._getCacheKey(a),e).catch(function(b){return ia.warn("Failed to update node with textures in IndexedDB cache: "+a.id+": "+b)});c._handleCancelled(d);return e}):e}):n.resolve(null)};p.prototype._addBundle=
- function(a,b){var c=this;return this._transformBundle(a,b).then(function(d){a.obb=d.obb;d={allGeometryData:b.allGeometryData,transformedGeometries:d.transformedGeometries,textureData:b.textureData,sharedResource:b.sharedResource,nodeVersion:a.version,nodeObb:a.obb,byteSize:T(d.transformedGeometries,b.textureData)};if(c._cachingEnabled()){var e=d.textureData.map(function(a){return qa(a)?a:{i3sTexId:a.i3sTexId,encoding:a.encoding,data:null}});c._idbCache.put(c._getCacheKey(a),{allGeometryData:d.allGeometryData,
- transformedGeometries:d.transformedGeometries,textureData:e,sharedResource:d.sharedResource,nodeVersion:d.nodeVersion,nodeObb:d.nodeObb,byteSize:d.byteSize}).catch(function(b){return ia.warn("Failed to store node in IndexedDB cache: "+a.id+": "+b)})}return c._addCachedBundle(a,d,b.attributeDataInfo)})};p.prototype._transformBundle=function(a,b){for(var c=[],d=[b.geometryBuffer],e=0,f=b.allGeometryData;e<f.length;e++)for(var g=0,h=f[e].geometries;g<h.length;g++)c.push(this._getVertexBufferLayout(h[g],
- b.sharedResource));a={geometryBuffer:b.geometryBuffer,geometryData:b.allGeometryData,layouts:c,center:a.mbs,obb:a.obb,elevationOffset:this.elevationOffset,hasColors:this._hasColors,needNormals:!this._isIntegratedMesh()&&this._controller.isMeshPyramid,normalReferenceFrame:this.layer.normalReferenceFrame||"none",indexSR:this._controller.crsIndex.toJSON(),vertexSR:this._controller.crsVertex.toJSON(),renderSR:this.view.renderSpatialReference.toJSON()};return this._workerThread?this._workerThread.invoke("process",
- a,d):n.resolve(this._worker.transform(a))};p.prototype._addCachedBundle=function(a,b,c){var d=b.allGeometryData,e=b.transformedGeometries,f=b.textureData,g=b.sharedResource;if(!this.rendererNeedsTextures)for(b=0;b<f.length;b++)f[b].data=null;b=this._stage;var h={};h[ha.OBJECT]={};h[ha.GEOMETRY]={};h[ha.MATERIAL]={};h[ha.TEXTURE]={};var k=this._stageLayer;if(this._nodeId2Meta.has(a.id))return this._applyFilters(a),n.resolve();if(!this.alwaysLoadEverythingModeEnabled&&!this._controller.isGeometryVisible(a))return n.resolve();
- for(var l=a.memory=0,m=this._hasColors,p=0;p<d.length;p++){var q=d[p],t=q.componentOffsets,r=q.geometries,q=q.featureIds,u=null,v=null;if(this._hasSymbolColors())for(var u=this._componentColorManager.getBuffer(q.length),v=new Uint16Array(q.length),x=0;x<q.length;x++)v[x]=u.aquireIndex();for(var x=a.id+"|"+q[0],w=[],z=[],B=[],A=void 0,C=0;C<r.length;C++){var D=r[C],E=this._createEngineMat(a,D,g,f,u),A=e[l++],m=m||A.hasNonWhiteColors,N=H.extractPositionData(A.interleavedVertexData,A.layout,A.indices),
- N=new da(new Float32Array(A.interleavedVertexData),A.layout,N,t||da.DefaultOffsets,A.indices||da.DefaultIndices);this._hasSymbolColors()&&this._setComponentIndices(N,v);var A=A.corMatrices,F=X.mat4d.create(A.localTrafo);null!=D.transformation&&X.mat4d.multiply(F,D.transformation,F);D=w.length;D=new U(N,x+(0<D?"_"+D:""));w.push(D);z.push(F);B.push([E]);a.memory+=this.memEstimateGeometryAdded(D.getData());h[ha.MATERIAL][E.id]=E;h[ha.GEOMETRY][D.id]=D}t=new ga({idHint:a.id,name:x,geometries:w,materials:B,
- transformations:z,castShadow:!0,metadata:{i3sNode:a.id,layerUid:this.layer.uid}});x=X.mat4d.create();X.mat4d.identity(x);X.mat4d.multiply(x,A.globalTrafo,x);t.setObjectTransformation(x);h[ha.OBJECT][t.id]=t;q={node:a,engineObject:t,featureIds:q,attributeData:c?c.attributeData:null,loadedAttributes:c?c.loadedAttributes:null,componentColorBuffer:u,componentIndices:v};this._nodeId2Meta.set(a.id,q);this._setObjectSymbology(q);this._applyFilters(a);this._highlights.objectCreated(t);this.visibleGeometryChanged(t)}b.beginMod();
- c=h[ha.OBJECT];for(var K in c)c.hasOwnProperty(K)&&k.addObject(c[K]);for(var G in h)if(h.hasOwnProperty(G)){K=h[G];for(var ra in K)K.hasOwnProperty(ra)&&null==b.get(G,ra)&&b.add(G,K[ra])}b.endMod();!this._hasTextures&&null!=a.textureData&&0<a.textureData.length&&(this._hasTextures=!0);this._hasColors=m;this._hasData=!0;this.notifyChange("hasTexturesOrVertexColors");return n.resolve()};p.prototype._clippingAreaChanged=function(){var a=this,b=[];L.extentToBoundingBox(this.view.clippingArea,b,this.view.renderSpatialReference)?
- this._clippingArea=b:this._clippingArea=null;this._updateFilters();this._nodeId2Meta.forEach(function(b){return a._applyFilters(b.node)});this._controller&&this._controller.updateClippingArea(this.view.clippingArea)};p.prototype._filterChange=function(){var a=this;this._updateFilters();this._nodeId2Meta.forEach(function(b){return a._applyFilters(b.node)})};p.prototype._updateFilters=function(){var a=this,b=[];if(this.layer.objectIdFilter){var c=new Float64Array(this.layer.objectIdFilter.ids),d="include"===
- this.layer.objectIdFilter.method;c.sort();b.push(function(b,e){return a._objectIdFilter(c,d,e)})}if(this._controller&&this._controller.parsedDefinitionExpression&&this._controller.definitionExpressionFields){this._definitionExpressionErrors=0;var e=this._controller.parsedDefinitionExpression,f=this._controller.definitionExpressionFields;b.push(function(b,c){return a._sqlFilter(b,e,f,c)})}this._clippingArea&&b.push(function(b,c){return a._boundingboxFilter(b,a._clippingArea,c)});this._filters=b};p.prototype._sqlFilter=
- function(a,b,c,e){var f={},g=new d(null,null,f);g.layer=this.layer;g.sourceLayer=this.layer;var h=this.layer.objectIdField,k=0,l=0,m=this._nodeId2Meta.get(a.id);a=m.featureIds;for(var n=m.attributeData,m=c.every(function(a){return null!=n[a]||a===h}),p=0;p<a.length&&k<e.length;p++)if(e[k]===a[p]){var q=!0;if(m){f[h]=a[p];for(var q=0,t=c;q<t.length;q++){var r=t[q];r!==h&&(f[r]=O.getCachedAttributeValue(n[r],p))}q=this._evaluateClause(b,g)}q&&(e[l]=e[k],l++);k++}e.length=l};p.prototype._evaluateClause=
- function(a,b){try{return a.testFeature(b)}catch(Ga){return this._definitionExpressionErrors<this._maxDefinitionExpressionErrors&&ia.error("Error while evaluating definitionExpression: "+Ga),this._definitionExpressionErrors++,this._definitionExpressionErrors===this._maxDefinitionExpressionErrors&&ia.error("Further errors are ignored"),!1}};p.prototype._objectIdFilter=function(a,c,d){for(var e=0,f=0;e<d.length;)0<=b.binaryIndexOf(a,d[e])===c&&(d[f]=d[e],f++),e++;d.length=f};p.prototype._boundingboxFilter=
- function(a,b,c){var d=[0,0,0,0];L.mbsToMbs(a.mbs,this._controller.crsIndex,d,this.view.renderSpatialReference);d=null!=b?O.intersectBoundingBoxWithMbs(b,d):2;if(2!==d)if(0===d)c.length=0;else{var e=d=0,f=this._nodeId2Meta.get(a.id);a=f.featureIds;var g=f.engineObject.getObjectTransformation(),h=f.engineObject.getGeometryRecords()[0].getShaderTransformation();X.mat4d.multiply(g,h);if(0===g[1]&&0===g[2]&&0===g[3]&&0===g[4]&&0===g[6]&&0===g[7]&&0===g[8]&&0===g[9]&&0===g[11]&&1===g[15]){h=xa;h[0]=(b[0]-
- g[12])/g[0];h[1]=(b[1]-g[13])/g[5];h[2]=(b[2]-g[14])/g[10];h[3]=(b[3]-g[12])/g[0];h[4]=(b[4]-g[13])/g[5];h[5]=(b[5]-g[14])/g[10];b=f.engineObject.getGeometryRecords()[0].geometry;f=b.getComponentCount();for(g=0;g<f&&d<c.length;g++)if(c[d]===a[g]){var k=b.getComponentAABB(g,oa);Q.intersects(h,k)&&(c[e]=c[d],e++);d++}c.length=e}}};p.prototype._updateEdgeMaterialPartial=function(a,b,c){if(this._edgeView){var d=this._edgeView.getComponentMaterial(a,b),d=z.diff(d,c);return d?"partial"===d.type&&(d=Object.keys(d.diff),
- 1===d.length&&"color"===d[0])?(this._edgeView.updateComponentColor(a,b,c.color),!0):!1:!0}};p.prototype._addOrUpdateEdgeRendering=function(a){if(this._edgeView){var b=a.engineObject,c=this._edgeView.hasObject(b),d=this._extractObjectEdgeMaterials(a),e=d.hasNonTransparent,d=d.edgeMaterials;if(c&&e)for(a=a.featureIds,c=0;c<a.length;c++){if(!this._updateEdgeMaterialPartial(b,c,d[c])){this._edgeView.removeObject(b);this._edgeView.addObject(b,d);break}}else c?this._edgeView.removeObject(b):e&&this._edgeView.addObject(b,
- d);d=b.isHidden(b.geometryRecords[0]);this._edgeView.updateObjectVisibility(b,!d)}};p.prototype._applyFilters=function(a){var b=this._nodeId2Meta.get(a.id);b&&(this._applyFiltersToObjects(a,b),this._addOrUpdateEdgeRendering(b))};p.prototype._applyFiltersToObjects=function(a,b){var c=b.engineObject;c.unhideAllComponents();if(0!==this._filters.length){b=b.featureIds;for(var d=b.slice(),e=0,f=this._filters;e<f.length;e++)(0,f[e])(a,d);if(d.length!==b.length)for(a=0,e=c.getGeometryRecords()[0],f=0;f<
- b.length;f++){var g=b[f];a>=d.length||d[a]!==g?c.setComponentVisibility(e,f,!1):a++}}};p.prototype._removeAllNodeDataFromStage=function(){var a=this;this._nodeId2Meta.forEach(function(b,c){a._removeNodeDataFromStage(c)})};p.prototype._removeNodeDataFromStage=function(a){var b=this._nodeId2Meta.get(a);if(b){var c=this._stage,d=this._stageLayer,e=b.engineObject;this._highlights.objectDeleted(e);this._edgeView&&this._edgeView.removeObject(e);this.visibleGeometryChanged(e);d.removeObject(e);for(var d=
- 0,f=e.getGeometryRecords();d<f.length;d++){var g=f[d];this.memEstimateGeometryRemoved(g.geometry.getData());c.remove(ha.GEOMETRY,g.geometry.id);for(var h=0,g=g.materials;h<g.length;h++)this._removeMaterial(g[h],c)}if(b.componentIndices){for(d=0;d<b.componentIndices.length;d++)b.componentColorBuffer.releaseIndex(b.componentIndices[d]);this._componentColorManager.garbageCollect()}c.remove(ha.OBJECT,e.id);this._nodeId2Meta.delete(a)}};p.prototype._removeMaterial=function(a,b){b.remove(ha.MATERIAL,a.id);
- var c=a.metadata.i3sTexId||"none";if("none"!==c){var d=this._texId2Meta.get(c),e=d.usedByEngineMats;a=e.indexOf(a);-1<a?(e[a]=e[e.length-1],e.pop()):ia.error("Missing reference from material to texture");0===e.length&&((e=d.engineTex)&&e!==this._whiteTexture&&(this.memEstimateTextureRemoved(e),b.remove(ha.TEXTURE,d.engineTex.id)),this._texId2Meta.delete(c))}};p.prototype._setPolygonOffset=function(a,b){var c=this._nodeId2Meta.get(a.id);if(c)for(a=0,c=c.engineObject.getGeometryRecords();a<c.length;a++)for(var d=
- 0,e=c[a].materials;d<e.length;d++)e[d].setParameterValues({polygonOffset:b})};p.prototype._rendererChange=function(a){(this._currentRenderer=a)&&(a.colorInfo||a.sizeInfo)&&ia.warn("renderer.colorInfo and renderer.sizeInfo are not supported for Scene Services. Use visualVariables instead.");if(a){var b=0;for(a=a.getSymbols();b<a.length;b++){var c=a[b];"mesh-3d"!==c.type&&ia.error("Symbols of type '"+c.type+"' are not supported for 3D Object Scene Services.")}}this.view.resourceController.setMemoryDirty()};
- p.prototype._getRenderingInfo=function(a,b){var c=this._currentRenderer,d=c&&c.getSymbol(a);if(!(d instanceof A&&this._hasSymbolColors()))return null;var e,f;if(c&&c.visualVariables)for(a=c.getVisualVariableValues(a),c=0;c<a.length;c++){var g=a[c],h=g.variable.type;"color"===h?e=g.value:"opacity"===h&&(f=g.value)}b.symbol=d;b.color=e?[e.r/255,e.g/255,e.b/255]:null;b.opacity=null!=f?f:e&&null!=e.a?e.a:null;return b};p.prototype._getSymbolFillMaterial=function(a,b){var c=0;for(a=a.symbolLayers.items;c<
- a.length;c++){var d=a[c];if("fill"===d.type){c=d.material;a=null!=c?c.color:null;null!=a?(na[0]=a.r/255,na[1]=a.g/255,na[2]=a.b/255,na[3]=a.a,b.color=na):b.color=null;b.colorMixMode=null!=c?c.colorMixMode:null;return}}b.color=null;b.colorMixMode=null};p.prototype._hasSymbolColors=function(){if(this._isIntegratedMesh()||!this.layer.store.defaultGeometrySchema)return!1;var a=this.layer.store.defaultGeometrySchema.featureAttributes;return!!(a&&a.faceRange&&a.id)};p.prototype._isIntegratedMesh=function(){return this.layer instanceof
- B};p.prototype._hasVertexColors=function(){return null!=this.layer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.layer.cachedDrawingInfo||!this.layer.cachedDrawingInfo.color)};p.prototype._extractObjectEdgeMaterials=function(a){for(var b=[],c=a.featureIds?a.featureIds.length:1,e=this.layer.objectIdField,f=new d(null,null,{}),g=f.attributes,h=this._currentRenderer&&this._currentRenderer.requiredFields,k,l=this._edgeView.createSolidEdgeMaterial({color:[0,0,0,0]}),m=0,n=this.fullOpacity,
- p=0;p<c;p++){k=l;null!=e&&null!=a.featureIds&&(g[e]=a.featureIds[p]);if(null!=h&&null!=a.attributeData)for(var q=0,t=Object.keys(a.attributeData);q<t.length;q++){var r=t[q];g[r]=O.getCachedAttributeValue(a.attributeData[r],p)}t=this._getRenderingInfo(f,Fa);q=a.engineObject;if(q.getComponentVisibility(q.getGeometryRecords()[0],p)&&0<n&&t&&t.symbol instanceof A)for(q=0,t=t.symbol.symbolLayers.items;q<t.length;q++)if(r=t[q],r instanceof C&&(r=R.createMaterial(this._edgeView,r,n))){k=r;break}b.push(k);
- m+=k.color[3]}return{hasNonTransparent:0<m,edgeMaterials:b}};p.prototype._setObjectSymbology=function(a){if(this._hasSymbolColors()){for(var b=a.featureIds?a.featureIds.length:1,c=new d(null,null,{}),e=c.attributes,f=this.layer.objectIdField,g=this._currentRenderer&&this._currentRenderer.requiredFields,h=!1,k=new Uint8Array(4),l={color:null,colorMixMode:null},m=[0,0,0,0],n=null,p=0;p<b;p++){null!=f&&null!=a.featureIds&&(e[f]=a.featureIds[p]);if(null!=g&&null!=a.attributeData)for(var q=0,t=Object.keys(a.attributeData);q<
- t.length;q++){var r=t[q];e[r]=O.getCachedAttributeValue(a.attributeData[r],p)}(t=this._getRenderingInfo(c,Fa))?(t.symbol!==n&&(n=t.symbol,this._getSymbolFillMaterial(t.symbol,l)),q=t.color,t=t.opacity,q=null==q||null==t?P.overrideColor(q,t,l.color,l.color&&l.color[3],la,m):P.overrideColor(q,t,null,null,la,m),1>q[3]&&(h=!0),O.encodeSymbolColor(q,l.colorMixMode,k)):O.encodeSymbolColor(null,null,k);a.componentColorBuffer.textureBuffer.setData(a.componentIndices[p],k[0],k[1],k[2],k[3])}this._updateObjectOpacity(a.engineObject,
- h)}};p.prototype._setComponentIndices=function(a,b){for(var c=a.getAttribute(Z.VertexAttrConstants.COMPONENTINDEX),d=c.data,e=c.offsetIdx,c=c.strideIdx,f=a.getIndices(Z.VertexAttrConstants.COMPONENTINDEX),g=0;g<b.length;g++)for(var h=a.componentOffsets[g+1],k=a.componentOffsets[g];k<h;k++)d[e+f[k]*c]=b[g]};p.prototype._elevationInfoChanged=function(){var a=this.layer.elevationInfo&&this.layer.elevationInfo.unit;a&&!D.supportsUnit(a)&&ia.warn("elevationInfo.unit","'"+a+"' is not a valid unit")};p.prototype._rangeInfosChanged=
- function(a){null!=a&&0<a.length&&ia.warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")};p.prototype._reloadAll=function(){this._removeAllNodeDataFromStage();null!=this._controller&&this._controller.restartNodeLoading()};p.prototype._opacityChange=function(a){var b=this;this._nodeId2Meta.forEach(function(a){b._updateObjectOpacity(a.engineObject);b._addOrUpdateEdgeRendering(a)})};p.prototype._updateObjectOpacity=function(a,b){var c=
- 0;for(a=a.getGeometryRecords();c<a.length;c++)for(var d=0,e=a[c].materials;d<e.length;d++){var f=e[d],g=f.metadata;void 0!==b&&(g.symbolIsTransparent=b);var h=f.getParams(),g=this._calcEngineMaterialTransparencyParams(g.i3sTex,g.i3sMatParams,g.symbolIsTransparent);h.transparent===g.transparent&&h.layerOpacity===g.layerOpacity||f.setParameterValues(g)}};p.prototype.queryExtent=function(a){return this._ensureQueryEngine().queryExtent(a)};p.prototype.queryFeatureCount=function(a){return this._ensureQueryEngine().queryFeatureCount(a)};
- p.prototype.queryFeatures=function(a){return this._ensureQueryEngine().queryFeatures(a)};p.prototype.queryObjectIds=function(a){return this._ensureQueryEngine().queryObjectIds(a)};p.prototype._ensureQueryEngine=function(){this._queryEngine||(this._queryEngine=this._createQueryEngine());return this._queryEngine};p.prototype._createQueryEngine=function(){var a=this,b={id:0,index:0,meta:null,bbCorners:new Float64Array(24)};return new J({forAll:function(c,d){a._forAllFeatures(function(d,e,f){b.id=d;b.index=
- e;b.meta=f;a._boundingBoxCornerPoints(e,f.engineObject,b.bbCorners);c(b)},d)},createGraphic:function(b){return a._createGraphic(b.index,b.meta)},requestFields:function(b,c,d){return O.whenGraphicAttributes(a.layer,c,a._getObjectIdField(),d,function(){var d=a._getGraphicIndices(b,c);return{node:b,indices:d}},{ignoreUnavailableFields:!1})},createExtentBuilder:function(){return a._createExtentBuilder()}},{enableObjectId:!0,enableOutFields:!!this.layer.objectIdField})};p.prototype._createExtentBuilder=
- function(){var a=this.view.renderSpatialReference,b=this.view.spatialReference,c=Q.create(Q.NEGATIVE_INFINITY),d=new Float64Array(24);return{add:function(e){L.bufferToBuffer(e.bbCorners,a,0,d,b,0,8)&&Q.expandBuffer(c,d,0,8)},getExtent:function(){return Q.toExtent(c,b)}}};p.prototype._forAllFeatures=function(a,b,c){var d=this;this._nodeId2Meta.forEach(function(e,f){d._forAllFeaturesOfNode(e,a,c);b&&b(e.node)})};p.prototype._forAllFeaturesOfNode=function(a,b,c){for(var d=a.featureIds,e=a.engineObject.getGeometryRecords()[0],
- f=0;f<d.length;f++)(c||a.engineObject.getComponentVisibility(e,f))&&b(d[f],f,a,e)};p.prototype._createGraphic=function(a,b){var c={};null!=b.featureIds&&(c[this._getObjectIdField()]=b.featureIds[a]);if(null!=b.attributeData)for(var e=0,f=Object.keys(b.attributeData);e<f.length;e++){var g=f[e];c[g]=O.getCachedAttributeValue(b.attributeData[g],a)}a=new d(null,null,c);a.layer=this.layer;a.sourceLayer=this.layer;return a};p.prototype._boundingBoxCornerPoints=function(a,b,c){a=b.geometries[0].getComponentAABB(a,
- xa);for(var d=0;8>d;++d)wa[0]=d&1?a[0]:a[3],wa[1]=d&2?a[1]:a[4],wa[2]=d&4?a[2]:a[5],X.mat4d.multiplyVec3(b.objectTransformation,wa),c[3*d]=wa[0],c[3*d+1]=wa[1],c[3*d+2]=wa[2];return c};p.prototype.highlight=function(a,b){var c=this,e=this._highlights;if(a instanceof E){b=e.acquireSet(b);var f=b.set,g=b.handle;this.queryObjectIds(a).then(function(a){return e.setFeatureIds(f,a)});return g}if("number"===typeof a||a instanceof d)return this.highlight([a],b);a instanceof k&&(a=a.toArray());if(Array.isArray(a)&&
- 0<a.length){if(a[0]instanceof d)return a=a.map(function(a){return S.attributeLookup(a.attributes,c._getObjectIdField())}),g=e.acquireSet(b),b=g.set,g=g.handle,e.setFeatureIds(b,a),g;if("number"===typeof a[0])return g=e.acquireSet(b),b=g.set,g=g.handle,e.setFeatureIds(b,a),g}return{remove:function(){}}};p.prototype.visibleGeometryChanged=function(a){var b=this;a?this._elevationProvider.objectChanged(a):this._elevationProvider.layerChanged();null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=
- u.schedule(function(){b.emit("visible-geometry-changed");b._visibleGeometryChangedSchedulerHandle=null}))};a([x.property()],p.prototype,"layer",void 0);a([x.property()],p.prototype,"_controller",void 0);a([x.property({dependsOn:["_controller.updating"]})],p.prototype,"updating",void 0);a([x.property({readOnly:!0,aliasOf:"_controller.updatingPercentage"})],p.prototype,"updatingPercentageValue",void 0);a([x.property({readOnly:!0})],p.prototype,"hasTexturesOrVertexColors",null);a([x.property({readOnly:!0,
- dependsOn:["layer.renderer"]})],p.prototype,"rendererNeedsTextures",null);a([x.property({readOnly:!0,dependsOn:["layer.elevationInfo"]})],p.prototype,"elevationOffset",null);a([x.property()],p.prototype,"alwaysLoadEverythingModeEnabled",void 0);a([x.property({dependsOn:["view.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled","_useCompressedTextures"]})],p.prototype,"uncompressedTextureDownsamplingEnabled",null);a([x.property({dependsOn:["layer.version"]})],p.prototype,"_useCompressedTextures",
- null);return p=a([x.subclass("esri.views.3d.layers.SceneLayerView3D")],p)}(x.declared(F,Y));var wa=X.vec3d.create(),xa=Q.create(),oa=Q.create(),na=[0,0,0,0],Fa={symbol:null};return h})},"esri/core/requireUtils":function(){define(["require","exports","dojo/Deferred"],function(r,h,f){function a(e,c){if(Array.isArray(c)){var g=new f;e(c,function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];g.resolve(a)});return g.promise}return a(e,[c]).then(function(a){return a[0]})}Object.defineProperty(h,
- "__esModule",{value:!0});h.when=a;h.getAbsMid=function(a,c,f){return c.toAbsMid?c.toAbsMid(a):f.id.replace(/\/[^\/]*$/ig,"/")+a}})},"esri/core/workers":function(){define(["require","exports","./workers/workers"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});for(var a in f)h.hasOwnProperty(a)||(h[a]=f[a])})},"esri/core/workers/workers":function(){define("require exports dojo/sniff dojo/promise/all ../Logger ../promiseUtils ./Connection ./RemoteClient ./WorkerOwner".split(" "),function(r,
- h,f,a,e,c,g,d,b){function k(){if(q)return q;for(var c=l+p,d=[],e=function(a){var c=b.create(a).then(function(b){return u[a]=b});d.push(c)},f=0;f<c;f++)e(f);return q=a(d).then(function(){})}Object.defineProperty(h,"__esModule",{value:!0});h.Connection=g;h.RemoteClient=d;(g=f("host-browser")?navigator.hardwareConcurrency:0)||(g=f("safari")&&f("mac")||f("trident")?8:2);var l=f("esri-workers-debug")?1:Math.max(1,Math.ceil(g/2)),p=f("esri-workers-debug")?1:Math.max(1,Math.floor(g/2)),n=e.getLogger("esri.core.workers"),
- t=0,u=[];h.initialize=function(){k()};h.open=function(a,b,d){void 0===b&&(b={});if(Array.isArray(a))return new h.Connection(a.map(function(a){return new h.RemoteClient(a,b.client)}));if("string"!==typeof a){n.warn("workers-open:signature-deprecated","DEPRECATED: workers.open() changed signature.");var e=a;a=b;b={client:e,strategy:d?"dedicated":"distributed"}}var f=b.strategy||"distributed";return"local"===f?c.create(function(b){r([a],function(a){b(h.RemoteClient.connect(a))})}).then(function(a){return new h.Connection([new h.RemoteClient(a,
- b.client)])}):k().then(function(){if("dedicated"===f){var d=l+t++;t%=p;return u[d].open(a).then(function(a){return new h.Connection([new h.RemoteClient(a,b.client)])})}return c.all(u.map(function(b){return b.open(a)})).then(function(a){return new h.Connection(a.map(function(a){return new h.RemoteClient(a,b.client)}))})})};h.terminate=function(){for(var a=0;a<u.length;a++)u[a]&&u[a].terminate();u.length=0};var q})},"esri/core/workers/Connection":function(){define(["require","exports","../promiseUtils"],
- function(r,h,f){return function(){function a(a){this._clientIdx=0;this._clients=a}a.prototype.broadcast=function(a,c,f){for(var d=[],b=0,e=this._clients;b<e.length;b++)d.push(e[b].invoke(a,c,f));return d};a.prototype.close=function(){for(var a=0,c=this._clients;a<c.length;a++)c[a].close();this._clients=[]};a.prototype.invoke=function(a,c,f,d){var b=d&&d.client;null!=b&&-1!==this._clients.indexOf(b)||this._clients.some(function(a){return a.isBusy()?!1:(b=a,!0)})||(this._clientIdx=(this._clientIdx+
- 1)%this._clients.length,b=this._clients[this._clientIdx]);a=b.invoke(a,c,f);d&&(d.client=b);return a};a.prototype.openPorts=function(){return f.all(this._clients.map(function(a){return a.openPort()}))};return a}()})},"esri/core/workers/RemoteClient":function(){define("require exports dojo/Deferred ../Error ../promiseUtils ./utils".split(" "),function(r,h,f,a,e,c){function g(a,b){a["delete"](b)}var d=c.MessageType.CLOSE,b=c.MessageType.CANCEL,k=c.MessageType.INVOKE,l=c.MessageType.RESPONSE,p=c.MessageType.OPEN_PORT,
- n=function(){function a(a){this._timer=null;this._cancelledJobIds=new Set;this._invokeMessages=[];this._invoke=a;this._timer=null;this._process=this._process.bind(this)}a.prototype.push=function(a){a.type===c.MessageType.CANCEL?this._cancelledJobIds.add(a.jobId):(this._invokeMessages.push(a),null===this._timer&&(this._timer=setTimeout(this._process,0)))};a.prototype.clear=function(){this._invokeMessages.length=0;this._cancelledJobIds.clear();this._timer=null};a.prototype._process=function(){this._timer=
- null;for(var a=0,b=this._invokeMessages;a<b.length;a++){var c=b[a];this._cancelledJobIds.has(c.jobId)||this._invoke(c)}this._cancelledJobIds.clear();this._invokeMessages.length=0};return a}();return function(){function h(a,b,c){this._outJobs=new Map;this._inJobs=new Map;this._queue=new n(this._onInvoke.bind(this));this._onMessage=this._onMessage.bind(this);this._client=b;this._port=a;this._port.addEventListener("message",this._onMessage);this._port.start();this._channel=c}h.connect=function(a){var b=
- new MessageChannel;a="function"===typeof a?new a:"default"in a&&"function"===typeof a.default?new a.default:a;a.remoteClient=new h(b.port1,a,b);return b.port2};h.prototype.close=function(){this._post({type:d});this._close()};h.prototype.isBusy=function(){return 0<this._outJobs.size};h.prototype.invoke=function(a,d,e){var h=this,l=c.newJobId(),n=new f(function(){g(h._outJobs,l);h._post({type:b,jobId:l})});this._outJobs.set(l,n);this._post({type:k,jobId:l,methodName:a},d,e);return n.promise};h.prototype.openPort=
- function(){var a=this,d=c.newJobId(),e=new f(function(){g(a._outJobs,d);a._post({type:b,jobId:d})});this._outJobs.set(d,e);this._post({type:p,jobId:d});return e.promise};h.prototype._close=function(){this._channel&&(this._channel=null);this._port.removeEventListener("message",this._onMessage);this._port.close();this._outJobs.forEach(function(a){a.cancel()});this._inJobs.clear();this._outJobs.clear();this._queue.clear();this._port=this._client=null};h.prototype._onMessage=function(a){if(a=c.receiveMessage(a))switch(a.type){case l:this._onResponse(a);
- break;case k:this._queue.push(a);break;case b:this._onCancel(a);break;case d:this._close();break;case p:this._onOpenPort(a)}};h.prototype._onCancel=function(a){var b=this._inJobs,c=a.jobId,d=b.get(c);this._queue.push(a);d&&(g(b,c),d.cancel())};h.prototype._onInvoke=function(a){var b=this,d=a.methodName,f=a.jobId;a=a.data;var h=this._inJobs,k=this._client,n=k[d],p;try{if(!n&&d&&-1!==d.indexOf("."))for(var t=d.split("."),r=0;r<t.length-1;r++)k=k[t[r]],n=k[t[r+1]];if("function"!==typeof n)throw new TypeError(d+
- " is not a function");p=n.call(k,a,this)}catch(E){this._post({type:l,jobId:f,error:c.toInvokeError(E)});return}e.isThenable(p)?(h.set(f,p),p.then(function(a){h.has(f)&&(g(h,f),b._post({type:l,jobId:f},a))}).catch(function(a){h.has(f)&&(g(h,f),a&&"cancel"===a.dojoType||b._post({type:l,jobId:f,error:c.toInvokeError(a||{message:"Error encountered at method "+d})}))})):this._post({type:l,jobId:f},p)};h.prototype._onOpenPort=function(a){var b=new MessageChannel;new h(b.port1,this._client);this._post({type:l,
- jobId:a.jobId},b.port2,[b.port2])};h.prototype._onResponse=function(b){var c=b.jobId,d=b.error;b=b.data;var e=this._outJobs;if(e.has(c)){var f=e.get(c);g(e,c);d?f.reject(a.fromJSON(JSON.parse(d))):f.resolve(b)}};h.prototype._post=function(a,b,d){return c.postMessage(this._port,a,b,d)};return h}()})},"esri/core/workers/utils":function(){define(["require","exports","dojo/has"],function(r,h,f){function a(a){return a&&"object"===typeof a&&("result"in a||"transferList"in a)}Object.defineProperty(h,"__esModule",
- {value:!0});(function(a){a[a.HANDSHAKE=0]="HANDSHAKE";a[a.CONFIGURE=1]="CONFIGURE";a[a.CONFIGURED=2]="CONFIGURED";a[a.OPEN=3]="OPEN";a[a.OPENED=4]="OPENED";a[a.RESPONSE=5]="RESPONSE";a[a.INVOKE=6]="INVOKE";a[a.CANCEL=7]="CANCEL";a[a.CLOSE=8]="CLOSE";a[a.OPEN_PORT=9]="OPEN_PORT"})(h.MessageType||(h.MessageType={}));var e=0;h.newJobId=function(){return e++};h.isTranferableResult=a;h.toInvokeError=function(a){return a?a.toJSON?JSON.stringify(a):JSON.stringify({name:a.name,message:a.message,details:a.details,
- stack:a.stack}):null};h.postMessage=function(c,e,d,b){2===arguments.length||void 0===d&&void 0===b?c.postMessage(e):(f("esri-workers-supports-transfer-arraybuffer")||(b?(b=b.filter(function(a){return!(a instanceof ArrayBuffer)}),b.length||(b=null)):a(d)&&d.transferList&&(d.transferList=d.transferList.filter(function(a){return!(a instanceof ArrayBuffer)}),d.transferList.length||(d.transferList=null))),b?(e.data=d,c.postMessage(e,b)):a(d)?(e.data=d.result,d.transferList?c.postMessage(e,d.transferList):
- c.postMessage(e)):(e.data=d,c.postMessage(e)))};h.receiveMessage=function(a){return a?(a=a.data)?"string"===typeof a?JSON.parse(a):a:null:null}})},"esri/core/workers/WorkerOwner":function(){define("require exports dojo/Deferred ../../kernel ../Error ../Logger ../promiseUtils ./utils ./workerFactory".split(" "),function(r,h,f,a,e,c,g,d,b){var k=c.getLogger("esri.core.workers"),l=d.MessageType.CANCEL,p=d.MessageType.INVOKE,n=d.MessageType.OPEN,t=d.MessageType.OPENED,u=d.MessageType.RESPONSE;return function(){function c(a,
- b){this._outJobs=new Map;this._inJobs=new Map;this.worker=a;this.id=b;a.addEventListener("message",this._onMessage.bind(this));a.addEventListener("error",function(a){a.preventDefault();k.error(a)})}c.create=function(a){return b.createWorker().then(function(b){return new c(b,a)})};c.prototype.terminate=function(){this.worker.terminate()};c.prototype.open=function(a){var b=this,c=d.newJobId(),e=new f(function(a){b._outJobs["delete"](c);b._post({type:l,jobId:c})});this._outJobs.set(c,e);this._post({type:n,
- jobId:c,modulePath:a});return e.promise};c.prototype._onMessage=function(a){if(a=d.receiveMessage(a))switch(a.type){case t:case u:this._onResponse(a);break;case l:this._onCancel(a);break;case p:this._onInvoke(a)}};c.prototype._onCancel=function(a){(a=this._inJobs.get(a.jobId))&&a.cancel()};c.prototype._onInvoke=function(b){var c=this,e=b.methodName,f=b.jobId;b=b.data;var h=this._inJobs,k=a.workerMessages[e],l;try{if("function"!==typeof k)throw new TypeError(e+" is not a function");l=k.call(null,b)}catch(D){this._post({type:u,
- jobId:f,error:d.toInvokeError(D)});return}g.isThenable(l)?(h.set(f,l),l.then(function(a){h["delete"](f);c._post({type:u,jobId:f},a)}).catch(function(a){h["delete"](f);a||(a={message:"Error encountered at method"+e});a.dojoType&&"cancel"===a.dojoType||c._post({type:u,jobId:f,error:d.toInvokeError(a)})})):this._post({type:u,jobId:f},l)};c.prototype._onResponse=function(a){var b=a.jobId,c=a.error;a=a.data;var d=this._outJobs.get(b);d&&(this._outJobs["delete"](b),c?d.reject(e.fromJSON(JSON.parse(c))):
- d.resolve(a))};c.prototype._post=function(a,b,c){return d.postMessage(this.worker,a,b,c)};return c}()})},"esri/core/workers/workerFactory":function(){define("require exports ../tsSupport/assignHelper dojo/_base/kernel dojo/_base/lang ../../config ../../request ../Logger ../promiseUtils ../sniff ../urlUtils ./loaderConfig ./utils ./WorkerFallback".split(" "),function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){function u(){return D?D:D=b.create(function(a){var b=new MessageChannel,c=b.port1,d=b.port2,e=function(b){k.add("esri-workers-supports-transfer-arraybuffer",
- Number(null!=b.data));c.removeEventListener("message",e);c.close();d.close();k("esri-workers-supports-transfer-arraybuffer")||m.warn("This browser doesn't support ArrayBuffer transfer.");a()};c.addEventListener("message",e);c.start();d.start();b=new ArrayBuffer(0);d.postMessage(b,[b])})}function q(d){return u().then(function(){return b.create(function(b){function g(l){if(l=n.receiveMessage(l))switch(l.type){case A:l=d;var m=c.workers.loaderUrl||p.DEFAULT_LOADER_URL,q;null!=c["default"]?(q=e.mixin({},
- c),delete q["default"],q=JSON.parse(JSON.stringify(q))):q=JSON.parse(JSON.stringify(c));var t=c.workers.loaderConfig,t=p.default({baseUrl:t.baseUrl,locale:a.locale,has:f({"esri-cors":1,"dojo-test-sniff":0,"config-deferredInstrumentation":0,"host-webworker":1,"events-keypress-typed":0,"esri-workers-supports-transfer-arraybuffer":k("esri-workers-supports-transfer-arraybuffer")},t.has),map:f({},t.map),paths:f({},t.paths),packages:t.packages||[]});l.postMessage({type:C,configure:{esriConfig:q,loaderUrl:m,
- loaderConfig:t}});break;case z:d.removeEventListener("message",g),d.removeEventListener("error",h),b(d)}}function h(a){a.preventDefault();d.removeEventListener("message",g);d.removeEventListener("error",h);m.warn("Failed to create Worker. Fallback to execute module in main thread",a);d=new t;d.addEventListener("message",g);d.addEventListener("error",h)}d.addEventListener("message",g);d.addEventListener("error",h)})})}Object.defineProperty(h,"__esModule",{value:!0});var v=l.normalize(r.toUrl("./worker.js")),
- x=!l.hasSameOrigin(v,location.href),m=d.getLogger("esri.core.workers"),B=null,z=n.MessageType.CONFIGURED,C=n.MessageType.CONFIGURE,A=n.MessageType.HANDSHAKE,D=null;h.createWorker=function(){if(!k("esri-workers"))return q(new t);if(!x){var a=void 0;try{a=new Worker(v)}catch(F){m.warn("Failed to create Worker. Fallback to execute module in main thread",event),a=new t}return q(a)}B||(B=g(v,{responseType:"text"}));return B.then(function(a){return new Worker(URL.createObjectURL(new Blob([a.data],{type:"text/javascript"})))}).catch(function(a){m.warn("Failed to create Worker. Fallback to execute module in main thread",
- a);return new t}).then(function(a){return q(a)})}})},"esri/core/workers/loaderConfig":function(){define(["require","exports","../tsSupport/assignHelper","dojo/has","../urlUtils"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});a=a("esri-built")?"dojo/dojo-lite.js":"dojo/dojo.js";h.DEFAULT_LOADER_URL=e.makeAbsolute(e.removeQueryParameters(r.toUrl(a)));h.DEFAULT_CONFIG={baseUrl:function(){var a=e.removeQueryParameters(r.toUrl("dojo/x.js"));return e.makeAbsolute(a.slice(0,a.length-
- 5))}(),packages:[{name:"esri"},{name:"dojo"},{name:"dojox"},{name:"dstore"},{name:"moment",main:"moment"},{name:"@dojo"},{name:"cldrjs",main:"dist/cldr"},{name:"globalize",main:"dist/globalize"},{name:"maquette",main:"dist/maquette.umd"},{name:"maquette-css-transitions",main:"dist/maquette-css-transitions.umd"},{name:"maquette-jsx",main:"dist/maquette-jsx.umd"},{name:"tslib",main:"tslib"}],map:{globalize:{cldr:"cldrjs/dist/cldr","cldr/event":"cldrjs/dist/cldr/event","cldr/supplemental":"cldrjs/dist/cldr/supplemental",
- "cldr/unresolved":"cldrjs/dist/cldr/unresolved"}}};h.default=function(a){var c={async:a.async,isDebug:a.isDebug,locale:a.locale,baseUrl:a.baseUrl,has:f({},a.has),map:f({},a.map),packages:a.packages&&a.packages.concat()||[],paths:f({},a.paths)};a.hasOwnProperty("async")||(c.async=!0);a.hasOwnProperty("isDebug")||(c.isDebug=!1);a.baseUrl||(c.baseUrl=h.DEFAULT_CONFIG.baseUrl);h.DEFAULT_CONFIG.packages.forEach(function(a){a:{for(var b=c.packages,d=0;d<b.length;d++)if(b[d].name===a.name)break a;a=f({},
- a);d=e.removeQueryParameters(r.toUrl(a.name+"/x.js"));d=d.slice(0,d.length-5);a.location=e.makeAbsolute(d);b.push(a)}});a=c.map=c.map||{};for(var d=0,b=Object.keys(h.DEFAULT_CONFIG.map);d<b.length;d++){var k=b[d];a[k]||(a[k]=h.DEFAULT_CONFIG.map[k])}return c}})},"esri/core/workers/WorkerFallback":function(){define(["require","exports","dojo/has","../global","./utils"],function(r,h,f,a,e){var c=function(){return function(){var a=this,c=document.createDocumentFragment();["addEventListener","dispatchEvent",
- "removeEventListener"].forEach(function(b){a[b]=function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];return c[b].apply(c,a)}})}}(),g=a.MutationObserver||a.WebKitMutationObserver,d=function(){var b;if(a.process&&a.process.nextTick)b=function(b){a.process.nextTick(b)};else if(a.Promise)b=function(b){a.Promise.resolve().then(b)};else if(g){var c=[],d=document.createElement("div");(new g(function(){for(;0<c.length;)c.shift()()})).observe(d,{attributes:!0});b=function(a){c.push(a);d.setAttribute("queueStatus",
- "1")}}return b}();return function(){function a(){this._dispatcher=new c;this._isInitialized=!1;this._workerPostMessage({type:e.MessageType.HANDSHAKE})}a.prototype.terminate=function(){};Object.defineProperty(a.prototype,"onmessage",{get:function(){return this._onmessageHandler},set:function(a){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler);(this._onmessageHandler=a)&&this.addEventListener("message",a)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
- "onerror",{get:function(){return this._onerrorHandler},set:function(a){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler);(this._onerrorHandler=a)&&this.addEventListener("error",a)},enumerable:!0,configurable:!0});a.prototype.postMessage=function(a,b){var c=this;d(function(){c._workerMessageHandler(new MessageEvent("message",{data:a}))})};a.prototype.dispatchEvent=function(a){return this._dispatcher.dispatchEvent(a)};a.prototype.addEventListener=function(a,b,c){this._dispatcher.addEventListener(a,
- b,c)};a.prototype.removeEventListener=function(a,b,c){this._dispatcher.removeEventListener(a,b,c)};a.prototype._workerPostMessage=function(a,b){var c=this;d(function(){c.dispatchEvent(new MessageEvent("message",{data:a}))})};a.prototype._workerMessageHandler=function(a){var b=this;if(a=e.receiveMessage(a)){var c=a.jobId;switch(a.type){case e.MessageType.CONFIGURE:this._isInitialized||this._workerPostMessage({type:e.MessageType.CONFIGURED});break;case e.MessageType.OPEN:r(["esri/core/workers/RemoteClient",
- a.modulePath],function(a,d){a=a.connect(d);b._workerPostMessage({type:e.MessageType.OPENED,jobId:c,data:a})})}}};return a}()})},"esri/views/3d/layers/LayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../geometry/support/heightModelInfoUtils ../../layers/LayerView".split(" "),function(r,h,f,a,e,c,g,d,b){return function(b){function h(){var a=
- null!==b&&b.apply(this,arguments)||this;a.supportsHeightUnitConversion=!1;return a}f(h,b);h.prototype.postscript=function(a){this.inherited(arguments);d.mayHaveHeightModelInfo(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())};h.prototype._validateHeightModelInfo=function(){var a=this;return e.create(function(b,e){c.whenFalseOnce(a.view.defaultsFromMap,"isHeightModelInfoSearching",function(){var c=d.rejectLayerError(a.layer,a.view.heightModelInfo,a.supportsHeightUnitConversion);
- c?e(c):b()})})};a([g.property()],h.prototype,"view",void 0);return h=a([g.subclass("esri.views.3d.layers.LayerView3D")],h)}(g.declared(b))})},"esri/views/3d/layers/SceneLayerWorker":function(){define("require exports ../../../core/promiseUtils ../../../geometry/SpatialReference ./i3s/I3SGeometryUtil ./i3s/I3SProjectionUtil ../lib/glMatrix ../support/meshProcessing ../support/orientedBoundingBox ../support/projectionUtils ../webgl-engine/lib/PreinterleavedGeometryData ../webgl-engine/lib/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){r=function(){function h(){}h.prototype.process=function(a){var b=[a.geometryBuffer];return f.resolve({result:this.transform(a,b),transferList:b})};h.prototype.transform=function(f,h){var m=a.fromJSON(f.indexSR),q=a.fromJSON(f.vertexSR),t=a.fromJSON(f.renderSR),r=f.hasColors,u=0,v=[],x=f.obb?null:b.create([0,0,0],[-1,-1,-1],[0,0,0,1]);g.vec3d.set(f.center,n);n[2]+=f.elevationOffset;var F=g.mat4d.create();k.computeLinearTransformation(m,n,F,t);for(var I=0,P=f.geometryData;I<
- P.length;I++)for(var G=P[I],M=G.componentOffsets,H=0,G=G.geometries;H<G.length;H++){var J=G[H],O=f.layouts[u];++u;var N=e.interleaveGeometryBuffer(J,f.geometryBuffer,O,[{name:p.VertexAttrConstants.COLOR,byteValue:255}],[p.VertexAttrConstants.NORMAL,p.VertexAttrConstants.NORMALCOMPRESSED,p.VertexAttrConstants.SYMBOLCOLOR,p.VertexAttrConstants.COMPONENTINDEX]),S=new l(new Float32Array(N),O),R=S.getAttribute(p.VertexAttrConstants.POSITION),Y=c.reprojectPoints(R,f.center,f.elevationOffset,m,q,t);x&&this._updateObb(x,
- R,F);f.needNormals&&(R={normals:S.getAttribute(p.VertexAttrConstants.NORMALCOMPRESSED),positions:R,normalInd:S.getIndices(p.VertexAttrConstants.NORMALCOMPRESSED),positionInd:S.getIndices(p.VertexAttrConstants.POSITION)},e.processAndInterleaveNormals(f.normalReferenceFrame,J,f.geometryBuffer,Y.globalTrafo,R));(J=S.getAttribute(p.VertexAttrConstants.COMPONENTINDEX))&&this._createComponentNumbers(J,M);(S=S.getAttribute(p.VertexAttrConstants.COLOR))&&(r=r||this._hasNonWhiteColors(S));S=O[0].stride;S=
- d.deduplicate(N,S/4,1-.8*S/(S+4));null!=S?(N=65536>S.uniqueCount?new Uint16Array(S.indices):S.indices,v.push({layout:O,interleavedVertexData:S.buffer,indices:N,corMatrices:Y,hasNonWhiteColors:r}),h&&(h.push(S.buffer),h.push(N.buffer))):(v.push({layout:O,interleavedVertexData:N,corMatrices:Y,hasNonWhiteColors:r}),h&&h.push(N))}x&&(g.mat4d.multiplyVec3(F,x.center,x.center),k.vectorToVector(x.center,t,x.center,q),x.center[2]-=f.elevationOffset);return{geometryBuffer:f.geometryBuffer,transformedGeometries:v,
- obb:x?x:f.obb}};h.prototype._hasNonWhiteColors=function(a){var b=a.data,c=a.size,d=a.strideIdx;for(a=a.offsetIdx;a<b.length;a+=d)for(var e=0;e<c;e++)if(255!==b[a+e])return!0;return!1};h.prototype._createComponentNumbers=function(a,b){var c=a.data,d=a.strideIdx,e=c.length/d,f=0;a=a.offsetIdx;for(var g=0;g<e;g++)g>=b[f+1]&&f++,c[a]=f,a+=d};h.prototype._updateObb=function(a,c,d){if(0<a.halfSize[0]){g.vec3.subtract(a.center,a.halfSize,n);g.vec3.add(a.center,a.halfSize,t);for(d=c.offsetIdx;d<c.data.length;d+=
- c.strideIdx)n[0]=Math.min(n[0],c.data[d]),n[1]=Math.min(n[1],c.data[d+1]),n[2]=Math.min(n[2],c.data[d+2]),t[0]=Math.max(t[0],c.data[d]),t[1]=Math.max(t[1],c.data[d+1]),t[2]=Math.max(t[2],c.data[d+2]);g.vec3.subtract(t,n,a.halfSize);g.vec3d.scale(a.halfSize,.5);g.vec3d.add(n,t,a.center);g.vec3d.scale(a.center,.5)}else b.compute(c,a),c=2*Math.sqrt(1+d[0]+d[5]+d[10]),u[0]=(d[9]-d[6])/c,u[1]=(d[2]-d[8])/c,u[2]=(d[4]-d[1])/c,u[3]=.25*c,g.quat4.conjugate(u),g.quat4.multiply(u,a.quaternion,a.quaternion)};
- return h}();var n=g.vec3d.create(),t=g.vec3d.create(),u=g.quat4.create();return r})},"esri/views/3d/layers/i3s/I3SGeometryUtil":function(){define("require exports ./I3SBinaryReader ../../support/meshProcessing ../../webgl-engine/lib/gl-matrix ../../webgl-engine/lib/Util".split(" "),function(r,h,f,a,e,c){function g(a,b,c,d,e,f,g){switch(c){case 1:for(c=0;c<g;c++)d[e]=a[b],b+=1,e+=f;break;case 2:for(c=0;c<g;c++)d[e]=a[b],d[e+1]=a[b+1],b+=2,e+=f;break;case 3:for(c=0;c<g;c++)d[e]=a[b],d[e+1]=a[b+1],d[e+
- 2]=a[b+2],b+=3,e+=f;break;case 4:for(c=0;c<g;c++)d[e]=a[b],d[e+1]=a[b+1],d[e+2]=a[b+2],d[e+3]=a[b+3],b+=4,e+=f;break;default:throw p("Unhandled stride size "+c);}}function d(a,b,c,d,e,f){switch(b){case 1:for(b=0;b<f;b++)c[d]=a,d+=e;break;case 2:for(b=0;b<f;b++)c[d]=a,c[d+1]=a,d+=e;break;case 3:for(b=0;b<f;b++)c[d]=a,c[d+1]=a,c[d+2]=a,d+=e;break;case 4:for(b=0;b<f;b++)c[d]=a,c[d+1]=a,c[d+2]=a,c[d+3]=a,d+=e;break;default:throw p("Unhandled stride size "+b);}}function b(a){switch(a){case 5120:return Int8Array;
- case 5126:return Float32Array;case 5124:return Int32Array;case 5122:return Int16Array;case 5121:return Uint8Array;case 5125:return Uint32Array;case 5123:return Uint16Array}throw Error("Unhandled data type: "+a);}function k(a){switch(a){case 5120:return"Int8";case 5126:return"Float32";case 5124:return"Int32";case 5122:return"Int16";case 5121:return"UInt8";case 5125:return"UInt32";case 5123:return"UInt16"}throw Error("Unhandled data type: "+a);}function l(a){return 0<a&&0===a%Uint32Array.BYTES_PER_ELEMENT}
- function p(a){return Error("I3SGeometryUtil processing failed: "+a)}Object.defineProperty(h,"__esModule",{value:!0});var n=new Uint8Array(64);h.interleaveGeometryBuffer=function(a,c,e,f,h){void 0===f&&(f=[]);void 0===h&&(h=[]);var m=a.params.vertexAttributes,q=m.position.count;if(!l(e[0].stride))throw p("Layout stride must use "+Uint32Array.BYTES_PER_ELEMENT+"-byte words");var t=new Uint32Array(e[0].stride/Uint32Array.BYTES_PER_ELEMENT*q);e=e.slice(0).sort(function(a,b){return a.offset-b.offset});
- a=function(a){if(-1!==h.indexOf(a.name))return"continue";var e=m[a.name],r=b(a.type),u=void 0,v=!1;if(null==e)if(v=f.filter(function(b){return b.name===a.name})[0]){e={valueType:k(a.type),byteOffset:0,count:q,valuesPerElement:a.count};for(u=0;u<n.length;u++)n[u]=v.byteValue;u=n.buffer;v=!0}else throw p("Geometry definition is missing attribute");else u=c;if(k(a.type)!==e.valueType)throw p("Geometry definition type must match attribute type");if(0!==e.byteOffset%Uint32Array.BYTES_PER_ELEMENT||0!==
- a.offset%Uint32Array.BYTES_PER_ELEMENT)throw p(a.name+" offset must use "+Uint32Array.BYTES_PER_ELEMENT+"-byte words");if(!l(e.valuesPerElement*r.BYTES_PER_ELEMENT)||!l(a.count*r.BYTES_PER_ELEMENT))throw p(a.name+" data must use "+Uint32Array.BYTES_PER_ELEMENT+"-byte words");var u=new Uint32Array(u),x=e.byteOffset/Uint32Array.BYTES_PER_ELEMENT,e=e.valuesPerElement*r.BYTES_PER_ELEMENT/Uint32Array.BYTES_PER_ELEMENT,r=a.offset/Uint32Array.BYTES_PER_ELEMENT,z=a.stride/Uint32Array.BYTES_PER_ELEMENT;v?
- d(u[0],e,t,r,z,q):g(u,x,e,t,r,z,q)};for(var r=0;r<e.length;r++)a(e[r]);return t.buffer};h.processAndInterleaveNormals=function(a,b,d,g,h){if("none"===a){var k=h.normals,l=h.positions;b=h.normalInd;a=h.positionInd;c.assert(h.normalInd.length===h.positionInd.length);h=e.vec3.create();g=e.vec3.create();d=e.vec2.create();for(var m=l.data,n=l.offsetIdx,l=l.strideIdx,p=k.data,q=k.offsetIdx,k=k.strideIdx,r=0;r<a.length;r+=3){var v=a[r],v=n+l*v,x=m[v],B=m[v+1],H=m[v+2],v=a[r+1],v=n+l*v;h[0]=m[v]-x;h[1]=m[v+
- 1]-B;h[2]=m[v+2]-H;v=a[r+2];v=n+l*v;g[0]=m[v]-x;g[1]=m[v+1]-B;g[2]=m[v+2]-H;e.vec3.cross(h,g,h);c.encodeNormal(h,d);for(x=0;3>x;x++)B=q+k*b[r+x],p[B]=c.encodeInt16(d[0]),p[B+1]=c.encodeInt16(d[1])}}else if(b=f.createTypedView(d,b.params.vertexAttributes.normal),d=h.normals,B="earth-centered"===a?g:null,a=b.length/3,h=d.data,g=d.offsetIdx,d=d.strideIdx,null!=B)for(m=B[0],n=B[1],l=B[2],p=B[4],q=B[5],k=B[6],r=B[8],x=B[9],B=B[10],H=0;H<a;H++){var v=b[3*H],J=b[3*H+1],O=b[3*H+2];t[0]=m*v+n*J+l*O;t[1]=p*
- v+q*J+k*O;t[2]=r*v+x*J+B*O;c.encodeNormal(t,u);h[g+H*d]=c.encodeInt16(u[0]);h[g+H*d+1]=c.encodeInt16(u[1])}else for(H=0;H<a;H++)t[0]=b[3*H],t[1]=b[3*H+1],t[2]=b[3*H+2],c.encodeNormal(t,u),h[g+H*d]=c.encodeInt16(u[0]),h[g+H*d+1]=c.encodeInt16(u[1])};h.extractPositionData=function(b,c,d){c=c[0];if(null==c||"position"!==c.name||5126!==c.type)return null;var e=new Float32Array(b),f=c.stride/4,g=3*e.length/f,h=new Float32Array(g);for(b=0;b<g/3;b++)h[3*b]=e[b*f+c.offset],h[3*b+1]=e[b*f+c.offset+1],h[3*
- b+2]=e[b*f+c.offset+2];c=a.deduplicate(h.buffer,3);b=65536>c.uniqueCount;if(d)for(e=new (b?Uint16Array:Uint32Array)(d.length),b=0;b<d.length;b++)e[b]=c.indices[d[b]];else e=b?new Uint16Array(c.indices):c.indices;return{data:new Float32Array(c.buffer),indices:e}};var t=e.vec3.create(),u=e.vec2.create()})},"esri/views/3d/layers/i3s/I3SBinaryReader":function(){define("require exports dojo/_base/lang ../../../../core/Error ../../../../core/Logger ./LEPCC".split(" "),function(r,h,f,a,e,c){function g(b,
- c,d){for(var e="",f=0;f<d;){var g=b[c+f];if(128>g)e+=String.fromCharCode(g),f++;else if(192<=g&&224>g){if(f+1>=d)throw new a("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");var h=b[c+f+1],g=(g&31)<<6|h&63,e=e+String.fromCharCode(g),f=f+2}else if(224<=g&&240>g){if(f+2>=d)throw new a("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");var h=b[c+f+1],k=b[c+f+2],g=(g&15)<<12|(h&63)<<6|k&63,e=e+String.fromCharCode(g),f=f+3}else if(240<=g&&248>g){if(f+
- 3>=d)throw new a("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");h=b[c+f+1];k=b[c+f+2];g=(g&7)<<18|(h&63)<<12|(k&63)<<6|b[c+f+3]&63;e=65536<=g?e+String.fromCharCode((g-65536>>10)+55296,(g&1023)+56320):e+String.fromCharCode(g);f+=4}else throw new a("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");}return e}function d(a,b){for(var c={byteOffset:0,byteCount:0,fields:Object.create(null)},d=0,e=0;e<b.length;e++){var f=b[e],g=f.valueType||f.type;c.fields[f.property]=
- (0,h.valueType2ArrayBufferReader[g])(a,d);d+=h.valueType2TypedArrayClassMap[g].BYTES_PER_ELEMENT}c.byteCount=d;return c}function b(b,c,d){var e=[],f,h=0,k;for(k=0;k<b;k+=1){f=c[k];if(0<f){if(e.push(g(d,h,f-1)),0!==d[h+f-1])throw new a("string-array-error","Invalid string array: missing null termination.");}else e.push(null);h+=f}return e}function k(a,b){return new h.valueType2TypedArrayClassMap[b.valueType](a,b.byteOffset,b.count*b.valuesPerElement)}function l(a,b){return new Uint8Array(a,b.byteOffset,
- b.byteCount)}function p(b,c,e){b=null!=c.header?d(b,c.header):{byteOffset:0,byteCount:0,fields:{count:e}};e={header:b,byteOffset:b.byteCount,byteCount:0,entries:Object.create(null)};for(var g=b.byteCount,h=0;h<c.ordering.length;h++){var k=c.ordering[h],l=f.clone(c[k]);l.count=b.fields.count;if("String"===l.valueType){if(l.byteOffset=g,l.byteCount=b.fields[k+"ByteCount"],"UTF-8"!==l.encoding)throw new a("unsupported-encoding","Unsupported String encoding.",{encoding:l.encoding});}else if(t(l.valueType)){var m=
- u(l.valueType),g=g+(0!==g%m?m-g%m:0);l.byteOffset=g;l.byteCount=m*l.valuesPerElement*l.count}else throw new a("unsupported-value-type","Unsupported binary valueType",{valueType:l.valueType});g+=l.byteCount;e.entries[k]=l}e.byteCount=g-e.byteOffset;return e}function n(b,c,d){c!==b&&q.error("Invalid "+d+" buffer size\n expected: "+b+", actual: "+c+")");if(c<b)throw new a("buffer-too-small","Binary buffer is too small",{expectedSize:b,actualSize:c});}function t(a){return h.valueType2TypedArrayClassMap.hasOwnProperty(a)}
- function u(a){return t(a)&&h.valueType2TypedArrayClassMap[a].BYTES_PER_ELEMENT}Object.defineProperty(h,"__esModule",{value:!0});var q=e.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");h.readHeader=d;h.readStringArray=b;h.createTypedView=k;h.createRawView=l;h.createAttributeDataIndex=p;h.createGeometryDataIndex=function(a,b,c){var e=d(a,b&&b.header),g=e.byteCount,h={header:e,byteOffset:e.byteCount,byteCount:0,vertexAttributes:f.clone(b.vertexAttributes)},k=h.vertexAttributes;c||null==k.region||
- delete k.region;var e=e.fields,l=null!=e.vertexCount?e.vertexCount:e.count;for(c=0;c<b.ordering.length;c++){var m=b.ordering[c];null!=k[m]&&(k[m].byteOffset=g,k[m].count=l,g+=u(k[m].valueType)*k[m].valuesPerElement*l)}k=e.faceCount;if(b.faces&&k)for(h.faces=f.clone(b.faces),l=h.faces,c=0;c<b.ordering.length;c++)m=b.ordering[c],null!=l[m]&&(l[m].byteOffset=g,l[m].count=k,g+=u(l[m].valueType)*l[m].valuesPerElement*k);e=e.featureCount;if(b.featureAttributes&&b.featureAttributeOrder&&e)for(h.featureAttributes=
- f.clone(b.featureAttributes),k=h.featureAttributes,c=0;c<b.featureAttributeOrder.length;c++)l=b.featureAttributeOrder[c],k[l].byteOffset=g,k[l].count=e,m=u(k[l].valueType),"UInt64"===k[l].valueType&&(m=8),g+=m*k[l].valuesPerElement*e;n(g,a.byteLength,"geometry");h.byteCount=g-h.byteOffset;return h};h.readBinaryAttribute=function(d,e,f){if("lepcc-rgb"===d.encoding)return c.decodeRGB(e);if("lepcc-intensity"===d.encoding)return c.decodeIntensity(e);if(null!=d.encoding&&""!==d.encoding)throw new a("unknown-attribute-storage-info-encoding",
- "Unknown Attribute Storage Info Encoding");d["attributeByteCounts "]&&!d.attributeByteCounts&&(q.warn("Warning: Trailing space in 'attributeByteCounts '."),d.attributeByteCounts=d["attributeByteCounts "]);"ObjectIds"===d.ordering[0]&&d.hasOwnProperty("objectIds")&&(q.warn("Warning: Case error in objectIds"),d.ordering[0]="objectIds");f=p(e,d,f);n(f.byteOffset+f.byteCount,e.byteLength,"attribute");if(d=f.entries.attributeValues||f.entries.objectIds){if("String"===d.valueType){f=f.entries.attributeByteCounts;
- var g=k(e,f);e=l(e,d);return b(f.count,g,e)}return k(e,d)}throw new a("bad-attribute-storage-info","Bad attributeStorageInfo specification.");};h.valueType2TypedArrayClassMap={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array};h.valueType2ArrayBufferReader={Float32:function(a,b){return(new DataView(a,0)).getFloat32(b,!0)},Float64:function(a,b){return(new DataView(a,0)).getFloat64(b,!0)},UInt8:function(a,
- b){return(new DataView(a,0)).getUint8(b)},Int8:function(a,b){return(new DataView(a,0)).getInt8(b)},UInt16:function(a,b){return(new DataView(a,0)).getUint16(b,!0)},Int16:function(a,b){return(new DataView(a,0)).getInt16(b,!0)},UInt32:function(a,b){return(new DataView(a,0)).getUint32(b,!0)},Int32:function(a,b){return(new DataView(a,0)).getInt32(b,!0)}};h.isValueType=t;h.getBytesPerValue=u})},"esri/views/3d/layers/i3s/LEPCC":function(){define(["require","exports","../../../../core/Error"],function(r,
- h,f){function a(a,b,c){return{identifier:String.fromCharCode.apply(null,new Uint8Array(a,c+g.identifierOffset,g.identifierLength)),version:b.getUint16(c+g.versionOffset,!0),checksum:b.getUint32(c+g.checksumOffset,!0)}}function e(a,b,e){var d=[];b=c(a,b,d);for(var f=[],g=0;g<d.length;g++){f.length=0;b=c(a,b,f);for(var h=0;h<f.length;h++)e.push(f[h]+d[g])}return b}function c(a,b,c){var d=new DataView(a,b),e=d.getUint8(0),g=e&31,h=!!(e&32),k=(e&192)>>6,e=0;if(0===k)e=d.getUint32(1,!0),b+=5;else if(1===
- k)e=d.getUint16(1,!0),b+=3;else if(2===k)e=d.getUint8(1),b+=2;else throw new f("lepcc-decode-error","Bad count type");if(h)throw new f("lepcc-decode-error","LUT not implemented");a=new Uint8Array(a,b,Math.ceil(e*g/8));for(var k=h=d=0,q=-1>>>32-g,r=0;r<e;r++){for(;h<g;)d|=a[k]<<h,h+=8,k+=1;c[r]=d&q;d>>>=g;h-=g;32<h+g&&(d|=a[k-1]>>8-h)}return b+k}Object.defineProperty(h,"__esModule",{value:!0});var g={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};h.decodeXYZ=
- function(c){var b,d,h,p,n,t,r,q,v,x,m,B,z=new DataView(c,0),C=0;p=a(c,z,C);h=p.identifier;p=p.version;C+=g.byteCount;if("LEPCC "!==h)throw new f("lepcc-decode-error","Bad identifier");if(1<p)throw new f("lepcc-decode-error","Unknown version");var A=C;b=z.getUint32(A+0,!0);d=z.getUint32(A+4,!0);h=z.getFloat64(A+8,!0);p=z.getFloat64(A+16,!0);n=z.getFloat64(A+24,!0);t=z.getFloat64(A+32,!0);r=z.getFloat64(A+40,!0);q=z.getFloat64(A+48,!0);v=z.getFloat64(A+56,!0);x=z.getFloat64(A+64,!0);m=z.getFloat64(A+
- 72,!0);B=z.getUint32(A+80,!0);z.getUint32(A+84,!0);C+=88;if(d*Math.pow(2,32)+b!==c.byteLength)throw new f("lepcc-decode-error","Bad size");z=new Float64Array(3*B);b=[];d=[];B=[];A=[];C=e(c,C,b);C=e(c,C,d);C=e(c,C,B);C=e(c,C,A);if(C!==c.byteLength)throw new f("lepcc-decode-error","Bad length");for(var D=C=c=0;D<b.length;D++)for(var C=C+b[D],E=0,F=0;F<d[D];F++){var E=E+B[c],I=A[c];z[3*c]=Math.min(t,h+2*v*E);z[3*c+1]=Math.min(r,p+2*x*C);z[3*c+2]=Math.min(q,n+2*m*I);c++}return{errorX:v,errorY:x,errorZ:m,
- result:z}};h.decodeRGB=function(c){var b,d,e,h,n,t,r=new DataView(c,0),q=0;h=a(c,r,q);e=h.identifier;h=h.version;q+=g.byteCount;if("ClusterRGB"!==e)throw new f("lepcc-decode-error","Bad identifier");if(1<h)throw new f("lepcc-decode-error","Unknown version");t=q;b=r.getUint32(t+0,!0);d=r.getUint32(t+4,!0);e=r.getUint32(t+8,!0);h=r.getUint16(t+12,!0);n=r.getUint8(t+14);t=r.getUint8(t+15);q+=16;if(d*Math.pow(2,32)+b!==c.byteLength)throw new f("lepcc-decode-error","Bad size");if(2!==n&&1!==n||0!==t){if(0===
- n&&0===t){if(3*e+q!==c.byteLength||0!==h)throw new f("lepcc-decode-error","Bad count");return(new Uint8Array(c,q)).slice()}if(2>=n&&1===t){if(q+3!==c.byteLength||1!==h)throw new f("lepcc-decode-error","Bad count");h=r.getUint8(q);b=r.getUint8(q+1);r=r.getUint8(q+2);q=new Uint8Array(3*e);for(c=0;c<e;c++)q[3*c]=h,q[3*c+1]=b,q[3*c+2]=r;return q}throw new f("lepcc-decode-error","Bad method "+n+","+t);}if(3*h+e+q!==c.byteLength||256<h)throw new f("lepcc-decode-error","Bad count");r=new Uint8Array(c,q,
- 3*h);h=new Uint8Array(c,q+3*h,e);q=new Uint8Array(3*e);for(c=0;c<e;c++)b=h[c],q[3*c]=r[3*b],q[3*c+1]=r[3*b+1],q[3*c+2]=r[3*b+2];return q};h.decodeIntensity=function(d){var b,e,h,p,n,t=new DataView(d,0),r=0;p=a(d,t,r);h=p.identifier;p=p.version;r+=g.byteCount;if("Intensity "!==h)throw new f("lepcc-decode-error","Bad identifier");if(1<p)throw new f("lepcc-decode-error","Unknown version");var q=r;b=t.getUint32(q+0,!0);e=t.getUint32(q+4,!0);h=t.getUint32(q+8,!0);p=t.getUint16(q+12,!0);n=t.getUint8(q+
- 14);t.getUint8(q+15);r+=16;if(e*Math.pow(2,32)+b!==d.byteLength)throw new f("lepcc-decode-error","Bad size");t=new Uint16Array(h);if(8===n){if(h+r!==d.byteLength)throw new f("lepcc-decode-error","Bad size");n=new Uint8Array(d,r,h)}else if(16===n){if(2*h+r!==d.byteLength)throw new f("lepcc-decode-error","Bad size");n=new Uint16Array(d,r,h)}else if(n=[],c(d,r,n)!==d.byteLength)throw new f("lepcc-decode-error","Bad size");for(d=0;d<h;d++)t[d]=n[d]*p;return t}})},"esri/views/3d/layers/i3s/I3SProjectionUtil":function(){define(["require",
- "exports","../../lib/glMatrix","../../support/projectionUtils"],function(r,h,f,a){Object.defineProperty(h,"__esModule",{value:!0});h.ReprojectionTypes={PER_VERTEX:"perVertex",NO_REPROJECTION:"noReprojection"};var e=new Float64Array(3E3),c=f.vec3d.create();h.reprojectPoints=function(g,d,b,h,l,p){var k=g.data,t=g.offsetIdx;g=g.strideIdx;f.vec3d.set(d,c);c[2]+=b;d=f.mat4d.create();a.computeLinearTransformation(h,c,d,p);b=f.mat4d.create();f.mat4d.inverse(d,b);var r=f.mat4d.create();f.mat4d.identity(r);
- var q=[0,0,0],v=k.length/g;a.vectorToVector(c,h,q,l);for(h=0;h<v;h+=1E3){for(var x=Math.min(1E3,v-h),m=0;m<x;m++){var B=t+g*(h+m);e[3*m]=k[B]+q[0];e[3*m+1]=k[B+1]+q[1];e[3*m+2]=k[B+2]+q[2]}a.bufferToBuffer(e,l,0,e,p,0,x);for(m=0;m<x;m++){var B=e[3*m],z=e[3*m+1],C=e[3*m+2],A=t+g*(h+m);k[A]=b[0]*B+b[4]*z+b[8]*C+b[12];k[A+1]=b[1]*B+b[5]*z+b[9]*C+b[13];k[A+2]=b[2]*B+b[6]*z+b[10]*C+b[14]}}return{localTrafo:r,globalTrafo:d}}})},"esri/views/3d/support/orientedBoundingBox":function(){define(["require","exports",
- "../lib/glMatrix","./aaBoundingBox","./dito"],function(r,h,f,a,e){function c(a,b,c){return{center:f.vec3d.createFrom(a[0],a[1],a[2]),halfSize:l.createFrom(b[0],b[1],b[2]),quaternion:k.createFrom(c[0],c[1],c[2],c[3])}}function g(a,c){var e=b(a.center,c);a=d(a,c);return e>a?1:e<-a?-1:0}function d(a,b){k.conjugate(a.quaternion,p);k.multiplyVec3(p,b,n);a=a.halfSize;return Math.abs(n[0]*a[0])+Math.abs(n[1]*a[1])+Math.abs(n[2]*a[2])}function b(a,b){return b[0]*a[0]+b[1]*a[1]+b[2]*a[2]+b[3]}Object.defineProperty(h,
- "__esModule",{value:!0});var k=f.quat4,l=f.vec3;r=f.mat3d;var p=k.create(),n=l.create(),t=l.create(),u=r.create();r=function(){return function(a){this.buffer=new ArrayBuffer(56*a);this.obbs=Array(a);for(var b=0;b<a;b++)this.obbs[b]={center:new Float64Array(this.buffer,56*b+0,3),halfSize:new Float32Array(this.buffer,56*b+24,3),quaternion:new Float32Array(this.buffer,56*b+36,4)}}}();h.ObbArray=r;h.create=c;h.clone=function(a){return c(a.center,a.halfSize,a.quaternion)};h.set=function(a,b){f.vec3d.set(a.center,
- b.center);f.vec3.set(a.halfSize,b.halfSize);f.quat4.set(a.quaternion,b.quaternion)};h.compute=function(a,b){b||(b=c([0,0,0],[-1,-1,-1],[0,0,0,1]));e.computeOBB(a,b);return b};h.intersectPlane=g;h.toAaBoundingBox=function(b,c){c||(c=a.create());var d=k.toMat3(b.quaternion,u),e=b.halfSize[0]*Math.abs(d[0])+b.halfSize[1]*Math.abs(d[3])+b.halfSize[2]*Math.abs(d[6]),f=b.halfSize[0]*Math.abs(d[1])+b.halfSize[1]*Math.abs(d[4])+b.halfSize[2]*Math.abs(d[7]),d=b.halfSize[0]*Math.abs(d[2])+b.halfSize[1]*Math.abs(d[5])+
- b.halfSize[2]*Math.abs(d[8]);c[0]=b.center[0]-e;c[1]=b.center[1]-f;c[2]=b.center[2]-d;c[3]=b.center[0]+e;c[4]=b.center[1]+f;c[5]=b.center[2]+d;return c};h.minimumDistancePlane=function(a,c){var e=b(a.center,c);a=d(a,c);return e-a};h.maximumDistancePlane=function(a,c){var e=b(a.center,c);a=d(a,c);return e+a};h.isVisible=function(a,b){return 0>=g(a,b[0])&&0>=g(a,b[1])&&0>=g(a,b[2])&&0>=g(a,b[3])&&0>=g(a,b[4])&&0>=g(a,b[5])};h.intersectLine=function(a,b,c,d){void 0===d&&(d=0);k.conjugate(a.quaternion,
- p);f.vec3.subtract(b,a.center,n);b=k.multiplyVec3(p,n,n);c=k.multiplyVec3(p,c,t);for(var e=-Infinity,g=Infinity,h=0;3>h;h++)if(1E-6<Math.abs(c[h]))var l=(d+a.halfSize[h]-b[h])/c[h],m=(-d-a.halfSize[h]-b[h])/c[h],e=Math.max(e,Math.min(l,m)),g=Math.min(g,Math.max(l,m));else if(b[h]>a.halfSize[h]+d||b[h]<-a.halfSize[h]-d)return!1;return e<=g}})},"esri/views/3d/support/dito":function(){define(["require","exports","../lib/glMatrix"],function(r,h,f){function a(a,c,d,g,h,k){if(!(1E-6>f.vec3d.length2(c)))for(f.vec3d.cross(d,
- c,C),f.vec3d.cross(g,c,A),f.vec3d.cross(h,c,D),e(a,c,z),F[1]=z[0],E[1]=z[1],I[1]=E[1]-F[1],d=[d,g,h],g=[C,A,D],h=0;3>h;++h){e(a,d[h],z);F[0]=z[0];E[0]=z[1];e(a,g[h],z);F[2]=z[0];E[2]=z[1];I[0]=E[0]-F[0];I[2]=E[2]-F[2];var l=b(I);l<k.quality&&(f.vec3d.set(d[h],k.b0),f.vec3d.set(c,k.b1),f.vec3d.set(g[h],k.b2),k.quality=l)}}function e(a,b,c){var d=a.data,e=a.offsetIdx;a=a.strideIdx;c[0]=Number.POSITIVE_INFINITY;for(c[1]=Number.NEGATIVE_INFINITY;e<d.length;e+=a){var f=d[e]*b[0]+d[e+1]*b[1]+d[e+2]*b[2];
- c[0]=Math.min(c[0],f);c[1]=Math.max(c[1],f)}}function c(a,b,c){f.vec3d.set(a,c.center);f.vec3d.scale(b,.5,c.halfSize);f.quat4.identity(c.quaternion)}function g(a,b,c,d,f,g){e(a,b,z);f[0]=z[0];g[0]=z[1];e(a,c,z);f[1]=z[0];g[1]=z[1];e(a,d,z);f[2]=z[0];g[2]=z[1]}function d(a,b,c,d,e,g,h){R[0]=a[0];R[3]=a[1];R[6]=a[2];R[1]=b[0];R[4]=b[1];R[7]=b[2];R[2]=c[0];R[5]=c[1];R[8]=c[2];f.quat4.fromRotationMatrix(R,h.quaternion);f.vec3d.add(d,e,Y);f.vec3d.scale(Y,.5);f.vec3d.scale(a,Y[0],h.center);f.vec3d.scale(b,
- Y[1],S);f.vec3d.add(h.center,S);f.vec3d.scale(c,Y[2],S);f.vec3d.add(h.center,S);f.vec3d.scale(g,.5,h.halfSize)}function b(a){return a[0]*a[1]+a[0]*a[2]+a[1]*a[2]}Object.defineProperty(h,"__esModule",{value:!0});var k=f.vec3d.create(),l=f.vec3d.create();h.computeOBB=function(e,h){var r=e.data.length/e.strideIdx;if(!(0>=r)){var A=new X(e);f.vec3d.add(A.minProj,A.maxProj,k);f.vec3d.scale(k,.5);f.vec3d.subtract(A.maxProj,A.minProj,l);var C=b(l),D=new Q;D.quality=C;14>r&&(e={data:new Float64Array(A.buffer,
- 112,42),size:3,offsetIdx:0,strideIdx:3});var E=f.vec3d.create(),F=f.vec3d.create(),K=f.vec3d.create(),r=f.vec3d.create(),L=f.vec3d.create(),S=f.vec3d.create(),I=f.vec3d.create(),R;R=e;for(var Y=f.vec3d.dist2(A.maxVert[0],A.minVert[0]),T=0,ha=1;7>ha;++ha){var ia=f.vec3d.dist2(A.maxVert[ha],A.minVert[ha]);ia>Y&&(Y=ia,T=ha)}f.vec3d.set(A.minVert[T],E);f.vec3d.set(A.maxVert[T],F);if(1E-6>f.vec3d.dist2(E,F))R=1;else{f.vec3d.subtract(E,F,r);f.vec3d.normalize(r);A=R.data;Y=R.strideIdx;T=Number.NEGATIVE_INFINITY;
- ha=0;for(ia=R.offsetIdx;ia<A.length;ia+=Y){f.vec3d.set3(A[ia]-E[0],A[ia+1]-E[1],A[ia+2]-E[2],B);var la=r[0]*B[0]+r[1]*B[1]+r[2]*B[2],w=f.vec3d.length2(r),la=f.vec3d.length2(B)-la*la/w;la>T&&(T=la,ha=ia)}f.vec3d.set3(A[ha],A[ha+1],A[ha+2],K);1E-6>T?R=2:(f.vec3d.subtract(F,K,L),f.vec3d.normalize(L),f.vec3d.subtract(K,E,S),f.vec3d.normalize(S),f.vec3d.cross(L,r,I),f.vec3d.normalize(I),a(R,I,r,L,S,D),R=0)}switch(R){case 1:c(k,l,h);return;case 2:C=e;f.vec3d.set(r,G);Math.abs(r[0])>Math.abs(r[1])&&Math.abs(r[0])>
- Math.abs(r[2])?G[0]=0:Math.abs(r[1])>Math.abs(r[2])?G[1]=0:G[2]=0;1E-6>f.vec3d.length2(G)&&(G[0]=G[1]=G[2]=1);f.vec3d.cross(r,G,M);f.vec3d.normalize(M);f.vec3d.cross(r,M,H);f.vec3d.normalize(H);g(C,r,M,H,J,O);f.vec3d.subtract(O,J,N);d(r,M,H,J,O,N,h);return}R=e;A=p;Y=n;T=z;ha=R.data;la=R.offsetIdx;ia=R.strideIdx;f.vec3d.set3(ha[la],ha[la+1],ha[la+2],Y);f.vec3d.set(Y,A);T[0]=f.vec3d.dot(P,I);T[1]=T[0];for(la+=ia;la<ha.length;la+=ia)f.vec3d.set3(ha[la],ha[la+1],ha[la+2],P),w=f.vec3d.dot(P,I),w<T[0]&&
- (T[0]=w,f.vec3d.set(P,Y)),w>T[1]&&(T[1]=w,f.vec3d.set(P,A));I=f.vec3.dot(E,I);z[1]-1E-6<=I&&(A[0]=void 0);z[0]+1E-6>=I&&(Y[0]=void 0);void 0!==p[0]&&(f.vec3d.subtract(p,E,t),f.vec3d.normalize(t),f.vec3d.subtract(p,F,u),f.vec3d.normalize(u),f.vec3d.subtract(p,K,q),f.vec3d.normalize(q),f.vec3d.cross(u,r,v),f.vec3d.normalize(v),f.vec3d.cross(q,L,x),f.vec3d.normalize(x),f.vec3d.cross(t,S,m),f.vec3d.normalize(m),a(R,v,r,u,t,D),a(R,x,L,q,u,D),a(R,m,S,t,q,D));void 0!==n[0]&&(f.vec3d.subtract(n,E,t),f.vec3d.normalize(t),
- f.vec3d.subtract(n,F,u),f.vec3d.normalize(u),f.vec3d.subtract(n,K,q),f.vec3d.normalize(q),f.vec3d.cross(u,r,v),f.vec3d.normalize(v),f.vec3d.cross(q,L,x),f.vec3d.normalize(x),f.vec3d.cross(t,S,m),f.vec3d.normalize(m),a(R,v,r,u,t,D),a(R,x,L,q,u,D),a(R,m,S,t,q,D));g(e,D.b0,D.b1,D.b2,J,O);e=f.vec3d.create();f.vec3d.subtract(O,J,e);D.quality=b(e);D.quality<C?d(D.b0,D.b1,D.b2,J,O,e,h):c(k,l,h)}};var p=f.vec3d.create(),n=f.vec3d.create(),t=f.vec3d.create(),u=f.vec3d.create(),q=f.vec3d.create(),v=f.vec3d.create(),
- x=f.vec3d.create(),m=f.vec3d.create(),B=f.vec3d.create(),z=f.vec2d.create(),C=f.vec3d.create(),A=f.vec3d.create(),D=f.vec3d.create(),E=f.vec3d.create(),F=f.vec3d.create(),I=f.vec3d.create(),P=f.vec3d.create(),G=f.vec3d.create(),M=f.vec3d.create(),H=f.vec3d.create(),J=f.vec3d.create(),O=f.vec3d.create(),N=f.vec3d.create(),S=f.vec3d.create(),R=f.mat3d.create(),Y=f.vec3d.create(),X=function(){return function(a){this.minVert=[];this.maxVert=[];this.buffer=new ArrayBuffer(448);var b=0;this.minProj=new Float64Array(this.buffer,
- b,7);b+=56;this.maxProj=new Float64Array(this.buffer,b,7);for(b+=56;7>this.minVert.length;)this.minVert.push(new Float64Array(this.buffer,b,3)),b+=24;for(;7>this.maxVert.length;)this.maxVert.push(new Float64Array(this.buffer,b,3)),b+=24;for(b=0;7>b;++b)this.minProj[b]=Number.POSITIVE_INFINITY,this.maxProj[b]=Number.NEGATIVE_INFINITY;for(var c=[],d=[],e=a.data,g=a.strideIdx,b=a.offsetIdx;b<e.length;b+=g)a=e[b],a<this.minProj[0]&&(this.minProj[0]=a,c[0]=b),a>this.maxProj[0]&&(this.maxProj[0]=a,d[0]=
- b),a=e[b+1],a<this.minProj[1]&&(this.minProj[1]=a,c[1]=b),a>this.maxProj[1]&&(this.maxProj[1]=a,d[1]=b),a=e[b+2],a<this.minProj[2]&&(this.minProj[2]=a,c[2]=b),a>this.maxProj[2]&&(this.maxProj[2]=a,d[2]=b),a=e[b]+e[b+1]+e[b+2],a<this.minProj[3]&&(this.minProj[3]=a,c[3]=b),a>this.maxProj[3]&&(this.maxProj[3]=a,d[3]=b),a=e[b]+e[b+1]-e[b+2],a<this.minProj[4]&&(this.minProj[4]=a,c[4]=b),a>this.maxProj[4]&&(this.maxProj[4]=a,d[4]=b),a=e[b]-e[b+1]+e[b+2],a<this.minProj[5]&&(this.minProj[5]=a,c[5]=b),a>this.maxProj[5]&&
- (this.maxProj[5]=a,d[5]=b),a=e[b]-e[b+1]-e[b+2],a<this.minProj[6]&&(this.minProj[6]=a,c[6]=b),a>this.maxProj[6]&&(this.maxProj[6]=a,d[6]=b);for(b=0;7>b;++b)a=c[b],f.vec3d.set3(e[a],e[a+1],e[a+2],this.minVert[b]),a=d[b],f.vec3d.set3(e[a],e[a+1],e[a+2],this.maxVert[b])}}(),Q=function(){return function(){this.b0=f.vec3d.createFrom(1,0,0);this.b1=f.vec3d.createFrom(0,1,0);this.b2=f.vec3d.createFrom(0,0,1);this.quality=0}}()})},"esri/views/3d/layers/i3s/Highlights":function(){define(["require","exports",
- "../../webgl-engine/lib/HighlightSet"],function(r,h,f){var a=function(){return function(a){this.highlightSet=new f;this.ids=new Set;this.options=a}}();return function(){function e(a){this.highlights=[];this.layerView=a}e.prototype.destroy=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()});this.highlights=null};e.prototype.acquireSet=function(c){var e=this,d=new a(c);this.highlights.push(d);return{set:d,handle:{remove:function(){return e.releaseSet(d)}}}};e.prototype.releaseSet=
- function(a){a.highlightSet.removeAll();a=this.highlights?this.highlights.indexOf(a):-1;-1!==a&&this.highlights.splice(a,1)};e.prototype.setFeatureIds=function(a,e){e.forEach(function(c){return a.ids.add(c)});this.layerView._forAllFeatures(function(c,b,e,f){a.ids.has(c)&&(c=e.engineObject.setComponentHighlight(f,b,a.options),a.highlightSet.addObject(e.engineObject,c))},null,!0)};e.prototype.objectCreated=function(a){var c=this;this.highlights.forEach(function(d){c.layerView._forAllFeaturesOfNode(c.layerView._getMetadata(a),
- function(b,c,e,f){d.ids.has(b)&&(b=a.setComponentHighlight(f,c,d.options),d.highlightSet.addObject(a,b))},!0)})};e.prototype.objectDeleted=function(a){this.highlights.forEach(function(c){c.highlightSet.removeObject(a)})};e.prototype.allObjectsDeleted=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()})};return e}()})},"esri/views/3d/webgl-engine/lib/HighlightSet":function(){define(["require","exports"],function(r,h){return function(){function f(){this.items=[]}f.prototype.addObject=
- function(a,e){this.items.push({type:"object",highlightId:e,object:a})};f.prototype.addRenderGeometry=function(a,e,c){this.items.push({type:"renderGeometry",highlightId:c,renderGeometry:a,renderer:e})};f.prototype.removeObject=function(a){for(var e=this.items.length-1;0<=e;--e){var c=this.items[e];"object"===c.type&&c.object===a&&(c.object.removeHighlights(c.highlightId),this.items.splice(e,1))}};f.prototype.removeRenderGeometry=function(a){for(var e=this.items.length-1;0<=e;--e){var c=this.items[e];
- "renderGeometry"===c.type&&c.renderGeometry===a&&(c.renderer.removeRenderGeometryHighlight(c.renderGeometry,c.highlightId),this.items.splice(e,1))}};f.prototype.removeAll=function(){this.items.forEach(function(a){"object"===a.type?a.object.removeHighlights(a.highlightId):"renderGeometry"===a.type&&a.renderer.removeRenderGeometryHighlight(a.renderGeometry,a.highlightId)});this.items=[]};return f}()})},"esri/views/3d/layers/i3s/I3SElevationProvider":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/Logger ../../../../core/accessorSupport/decorators ../../../../geometry/Point ../../lib/glMatrix ../../support/aaBoundingRect ../../support/Evented ../../webgl-engine/lib/Selector".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p){var n=k.create(k.NEGATIVE_INFINITY),t={spatialReference:null,extent:n},u=b.vec3d.create(),q=b.vec3d.create(),v=b.vec3d.create(),x=c.getLogger("esri.views.3d.layers.i3s.I3SElevationProvider");return function(c){function e(a){return c.call(this)||this}f(e,c);e.prototype.initialize=function(){this.renderCoordsHelper=this.layerView.view.renderCoordsHelper;this.intersectLayers=[this.stageLayer];this.selector=new p(this.layerView.view.viewingMode);var a=this.layerView.layer.fullExtent;
- this.zmin=a.zmin;this.zmax=a.zmax};e.prototype.getElevation=function(a){if(a instanceof d){if(!this.renderCoordsHelper.toRenderCoords(a,u))return x.error("could not project point for elevation alignment"),-Infinity}else if(!this.renderCoordsHelper.toRenderCoords(a,this.spatialReference,u))return x.error("could not project point for elevation alignment"),-Infinity;var c=this.layerView.elevationOffset;a=this.zmin+c;c=this.zmax+c;b.vec3d.set(u,q);b.vec3d.set(u,v);this.renderCoordsHelper.setAltitude(c,
- q);this.renderCoordsHelper.setAltitude(a,v);this.selector.init(this.intersectLayers,q,v,null,null,1,!1);return this.selector.getMinResult().getIntersectionPoint(u)?this.renderCoordsHelper.getAltitude(u):-Infinity};e.prototype.layerChanged=function(){this.spatialReference&&(t.extent=this.computeLayerExtent(this.intersectLayers[0]),t.spatialReference=this.spatialReference,this.emit("elevation-change",t))};e.prototype.objectChanged=function(a){this.spatialReference&&(t.extent=this.computeObjectExtent(a),
- t.spatialReference=this.spatialReference,this.emit("elevation-change",t))};e.prototype.computeObjectExtent=function(a){k.set(n,k.NEGATIVE_INFINITY);this.expandExtent(a,n);return n};e.prototype.computeLayerExtent=function(a){k.set(n,k.NEGATIVE_INFINITY);var b=0;for(a=a.getObjects();b<a.length;b++)this.expandExtent(a[b],n);return n};e.prototype.expandExtent=function(a,c){for(var d=a.getBBMin(!0),e=a.getBBMax(!0),f=0;8>f;++f)u[0]=f&1?d[0]:e[0],u[1]=f&2?d[1]:e[1],u[2]=f&4?d[2]:e[2],b.mat4d.multiplyVec3(a.objectTransformation,
- u),this.renderCoordsHelper.fromRenderCoords(u,u,this.spatialReference),k.expand(c,u);return c};a([g.property({constructOnly:!0})],e.prototype,"layerView",void 0);a([g.property({constructOnly:!0})],e.prototype,"stageLayer",void 0);a([g.property({readOnly:!0,aliasOf:"layerView.view.elevationProvider.spatialReference"})],e.prototype,"spatialReference",void 0);return e=a([g.subclass("esri.views.3d.layers.i3s.I3SElevationProvider")],e)}(g.declared(e,l.Evented))})},"esri/views/3d/layers/i3s/I3SQueryEngine":function(){define("require exports dojo/promise/all ../../../../core/Error ../../../../core/promiseUtils ../../../../tasks/support/FeatureSet".split(" "),
- function(r,h,f,a,e,c){return function(){function g(a,b){this._support=a;this._options=b}g.prototype.queryExtent=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=0,d=b._support.createExtentBuilder();b._forAllQueried(a,function(a){c++;d.add(a)});return{count:c,extent:0===c?null:d.getExtent()}})};g.prototype.queryFeatureCount=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=0;b._forAllQueried(a,function(){return c++});return c})};g.prototype.queryFeatures=
- function(d){var b=this;return this._rejectUnsupported(d).then(function(){var c=[],g=d&&d.outFields,h=[];if(0<b._forAllQueried(d,function(a){return h.push(b._support.createGraphic(a))},function(a){g&&(c.push(b._support.requestFields(a,h,g)),h=[])})&&!d.num)return e.reject(new a("Unsupported Query","Large feature query, use Query.num and Query.start to batch"));g||c.push(e.resolve(h));return f(c)}).then(function(a){a=a.reduce(function(a,b){return a.concat(b)},[]);var b=new c;b.features=a;return b})};
- g.prototype.queryObjectIds=function(a){var b=this;return this._rejectUnsupported(a).then(function(){var c=[];b._forAllQueried(a,function(a){return c.push(a.id)});return c})};g.defaultExtentBuilder=function(a){var b=null;return{add:function(c){(c=a(c))&&(b=null!=b?b.union(c):c.clone())},getExtent:function(){return b}}};g.prototype._forAllQueried=function(a,b,c){var d=[];if(a&&a.objectIds){var e=a.objectIds;d.push(function(a){return 0<=e.indexOf(a.id)})}var f=a&&a.start||0,g=a&&a.num||1E4;d.push(function(){if(0>=
- g)return--g,!1;if(0<f)return--f,!1;--g;return!0});this._support.forAll(function(a){for(var c=0;c<d.length;c++)if(!(0,d[c])(a))return;b(a)},c);return Math.max(0,-g)};g.prototype._rejectUnsupported=function(c){if(null==c)return e.resolve();var b=function(b){return e.reject(new a("Unsupported Query","Unsupported property '"+b+"'"))};return null!=c.distance?b("distance"):null!=c.geometryPrecision?b("geometryPrecision"):c.groupByFieldsForStatistics&&c.groupByFieldsForStatistics.length?b("groupByFieldsForStatistics"):
- null!=c.maxAllowableOffset?b("maxAllowableOffset"):c.multipatchOption?b("multipatchOption"):c.orderByFields&&c.orderByFields.length?b("orderByFields"):c.outSpatialReference?b("outSpatialReference"):c.outStatistics&&c.outStatistics.length?b("outStatistics"):c.pixelSize?b("pixelSize"):c.quantizationParameters?b("quantizationParameters"):c.relationParameter?b("relationParameter"):c.returnDistinctValues?b("returnDistinctValues"):c.text?b("text"):c.timeExtent?b("timeExtent"):c.where?b("where"):c.geometry?
- b("geometry"):!this._options.enableOutFields&&c.outFields&&c.outFields.length?b("outFields"):!this._options.enableObjectId&&c.objectIds&&c.objectIds.length?b("objectIds"):e.resolve()};return g}()})},"esri/views/3d/layers/i3s/I3SUtil":function(){define("require exports ../../../../request ../../../../core/Error ../../../../core/promiseUtils ../../../../core/urlUtils ../../../../geometry/SpatialReference ../../../../geometry/support/webMercatorUtils ../../../../tasks/QueryTask ../../../../tasks/support/Query ./I3SBinaryReader ../../lib/glMatrix ../../support/projectionUtils ../support/symbolColorUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t){function u(a){return a&&parseInt(a.substring(a.lastIndexOf("/")+1,a.length),10)}function q(a,b,c,d,e,f){if(null!=c){var g=H;n.mbsToMbs(c.mbs,d,g,b);if(0!==v(a,g)){f.push(c);for(var g=null!=c.children?c.children.length:0,h=0;h<g;h++)q(a,b,e[c.children[h].id],d,e,f)}}}function v(a,b){var c=b[0],d=b[1],e=b[2];b=b[3];var f=0;if(c<a[0])var g=a[0]-c,f=f+g*g;d<a[1]&&(g=a[1]-d,f+=g*g);e<a[2]&&(g=a[2]-e,f+=g*g);c>a[3]&&(g=c-a[3],f+=g*g);d>a[4]&&(g=d-a[4],f+=g*g);e>a[5]&&
- (g=e-a[5],f+=g*g);if(f>b*b)return 0;if(0<f)return 1;f=Infinity;c-a[0]<f&&(f=c-a[0]);d-a[1]<f&&(f=d-a[1]);e-a[2]<f&&(f=e-a[2]);a[3]-c<f&&(f=a[3]-c);a[4]-d<f&&(f=a[4]-d);a[5]-e<f&&(f=a[5]-e);return f>b?2:1}function x(a,b,c){var d=[],e=c&&c.missingFields;c=c&&c.originalFields;for(var f=0;f<a.length;f++){for(var g=a[f],h=g.toLowerCase(),k=!1,l=0,m=b;l<m.length;l++){var n=m[l];if(h===n.name.toLowerCase()){d.push(n.name);k=!0;c&&c.push(g);break}}!k&&e&&e.push(g)}return d}function m(a,b){return a.filter(function(a){return a.toLowerCase()!==
- b.toLowerCase()}).concat([b])}function B(a,b,c,d){b.sort(function(a,b){return a.attributes[c]-b.attributes[c]});var e=b.map(function(a){return a.attributes[c]}),f=[],g=x(d,a.fields,{originalFields:f});return C(a,e,g).then(function(a){for(var c=0;c<b.length;c++){var d=b[c],e=a[c];d.attributes={};for(var h=0;h<f.length;h++)d.attributes[f[h]]=e[g[h]]}return b})}function z(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d];e in b.attributes||c.push(e)}return c}function C(c,d,f){if(null!=c.maxRecordCount&&
- d.length>c.maxRecordCount){var g=E(d,c.maxRecordCount);return e.all(g.map(function(a){return C(c,a,f)})).then(F)}g=new k({objectIds:d,outFields:f,orderByFields:[c.objectIdField]});return(new b(c.parsedUrl.path)).execute(g).then(function(b){return b&&b.features&&b.features.length===d.length?b.features.map(function(a){return a.attributes}):e.reject(new a("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer"))})}function A(b,d,g,h,k){for(var m=[],n=0;n<d.attributeData.length;n++){var p=
- d.attributeData[n],q=b[n];q&&-1!==h.indexOf(q.name)&&(p=c.makeAbsolute(p.href,d.baseUrl),m.push({url:p,storageInfo:q}))}return e.eachAlways(m.map(function(a){return f(a.url,{responseType:"array-buffer"}).then(function(b){return l.readBinaryAttribute(a.storageInfo,b.data)})})).then(function(b){var c=[];if(!k.ignoreUnavailableFields&&b.some(function(a){return null==a.value})){for(var c=[],d=0;d<b.length;d++)null==b[d].value&&c.push({name:m[d].storageInfo.name,error:b[d].error});return e.reject(new a("scenelayer:attribute-request-failed",
- "Request for scene layer attributes failed",{failedAttributes:c}))}for(var f=0;f<g.length;f++){for(var h=g[f],l={},d=0;d<b.length;d++)null!=b[d].value&&(l[m[d].storageInfo.name]=D(b[d].value,h));c.push(l)}return c})}function D(a,b){b=a[b];return a instanceof Int16Array?b===J?null:b:a instanceof Int32Array?b===O?null:b:b!==b?null:b}function E(a,b){var c=a.length;b=Math.ceil(c/b);for(var d=[],e=0;e<b;e++)d.push(a.slice(Math.floor(c*e/b),Math.floor(c*(e+1)/b)));return d}function F(a){for(var b=[],c=
- 0;c<a.length;c++)b=b.concat(a[c]);return b}function I(a){var b=new g(u(a.store.indexCRS||a.store.geographicCRS));return b.equals(a.spatialReference)?a.spatialReference:b}function P(a){var b=new g(u(a.store.vertexCRS||a.store.projectedCRS));return b.equals(a.spatialReference)?a.spatialReference:b}function G(b,c,e){if(!d.canProject(b,c))throw new a("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===
- e&&b.isGeographic)throw new a("layerview:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes",{});}function M(a,b,c){var d=I(a);a=P(a);G(d,b,c);G(a,b,c)}Object.defineProperty(h,"__esModule",{value:!0});h.DDS_ENCODING_STRING="image/vnd-ms.dds";h.BROWSER_SUPPORTED_IMAGE_ENCODING_STRINGS=["image/jpeg","image/png"];h.extractWkid=u;h.getAppropriateTextureEncoding=function(a,b){if(Array.isArray(a)){if(b&&(b=a.indexOf(h.DDS_ENCODING_STRING),-1<b))return b;for(b=0;b<
- a.length;b++)if(-1<h.BROWSER_SUPPORTED_IMAGE_ENCODING_STRINGS.indexOf(a[b]))return b;throw Error("Could not find appropriate texture encoding (among "+a.toString()+")");}return-1};h.findIntersectingNodes=q;h.buildTopNodeMap=function(a,b,c,d){a.set(c,d);for(c=function(){var b=Number.POSITIVE_INFINITY,c;a.forEach(function(a,d){a<b&&(c=d,b=a)});a.delete(c)};a.size>b;)c()};var H=p.vec4d.create();h.intersectBoundingBoxWithMbs=v;h.findFieldsCaseInsensitive=x;h.whenGraphicAttributes=function(b,c,d,f,g,h){var k=
- !0===(h&&h.populateObjectId),l=h.ignoreUnavailableFields?void 0:[],n=1===f.length&&"*"===f[0];!n&&k&&(f=m(f,d));f=n?f:x(f,b.fields,{missingFields:l});if(l&&0!==l.length)return e.reject(new a("scenelayer:unknown-fields","This scene layer does not have the requested fields",{unknownFields:l}));if(0===c.length)return e.resolve(c);var k=b.associatedLayer,l=b.attributeStorageInfo,p=n?b.fields.map(function(a){return a.name}):f;if(k)return B(k,c,d,p);b=z(p,c[0]);return 0===b.length?e.resolve(c):l?(g=g(),
- null==g?e.reject(new a("scenelayer:feature-not-loaded","Tried to query attributes for unloaded features")):A(l,g.node,g.indices,b,h).then(function(a){for(var b=0;b<c.length;b++){for(var d=0,e=p;d<e.length;d++){var f=e[d];f in a[b]||(a[b][f]=c[b].attributes[f])}c[b].attributes=a[b]}return c})):e.reject(new a("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available"))};var J=-Math.pow(2,15),O=-Math.pow(2,31);h.getCachedAttributeValue=D;h.convertFlatRangesToOffsets=
- function(b,c,d){void 0===d&&(d=2);c=null!=c?c:b.length/d;for(var e=new Uint32Array(c+1),f=0;f<c;f++){var g=b[f*d];e[f]=3*g;var h=(f-1)*d+1;if(0<=h&&g-1!==b[h])throw new a("Face ranges are not continuous");}e[e.length-1]=3*(b[(c-1)*d+1]+1);return e};h.getIndexCrs=I;h.getVertexCrs=P;h.getCacheKeySuffix=function(a,b){return b===n.SphericalECEFSpatialReference?"@ECEF":a.equals(b)?"":null!=b.wkid?"@"+b.wkid:null};h.checkSpatialReference=G;h.checkSpatialReferences=M;h.checkSceneLayerValid=function(b){var c;
- (c=null==b.store||null==b.store.defaultGeometrySchema)||(b=b.store.defaultGeometrySchema,c=!!(null!=b.geometryType&&"triangles"!==b.geometryType||null!=b.topology&&"PerAttributeArray"!==b.topology||null==b.vertexAttributes||null==b.vertexAttributes.position));if(c)throw new a("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{});};h.checkSceneLayerCompatibleWithView=function(a,b){M(a,b.spatialReference,b.viewingMode)};h.checkPointCloudLayerValid=
- function(b){var c;(c=null==b.store||null==b.store.defaultGeometrySchema)||(b=b.store.defaultGeometrySchema,c=!!(null==b.geometryType||"points"!==b.geometryType||null!=b.topology&&"PerAttributeArray"!==b.topology||null!=b.encoding&&""!==b.encoding&&"lepcc-xyz"!==b.encoding||null==b.vertexAttributes||null==b.vertexAttributes.position));if(c)throw new a("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{});};h.checkPointCloudLayerCompatibleWithView=
- function(a,b){G(a.spatialReference,b.spatialReference,b.viewingMode)};h.encodeSymbolColor=t.encodeSymbolColor;h.rendererNeedsTextures=function(a){if(null==a||"simple"!==a.type&&"class-breaks"!==a.type&&"unique-value"!==a.type||("unique-value"===a.type||"class-breaks"===a.type)&&null==a.defaultSymbol)return!0;a=a.getSymbols();if(0===a.length)return!0;for(var b=0;b<a.length;b++){var c=a[b];if("mesh-3d"!==c.type||0===c.symbolLayers.length)return!0;for(var d=0,c=c.symbolLayers.items;d<c.length;d++){var e=
- c[d];if("fill"!==e.type||null==e.material||"replace"!==e.material.colorMixMode)return!0}}return!1};h.mapToKeys=function(a){var b=[];a.forEach(function(a,c){return b.push(c)});return b};h.setToKeys=function(a){var b=[];a.forEach(function(a){return b.push(a)});return b}})},"esri/views/3d/layers/i3s/IDBCache":function(){define(["require","exports","../../../../core/Error","../../../../core/promiseUtils"],function(r,h,f,a){function e(c){return a.create(function(a,b){c.oncomplete=function(){return a()};
- c.onerror=function(){return b(c.error)};c.onabort=function(){return b(c.error)}})}function c(c){return a.create(function(a,b){"done"===c.readyState?null!=c.error?b(c.error):a(c.result):(c.onsuccess=function(){return a(c.result)},c.onerror=function(){return b(c.error)})})}Object.defineProperty(h,"__esModule",{value:!0});r=function(){function g(a,b,c){this._quotaReductionPromise=this._db=null;this._gcCounter=0;this._destroyed=!1;this.gcFrequency=50;this.maxByteSize=1073741824;this.quotaReductionFactor=
- .2;this._dbName=a;this._storeName=b;this._version=c}g.prototype.init=function(){var d=this;return a.resolve().then(function(){var a=indexedDB.open(d._dbName,d._version);a.onupgradeneeded=function(b){var c=a.result,e=a.transaction,f=c.objectStoreNames.contains(d._storeName)?e.objectStore(d._storeName):c.createObjectStore(d._storeName),c=c.objectStoreNames.contains("last_access")?e.objectStore("last_access"):c.createObjectStore("last_access");c.indexNames.contains("date")||c.createIndex("date","date",
- {unique:!1});c.indexNames.contains("byteSize")||c.createIndex("byteSize","byteSize",{unique:!1});b.oldVersion<d._version&&(f.clear(),c.clear())};return c(a)}).then(function(a){d._destroyed?a.close():d._db=a})};g.prototype.destroy=function(){this._db&&(this._db.close(),this._db=null);this._destroyed=!0};g.prototype.put=function(c,b){var d=this;return null==this._db?a.reject(new f("indexedb:not-initialized","IndexedDB Cache is not initialized")):(null!=this._quotaReductionPromise?this._quotaReductionPromise:
- a.resolve()).then(function(){return d._put(c,b)}).catch(function(a){if("QuotaExceededError"===a.name)return null==d._quotaReductionPromise&&(d._quotaReductionPromise=d._getCacheSize().then(function(a){return d._removeLeastRecentlyAccessed(b.byteSize+Math.ceil(a*d.quotaReductionFactor))}),d._quotaReductionPromise.always(function(){d._quotaReductionPromise=null})),d._quotaReductionPromise.then(function(){return d._put(c,b)});throw a;}).then(function(){d._gcCounter--;0>d._gcCounter&&(d._gcCounter=d.gcFrequency,
- d._getCacheSize().then(function(a){return d._removeLeastRecentlyAccessed(a-d.maxByteSize)}))})};g.prototype.get=function(d){var b=this;return null==this._db?a.resolve(null):a.resolve().then(function(){var a=b._db.transaction(b._storeName,"readonly").objectStore(b._storeName).get(d);return c(a)}).then(function(a){null!=a&&b._db.transaction("last_access","readwrite").objectStore("last_access").put({date:(new Date).getTime(),byteSize:a.byteSize},d);return a}).catch(function(a){return null})};g.prototype.remove=
- function(c){var b=this;return null==this._db?a.resolve():a.resolve().then(function(){var a=b._db.transaction([b._storeName,"last_access"],"readwrite"),d=a.objectStore(b._storeName),f=a.objectStore("last_access");d.delete(c);f.delete(c);return e(a)})};g.prototype._put=function(a,b){var c=this._db.transaction([this._storeName,"last_access"],"readwrite");c.objectStore(this._storeName).put(b,a);c.objectStore("last_access").put({date:(new Date).getTime(),byteSize:b.byteSize},a);return e(c)};g.prototype._removeLeastRecentlyAccessed=
- function(a){if(!(0>=a)){var b=this._db.transaction([this._storeName,"last_access"],"readwrite"),c=b.objectStore(this._storeName),d=b.objectStore("last_access"),f=0,g=d.index("date").openCursor(null,"next");g.onsuccess=function(b){b=g.result;null!=b&&(null!=b.value.byteSize&&(f+=b.value.byteSize),c.delete(b.primaryKey),d.delete(b.primaryKey),f<a&&b.continue())};return e(b)}};g.prototype._getCacheSize=function(){var a=this._db.transaction("last_access"),b=0,c=a.objectStore("last_access").index("byteSize").openKeyCursor();
- c.onsuccess=function(a){if(a=c.result){var d=a.key;null!=d&&(b+=d);a.continue()}};return e(a).then(function(){return b})};return g}();h.IDBCache=r;h.whenTransaction=e;h.whenRequest=c})},"esri/views/3d/layers/support/attributeUtils":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",{value:!0});h.attributeLookup=function(f,a){a=a.toLowerCase();for(var e=0,c=Object.keys(f);e<c.length;e++){var g=c[e];if(g.toLowerCase()===a)return f[g]}return null}})},"esri/views/3d/layers/support/LayerViewUpdatingPercentage":function(){define(["../../../../core/Accessor"],
- function(r){return r.createSubclass([],{properties:{updating:{readOnly:!0},updatingPercentageValue:{value:100,readOnly:!0},updatingPercentage:{dependsOn:["updating","updatingPercentageValue"],readOnly:!0,value:0,get:function(){return this.updating?this.updatingPercentageValue:0}}},constructor:function(){}})})},"esri/views/3d/layers/i3s/I3SIndexTraversal":function(){define(["require","exports","../../../../core/urlUtils","./I3SUtil"],function(r,h,f,a){var e="version level sharedResource attributeData geometryData textureData lodSelection".split(" ");
- return function(){function c(a,c,b,e,h,p,n,t){var d=this;this.rootId=b;this.progressiveLoadPenalty=e;this.nodeIndex=h;this.streamDataSupplier=p;this.viewportQueries=n;this.logger=t;this._dirty=!0;this.cancelled=!1;this._loadingNodes=new Set;this._pendingNodes=1;this._nodeTraversalState={};this._version=0;this._maxLodLevel=this.viewportQueries.maxLodLevel;this.rootUrl=f.makeAbsolute(c,a);this.traverseVisible(function(a){d.nodeTraversalState(a.id);return!0})}c.prototype.requestReload=function(){this._dirty=
- !0;++this._version};c.prototype.update=function(a){var c=this;if(this.cancelled||!this._dirty)return!1;var b=function(a,b){c.nodeTraversalState(b.id)};this._collectMissing(a).forEach(function(a,d){return c._loadNode(d,b)});return this._dirty=0<this._pendingNodes};c.prototype.cancel=function(){this.cancelled=!0};c.prototype.isLoading=function(){return this._dirty};c.prototype.getNumLoading=function(){return this._loadingNodes.size};c.prototype.getNumPending=function(){return this._pendingNodes};c.prototype.nodeTraversalState=
- function(a){var c=this._nodeTraversalState[a];if(null!=c&&c.version===this._version)return this._nodeTraversalState[a];var b=this.nodeIndex[a];if(null==b)return null;var e=null,f=0;if(null!=b.parentNode){e=this.nodeIndex[b.parentNode.id];if(null==e)return null;e=this._nodeTraversalState[e.id];null!=e&&(f=e.lodLevel)}var e=this.viewportQueries.hasLOD(b),g=this.viewportQueries.getLodLevel(b),f=!e||g>f;if(c)return c.lodLevel=g,c.isChosen=f,c.version=this._version,c;this._nodeTraversalState[b.id]={nodeHasLOD:e,
- lodLevel:g,isChosen:f,version:this._version};return this._nodeTraversalState[a]};c.prototype._loadNode=function(a,c){var b=this;this._loadingNodes.add(a.id);var d=f.makeAbsolute(a.href,a.baseUrl);this.streamDataSupplier.request(d,"json").then(function(a,d){var f={id:d.id,mbs:d.mbs,parentNode:d.parentNode,children:d.children,featureData:d.featureData};e.forEach(function(a){f[a]=d.hasOwnProperty(a)?d[a]:null});b.nodeIndex[f.id]=f;f.baseUrl=a;c(a,f);b._loadingNodes.delete(f.id)},function(c){b.loadErrorCallback(d);
- b._loadingNodes.delete(a.id)})};c.prototype._collectMissing=function(c){var d=this,b=new Map;this._pendingNodes=0;this.traverseVisible(function(e,f){var g=e.id;if(d.nodeIndex[g])return!0;++d._pendingNodes;if(d._loadingNodes.has(g))return!0;a.buildTopNodeMap(b,c,{id:g,href:e.href,baseUrl:f?f.baseUrl:""},d.entryPriority(e));return!0});return b};c.prototype.entryPriority=function(a){if(a.id===this.rootId)return 0;var c=0,b=this.nodeIndex[a.id];null!=b&&null!=b.parentNode&&(b=this._nodeTraversalState[b.parentNode.id],
- null!=b&&(c=b.lodLevel));a=this.viewportQueries.distToPOI(a);return-a-c*(a+this.progressiveLoadPenalty)};c.prototype.traverseVisible=function(a){var c=this.nodeIndex[this.rootId];return this._traverse({id:this.rootId,mbs:c?c.mbs:null,href:this.rootUrl},a,null)};c.prototype._traverse=function(a,c,b){if(!c(a,b))return!1;b=this.nodeIndex[a.id];if(!b)return!0;a=this.nodeTraversalState(a.id);if(a.nodeHasLOD&&a.lodLevel===this._maxLodLevel)return!0;if(b.children){a=0;for(var d=b.children;a<d.length;a++){var e=
- d[a],f=this.nodeIndex[e.id];if(f&&(!f.children||0===f.children.length)){if(this.viewportQueries.isGeometryVisible(f)&&!c(e,b))return!1}else if(this.viewportQueries.isNodeVisible(e)&&!this._traverse(e,c,b))return!1}}return!0};c.prototype.loadErrorCallback=function(a){this.logger.warn("Error loading node: "+a)};return c}()})},"esri/views/3d/layers/i3s/I3SLodHandling":function(){define(["require","exports"],function(r,h){return function(){function f(a,e,c){this.layerViewRequiredFunctions=a;this.layerViewOptionalFunctions=
- e;this.lodGlobalDirtyChanged=c}f.prototype.startNodeLoading=function(a,e,c,f,d,b){this._lodGlobalDirty=!1;this._maxLodLevel=b.maxLodLevel;this._nodeIndex=f;this._rootId=d;this._nodeTraversalState=c;this._isNodeVisible=a;this._isGeometryVisible=e;this.lodGlobalDirtyChanged(this._lodGlobalDirty)};f.prototype.shouldLoadNode=function(a){var e=this._nodeTraversalState(a.id);return e.isChosen?e.lodLevel===this._maxLodLevel?!0:this.childrenEmpty(a):!1};f.prototype.setLodGlobalDirty=function(){this._lodGlobalDirty=
- !0;this.lodGlobalDirtyChanged(this._lodGlobalDirty)};f.prototype.lodSwapBundleLoaded=function(a){this.setLodGlobalDirty()};Object.defineProperty(f.prototype,"requiresLODGlobalHandling",{get:function(){return null!=this._rootId&&(!0===this._lodGlobalDirty||1.1<this.layerViewRequiredFunctions.getMemoryUsage())},enumerable:!0,configurable:!0});f.prototype.lodGlobalHandling=function(){if(this.requiresLODGlobalHandling){var a=this._rootId,e=this.layerViewRequiredFunctions.getMemoryUsage();this._lodGlobalHandlingRecursion(a,
- {removeNodes:Math.max(0,Math.floor(10*(e-1)))});this._lodGlobalDirty=!1;this.lodGlobalDirtyChanged(this._lodGlobalDirty)}};f.prototype._lodGlobalHandlingRecursion=function(a,e){var c=this._nodeIndex[a];if(null==c)return!1;a=this._nodeTraversalState(a);var f=a.isChosen&&(!a.nodeHasLOD||a.lodLevel===this._maxLodLevel);(a=this.layerViewRequiredFunctions.isBundleLoaded(c))&&null!=this.layerViewOptionalFunctions.setPolygonOffset&&this.layerViewOptionalFunctions.setPolygonOffset(c,!f);if(f&&a)return this._removeChildrenRecursive(c),
- !0;var d=!1;if(null!=c.children&&0!==c.children.length)for(var d=!0,b=0,h=c.children;b<h.length;b++){var l=h[b],p=this._nodeIndex[l.id];if(p?this._isGeometryVisible(p):this._isNodeVisible(l))l=this._lodGlobalHandlingRecursion(l.id,e),d=d&&l}a&&!f&&(d||0<e.removeNodes)&&(this.layerViewRequiredFunctions.removeNodeData(c),e.removeNodes--,a=!1);e=!c.featureData||0===c.featureData.length;return d||a||e};f.prototype._removeChildrenRecursive=function(a){if(null!=a.children){var e=0;for(a=a.children;e<a.length;e++){var c=
- this._nodeIndex[a[e].id];null!=c&&(this._removeChildrenRecursive(c),this.layerViewRequiredFunctions.removeNodeData(c))}}};f.prototype._subtreeEmpty=function(a){return this.layerViewRequiredFunctions.isBundleLoaded(a)?!1:this.childrenEmpty(a)};f.prototype.childrenEmpty=function(a){if(null==a.children)return!0;var e=0;for(a=a.children;e<a.length;e++){var c=a[e];if(this._isNodeVisible(c)&&(c=this._nodeIndex[c.id],null!=c&&!this._subtreeEmpty(c)))return!1}return!0};return f}()})},"esri/views/3d/layers/i3s/I3SNodeLoader":function(){define("require exports dojo/Deferred dojo/_base/lang dojo/errors/CancelError ../../../../core/promiseUtils ../../../../core/urlUtils ./I3SBinaryReader ./I3SUtil ../../webgl-engine/lib/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){r=function(){function h(a,b,d,e,f){this.logger=b;this.defaultGeometrySchema=d;this.requiredAttributes=e;this.options=f;this.loadShared=function(a){if(null==a.sharedResource)return c.resolve({});var b=g.makeAbsolute(a.sharedResource.href,a.baseUrl);return this.loadJSON(b).then(function(a){h.fixTextureEncodings(a);h.addAbsoluteHrefTexture(a,b);return a})};this.loader=a;this.cancelled=!1}h.prototype.cancel=function(){this.cancelled=!0};h.prototype.loadJSON=function(a){var b=
- this.loader.request(a,"json"),c=new f;b.then(function(a,b){c.resolve(b)},function(b){c.reject(Error("Failed to load: "+a))});return c.promise};h.prototype.loadBinary=function(a){var b=this.loader.request(a,"binary"),c=new f;b.then(function(a,b){c.resolve(b)},function(b){c.reject(Error("Failed to load: "+a))});return c.promise};h.prototype.loadImage=function(a){var b=this.loader.request(a,"image"),c=new f;b.then(function(a,b){c.resolve(b)},function(b){c.reject(Error("Failed to load: "+a))});return c.promise};
- h.prototype.loadAttribute=function(a,b,c){a=g.makeAbsolute(c,a);return this.loadBinary(a).then(function(a){return d.readBinaryAttribute(b,a)})};h.prototype.loadAttributes=function(a,b,d){var e=this,f=d.map(function(d){return null==a.attributeData||null==a.attributeData[d.index]?(e.logger.error("Missing attributeData for '"+d.name+"' on node '"+a.id+"'"),c.resolve(null)):e.loadAttribute(b,d.attributeStorageInfo,a.attributeData[d.index].href).catch(function(b){e.logger.error("Failed to load attributeData for '"+
- d.name+"' on node '"+a.id+"'");return null})});return c.all(f).then(function(a){for(var b={},c=0;c<d.length;++c)a[c]&&(b[d[c].name]=a[c]);return b})};h.prototype.prepareBinaryGeometryData=function(c,e,f,g){a.mixin(c.geometries[0].params,f);g||null!=f.vertexAttributes.region||delete f.vertexAttributes.region;if(null!=f.featureAttributes){g=f.featureAttributes;if(g.faceRange){var h=d.createTypedView(e,g.faceRange);c.componentOffsets=b.convertFlatRangesToOffsets(h,f.header.fields.featureCount,g.faceRange.valuesPerElement)}if(g.id){c.featureIds=
- [];var h=1,k=d.valueType2TypedArrayClassMap[g.id.valueType];"UInt64"===g.id.valueType&&(k=Uint32Array,h=2);e=new k(e,g.id.byteOffset,g.id.count*g.id.valuesPerElement*h);for(k=0;k<f.header.fields.featureCount;k++)if(c.featureIds[k]=e[k*g.id.valuesPerElement*h],2===h){var l=e[k*g.id.valuesPerElement*h+1];if(2097150<=l)throw Error("ID exceeded maximum range supported by javascript (max \x3d 53bit-1 \x3d 9007199254740991)");c.featureIds[k]+=4294967296*l}}}};h.prototype.loadBundleData=function(a,b){var e=
- this,f=a.baseUrl,h=null,k=this.loadShared(a),l=null;null!=this.requiredAttributes&&(l=this.loadAttributes(a,f,this.requiredAttributes));var m=null;null!=a.geometryData&&(f=g.makeAbsolute(a.geometryData[b].href,f),m=this.loadBinary(f));return k.then(function(f){e.handleCancelled();return(e.options.loadFeatureData?e.loadFeatureData(a,b):c.resolve(null)).then(function(b){e.handleCancelled();var g=e.options.loadFeatureData?e.collectGeometries(a,b,f):e.meshPyramidGeometryData(a,f);b=null!=m?m.then(function(a){h=
- a;var b=Object.keys(f.materialDefinitions)[0],b=f.materialDefinitions[b].params.vertexRegions,c=d.createGeometryDataIndex(a,e.defaultGeometrySchema,b);e.prepareBinaryGeometryData(g[0],a,c,b);return g}):c.resolve(g);var k=e.loadTextures(g,f);return c.all([k,b,l])}).then(function(a){var b=a[0],c=a[1];a=a[2];e.handleCancelled();var d=null;a&&(d={attributeData:a,loadedAttributes:e.requiredAttributes});return{allGeometryData:c,attributeDataInfo:d,geometryBuffer:h,sharedResource:f,textureData:b}})})};h.addAbsoluteHrefTexture=
- function(a,b){a=a.textureDefinitions;if(null!=a)for(var c=0,d=Object.keys(a);c<d.length;c++)for(var e=0,f=a[d[c]].images;e<f.length;e++){var h=f[e];Array.isArray(h.href)?h.hrefConcat=h.href.map(function(a){return g.makeAbsolute(a,b)}):h.hrefConcat=g.makeAbsolute(h.href,b)}};h.fixTextureEncodings=function(a){a=a.textureDefinitions;if(null!=a)for(var b in a){var c=a[b];if(Array.isArray(c.encoding))for(var d=0;d<c.encoding.length;d++){var e=c.encoding[d];"data:"===e.substring(0,5)&&(c.encoding[d]=e.substring(5))}else e=
- c.encoding,"data:"===e.substring(0,5)&&(c.encoding=e.substring(5))}};h.prototype.loadTexture=function(a,c,d,e){var f=this;return e===b.DDS_ENCODING_STRING?this.loadBinary(a).then(function(a){f.handleCancelled();return{i3sTexId:c,data:a,encoding:e}}):this.loadImage(a).then(function(a){var b=a;f.handleCancelled();if(d&&4096<=a.width*a.height){var b=Math.ceil(a.width/2),g=Math.ceil(a.height/2),h=document.createElement("canvas");h.width=b;h.height=g;h.getContext("2d").drawImage(a,0,0,b,g);b=h}return{i3sTexId:c,
- data:b,encoding:e}})};h.prototype.loadTextures=function(a,d){for(var e=[],f=0;f<a.length;f++){var g=a[f].geometries;if(null!=g)for(var l=0;l<g.length;l++){var n=g[l].params.textureID||"none";if("none"!==n){null!=d.textureDefinitions&&null!=d.textureDefinitions[n]||this.logger.warn("textureDefinitions missing in shared resource. i3sTexId: "+n);var m=d.textureDefinitions[n];k.assert(void 0!==m,"geometry wants unknown texture "+n);if(0!==m.images.length){var p=m.images[m.images.length-1],r=this.options.textureFormat===
- h.TextureFormat.Downsampled,C=b.getAppropriateTextureEncoding(m.encoding,this.options.textureFormat===h.TextureFormat.Compressed),m=-1<C?m.encoding[C]:m.encoding,p=-1<C?p.hrefConcat[C]:p.hrefConcat;this.options.loadTextureData?e.push(this.loadTexture(p,n,r,m)):e.push({i3sTexId:n,encoding:m,data:null})}}}}return c.all(e)};h.prototype.meshPyramidGeometryData=function(a,b){a=b.materialDefinitions?Object.keys(b.materialDefinitions)[0]:null;b=b.textureDefinitions?Object.keys(b.textureDefinitions)[0]:null;
- return[{featureIds:[],geometries:[{type:"ArrayBufferView",params:{materialID:a,textureID:b}}],featureDataPosition:[0,0,0]}]};h.prototype.collectGeometries=function(a,b,c){a=[];c=0;for(b=b.featureData;c<b.length;c++){var d=b[c],e=d.geometries;if(null!=e)for(var f=0;f<e.length;f++)a.push({featureIds:[d.id],featureDataPosition:d.position,geometries:[d.geometries[f]]});else null!=d.position&&a.push({featureIds:[d.id],featureDataPosition:d.position,geometries:null})}return a};h.prototype.loadFeatureData=
- function(a,b){a=g.makeAbsolute(a.featureData[b].href,a.baseUrl);return this.loadJSON(a)};h.prototype.handleCancelled=function(){if(this.cancelled)throw new e;};return h}();(function(a){a=a.TextureFormat||(a.TextureFormat={});a[a.Compressed=0]="Compressed";a[a.Normal=1]="Normal";a[a.Downsampled=2]="Downsampled"})(r||(r={}));return r})},"esri/views/3d/layers/i3s/I3SViewportQueries":function(){define("require exports ../../../../geometry/Point ../graphics/ElevationContext ../graphics/featureExpressionInfoUtils ../graphics/Graphics3DSymbolCommonCode ./I3SUtil ../../lib/glMatrix ../../support/orientedBoundingBox ../../support/projectionUtils ../../webgl-engine/lib/Util".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l){return function(){function h(b,c,g,h,k,l,m,p,r){void 0===r&&(r={});this.indexSR=b;this._renderCoordsHelper=c;this.extent=k;this.errorMetricPreference=l;this.elevationProvider=m;this.options=r;this._computedOBBs={};this._computedMBSs={};this._isNodeVisibleCached={};this.fp=[];this._idleCamera=!0;this.maxDistance=0;this.maxLodLevel=2;this._tmp1=[0,0,0];this._tmp2=[0,0,0];this._tmp3=[0,0,0];this._tmp0=[0,0,0];this.supportedMetrics=["screenSpaceRelative","maxScreenThreshold",
- "removedFeatureDiameter","distanceRangeFromDefaultCamera"];this.screenspaceErrorBias=r.screenspaceErrorBias||1;this.progressiveLoadFactor=r.progressiveLoadFactor||1;this.enableLoD=!r.disableLod;for(c=0;8>c;++c)this.fp[c]=d.vec4d.create();this.updateCamera(g);this._poi=d.vec3d.create(h);this.engineSR=this._renderCoordsHelper.spatialReference;p?(this._elevationContext=new a,this._elevationContext.featureExpressionInfoContext=e.createContext(e.extractExpressionInfo(p,!1)),this._elevationContext.mixinApi(p)):
- this._elevationContext=null;this.tmpPoint=new f({x:0,y:0,z:0,spatialReference:b})}h.prototype.updateCamera=function(a){l.matrix2frustumPlanes(a.viewMatrix,a.projectionMatrix,this.fp);this._screenSizeFactor=1/a.perPixelRatio;this._camPos=a.eye;this._isNodeVisibleCached={}};h.prototype.updatePointOfInterest=function(a){d.vec3d.set(a,this._poi);this.maxDistance=0};h.prototype.updateScreenSpaceErrorBias=function(a){this.screenspaceErrorBias=a};h.prototype.setCameraIdle=function(a){this._idleCamera!==
- a&&(this._idleCamera=a,this._isNodeVisibleCached={})};h.prototype.updateExtent=function(a){this.extent=a;this._isNodeVisibleCached={}};h.prototype.computeMbs=function(a){var b=this._computedMBSs[a.id];b||(b=d.vec4d.createFrom(a.mbs[0],a.mbs[1],a.mbs[2],-1),this._computedMBSs[a.id]=b);0>b[3]&&(d.vec4d.set(a.mbs,b),this._elevationContext&&1E5>b[3]&&(this.tmpPoint.x=b[0],this.tmpPoint.y=b[1],this.tmpPoint.z=b[2],b[2]=c.computeElevation(this.elevationProvider,this.tmpPoint,this._elevationContext,this._renderCoordsHelper,
- null)),k.mbsToMbs(b,this.indexSR,b,this.engineSR));return b};h.prototype.computeObb=function(a){if(a.obb&&!(0>a.obb.halfSize[0])){var e=this._computedOBBs[a.id];e||(e=b.clone(a.obb),e.halfSize[0]=-1,this._computedOBBs[a.id]=e);0>e.halfSize[0]&&(e.halfSize[0]=a.obb.halfSize[0],d.vec3d.set(a.obb.center,e.center),this._elevationContext&&1E5>a.mbs[3]&&(this.tmpPoint.x=a.obb.center[0],this.tmpPoint.y=a.obb.center[1],this.tmpPoint.z=a.obb.center[2],e.center[2]=c.computeElevation(this.elevationProvider,
- this.tmpPoint,this._elevationContext,this._renderCoordsHelper,null)),k.bufferToBuffer(e.center,this.indexSR,0,e.center,this.engineSR,0,1));return e}};h.prototype._isNodeVisible=function(a){a=this.computeMbs(a);return this.isMBSinExtent(a)&&this.isMBSVisible(a)};h.prototype.isNodeVisible=function(a){if(!this.enableLoD)return!0;if(!this._idleCamera)return this._isNodeVisible(a);if(null!=this._isNodeVisibleCached[a.id])return this._isNodeVisibleCached[a.id];this._isNodeVisibleCached[a.id]=this._isNodeVisible(a);
- return this._isNodeVisibleCached[a.id]};h.prototype.isGeometryVisible=function(a){return this.isNodeVisible(a)?(a=this.computeObb(a))?b.isVisible(a,this.fp):!0:!1};h.prototype.invalidateCache=function(a){if(null==a){for(var b=0,c=Object.keys(this._computedMBSs);b<c.length;b++)a=c[b],this._computedMBSs[a][3]=-1;b=0;for(c=Object.keys(this._computedOBBs);b<c.length;b++)a=c[b],this._computedOBBs[a].halfSize[0]=-1}else this._computedMBSs[a]&&(this._computedMBSs[a][3]=-1),this._computedOBBs[a]&&(this._computedOBBs[a].halfSize[0]=
- -1)};h.prototype.isMBSinExtent=function(a){return this.extent?0!==g.intersectBoundingBoxWithMbs(this.extent,a):!0};h.prototype.isMBSVisible=function(a){var b=a[0],c=a[1],d=a[2];a=a[3];var e=this.fp;return e[0][0]*b+e[0][1]*c+e[0][2]*d+e[0][3]<=a&&e[1][0]*b+e[1][1]*c+e[1][2]*d+e[1][3]<=a&&e[2][0]*b+e[2][1]*c+e[2][2]*d+e[2][3]<=a&&e[3][0]*b+e[3][1]*c+e[3][2]*d+e[3][3]<=a&&e[4][0]*b+e[4][1]*c+e[4][2]*d+e[4][3]<=a&&e[5][0]*b+e[5][1]*c+e[5][2]*d+e[5][3]<=a};h.prototype.calcScreenSpaceSize=function(a,b){a=
- this.computeMbs(a);var c=a[3];a=d.vec3d.dist2(a,this._camPos)-c*c;return 0>a?.5*Number.MAX_VALUE:b/Math.sqrt(a)*this._screenSizeFactor};h.prototype.calcCameraDistance=function(a){a=this.computeMbs(a);return Math.max(0,d.vec3d.dist(a,this._camPos)-a[3])};h.prototype.calcAngleDependentLoD=function(a){a=this.computeMbs(a);var b=a[3];a=(Math.abs(a[0]*(a[0]-this._camPos[0])+a[1]*(a[1]-this._camPos[1])+a[2]*(a[2]-this._camPos[2]))/d.vec3d.length(a)+b)/d.vec3d.dist(a,this._camPos);return Math.min(1,a)};
- h.prototype.hasLOD=function(a){return null!=a.lodSelection};h.prototype.hasFeatures=function(a){return null!=a.featureData};h.prototype.getDistancePlanarMode=function(a,b,c){var d=a[0]-b[0],e=a[1]-b[1];a=a[2]-b[2];d=d+d+e*e;if(d<=c*c)return Math.abs(a);c=Math.sqrt(d)-c;return Math.sqrt(a*a+c*c)};h.prototype.getDistanceGlobeMode=function(a,b,c){var e=d.vec3d.length(b),f=d.vec3d.length(a)-e;d.vec3d.scale(a,d.vec3d.dot(a,b)/d.vec3d.length2(a),this._tmp0);if(d.vec3d.dist2(b,this._tmp0)<=c*c)return Math.abs(f);
- b=d.vec3d.scale(b,1/e,this._tmp0);var e=d.vec3d.scale(b,e-c*c/2/e,this._tmp1),g=d.vec3d.subtract(a,e,this._tmp2),g=d.vec3d.subtract(g,d.vec3d.scale(b,d.vec3d.dot(b,g),this._tmp3),this._tmp2),e=d.vec3d.add(e,d.vec3d.scale(g,c/d.vec3d.length(g),this._tmp2),this._tmp2);c=d.vec3d.dist(a,e);2E5<=f&&(a=d.vec3d.subtract(a,e,this._tmp1),a=d.vec3d.dot(a,b)/d.vec3d.length(a),.08>a&&(a=1E-4),c/=a);return c};h.prototype.getDistance=function(a,b,c){return this.engineSR===k.SphericalECEFSpatialReference?this.getDistanceGlobeMode(a,
- b,c):this.getDistancePlanarMode(a,b,c)};h.prototype._selectErrorMetric=function(a){if(this.errorMetricPreference)for(var b=0;b<this.errorMetricPreference.length;b++)for(var c=0;c<a.length;c++){if(a[c].metricType===this.errorMetricPreference[b])return a[c]}else for(b=0;b<a.length;b++)if(0<=this.supportedMetrics.indexOf(a[b].metricType))return a[b];return null};h.prototype.getLodLevel=function(a){if(!a.lodSelection||0>=a.lodSelection.length||!1===this.hasFeatures(a))return 0;if(null==a.children||0===
- a.children.length)return this.maxLodLevel;var b=this.enableLoD?this._selectErrorMetric(a.lodSelection):null;if(null==b)return 0;if(1>this.progressiveLoadFactor){var c=this.screenspaceErrorBias;return this.evaluateLODmetric(a,this.progressiveLoadFactor*this.screenspaceErrorBias,b)?this.evaluateLODmetric(a,c,b)?2:1:0}return this.evaluateLODmetric(a,this.screenspaceErrorBias,b)?this.maxLodLevel:0};h.prototype.evaluateLODmetric=function(a,b,c){return"screenSpaceRelative"===c.metricType?(a=this.computeMbs(a),
- a=2*this.getDistance(this._camPos,a,a[3])/this._screenSizeFactor,c.maxError*b<=a):"maxScreenThreshold"===c.metricType?(b=this.calcScreenSpaceSize(a,a.mbs[3]*b),this.options.angleDependentLoD&&(b*=this.calcAngleDependentLoD(a)),b<c.maxError):"removedFeatureDiameter"===c.metricType?10>this.calcScreenSpaceSize(a,c.maxError)*b:"distanceRangeFromDefaultCamera"===c.metricType?this.calcCameraDistance(a)>c.maxError*b:!1};h.prototype.distToPOI=function(a){a=this.computeMbs(a);a=d.vec3d.dist(a,this._poi)-a[3];
- this.maxDistance=Math.max(this.maxDistance,a);return a};h.prototype.distCameraToPOI=function(){return d.vec3d.dist(this._camPos,this._poi)};return h}()})},"esri/views/3d/layers/i3s/IdleQueue":function(){define(["require","exports","dojo/Deferred"],function(r,h,f){Object.defineProperty(h,"__esModule",{value:!0});r=function(){function a(){this._deferreds=[];this._values=[]}a.prototype.push=function(a){var c=new f;this._deferreds.push(c);this._values.push(a);return c.promise};a.prototype.length=function(){return this._deferreds.length};
- a.prototype.process=function(){this._deferreds.shift().resolve(this._values.shift())};a.prototype.cancelAll=function(){for(var a=0,c=this._deferreds;a<c.length;a++)c[a].cancel();this._deferreds.length=0;this._values.length=0};return a}();h.IdleQueue=r})},"esri/views/3d/layers/ElevationLayerView3D":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Error ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ./TiledLayerView3D ./support/tiledLayerUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k){return function(b){function h(){return null!==b&&b.apply(this,arguments)||this}f(h,b);h.prototype.initialize=function(){var a=this,b=this.get("view.map.ground.layers"),d=this.get("view.map.allLayers"),d=d&&d.includes(this.layer),b=b&&b.includes(this.layer);d&&!b&&(b=new e("layerview:elevation-layer-only","3D elevation layer '"+this.layer.id+"' can only be added in the map ground"),this.addResolvingPromise(c.reject(b)));(b=this._getTileInfoSupportError(this.tileInfo,this.layer.fullExtent))?
- this.addResolvingPromise(c.reject(b)):(b=g.whenTrueOnce(this.view,"basemapTerrain.tilingSchemeLocked").then(function(){k.throwIfError(a._getTileInfoCompatibilityError(a.tileInfo,a.view.basemapTerrain.tilingScheme))}),this.addResolvingPromise(b));this.addResolvingPromise(k.checkArcGISServiceVersionCompatibility(this.layer));this._updateMinMaxDataLevel()};a([d.property({aliasOf:"layer.fullExtent"})],h.prototype,"fullExtent",void 0);a([d.property()],h.prototype,"layer",void 0);a([d.property({aliasOf:"layer.tileInfo"})],
- h.prototype,"tileInfo",void 0);return h=a([d.subclass("esri.views.3d.layers.ElevationLayerView3D")],h)}(d.declared(b))})},"esri/views/3d/layers/TiledLayerView3D":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Error ../../../core/accessorSupport/decorators ./LayerView3D ./support/LayerViewUpdatingPercentage ../terrain/terrainUtils".split(" "),function(r,h,f,a,e,c,g,d,b){return function(d){function g(){var a=null!==d&&d.apply(this,
- arguments)||this;a.minDataLevel=0;a.maxDataLevel=Infinity;a._isUpdating=!1;return a}f(g,d);Object.defineProperty(g.prototype,"formatIsTransparent",{get:function(){return!0},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"isTransparent",{get:function(){return 1>this.fullOpacity||this.formatIsTransparent},enumerable:!0,configurable:!0});g.prototype.getTileUrl=function(a,b,c){return this.layer.getTileUrl(a,b,c)};g.prototype._evaluateUpdatingState=function(a){this._isUpdating=a;this.notifyChange("updating")};
- g.prototype.isUpdating=function(){return this._isUpdating};g.prototype._getTileInfoSupportError=function(a,c){if(a=b.checkIfTileInfoSupportedForView(a,c,this.view.spatialReference,this.view.basemapTerrain.manifold)){c={layer:this.layer,error:a};var d=void 0;switch(a.name){case "tilingscheme:local-gcs-not-supported":d=new e("layerview:local-gcs-not-supported","Geographic coordinate systems are not supported in local scenes",c);break;case "tilingscheme:spatial-reference-mismatch":case "tilingscheme:global-unsupported-spatial-reference":d=
- new e("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",c);break;default:d=new e("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",c)}return d}return null};g.prototype._getTileInfoCompatibilityError=function(a,b){return b.compatibleWith(a)?null:new e("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")};
- g.prototype._updateMinMaxDataLevel=function(){var a=Infinity,b=0;this.tileInfo.lods.forEach(function(c){a=Math.min(c.level,a);b=Math.max(c.level,b)});c=[a,b];this.minDataLevel=c[0];this.maxDataLevel=c[1];var c};a([c.property({readOnly:!0})],g.prototype,"formatIsTransparent",null);a([c.property()],g.prototype,"fullExtent",void 0);a([c.property({readOnly:!0,dependsOn:["fullOpacity","formatIsTransparent"]})],g.prototype,"isTransparent",null);a([c.property()],g.prototype,"layer",void 0);a([c.property()],
- g.prototype,"minDataLevel",void 0);a([c.property()],g.prototype,"maxDataLevel",void 0);a([c.property()],g.prototype,"tileInfo",void 0);return g=a([c.subclass("esri.views.3d.layers.TiledLayerView3D")],g)}(c.declared(g,d))})},"esri/views/3d/layers/support/tiledLayerUtils":function(){define("require exports dojo/request/xhr ../../../../core/Error ../../../../core/promiseUtils ../../../../layers/support/arcgisLayerUrl".split(" "),function(r,h,f,a,e,c){function g(a){var b=null,c=a.search(/\/rest\/services\//i);
- 0<c&&(b=a.substring(0,c+6));return b}Object.defineProperty(h,"__esModule",{value:!0});h.checkArcGISServiceVersionCompatibility=function(d){if(!c.isHostedAgolService(d.url)){if(10.22>d.version)return d=new a("layerview:service-version-too-old","Tiled Map Layers on servers prior to 10.2.2 are not supported. Detected version: "+d.version,{minVersion:10.22,detectedVersion:d.version}),e.reject(d);if(10.22!==d.version||c.isHostedSecuredProxyService(d.url,d.get("portalItem.id")))return e.resolve();d=g(d.url);
- var b=new a("tiledlayerview3d:service-missing-cors-patch","Tiled Map Layers from 10.2.2 servers are only supported if all server updates have been applied.");return f(d+"self?f\x3djson",{headers:{"X-Requested-With":null},timeout:1E4,handleAs:"json"}).then(function(a){if(!a||a.error)throw b;}).catch(function(){throw b;})}};h.throwIfError=function(a){if(a)throw a;}})},"esri/views/3d/layers/FeatureLayerView3D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Error ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../layers/FeatureLayer ../../../layers/graphics/controllers/SnapshotController ../../../layers/graphics/controllers/support/controllerUtils ./GraphicLayerView3DBase ../../layers/RefreshableLayerView".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n){return function(h){function n(a){var c=h.call(this)||this;c.labelingEnabled=a.layer instanceof b;return c}f(n,h);p=n;n.prototype.initialize=function(){this.addResolvingPromise(this.validateMaximumFeatureCount())};n.prototype.createController=function(){var a=this;return this.layer.createGraphicsController({layerView:this,options:{maxPageSize:300,extent:this.view.clippingArea}}).then(function(b){b instanceof k&&a._eventHandles.push(g.whenFalseOnce(a,"suspended",
- function(){b.startup()}));return b}).catch(function(a){return c.reject(new e("featurelayerview3d:create-controller",a.message,{error:a}))})};n.prototype.validateMaximumFeatureCount=function(){return 0>p.maximumFeatureCount||!this.layer.url?c.resolve():this.layer.queryFeatureCount().then(function(a){if(a>p.maximumFeatureCount)throw new e("featurelayerview3d:maximum-feature-count-exceeded","The maximum number of allowed features (${maximumFeatureCount}) has been exceeded (layer has ${numberOfFeatures} features)",
- {maximumFeatureCount:p.maximumFeatureCount,numberOfFeatures:a});})};n.prototype.doRefresh=function(){!this.suspended&&l.isRefreshable(this.controller)&&this.controller.refresh()};n.maximumFeatureCount=-1;a([d.property()],n.prototype,"controller",void 0);return n=p=a([d.subclass("esri.views.3d.layers.FeatureLayerView3D")],n);var p}(d.declared(p,n))})},"esri/layers/graphics/controllers/support/controllerUtils":function(){define(["require","exports"],function(r,h){Object.defineProperty(h,"__esModule",
- {value:!0});h.isRefreshable=function(f){return f&&f.refresh}})},"esri/views/3d/layers/GraphicLayerView3DBase":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper dojo/promise/all ../../../core/Error ../../../core/promiseUtils ../../../core/watchUtils ../../../core/accessorSupport/decorators ../../../layers/graphics/QueryEngine ../../../renderers/support/renderingInfoUtils ./LayerView3D ./graphics/Graphics3DLayerViewCore ./graphics/graphicUtils ./support/LayerViewUpdatingPercentage ./support/projectExtentUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q){return function(h){function p(a){a=h.call(this)||this;a.supportsHeightUnitConversion=!0;a.controller=null;a.supportsDraping=!0;a._overlayUpdating=null;a._progressMaxNumNodes=0;a._eventHandles=[];a._controllerClientSideFiltering=!1;a._suspendResumeExtent=null;a.fullExtentInViewSpatialReference=null;a._isUpdating=!1;a._controllerCreated=!1;return a}f(p,h);Object.defineProperty(p.prototype,"drawingOrder",{set:function(a){this._layerViewCore.graphicsCore.setDrawingOrder(a);
- this._set("drawingOrder",a)},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"hasDraped",{get:function(){return this._layerViewCore.graphicsCore.hasDraped},enumerable:!0,configurable:!0});p.prototype.initialize=function(){var a=this;this._layerViewCore=new n({owner:this,layer:this.layer,spatialIndexRequired:!0,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,labelingEnabled:this.labelingEnabled,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,verticalScaleEnabled:this.supportsHeightUnitConversion,
- highlightsEnabled:!0,updateSuspendResumeExtent:function(){return a.updateSuspendResumeExtent()},updateClippingExtent:function(b){return a.updateClippingExtent(b)}});this.addResolvingPromise(this._layerViewCore.initialize());this.drawingOrder=this.view.getDrawingOrder(this.layer.uid);this.initializeController();this.addResolvingPromise(this.validateGeometryType());var b=q.toView(this).then(function(b){a.fullExtentInViewSpatialReference=b});b&&this.addResolvingPromise(b);this._evaluateUpdatingState()};
- p.prototype.destroy=function(){this._eventHandles.forEach(function(a){return a.remove()});this._eventHandles=null;this.controller&&(this.controller.destroy(),this.controller=null);this._layerViewCore&&(this._layerViewCore.destroy(),this._layerViewCore=null);this.loadedGraphics=null};p.prototype.getRenderingInfo=function(a){if((a=l.getRenderingInfo(a,{renderer:this.layer.renderer}))&&a.color){var b=a.color;b[0]/=255;b[1]/=255;b[2]/=255}return a};p.prototype.getGraphicsFromStageObject=function(a,b){var c=
- a.getMetadata().graphicId,d=null;this.loadedGraphics&&this.loadedGraphics.some(function(a){return a.uid===c?(d=a,!0):!1});return g.create(function(a,b){null!==d?a(d):b()})};p.prototype.getGraphics3DGraphics=function(){return this._layerViewCore.graphicsCore.getGraphics3DGraphics()};p.prototype.getGraphics3DGraphicsKeys=function(){return this._layerViewCore.graphicsCore.getGraphics3DGraphicsKeys()};p.prototype.getSymbolUpdateType=function(){return this._layerViewCore.graphicsCore.getSymbolUpdateType()};
- p.prototype.queryGraphics=function(){return this._queryEngine?this._queryEngine.queryFeatures():this._rejectQuery()};p.prototype.queryFeatures=function(a){return this._queryEngine?this._queryEngine.queryFeatures(a):this._rejectQuery()};p.prototype.queryObjectIds=function(a){return this._queryEngine?this._queryEngine.queryObjectIds(a):this._rejectQuery()};p.prototype.queryFeatureCount=function(a){return this._queryEngine?this._queryEngine.queryFeatureCount(a):this._rejectQuery()};p.prototype.queryExtent=
- function(a){return this._queryEngine?this._queryEngine.queryExtent(a):this._rejectQuery()};p.prototype.whenGraphicBounds=function(a,b){return this._layerViewCore.graphicsCore.whenGraphicBounds(a,b)};p.prototype.highlight=function(a,b){return this._layerViewCore.highlight(a,b,this.layer.objectIdField)};p.prototype._rejectQuery=function(){return g.reject(new c("FeatureLayerView3D","Not ready to execute query"))};p.prototype._notifySuspendedChange=function(){this.notifyChange("suspended")};p.prototype._notifyDrapedDataChange=
- function(){this.notifyChange("hasDraped");this.emit("draped-data-change")};p.prototype.canResume=function(){return this.inherited(arguments)&&this._layerViewCore&&this._layerViewCore.canResume()};p.prototype._evaluateUpdatingState=function(){if(this._layerViewCore.elevationAlignment){var a;a=0+this._layerViewCore.elevationAlignment.numNodesUpdating();a+=this._layerViewCore.graphicsCore.numNodesUpdating();var b;b=(b=(b=(b=(b=!this._controllerCreated)||this.controller&&this.controller.updating)||this._overlayUpdating)||
- this._layerViewCore.graphicsCore.needsIdleUpdate())||!(this.view.basemapTerrain&&this.view.basemapTerrain.ready);var c;c=(c=0<a||b||this._layerViewCore.spatialIndex.isUpdating())||this._layerViewCore.elevationAlignment.isUpdating();this._progressMaxNumNodes=Math.max(a,this._progressMaxNumNodes);0===a&&(this._progressMaxNumNodes=1);this._isUpdating=c;this.notifyChange("updating");this._set("updatingPercentageValue",b?100:100*a/this._progressMaxNumNodes)}else this._isUpdating=!1,this.notifyChange("updating"),
- this._set("updatingPercentageValue",100)};p.prototype.isUpdating=function(){return this._isUpdating};p.prototype.initializeController=function(){var a=this,b=null,c=this.createController().then(function(a){b=a}),f=d.whenTrueOnce(this.view,"basemapTerrain.ready");e([this.when(),f]).then(function(){a.controller=b;a._eventHandles.push(a.controller.watch("updating",function(){return a._evaluateUpdatingState()}));a.loadedGraphics=b.graphics;a._queryEngine=new k({features:a.loadedGraphics,objectIdField:a.layer.objectIdField});
- a._evaluateUpdatingState()}).always(function(){a._controllerCreated=!0;a._evaluateUpdatingState()});this.addResolvingPromise(c)};p.prototype.updateClippingExtent=function(a){if(this.controller){if(this._controllerClientSideFiltering)return!1;this.controller.extent?(this.controller.extent=null,this._controllerClientSideFiltering=!0):this.controller.extent=a;return!0}return!1};p.prototype.updateSuspendResumeExtent=function(){return this._suspendResumeExtent=t.enlargeExtent(this._layerViewCore.graphicsCore.computedExtent,
- this._suspendResumeExtent,1.2)};p.prototype.validateGeometryType=function(){var a=this.layer;switch(a.geometryType){case "multipatch":case "multipoint":return g.reject(new c("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:a.geometryType}))}};p.prototype.getStats=function(){var a=this._layerViewCore.graphicsCore.getGraphics3DGraphics(),b="null",c=this._suspendResumeExtent;c&&(b=[c[0],c[1],c[2],c[3]].map(function(a){return a.toPrecision(4)}).join(", "));
- var c="null",d=this._layerViewCore.graphicsCore.computedExtent;d&&(c=[d.xmin,d.ymin,d.xmax,d.ymax].map(function(a){return a.toPrecision(4)}).join(", "));return{numCollection:this.loadedGraphics.length,numGraphics:Object.keys(a).length,numElevationUpdating:this._layerViewCore.elevationAlignment.numNodesUpdating(),numSpatialIndexUpdating:this._layerViewCore.spatialIndex.numNodesUpdating(),numGraphicsUpdating:this._layerViewCore.graphicsCore.numNodesUpdating(),visibilityFrustum:this._layerViewCore.frustumVisibility.canResume(),
- visibilityScale:this._layerViewCore.scaleVisibility.canResume(),resumeExtent:b,computedExtent:c,updating:this.updating,suspended:this.suspended}};p.maximumFeatureCount=-1;a([b.property()],p.prototype,"drawingOrder",null);a([b.property()],p.prototype,"loadedGraphics",void 0);a([b.property()],p.prototype,"symbolsUpdating",void 0);a([b.property()],p.prototype,"hasDraped",null);a([b.property()],p.prototype,"controller",void 0);return p=a([b.subclass("esri.views.3d.layers.GraphicsLayerView3DBase")],p)}(b.declared(p,
- u))})},"esri/renderers/support/renderingInfoUtils":function(){define(["require","exports"],function(r,h){function f(a,c){if(!a||a.symbol)return null;c=c.renderer;return a&&c&&c.getObservationRenderer?c.getObservationRenderer(a):c}function a(a,c){if(a.symbol)return a.symbol;var e=f(a,c);return e&&e.getSymbol(a,c)}Object.defineProperty(h,"__esModule",{value:!0});h.getRenderer=f;h.getSymbol=a;h.getRenderingInfo=function(e,c){var g=f(e,c),d=a(e,c);if(!d)return null;d={renderer:g,symbol:d};if(g){g.colorInfo&&
- (d.color=g.getColor(e).toRgba());if(g.sizeInfo){var b=g.getSize(e);d.size=[b,b,b]}if(g.visualVariables){e=g.getVisualVariableValues(e,c);b=["proportional","proportional","proportional"];for(c=0;c<e.length;c++){var h=e[c],g=h.variable,l=h.value;"color"===g.type?d.color=l.toRgba():"size"===g.type?"outline"===g.target?d.outlineSize=l:(h=g.axis,g=g.useSymbolValue?"symbolValue":l,"width"===h?b[0]=g:"depth"===h?b[1]=g:"height"===h?b[2]=g:b[0]="width-and-depth"===h?b[1]=g:b[1]=b[2]=g):"opacity"===g.type?
- d.opacity=l:"rotation"===g.type&&"tilt"===g.axis?d.tilt=l:"rotation"===g.type&&"roll"===g.axis?d.roll=l:"rotation"===g.type&&(d.heading=l)}if(isFinite(b[0])||isFinite(b[1])||isFinite(b[2]))d.size=b}}return d}})},"esri/views/3d/layers/graphics/Graphics3DLayerViewCore":function(){define("require exports ../../../../Graphic ../../../../core/Collection ../../../../core/Handles ../../../../core/promiseUtils ../../../../core/watchUtils ../../../../tasks/support/Query ./Graphics3DCore ./Graphics3DElevationAlignment ./Graphics3DFrustumVisibility ./Graphics3DHighlights ./Graphics3DLabeling ./Graphics3DScaleVisibility ./Graphics3DSpatialIndex ./Graphics3DVerticalScale ../support/attributeUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v){return function(){function h(a){var c=this;this._handles=new e;this.layer=a.layer;this.owner=a.owner;this.updateClippingExtent=a.updateClippingExtent;this.updateSuspendResumeExtent=a.updateSuspendResumeExtent;this.getGraphicsInExtent=a.getGraphicsInExtent;this.graphicsCore=new b(a.elevationFeatureExpressionEnabled);a.spatialIndexRequired&&(this.spatialIndex=new u);if(a.frustumVisibilityEnabled){this.frustumVisibility=new l;var d=this.owner.view.basemapTerrain;
- this._handles.add([this.owner.view.on("resize",function(){return c.frustumVisibility.viewChange()}),this.owner.view.state.watch("camera",function(){return c.frustumVisibility.viewChange()},!0),d.on("elevation-bounds-change",function(){return c.frustumVisibility.elevationBoundsChange()})]);"local"===this.owner.view.viewingMode?this.frustumVisibility.isVisibleBelowSurface=!0:this._handles.add(g.init(d,["opacity","wireframe"],function(){return c.frustumVisibility.isVisibleBelowSurface=d.isSeeThrough()}))}a.scaleVisibilityEnabled&&
- (a.spatialIndexRequired?(this.scaleVisibility=new t,this._handles.add(this.layer.watch("minScale,maxScale",function(){return c.scaleVisibility.layerMinMaxScaleChangeHandler()}))):console.warn("scaleVisibility requires a spatialIndex"));a.elevationAlignmentEnabled&&(this.elevationAlignment=new k,this._handles.add(this.layer.watch("elevationInfo",function(){return c.graphicsCore.elevationInfoChange()})));a.labelingEnabled&&(this.labeling=new n,this._handles.add(this.layer.watch("labelsVisible",function(){return c.labeling.labelVisibilityChanged()})),
- this._handles.add(this.layer.watch("labelingInfo",function(){return c.labeling.updateLabelingInfo()})));a.verticalScaleEnabled&&(this.verticalScale=new q({sourceSpatialReference:this.layer.spatialReference,destSpatialReference:this.owner.view.spatialReference}));a.highlightsEnabled&&(this.highlights=new p)}h.prototype.initialize=function(){var a=this;return this.whenSpatialIndexLoaded().then(function(){return a.deferredInitialize()})};h.prototype.whenSpatialIndexLoaded=function(){return this.spatialIndex?
- this.spatialIndex.whenLoaded():c.resolve()};h.prototype.deferredInitialize=function(){var a=this;this.spatialIndex&&this.spatialIndex.initialize(this.owner,this.layer,this.owner.view.spatialReference,this.graphicsCore);this.frustumVisibility&&this.frustumVisibility.initialize(this.owner);var b=this.owner.view.basemapTerrain,c=this.owner.view.elevationProvider;this.scaleVisibility&&this.scaleVisibility.initialize(this.owner,this.layer,this.spatialIndex,this.graphicsCore,b);this.elevationAlignment&&
- this.elevationAlignment.initialize(this.owner,function(b,c,d){return a._getGraphicsInExtent(b,c,d)},this.graphicsCore,c);this.labeling&&this.labeling.initialize(this.owner,this.layer,this.spatialIndex,this.graphicsCore,this.scaleVisibility);this.highlights&&this.highlights.initialize(this.graphicsCore);this.graphicsCore.initialize(this.owner,this.layer,this.elevationAlignment,this.scaleVisibility,this.spatialIndex,this.labeling,this.highlights,function(){a.updateSuspendResumeExtent&&a._updateSuspendResumeExtent(a.updateSuspendResumeExtent())},
- function(b){return a.verticalScale?a.verticalScale.adjust(b):b},b);this._handles.add([this.layer.watch("renderer",function(b){return a.graphicsCore.rendererChange(b)}),this.owner.watch("fullOpacity",function(){return a.graphicsCore.opacityChange()})]);this._handles.add(this.layer.on("graphic-update",function(b){return a.graphicsCore.graphicUpdateHandler(b)}));this.owner.view.resourceController.registerIdleFrameWorker(this,{needsUpdate:this._needsIdleUpdate,idleFrame:this._idleUpdate});this.updateClippingExtent&&
- (this._handles.add(this.owner.view.watch("clippingArea",function(){return a._updateClippingExtent()})),this._updateClippingExtent());if(this.labeling)return this.labeling.updateLabelingInfo()};h.prototype.destroy=function(){this.owner&&this.owner.view.resourceController.deregisterIdleFrameWorker(this);this._handles&&(this._handles.destroy(),this._handles=null);this.frustumVisibility&&(this.frustumVisibility.destroy(),this.frustumVisibility=null);this.scaleVisibility&&(this.scaleVisibility.destroy(),
- this.scaleVisibility=null);this.elevationAlignment&&(this.elevationAlignment.destroy(),this.elevationAlignment=null);this.labeling&&(this.labeling.destroy(),this.labeling=null);this.graphicsCore&&(this.graphicsCore.destroy(),this.graphicsCore=null);this.spatialIndex&&(this.spatialIndex.destroy(),this.spatialIndex=null);this.highlights&&(this.highlights.destroy(),this.highlights=null);this.owner=this.layer=null};h.prototype.highlight=function(b,c,e){var g=this;if(b instanceof d){c=this.highlights.acquireSet(c,
- e);var h=c.set,k=c.handle;this.owner.queryObjectIds(b).then(function(a){return g.highlights.setObjectIds(h,a)});return k}if("number"===typeof b||b instanceof f)return this.highlight([b],c,e);b instanceof a&&(b=b.toArray());if(Array.isArray(b)&&0<b.length){if(b[0]instanceof f)if(k=b,e&&k[0].attributes&&null!==v.attributeLookup(k[0].attributes,e))b=k.map(function(a){return v.attributeLookup(a.attributes,e)});else return b=k.map(function(a){return a.uid}),k=this.highlights.acquireSet(c,null),c=k.set,
- k=k.handle,this.highlights.setUids(c,b),k;if("number"===typeof b[0])return k=this.highlights.acquireSet(c,e),c=k.set,k=k.handle,this.highlights.setObjectIds(c,b),k}return{remove:function(){}}};h.prototype.canResume=function(){return(!this.frustumVisibility||this.frustumVisibility.canResume())&&(!this.scaleVisibility||this.scaleVisibility.canResume())};h.prototype._needsIdleUpdate=function(){return this.frustumVisibility&&this.frustumVisibility.needsIdleUpdate()||this.scaleVisibility&&this.scaleVisibility.needsIdleUpdate()||
- this.elevationAlignment&&this.elevationAlignment.needsIdleUpdate()||this.graphicsCore&&this.graphicsCore.needsIdleUpdate()?!0:!1};h.prototype._idleUpdate=function(a){this.frustumVisibility&&this.frustumVisibility.idleUpdate(a);this.scaleVisibility&&this.scaleVisibility.idleUpdate(a);this.elevationAlignment&&this.elevationAlignment.idleUpdate(a);this.graphicsCore&&this.graphicsCore.idleUpdate(a)};h.prototype._updateSuspendResumeExtent=function(a){this.frustumVisibility&&this.frustumVisibility.setExtent(a);
- this.scaleVisibility&&this.scaleVisibility.setExtent(a)};h.prototype._updateClippingExtent=function(){var a=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(a,this.owner.view.spatialReference)&&(this.updateClippingExtent(a)||this.graphicsCore.recreateAllGraphics())};h.prototype._getGraphicsInExtent=function(a,b,c){this.getGraphicsInExtent?this.getGraphicsInExtent(a,b,c):this.spatialIndex?this.spatialIndex.intersects(a,b,c):c([],0)};return h}()})},"esri/views/3d/layers/graphics/Graphics3DFrustumVisibility":function(){define("require exports ../../lib/glMatrix ../../support/aaBoundingBox ../../support/aaBoundingRect ../../support/earthUtils ../../support/intersectionUtils ../../support/mathUtils ../../support/projectionUtils".split(" "),
- function(r,h,f,a,e,c,g,d,b){var k=-.3*c.earthRadius;r=.5*Math.PI;var l=r/Math.PI*180,p=r*c.earthRadius,n=.9*c.earthRadius,t=function(){function c(){this.extent=Array(4);this.planes=Array(4);this.maxSpan=0;this.center={origin:f.vec3d.create(),direction:f.vec3d.create()};for(var a=0;4>a;a++)this.extent[a]={origin:f.vec3d.create(),originLength:0,direction:f.vec3d.create(),cap:{next:null,direction:f.vec3d.create()}},this.planes[a]=f.vec4d.create();this.planes[4]=f.vec4d.create()}c.prototype.toRenderBoundingExtent=
- function(c,g,h,k){e.center(c,q);q[2]=k;b.computeLinearTransformation(h,q,v,g);f.mat4d.inverse(v,x);a.set(m,a.NEGATIVE_INFINITY);for(var l=0,n=u;l<n.length;l++)for(var p=n[l],r=p.x0,t=p.x1,z=p.y0,p=p.y1,A=0;5>A;A++){var B=A/4;q[0]=d.lerp(c[r],c[t],B);q[1]=d.lerp(c[z],c[p],B);q[2]=k;b.vectorToVector(q,h,q,g);f.mat4d.multiplyVec3(x,q);a.expand(m,q)}f.mat4d.multiplyVec3(v,f.vec3d.set3(m[0],m[1],m[2],this.extent[0].origin));f.mat4d.multiplyVec3(v,f.vec3d.set3(m[3],m[1],m[2],this.extent[1].origin));f.mat4d.multiplyVec3(v,
- f.vec3d.set3(m[3],m[4],m[2],this.extent[2].origin));f.mat4d.multiplyVec3(v,f.vec3d.set3(m[0],m[4],m[2],this.extent[3].origin))};c.prototype.update=function(a,b,c,d,e,g){e=this.extent;this.toRenderBoundingExtent(a,c,d,g);f.vec3d.add(e[0].origin,e[2].origin,this.center.origin);f.vec3d.scale(this.center.origin,.5);b(this.center.origin,this.center.direction);for(c=0;4>c;c++)d=e[c],b(d.origin,d.direction),d.originLength=f.vec3d.length(d.origin),g=e[3===c?0:c+1],d.cap.next=g.origin,f.vec3d.direction(g.origin,
- d.origin,d.cap.direction),this._computePlane(d.cap.direction,d.direction,d.origin,this.planes[c]);this._computePlane(e[1].cap.direction,e[0].cap.direction,e[0].origin,this.planes[4]);this.maxSpan=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]))};c.prototype.isVisibleInFrustumGlobal=function(a){if(0>f.vec3d.dot(this.center.direction,a.direction))return!0;for(var b=0;4>b;b++)if(0>f.vec3d.dot(this.extent[b].direction,a.direction))return!0;return!1};c.prototype.isVisibleInFrustum=function(a,b,c){if("global"===
- a.viewingMode){if(this.maxSpan>(a.spatialReference.isWGS84?l:p))return!0;if(b.altitude>=n)return this.isVisibleInFrustumGlobal(b)}for(a=0;a<this.extent.length;a++)if(c=this.extent[a],g.frustumRay(b.planes,c.origin,null,c.direction)||g.frustumLineSegment(b.planes,c.origin,c.cap.next,c.cap.direction))return!0;for(a=0;a<b.lines.length;a++)if(c=b.lines[a],g.frustumLineSegment(this.planes,c.origin,c.endpoint,c.direction))return!0;return!1};c.prototype._computePlane=function(a,b,c,d){f.vec3d.cross(a,b,
- d);d[3]=-f.vec3d.dot(d,c)};return c}();c=function(){function a(){this.frustumVisibilityDirty=this.frustumVisibility=!0;this.extent=null;this.extentEngine=new t;this.extentEngineDirty=!0;this.renderSREqualsViewSR=null;this._isVisibleBelowSurface=!1;this.layerView=null}a.prototype.initialize=function(a){this.layerView=a;this.renderSREqualsViewSR=a.view.renderSpatialReference.equals(a.view.spatialReference)};a.prototype.destroy=function(){this.extentEngine=this.extent=this.layerView=null};a.prototype.needsIdleUpdate=
- function(){return this.frustumVisibilityDirty};a.prototype.canResume=function(){return this.frustumVisibility};a.prototype.setExtent=function(a){this.extent=a;this.frustumVisibilityDirty=this.extentEngineDirty=!0};a.prototype.viewChange=function(){this.frustumVisibilityDirty=!0};a.prototype.elevationBoundsChange=function(){this.extentEngineDirty=this.frustumVisibilityDirty=!0};Object.defineProperty(a.prototype,"isVisibleBelowSurface",{set:function(a){this._isVisibleBelowSurface=a;this.extentEngineDirty=
- this.frustumVisibilityDirty=!0},enumerable:!0,configurable:!0});a.prototype.idleUpdate=function(a){!a.done()&&this.frustumVisibilityDirty&&(this.updateSuspendFrustumVisible(),this.frustumVisibilityDirty=!1)};a.prototype.updateExtentEngine=function(){if(this.extentEngineDirty){this.extentEngineDirty=!1;var a=this.layerView.view,b=a.renderCoordsHelper.worldUpAtPosition.bind(a.renderCoordsHelper),c;if(this._isVisibleBelowSurface)c=k;else{c=a.basemapTerrain.getElevationBounds();var d=c[0];c=d-Math.max(1,
- (c[1]-d)*(1.2-1))}this.extentEngine.update(this.extent,b,a.renderSpatialReference,a.spatialReference,this.renderSREqualsViewSR,c)}};a.prototype.updateSuspendFrustumVisible=function(){if(this.extent){this.updateExtentEngine();var a=this.extentEngine.isVisibleInFrustum(this.layerView.view,this.layerView.view.frustum,this._isVisibleBelowSurface);a!==this.frustumVisibility&&(this.frustumVisibility=a,this.layerView._notifySuspendedChange())}else this.frustumVisibility=!0};return a}();var u=[{x0:0,y0:1,
- x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],q=f.vec3d.create(),v=f.mat4d.create(),x=f.mat4d.create(),m=a.create();return c})},"esri/views/3d/layers/graphics/Graphics3DHighlights":function(){define(["require","exports","./Graphics3DHighlightSet"],function(r,h,f){return function(){function a(){this.graphicsCore=null;this.highlights=[]}a.prototype.destroy=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()});this.highlights=null};a.prototype.initialize=
- function(a){this.graphicsCore=a};a.prototype.acquireSet=function(a,c){var e=this,d=new f(a,c);this.highlights.push(d);return{set:d,handle:{remove:function(){return e.releaseSet(d)}}}};a.prototype.releaseSet=function(a){a.highlightSet.removeAll();a=this.highlights?this.highlights.indexOf(a):-1;-1!==a&&this.highlights.splice(a,1)};a.prototype.setUids=function(a,c){var e=this.graphicsCore.graphics;c.forEach(function(c){a.ids.add(c);(c=e[c])&&c.addHighlight(a.highlightSet,a.options)})};a.prototype.setObjectIds=
- function(a,c){var e=this.graphicsCore.graphics;c.forEach(function(b){return a.ids.add(b)});for(var d in e)(c=e[d])&&a.hasGraphic(c)&&c.addHighlight(a.highlightSet,a.options)};a.prototype.graphicCreated=function(a){this.highlights.forEach(function(c){c.hasGraphic(a)&&a.addHighlight(c.highlightSet,c.options)})};a.prototype.graphicDeleted=function(a){this.highlights.forEach(function(c){c.hasGraphic(a)&&a.removeHighlight(c.highlightSet)})};a.prototype.allGraphicsDeleted=function(){this.highlights.forEach(function(a){return a.highlightSet.removeAll()})};
- return a}()})},"esri/views/3d/layers/graphics/Graphics3DHighlightSet":function(){define(["require","exports","../../webgl-engine/lib/HighlightSet"],function(r,h,f){return function(){function a(a,c){this.highlightSet=new f;this.ids=new Set;this.options=a;this.objectIdField=c}a.prototype.hasGraphic=function(a){return this.objectIdField?this.ids.has(a.graphic.attributes[this.objectIdField]):this.ids.has(a.graphic.uid)};return a}()})},"esri/views/3d/layers/graphics/Graphics3DLabeling":function(){define("require exports dojo/promise/all ../../../../core/Handles ../../../../core/watchUtils ../../../../layers/support/LabelClass ../../../../symbols/callouts/calloutUtils ./Graphics3DCalloutSymbolLayerFactory ./Graphics3DWebStyleSymbol ./labelPlacement ../../support/debugFlags ../../webgl-engine/lib/MaterialCollection ../../webgl-engine/lib/TextTextureAtlas".split(" "),
- function(r,h,f,a,e,c,g,d,b,k,l,p,n){return function(){function h(){this.calloutMaterialCollection=this.hudMaterialCollection=this.textTextureAtlas=null;this.labelVisibilityDirty=!1;this.labelClasses=[];this.eventHandles=new a;this.graphicsCore=this.spatialIndex=this.layer=this.layerView=null}h.prototype.initialize=function(a,b,c,d,f){var g=this;this.layerView=a;this.layer=b;this.spatialIndex=c;this.graphicsCore=d;this.scaleVisibility=f;this.eventHandles.add(e.whenNot(this.layerView,"suspended",function(){return g.resume()}))};
- h.prototype.destroy=function(){this.textTextureAtlas&&(this.textTextureAtlas.dispose(),this.textTextureAtlas=null);this.hudMaterialCollection&&(this.hudMaterialCollection.dispose(),this.hudMaterialCollection=null);this.calloutMaterialCollection&&(this.calloutMaterialCollection.dispose(),this.calloutMaterialCollection=null);this.labelClasses=null;this.eventHandles.destroy();this.graphicsCore=this.layer=this.layerView=this.eventHandles=null};h.prototype.clear=function(){this.layerView.view.deconflictor.setDirty();
- this.textTextureAtlas&&(this.textTextureAtlas.dispose(),this.textTextureAtlas=null);this.hudMaterialCollection&&(this.hudMaterialCollection.dispose(),this.hudMaterialCollection=null);this.calloutMaterialCollection&&(this.calloutMaterialCollection.dispose(),this.calloutMaterialCollection=null)};h.prototype.updateLabelingInfo=function(){var a=this;this.removeLabels();return this.layer.when(function(){a.scaleVisibility&&a.scaleVisibility.updateScaleRangeActive();var c=a.layer.labelingInfo&&a.layer.labelingInfo.filter(function(a){return!!a.symbol});
- if(c&&0<c.length){var e=Array(c.length),c=c.map(function(c,f){var h=c.symbol,k;k=a.graphicsCore.getOrCreateGraphics3DSymbol(h);k=k instanceof b?k.graphics3DSymbol:k;var l=null;g.isCalloutSupport(h)&&h.hasVisibleCallout()&&(l=d.make(h,a.graphicsCore.symbolCreationContext));e[f]={labelClass:c,graphics3DSymbol:k,graphics3DCalloutSymbolLayer:l,options:c.getOptions()};return k});return f(c).then(function(){return e})}return null}).then(function(b){a.labelClasses=b;a.labelVisibilityChanged()})};h.prototype.createLabelsForGraphic=
- function(a,b){var d=!1;if(this.labelClasses&&0!==this.labelClasses.length&&b._graphics[0]){for(var e=this.layerLabelsEnabled(),f=0;f<this.labelClasses.length;f++){var g=this.labelClasses[f],h=g.labelClass;if(c.evaluateWhere(h.where,a.attributes)&&(h=h.getLabelExpression(),h.expression)){var q=c.buildLabelText(h.expression,a,this.layer.fields,g.options);if(q){h=null;g.graphics3DSymbol&&g.graphics3DSymbol.symbol&&"label-3d"===g.graphics3DSymbol.symbol.type&&(h=g.graphics3DSymbol.symbol);var r=g.graphics3DSymbol.childGraphics3DSymbols[0],
- t=k.get({graphic:a,graphics3DGraphic:b,labelSymbol:h,labelClass:g.labelClass});if(r&&t.isValid){null==this.textTextureAtlas&&(this.textTextureAtlas=new n(this.layer.id,this.layerView.view._stage));null==this.hudMaterialCollection&&(this.hudMaterialCollection=new p(this.layerView.view._stage));f={text:q,centerOffset:t.centerOffset,translation:t.translation,elevationOffset:t.elevationOffset,screenOffset:t.screenOffset,anchor:t.anchor,needsOffsetAdjustment:t.needsOffsetAdjustment,centerOffsetUnits:t.centerOffsetUnits,
- verticalOffset:t.verticalOffset,debugDrawBorder:l.LABELS_SHOW_BORDER};if(r=r.createGraphics3DGraphic(a,f,this.hudMaterialCollection,this.textTextureAtlas))r._labelClass=g.labelClass,b.addLabelGraphic(r,this.graphicsCore.labelStageLayer,this.graphicsCore.stage),this.spatialIndex&&!b.addedToSpatialIndex&&this.spatialIndex.shouldAddToSpatialIndex(a,b,this.scaleVisibility.scaleRangeActive())&&this.spatialIndex.addGraphicToSpatialIndex(a,b),b.setVisibilityFlag(0,e,1),b.setVisibilityFlag(1,void 0,1),this.layerView.view.deconflictor.initializeLabelVisibility(b),
- d=!0,g.graphics3DCalloutSymbolLayer&&t.hasLabelVerticalOffset&&(null==this.calloutMaterialCollection&&(this.calloutMaterialCollection=new p(this.layerView.view._stage)),(e=g.graphics3DCalloutSymbolLayer.createGraphics3DGraphic(a,{symbol:h,needsOffsetAdjustment:t.needsOffsetAdjustment,translation:f.translation,elevationOffset:f.elevationOffset,screenOffset:f.screenOffset,centerOffset:f.centerOffset,centerOffsetUnits:f.centerOffsetUnits,materialCollection:this.calloutMaterialCollection}))&&b.addLabelGraphic(e,
- this.graphicsCore.labelStageLayer,this.graphicsCore.stage));break}}}}d&&this.scaleVisibility&&this.scaleVisibility.updateGraphicLabelScaleVisibility(a,b)}};h.prototype.layerLabelsEnabled=function(){return this.layer.labelsVisible};h.prototype.getGraphics3DGraphics=function(){return this.graphicsCore.getGraphics3DGraphics()};h.prototype.getGraphics3DGraphicsKeys=function(){return this.graphicsCore.getGraphics3DGraphicsKeys()};h.prototype.labelVisibilityChanged=function(){var a=this;if(this.layerView.suspended)this.labelVisibilityDirty=
- !0;else if(this.layerView.loadedGraphics){var b=this.layerLabelsEnabled();this.layerView.loadedGraphics.forEach(function(c){var d=a.graphicsCore.getGraphics3DGraphicById(c.uid);d&&(b&&0===d._labelGraphics.length&&a.createLabelsForGraphic(c,d),d.setVisibilityFlag(0,b,1))});this.layerView.view.deconflictor.setDirty();this.labelVisibilityDirty=!1}};h.prototype.elevationInfoChange=function(){this.labelClasses&&this.labelClasses.forEach(function(a){a.graphics3DSymbol.layerPropertyChanged("elevationInfo",
- {})})};h.prototype.resume=function(){this.labelVisibilityDirty&&this.labelVisibilityChanged()};h.prototype.removeLabels=function(){var a=this;this.layerView.loadedGraphics&&(this.layerView.loadedGraphics.forEach(function(b){if(b=a.graphicsCore.getGraphics3DGraphicById(b.uid))b._labelGraphics&&b._labelGraphics.forEach(function(a){return a._labelClass=null}),b.clearLabelGraphics()}),this.labelClasses=null,this.layerView.view.deconflictor.setDirty())};return h}()})},"esri/views/3d/layers/graphics/labelPlacement":function(){define("require exports ../../../../core/Logger ../../../../core/scheduling ./Graphics3DWebStyleSymbol ../../lib/glMatrix ../../webgl-engine/materials/HUDMaterial".split(" "),
- function(r,h,f,a,e,c,g){function d(a,d){switch(d.graphic.geometry.type){case "polyline":case "polygon":case "extent":case "multipoint":a.anchor="center";break;case "point":var e=d.graphics3DGraphic,f=k(e.graphics3DSymbol).symbol.symbolLayers.getItemAt(0),e=e.getCenterObjectSpace();c.vec3d.set(e,a.translation);switch(f.type){case "icon":case "text":e=d.graphics3DGraphic;f=e._graphics[0].getScreenSize();e.isDraped()?a.hasLabelVerticalOffset||(a.anchor="center"):(e=void 0,void 0===e&&(e=m),d=d.graphics3DGraphic._graphics[0].stageObject.getGeometryRecords()[0].materials[0],
- d instanceof g?(d=d.getParams().anchorPos,e[0]=2*(d[0]-.5),e[1]=2*(d[1]-.5)):(e[0]=0,e[1]=0),d=e,x[0]=f[0]/2*(a.normalizedOffset[0]-d[0]),x[1]=f[1]/2*(a.normalizedOffset[1]-d[1]),a.screenOffset[0]=x[0],a.hasLabelVerticalOffset?(a.centerOffset[1]=x[1],a.centerOffsetUnits="screen"):a.screenOffset[1]=x[1]);break;case "object":b(a,d)}break;case "mesh":b(a,d)}}function b(a,b){b=b.graphics3DGraphic._graphics[0].getBoundingBoxObjectSpace();b=[b[3]-b[0],b[4]-b[1],b[5]-b[2]];a.centerOffset[0]=1.1*Math.max(b[0],
- b[1])/2*a.normalizedOffset[0];var d=b[2]/2*a.normalizedOffset[1]+a.translation[2];a.translation[2]=d*(1.1-1);a.elevationOffset=d;b=c.vec3d.length(b);a.centerOffset[2]=1.1*b/2*a.normalizedOffset[2]}function k(a){return a instanceof e?a.graphics3DSymbol:a}function l(a,b){var c=b.labelSymbol;b=b.graphics3DGraphic;var d=k(b.graphics3DSymbol).symbol;if("point-3d"===d.type&&d.supportsCallout()&&d.hasVisibleVerticalOffset()&&!b.isDraped())a.verticalOffset=p(d.verticalOffset);else if(c&&c.hasVisibleVerticalOffset()&&
- ("point-3d"!==d.type||!d.supportsCallout()||!d.verticalOffset||b.isDraped())){a:switch(a.placement){case "above-center":b=!0;break a;default:b=!1}b?(a.verticalOffset=p(c.verticalOffset),a.anchor="bottom",a.normalizedOffset=[0,a.normalizedOffset[1],0],a.hasLabelVerticalOffset=!0):(n.error("verticalOffset","Callouts and vertical offset on labels are currently only supported with above-center label placement (not with "+a.placement+" placement)"),a.isValid=!1)}}function p(a){return{screenLength:a.screenLength,
- minWorldLength:a.minWorldLength,maxWorldLength:a.maxWorldLength}}Object.defineProperty(h,"__esModule",{value:!0});var n=f.getLogger("esri.views.3d.layers.graphics.labelPlacement"),t=null;h.get=function(b){var c=b.labelClass.labelPlacement,e=u[c];e||(null!=c&&null==t&&(n.warn("labelPlacement","'"+c+"' is not a valid label placement"),t=a.schedule(function(){t.remove();t=null})),e=u["default"]);var c=b.graphics3DGraphic._graphics[0],f=c.graphics3DSymbolLayer.getGraphicElevationContext(b.graphics3DGraphic.graphic),
- e={placement:e.placement,anchor:e.anchor,normalizedOffset:e.normalizedOffset,needsOffsetAdjustment:c.isDraped()?void 0:f.hasOffsetAdjustment,verticalOffset:null,screenOffset:[0,0],centerOffset:[0,0,0,-1],centerOffsetUnits:"world",translation:[0,0,0],elevationOffset:0,hasLabelVerticalOffset:!1,isValid:!0};l(e,b);d(e,b);return e};var u={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},
- "above-right":{placement:"above-right",normalizedOffset:[1,1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},
- "center-right":{placement:"center-right",normalizedOffset:[1,0,0],anchor:"left"}},q={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],
- "center-left":["esriServerPointLabelPlacementCenterLeft"],"center-right":["esriServerPointLabelPlacementCenterRight"]};r=function(a){var b=u[a];q[a].forEach(function(a){u[a]=b})};for(var v in q)r(v);Object.freeze&&(Object.freeze(u),Object.keys(u).forEach(function(a){Object.freeze(u[a]);Object.freeze(u[a].normalizedOffset)}));var x=[0,0],m=[0,0]})},"esri/views/3d/webgl-engine/lib/MaterialCollection":function(){define(["require","exports","./ModelContentType"],function(r,h,f){return function(){function a(a){this.materials=
- {};this.stage=a}a.prototype.getMaterial=function(a){return this.materials[a]};a.prototype.addMaterial=function(a,c){this.materials[a]=c;this.stage.add(f.MATERIAL,c)};a.prototype.dispose=function(){for(var a in this.materials)this.stage.remove(f.MATERIAL,this.materials[a].id);this.materials={}};return a}()})},"esri/views/3d/webgl-engine/lib/TextTextureAtlas":function(){define("require exports ./ModelContentType ./TextTexture ./Texture ../../../webgl/Texture".split(" "),function(r,h,f,a,e,c){var g=
- a.preferredAtlasSize(),d=function(){function a(a){this.textTextures={};this.dirty=!1;this._glTexture=null;this.id=e.idGen.gen(a)}a.prototype.dispose=function(){};a.prototype.deferredLoading=function(){return!1};a.prototype.getWidth=function(){return g};a.prototype.getHeight=function(){return g};a.prototype.initializeThroughRender=function(a,b){b.wrapMode=33071;b.samplingMode=9987;b.flipped=!0;b.preMultiplyAlpha=!0;b.hasMipmap=!0;var d=this._drawToCanvas();this._glTexture=new c(a,b,d);this.dirty=!1;
- return this._glTexture};a.prototype.redraw=function(){if(this.dirty&&this._glTexture){var a=this._drawToCanvas();this._glTexture.setData(a);this.dirty=!1}};a.prototype.setUnloadFunc=function(a){this._unloadFunc=a};a.prototype.unload=function(){null!=this._unloadFunc&&(this._unloadFunc(this.id),this._unloadFunc=null)};a.prototype._drawToCanvas=function(){var b=a._create2Dcanvas(),c=b.getContext("2d");c.clearRect(0,0,g,g);for(var d in this.textTextures){var e=this.textTextures[d];e.textTexture.renderText(e.placement.width,
- e.placement.height,c,e.placement.atlasOffX,e.placement.atlasOffY)}return b};a._create2Dcanvas=function(){a._textCanvas2D||(a._textCanvas2D=document.createElement("canvas"),a._textCanvas2D.setAttribute("id","canvas2d"),a._textCanvas2D.setAttribute("width",g.toString()),a._textCanvas2D.setAttribute("height",g.toString()),a._textCanvas2D.setAttribute("style","display:none"));return a._textCanvas2D};return a}();return function(){function a(a,b){this._textureAtlasSubtextures=[];this._curLineHeight=this._curY=
- this._curX=0;this._idHint=a;this._stage=b}a.prototype.dispose=function(){for(var a=0;a<this._textureAtlasSubtextures.length;a++)this._stage.remove(f.TEXTURE,this._textureAtlasSubtextures[a].id);this._textureAtlasSubtextures=[]};a.prototype.canHoldTextTexture=function(a){return a.getRenderedWidth()<=g&&a.getRenderedHeight()<=g};a.prototype.addTextTexture=function(a){for(var b=JSON.stringify(a.getParams())+"_"+a.getText(),c=0;c<this._textureAtlasSubtextures.length;c++){var e=this._textureAtlasSubtextures[c].textTextures[b];
- if(null!=e)return e.placement}var h=null;0===this._textureAtlasSubtextures.length&&(h=new d(this._idHint),this._textureAtlasSubtextures.push(h));var c=a.getRenderedWidth(),e=a.getRenderedHeight(),k=c+2,q=e+2+2,r;this._curLineHeight=Math.max(this._curLineHeight,q);this._curX+k<g&&this._curY+this._curLineHeight<g||(this._curY+this._curLineHeight+q<g?(this._curX=0,this._curY+=this._curLineHeight):(h=new d(this._idHint),this._textureAtlasSubtextures.push(h),this._curY=this._curX=0,this._curLineHeight=
- q));q=this._curX;r=this._curY;this._curX+=k;null!=h&&this._stage.add(f.TEXTURE,h);h=this._textureAtlasSubtextures[this._textureAtlasSubtextures.length-1];c={uvMinMax:[q/g,1-(r+e)/g,(q+c)/g,1-r/g],atlasOffX:q,atlasOffY:r,width:c,height:e,texture:h};h.textTextures[b]={placement:c,textTexture:a};h.dirty=!0;return c};return a}()})},"esri/views/3d/layers/graphics/Graphics3DScaleVisibility":function(){define(["require","exports"],function(r,h){function f(a,e){return null!==a&&0<a&&8E7>a||50<e}return function(){function a(){this._scaleRangeActive=
- !1;this.layerScaleRangeVisibilityDirty=this.layerScaleRangeVisibility=!0;this.layerScaleRangeVisibilityQuery=!1;this.basemapTerrain=this.graphicsCore=this.extent=this.spatialIndex=this.layer=this.layerView=this.scaleChangeEventHandle=null}a.prototype.initialize=function(a,c,f,d,b){this.layerView=a;this.layer=c;this.spatialIndex=f;this.graphicsCore=d;this.basemapTerrain=b;this.updateScaleRangeActive()};a.prototype.destroy=function(){this.scaleChangeEventHandle&&(this.scaleChangeEventHandle.remove(),
- this.scaleChangeEventHandle=null);this.graphicsCore=this.spatialIndex=this.extent=this.layerView=null};a.prototype.needsIdleUpdate=function(){return this.layerView.view.basemapTerrain&&this.layerScaleRangeVisibilityDirty};a.prototype.canResume=function(){return this.layerScaleRangeVisibility};a.prototype.setExtent=function(a){this.extent=a;this.layerScaleRangeVisibilityDirty=!0};a.prototype.idleUpdate=function(a){this.layerView.view.basemapTerrain&&!a.done()&&this.layerScaleRangeVisibilityDirty&&
- (this.updateSuspendScaleVisible(),this.layerScaleRangeVisibilityDirty=!1)};a.prototype.scaleRangeActive=function(){return this._scaleRangeActive};a.prototype.updateScaleRangeActive=function(){var a=this;if(!this.spatialIndex)return this._scaleRangeActive=!1;var c=this.layer,g=!1;c.labelingInfo&&(g=g||c.labelingInfo.some(function(a){return a&&f(a.minScale,a.maxScale)}));g=g||f(c.minScale,c.maxScale);c=this._scaleRangeActive!==g;(this._scaleRangeActive=g)&&!this.scaleChangeEventHandle&&this.basemapTerrain?
- this.scaleChangeEventHandle=this.basemapTerrain.on("scale-change",function(c){return a.scaleUpdateHandler(c)}):!g&&this.scaleChangeEventHandle&&(this.scaleChangeEventHandle.remove(),this.scaleChangeEventHandle=null);return c};a.prototype.updateSuspendScaleVisibleFinish=function(a){this.layerScaleRangeVisibilityQuery=!1;this.layerScaleRangeVisibility!==a&&(this.layerScaleRangeVisibility=a,this.layerView._notifySuspendedChange())};a.prototype.updateSuspendScaleVisible=function(){var a=this,c=this.layerView.view.basemapTerrain;
- this.extent&&c&&this._scaleRangeActive?this.layerScaleRangeVisibilityQuery||(this.layerScaleRangeVisibilityQuery=!0,c.queryVisibleScaleRange(this.extent,this.layer.minScale,this.layer.maxScale,function(c){return a.updateSuspendScaleVisibleFinish(c)})):this.updateSuspendScaleVisibleFinish(!0)};a.prototype.visibleAtScale=function(a,c,f){return null==a?!0:a>f&&(!c||a<c)};a.prototype.visibleAtLayerScale=function(a){return this.visibleAtScale(a,this.layer.minScale,this.layer.maxScale)};a.prototype.visibleAtLabelScale=
- function(a,c){return this.visibleAtScale(a,c.minScale,c.maxScale)};a.prototype.graphicScale=function(a,c){var e;c.centroid?e=c.centroid:"point"===a.geometry.type&&(e=a.geometry);return e?this.layerView.view.basemapTerrain?this.layerView.view.basemapTerrain.getScale(e):1:null};a.prototype.graphicVisible=function(a,c){a=this.graphicScale(a,c);return this.visibleAtLayerScale(a)};a.prototype.updateGraphicScaleVisibility=function(a,c){return this._scaleRangeActive?(c.addedToSpatialIndex||this.spatialIndex.addGraphicToSpatialIndex(a,
- c),a=this.graphicVisible(a,c),c.setVisibilityFlag(1,a)):!1};a.prototype.updateGraphicLabelScaleVisibility=function(a,c){if(!this._scaleRangeActive||!c._labelGraphics||0===c._labelGraphics.length)return!1;c.addedToSpatialIndex||this.spatialIndex.addGraphicToSpatialIndex(a,c);a=this.graphicScale(a,c);(c=this.updateLabelScaleVisibility(c,a))&&this.layerView.view.deconflictor.setDirty();return c};a.prototype.updateLabelScaleVisibility=function(a,c){if(!a._labelGraphics||0===a._labelGraphics.length)return!1;
- var e=a._labelGraphics[0]._labelClass;return e&&null!=e.minScale&&null!=e.maxScale&&(c=this.visibleAtLabelScale(c,e),a.setVisibilityFlag(1,c,1))?!0:!1};a.prototype.scaleUpdateHandler=function(a){var c=this;if(!this.layerView.suspended&&this.spatialIndex.hasGraphics()){var e=a.extent,d=a.scale;this.spatialIndex.intersects(e,a.spatialReference,function(a,f){for(var b=c.visibleAtLayerScale(d),g=!1,h=!1,k=0;k<f;k++){var r=c.graphicsCore.getGraphics3DGraphicById(a[k]);if(r){var q=r.centroid;q&&(e[0]>q.x||
- e[1]>q.y||e[2]<q.x||e[3]<q.y)||(q=!1,r.setVisibilityFlag(1,b)&&(q=!0),c.updateLabelScaleVisibility(r,d)&&(q=!0),q&&(h=!0,r.isDraped()&&(g=!0)))}}h&&c.layerView.view.deconflictor.setDirty();g&&c.layerView._notifyDrapedDataChange()})}this.layerScaleRangeVisibilityDirty=!0};a.prototype.layerMinMaxScaleChangeHandler=function(){this.updateScaleRangeActive()&&(this._scaleRangeActive?this.graphicsCore.updateAllGraphicsVisibility():this.graphicsCore.forEachGraphics3DGraphic(function(a){return a.setVisibilityFlag(1,
- void 0)}));this.layerScaleRangeVisibilityDirty=!0};return a}()})},"esri/views/3d/layers/graphics/Graphics3DVerticalScale":function(){define(["require","exports","../../../../geometry/support/scaleUtils"],function(r,h,f){return function(){function a(a){this.sourceSpatialReference=a.sourceSpatialReference;this.destSpatialReference=a.destSpatialReference}a.prototype.adjust=function(a){var c=this._getVerticalUnitScale();1!==c&&(a=a.slice(),this._scaleVerticalUnits(a,c));return a};a.prototype._getVerticalUnitScale=
- function(){if(this.sourceSpatialReference&&!this.sourceSpatialReference.equals(this.destSpatialReference)){var a=f.getMetersPerVerticalUnitForSR(this.sourceSpatialReference),c=f.getMetersPerVerticalUnitForSR(this.destSpatialReference);return a/c}return 1};a.prototype._vertexListsScaleZ=function(a,c){for(var e=0;e<a.length;++e)for(var d=a[e],b=0;b<d.length;++b)d[b][2]*=c};a.prototype._scaleVerticalUnits=function(a,c){for(var e=0;e<a.length;++e){var d=a[e].geometry;d&&d.hasZ&&(this._geometryIsPoint(d)?
- null!==d.z&&(d.z*=c):this._geometryIsPolyline(d)?this._vertexListsScaleZ(d.paths,c):this._geometryIsPolygon(d)&&this._vertexListsScaleZ(d.rings,c))}};a.prototype._geometryIsPoint=function(a){return"point"===a.type};a.prototype._geometryIsPolygon=function(a){return"polygon"===a.type};a.prototype._geometryIsPolyline=function(a){return"polyline"===a.type};return a}()})},"esri/views/3d/layers/support/projectExtentUtils":function(){define(["require","exports","../../../../core/promiseUtils","../../../../geometry/support/webMercatorUtils",
- "../../../../portal/support/geometryServiceUtils"],function(r,h,f,a,e){Object.defineProperty(h,"__esModule",{value:!0});h.toView=function(c){var g=c.view.spatialReference,d=c.layer.fullExtent&&c.layer.fullExtent.spatialReference;return!d||d.equals(g)||"local"!==c.view.viewingMode?f.resolve(null):a.canProject(d,g)?f.resolve(a.project(c.layer.fullExtent,g)):e.projectGeometry(c.layer.fullExtent,g,c.layer.portalItem).then(function(a){if(!c.destroyed&&a)return a}).catch(function(){return null})}})},"esri/views/layers/RefreshableLayerView":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/accessorSupport/decorators".split(" "),
- function(r,h,f,a,e,c){return function(e){function d(){var a=null!==e&&e.apply(this,arguments)||this;a.refreshTimestamp=null;return a}f(d,e);d.prototype.refresh=function(a){void 0===a&&(a=Date.now());this._set("refreshTimestamp",a);this.doRefresh&&this.doRefresh()};a([c.property()],d.prototype,"layer",void 0);a([c.aliasOf("layer.refreshInterval")],d.prototype,"refreshInterval",void 0);a([c.property({readOnly:!0})],d.prototype,"refreshTimestamp",void 0);return d=a([c.subclass("esri.layers.mixins.RefreshableLayerView")],
- d)}(c.declared(e))})},"url:esri/views/3d/environment/materials/SimpleAtmosphereMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsSimpleAtmosphere"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n\r\n#ifndef PANORAMIC\r\n\r\n const float TWICEPI \x3d 2.0*3.14159265;\r\n const float ATMOSPHERE_RIM_SEGMENTS \x3d 128.0;\r\n\r\n uniform vec3 silCircleCenter;\r\n uniform vec3 silCircleV1;\r\n uniform vec3 silCircleV2;\r\n uniform vec2 texV;\r\n\r\n#endif\r\n\r\n uniform vec3 lightDirection;\r\n\r\n attribute vec3 $position;\r\n varying vec2 vtc;\r\n varying float falloff;\r\n\r\n void main(void) {\r\n\r\n#ifdef PANORAMIC\r\n\r\n vec3 pos \x3d $position;\r\n float ndotl \x3d lightDirection.z;\r\n vtc \x3d vec2(0, $position.z+0.05);\r\n\r\n#else\r\n\r\n float phi \x3d $position.x * (TWICEPI / ATMOSPHERE_RIM_SEGMENTS) + 1.0;\r\n vec3 pos \x3d (sin(phi) * silCircleV1 + cos(phi) * silCircleV2 + silCircleCenter) * $position.y;\r\n float ndotl \x3d dot(normalize(pos), lightDirection);\r\n\r\n vtc.x \x3d $position.x / ATMOSPHERE_RIM_SEGMENTS;\r\n vtc.y \x3d texV.x * (1.0 - $position.z) + texV.y * $position.z;\r\n\r\n#endif\r\n\r\n falloff \x3d max(0.0, (smoothstep(-1.0, 0.8, ndotl + ndotl)));\r\n\r\n gl_Position \x3d proj * view * vec4(pos, 1.0);\r\n gl_Position.z \x3d gl_Position.w; // project atmosphere onto the far plane\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsSimpleAtmosphere"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n uniform vec4 color;\r\n varying vec2 vtc;\r\n varying float falloff;\r\n\r\n void main() {\r\n vec4 texColor \x3d texture2D(tex, vtc);\r\n gl_FragColor \x3d texColor * color * falloff;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/environment/materials/RealisticAtmosphereMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3c!--Vertex Shader for Atmosphere--\x3e\r\n\x3csnippet name\x3d"vsRealisticAtmosphere"\x3e\x3c![CDATA[\r\n//\r\n// Based on Atmospheric scattering vertex shader by Sean O\'Neil from GPU Gems 2 Chapter 16.\r\n//\r\n// Link: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html\r\n// Download Portal: http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Index.html\r\n// Unmodified Source Code: http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Content/16.zip\r\n//\r\n// Adapted for WebGIS by Jascha Gr\u00fcbel (jgruebel@esri.com), Z\u00fcrich 2015\r\n//\r\n\r\n $vsprecisionf\r\n\r\n //Camera\r\n uniform vec2 halfSizeNearPlane;\r\n uniform vec3 v3CameraUp;\r\n uniform vec3 v3CameraRight;\r\n uniform vec3 v3CameraDir;\r\n uniform vec2 v2CameraCenterOffset;\r\n\r\n //Attributes\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n\r\n //Varyings\r\n varying vec3 v3WorldRay;\r\n varying vec2 vtc;\r\n\r\n#ifdef HAZE\r\n varying vec3 v3EyeDir;\r\n#endif\r\n\r\n void main(void) {\r\n vec3 v3Pos \x3d $position;\r\n vtc \x3d $uv0;\r\n vec2 rayvtc \x3d $uv0 - v2CameraCenterOffset;\r\n\r\n#ifdef HAZE\r\n v3EyeDir \x3d vec3((2.0*halfSizeNearPlane *rayvtc)-halfSizeNearPlane,-1.0);\r\n#else\r\n vec3 v3EyeDir \x3d vec3((2.0*halfSizeNearPlane *rayvtc)-halfSizeNearPlane,-1.0);\r\n#endif\r\n v3WorldRay \x3d v3EyeDir.z*v3CameraDir + v3EyeDir.y*v3CameraUp + v3EyeDir.x*v3CameraRight;\r\n gl_Position \x3d vec4(v3Pos, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"atmosphereScaleFunction"\x3e\x3c![CDATA[\r\n //Approximation for inner integral based on a radii ratio of 10.25:10\r\n float scale(float fCos){\r\n float x \x3d 1.0 - fCos;\r\n return exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"toneMapperConstants"\x3e\x3c![CDATA[\r\n#ifdef HAZE\r\n const float fOneOverGamma \x3d 1.0;//Gamma \x3d 1.0\r\n#else\r\n const float fOneOverGamma \x3d 0.454545; // Gamma \x3d 2.2\r\n#endif\r\n const vec3 v3OneOverGamma \x3d vec3(fOneOverGamma);\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"exponentialToneMapper"\x3e\x3c![CDATA[\r\n //ToneMapping operators\r\n vec3 expTM(vec3 inputColor,float exposure){\r\n return pow(1.0 - exp(inputColor * -exposure), v3OneOverGamma);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"reinhardToneMapper"\x3e\x3c![CDATA[\r\n vec3 reinhardTM(vec3 inputColor, float exposure){\r\n vec3 intermediate \x3d inputColor *exposure;\r\n intermediate /\x3d (1.0+intermediate);\r\n return pow(intermediate, v3OneOverGamma);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"HSVColorSpace"\x3e\x3c![CDATA[\r\n//based on http://gamedev.stackexchange.com/a/59808\r\n// Hue in range [0,1] instead of 360\u00b0\r\nvec3 rgb2hsv(vec3 c)\r\n{\r\n vec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\r\n vec4 p \x3d mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\r\n vec4 q \x3d mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\r\n\r\n float d \x3d q.x - min(q.w, q.y);\r\n float e \x3d 1.0e-10;\r\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\r\n}\r\n\r\nvec3 hsv2rgb(vec3 c)\r\n{\r\n vec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\r\n vec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\r\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"atmosphereUniformsConstantsVaryings"\x3e\x3c![CDATA[\r\n\r\n //Light\r\n uniform vec3 v3LightDir; // The direction vector to the light source\r\n uniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels\r\n uniform vec3 v3InvWavelengthScaled; //v3InvWavelength * fKr4PI + fKm4PI\r\n\r\n //Radii\r\n uniform vec4 v4Radii; // inner, inner^2, outer, outer^2,\r\n\r\n //Atmosphere\r\n const float fKrESun \x3d 0.075; // Kr * ESun \x3d 0.005 * 15.0\r\n const float fKmESun \x3d 0.015; // Km * ESun \x3d 0.005 * 15\r\n //uniform float fScale; // 1 / (fOuterRadius - fInnerRadius)\r\n //uniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere\'s average density is found)\r\n //uniform float fScaleOverScaleDepth; // fScale / fScaleDepth\r\n //uniform float fOneOverScaleDepth; // 1.0 / fScaleDepth\r\n\r\n //uniform float fScaleDepthBlue; // The scale depth (i.e. the altitude at which the atmosphere\'s average density is found)\r\n //uniform float fScaleOverScaleDepthBlue; // fScale / fScaleDepth\r\n //uniform float fOneOverScaleDepthBlue; // 1.0 / fScaleDepth\r\n\r\n uniform vec4 v4AtmosParams1; //(fScale,fScaleDepth,fScaleOverScaleDepth,fOneOverScaleDepth)\r\n uniform vec4 v4AtmosParams2; //(g,fScaleDepthBlue,fScaleOverScaleDepthBlue,fOneOverScaleDepthBlue)\r\n#ifndef HAZE\r\n uniform vec4 v4AtmosParams3; //(g2,fMiePhaseCoefficients,fLowerAlphaBlendBound,fOneOverOuterRadiusMinusAlphaBlendBound)\r\n#endif\r\n\r\n //Camera\r\n uniform vec3 v3CameraPos; // The camera\'s current position\r\n //uniform float fCameraHeight; // The camera\'s current height\r\n //uniform float fCameraHeight2; // fCameraHeight^2\r\n //uniform float fC; //fCameraHeight2 - fOuterRadius2; // C \x3d ||o-c||^2 - r^2\r\n //uniform float fCSur; //fCameraHeight2 - (fInnerRadius2 - 63756370000.0); // C \x3d ||o-c||^2 - r^2\r\n uniform vec4 v4SphereComp; //The camera\'s current height, CameraHeight^2,fC,fCSur\r\n uniform vec2 nearFar;\r\n\r\n //Camera HDR\r\n#ifdef HAZE\r\n const float fExposure \x3d 1.5;\r\n#else\r\n const float fExposure \x3d 2.0;\r\n#endif\r\n\r\n#ifdef HAZE\r\n //Depth texture\r\n uniform sampler2D tDepth;\r\n#endif\r\n\r\n //Testing variables\r\n uniform float showTest;\r\n\r\n //Varyings\r\n varying vec3 v3EyeDir;\r\n varying vec3 v3WorldRay;\r\n varying vec2 vtc;\r\n\r\n //Loop constants for integral approximation\r\n const float fSamples \x3d 5.0;\r\n const int maxSamples \x3d 5;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmospherePrecomputation"\x3e\x3c![CDATA[\r\n float fInnerRadius \x3d v4Radii[0]; // The inner (planetary) radius\r\n float fInnerRadius2 \x3d v4Radii[1]; // fInnerRadius^2\r\n float fOuterRadius \x3d v4Radii[2]; // The outer (atmosphere) radius\r\n float fOuterRadius2 \x3d v4Radii[3]; // fOuterRadius^2\r\n\r\n float fCameraHeight \x3d v4SphereComp[0];\r\n float fCameraHeight2 \x3d v4SphereComp[1];\r\n float fC \x3d v4SphereComp[2];\r\n float fCSur \x3d v4SphereComp[3];\r\n\r\n#ifdef PLANAR\r\n vec3 cameraPosition \x3d vec3(0.0,0.0,fCameraHeight);\r\n#else\r\n vec3 cameraPosition \x3d v3CameraPos;\r\n#endif\r\n\r\n //Debug variables\r\n vec3 test \x3d vec3(0.0,0.0,0.0);\r\n\r\n //Obtain ray from Camera\r\n vec3 worldSpaceRay \x3d normalize(v3WorldRay);\r\n\r\n //Compute Atmosphere intersection; i.e. ray/sphere intersection\r\n float B \x3d 2.0 * dot(cameraPosition, worldSpaceRay); // B \x3d 2(l * (o-c))\r\n float det \x3d B*B - 4.0 * fC; // det \x3d B^2 - 4.0* C\r\n\r\n //idealized sphere intersection to discard early some pixels\r\n float detSur \x3d B*B - 4.0 * fCSur; // det \x3d B^2 - 4.0* C\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereDiscardPixels"\x3e\x3c![CDATA[\r\n#ifdef HAZE\r\n bool continueComputation \x3d true;\r\n\r\n // only use red channel from depth texture.\r\n // see \'Issues\' at https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture\r\n float depthSample \x3d texture2D(tDepth, vtc).r;\r\n\r\n float zNear \x3d nearFar[0];\r\n float zFar \x3d nearFar[1];\r\n\r\n // http://web.archive.org/web/20130416194336/http://olivers.posterous.com/linear-depth-in-glsl-for-real\r\n float zNorm \x3d 2.0 * depthSample - 1.0;\r\n float linDepth \x3d 2.0 * zNear * zFar /\r\n (zFar + zNear - zNorm * (zFar - zNear));\r\n\r\n float rayEndT;\r\n float altitudeAlpha \x3d 1.0;\r\n\r\n // find intersections with ground, but only between the near and far\r\n // clipping planes.\r\n if (depthSample \x3c 1.0 \x26\x26 depthSample \x3e 0.0) {\r\n vec3 cameraSpaceRay \x3d normalize(v3EyeDir);\r\n cameraSpaceRay /\x3d cameraSpaceRay.z;\r\n cameraSpaceRay *\x3d linDepth;\r\n\r\n float cameraSpaceRayLength \x3d length(cameraSpaceRay);\r\n\r\n#ifndef PLANAR\r\n vec3 v3World \x3d cameraPosition + worldSpaceRay * cameraSpaceRayLength;\r\n float v3WorldRadius2 \x3d dot(v3World, v3World);\r\n\r\n // Handle tall structures:\r\n // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/5450\r\n float transitionStart \x3d fInnerRadius + 20000.0;\r\n float transitionHeight \x3d 25000.0;\r\n float transitionEnd \x3d transitionStart + transitionHeight;\r\n\r\n float edge0 \x3d transitionStart * transitionStart;\r\n float edge1 \x3d transitionEnd * transitionEnd;\r\n\r\n altitudeAlpha \x3d 1.0 - clamp((v3WorldRadius2 - edge0) / (edge1 - edge0), 0.0, 1.0);\r\n rayEndT \x3d cameraSpaceRayLength;\r\n\r\n if (altitudeAlpha \x3e 0.0) {\r\n continueComputation \x3d true;\r\n\r\n if (detSur \x3e 0.0) {\r\n float nearSurfaceT \x3d 0.5 *(-B - sqrt(detSur));\r\n float interp \x3d clamp(((fCameraHeight - fInnerRadius) - 2000000.0) / 6000000.0, 0.0, 1.0);\r\n rayEndT \x3d mix(cameraSpaceRayLength, nearSurfaceT, interp);\r\n }\r\n }\r\n#else\r\n rayEndT \x3d cameraSpaceRayLength;\r\n#endif\r\n }\r\n#ifdef PLANAR\r\n if (16500.0 + fInnerRadius \x3e\x3d fCameraHeight){\r\n continueComputation \x3d true;\r\n }\r\n#endif\r\n#endif\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"atmosphereUnpackAddUniforms"\x3e\x3c![CDATA[\r\n float fScale \x3d v4AtmosParams1.x;\r\n vec2 v2ScaleDepth \x3d vec2(v4AtmosParams1.y,v4AtmosParams2.y);//fScaleDepth, fScaleDepthBlue\r\n vec2 v2ScaleOverScaleDepth \x3d vec2(v4AtmosParams1.z,v4AtmosParams2.z);//fScaleOverScaleDepth, fScaleOverScaleDepthBlue\r\n vec2 v2OneOverScaleDepth \x3d vec2(v4AtmosParams1.w,v4AtmosParams2.w);//fOneOverScaleDepth, fOneOverScaleDepthBlue\r\n\r\n#ifndef HAZE\r\n float g \x3d v4AtmosParams2.x;\r\n float g2 \x3d v4AtmosParams3.x;\r\n float fMiePhaseCoefficients \x3d v4AtmosParams3.y;\r\n float fLowerAlphaBlendBound \x3d v4AtmosParams3.z;\r\n float fOneOverOuterRadiusMinusAlphaBlendBound \x3d v4AtmosParams3.w;\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputeRayAndLoopSetup"\x3e\x3c![CDATA[\r\n float rayStartT \x3d 0.5 *(-B - sqrt(det)); //near intersection with atmosphere\r\n#ifdef HAZE\r\n float nearT \x3d abs(rayStartT);\r\n float farT \x3d abs(rayEndT);\r\n#else\r\n float rayEndT \x3d 0.5 *(-B + sqrt(det)); //far intersection with atmosphere\r\n\r\n#endif\r\n\r\n float fDistance;//calculate its scattering offset\r\n // Calculate the ray\'s starting position\r\n if (rayStartT \x3c 0.0)\r\n { //ray starts from camera to far\r\n rayStartT \x3d 0.0;\r\n#ifndef HAZE\r\n fDistance \x3d fScale*(fInnerRadius - fCameraHeight);\r\n#endif\r\n }\r\n#ifndef HAZE\r\n else\r\n {//outside atmosphere\r\n fDistance \x3d -1.0;\r\n }\r\n#endif\r\n\r\n // Initialize the scattering loop variables\r\n vec3 v3Start \x3d cameraPosition + worldSpaceRay * rayStartT;\r\n\r\n#ifdef HAZE\r\n vec3 v3End \x3d cameraPosition + worldSpaceRay * rayEndT;\r\n\r\n float fEndLength \x3d length(v3End);\r\n float fLocalCameraHeight \x3d length(v3Start);\r\n\r\n //computed for the original end point to get consistent light angles after possible inversions\r\n float fLightAngle \x3d dot(v3LightDir, v3End) / fEndLength;\r\n\r\n if (nearT \x3e farT)\r\n {\r\n if (fLocalCameraHeight \x3c fEndLength)\r\n {\r\n //Switch positive slopes for flipped rays\r\n v3End \x3d cameraPosition + worldSpaceRay * rayStartT;\r\n v3Start \x3d cameraPosition + worldSpaceRay * rayEndT;\r\n worldSpaceRay *\x3d -1.0;\r\n fEndLength \x3d length(v3End);\r\n fLocalCameraHeight \x3d length(v3Start);\r\n }\r\n else if (fLocalCameraHeight \x3d\x3d fEndLength)\r\n {// create minuscule fake slope for integration if the slope is zero\r\n fLocalCameraHeight +\x3d 1.0; //BUGFIX, if the height of camera and ground is equal the equation breaks, add fake meter to camera height to get\r\n //slope for the camera function\r\n }\r\n }\r\n\r\n //Calculate its scattering offset\r\n // Assumes camera constrains of WSV 3.8\r\n float fCameraDepth;\r\n float fCameraDepthBlue;\r\n if (fLocalCameraHeight \x3e fOuterRadius)\r\n {\r\n fDistance \x3d fInnerRadius - fOuterRadius;\r\n } else\r\n {//outside atmosphere\r\n fDistance \x3d fEndLength - fLocalCameraHeight;\r\n }\r\n\r\n#endif\r\n vec2 v2OpticalStartDepth \x3d exp(fDistance * v2OneOverScaleDepth);\r\n\r\n float fRayLength \x3d rayEndT - rayStartT;\r\n float fSampleLength \x3d fRayLength / fSamples;\r\n float fScaledLength \x3d fSampleLength * fScale;\r\n vec3 v3SampleRay \x3d worldSpaceRay * fSampleLength;\r\n vec3 v3SamplePoint \x3d v3Start + v3SampleRay * 0.5;\r\n\r\n#ifdef HAZE\r\n float fCameraAngle \x3d dot(-worldSpaceRay, v3End) / fEndLength;\r\n float fScaleCameraAngle \x3d scale(fCameraAngle);\r\n vec2 v2CameraOffset \x3d fScaleCameraAngle*v2OpticalStartDepth;\r\n\r\n float scaledValues \x3d scale(fLightAngle) + fScaleCameraAngle;\r\n vec2 v2ScaledValuesDepth \x3d scaledValues * v2ScaleDepth;\r\n#else\r\n float fCameraAngle \x3d dot(worldSpaceRay, v3Start / length(v3Start));\r\n float angleMultiplier \x3d fCameraAngle\x3e0.0?fCameraAngle:0.0;\r\n\r\n float fScaleCameraAngle \x3d scale(fCameraAngle);\r\n vec2 v2CameraOffset \x3d fScaleCameraAngle*v2OpticalStartDepth * v2ScaleDepth;\r\n#endif\r\n\r\n //Loop variables\r\n vec3 v3FrontColor \x3d vec3(0.0, 0.0, 0.0);\r\n vec3 v3FrontColorBlue \x3d vec3(0.0, 0.0, 0.0);\r\n vec3 v3Attenuate\x3d vec3(0.0, 0.0, 0.0);\r\n vec3 v3AttenuateBlue \x3d vec3(0.0, 0.0, 0.0);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputeSampleContribution"\x3e\x3c![CDATA[\r\n float fHeight \x3d length(v3SamplePoint);\r\n vec2 v2Depth \x3d exp(v2ScaleOverScaleDepth * (fInnerRadius - fHeight));\r\n#ifdef HAZE\r\n vec2 v2Scatter \x3d v2Depth*v2ScaledValuesDepth-v2CameraOffset;\r\n#else\r\n float fLightAngle \x3d dot(v3LightDir, v3SamplePoint) / fHeight;\r\n float fCameraAngle \x3d dot(worldSpaceRay, v3SamplePoint) / fHeight;\r\n float fTempScaledValues \x3d scale(fLightAngle) - scale(fCameraAngle);\r\n vec2 v2Scatter \x3d v2CameraOffset + fTempScaledValues*v2Depth* v2ScaleDepth;\r\n#endif\r\n v3Attenuate \x3d exp(-v2Scatter.x * v3InvWavelengthScaled);\r\n v3AttenuateBlue \x3d exp(-v2Scatter.y * v3InvWavelengthScaled);\r\n\r\n v3FrontColor +\x3d v3Attenuate * v2Depth.x;\r\n v3FrontColorBlue +\x3d v3AttenuateBlue * v2Depth.y;\r\n\r\n v3SamplePoint +\x3d v3SampleRay;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputeHDRColors"\x3e\x3c![CDATA[\r\n //Phase computation\r\n //clamp to avoid numerical instability at fCos \x3d\x3d -1.0 (and close values) to display fake sun\r\n float fCos \x3d clamp(dot(v3LightDir, -worldSpaceRay ),-0.9999999,1.0);\r\n float fOnePlusCos2 \x3d fCos*fCos + 1.0;\r\n#ifdef HAZE\r\n // Finally, scale the Rayleigh colors and set up the varying variables for the pixel shader\r\n vec3 colorCoefficients \x3d (fScaledLength* 0.75 * fOnePlusCos2)*(fKrESun*v3InvWavelength+fKmESun);\r\n\r\n //Scaled Length is only applied afterwards to save multiplications\r\n vec3 v3Color \x3d colorCoefficients *v3FrontColor;\r\n vec3 v3ColorBlue \x3d colorCoefficients *v3FrontColorBlue;\r\n#else\r\n vec3 v3RayleighCoefficients \x3d (fScaledLength*0.75 * fOnePlusCos2*fKrESun)*v3InvWavelength;\r\n float fMieCoefficients \x3d fScaledLength*fKmESun * fMiePhaseCoefficients * fOnePlusCos2 / pow(1.0 + g2 - 2.0*g*fCos, 1.5);\r\n\r\n // Calculate the attenuation factor for the ground\r\n vec3 v3Color \x3d v3RayleighCoefficients * v3FrontColor + fMieCoefficients * v3FrontColor;\r\n vec3 v3ColorBlue \x3d v3RayleighCoefficients * v3FrontColorBlue + fMieCoefficients * v3FrontColorBlue;\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"atmosphereComputePixelColor"\x3e\x3c![CDATA[\r\n\r\n\r\n //HDR to LDR conversion\r\n vec3 ldrBlue \x3d expTM(v3ColorBlue,2.0*fExposure);\r\n vec3 ldrRed \x3d expTM(v3Color,fExposure);\r\n\r\n //mix reddish and blueish atmosphere\r\n vec3 LDR \x3d mix(ldrBlue,ldrRed,0.2);\r\n#ifdef HAZE\r\n LDR *\x3d (1.0-fCameraAngle);\r\n vec3 hsv \x3d rgb2hsv(LDR);\r\n hsv.y \x3d clamp(hsv.y*1.5,0.0,1.0);//boost haze saturation by 50%\r\n LDR \x3d hsv2rgb(hsv);\r\n vec3 finalColor \x3d LDR;\r\n // when rendering we specify the blend functions such that\r\n // newDestColor \x3d oldDestColor*(1.0-finalColor) + finalColor\r\n#else\r\n //reinhard tonemapper for looking upwards\r\n vec3 ldrReinhard \x3d reinhardTM(v3Color,fExposure);\r\n LDR +\x3d angleMultiplier*ldrReinhard;\r\n\r\n //height dependent parameter to smooth out reddish atmosphere\r\n float side \x3d (rayEndT+rayStartT)*0.5;\r\n float atmoHeight \x3d sqrt(fCameraHeight2 - side*side);\r\n float h2 \x3d clamp(1.0-(atmoHeight-fLowerAlphaBlendBound)/(fOuterRadius-fLowerAlphaBlendBound),0.0,1.0);\r\n\r\n vec3 finalColor \x3d LDR*h2;\r\n vec3 hsv \x3d rgb2hsv(finalColor);\r\n hsv.y \x3d clamp(hsv.y*1.5,0.0,1.0);//boost sky saturation by 50%\r\n finalColor \x3d hsv2rgb(hsv);\r\n#endif\r\n#ifdef PLANAR\r\n#ifndef HAZE\r\n float alpha \x3d clamp(fCameraHeight-fInnerRadius,7000.0,30000.0);\r\n alpha \x3d alpha / (30000.0-7000.0);\r\n gl_FragColor \x3d vec4(finalColor, 1.0-alpha);\r\n#else\r\n float alpha \x3d clamp(fCameraHeight-fInnerRadius,0.0,16500.0);\r\n alpha \x3d alpha / (16500.0-0.0);\r\n gl_FragColor \x3d vec4(finalColor, 1.0-alpha);\r\n#endif\r\n#else\r\n#ifndef HAZE\r\n float alpha \x3d clamp(fCameraHeight-fInnerRadius,7000.0,30000.0);\r\n alpha \x3d alpha / (30000.0-7000.0);\r\n float atmosStrength \x3d clamp((length(ldrRed)-0.05)*1.05,0.0,1.0);\r\n gl_FragColor \x3d vec4(finalColor, atmosStrength*clamp(1.0-(atmoHeight-fInnerRadius)/(fOuterRadius-fInnerRadius),0.0,1.0));\r\n#else\r\n gl_FragColor \x3d vec4(finalColor, 1.0) * altitudeAlpha;\r\n#endif\r\n#endif\r\n\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!--Fragment Shader for Atmosphere--\x3e\r\n\x3csnippet name\x3d"fsRealisticAtmosphere"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n$atmosphereUniformsConstantsVaryings\r\n\r\n$atmosphereScaleFunction\r\n\r\n //Conversion implementation found in util.xml\r\n$rgba2float\r\n\r\n\r\n$toneMapperConstants\r\n$exponentialToneMapper\r\n#ifndef HAZE\r\n$reinhardToneMapper\r\n#endif\r\n\r\n$HSVColorSpace\r\n\r\n void main()\r\n {\r\n\r\n $atmospherePrecomputation\r\n\r\n //Inside Atmosphere\r\n if (det \x3e\x3d 0.0) {\r\n#ifdef HAZE\r\n $atmosphereDiscardPixels\r\n\r\n if (continueComputation) {\r\n#endif\r\n $atmosphereUnpackAddUniforms\r\n\r\n $atmosphereComputeRayAndLoopSetup\r\n\r\n // Now loop through the sample rays\r\n for(int i\x3d0; i\x3cmaxSamples; i++)\r\n {\r\n $atmosphereComputeSampleContribution\r\n }\r\n\r\n $atmosphereComputeHDRColors\r\n\r\n $atmosphereComputePixelColor\r\n\r\n //Debug variable overlay\r\n if(showTest\x3e0.0){\r\n gl_FragColor \x3d vec4(test,1.0);\r\n }\r\n#ifdef HAZE\r\n } else {//Not on surface\r\n gl_FragColor \x3d vec4(0.0);\r\n }\r\n#endif\r\n } else {//Outside Atmosphere\r\n gl_FragColor \x3d vec4(0.0);\r\n }\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/offscreen.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsOffscreenRenderer"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n varying vec2 vtc;\r\n\r\n void main(void) {\r\n gl_Position \x3d vec4($position.xy, 0.0, 1.0);\r\n vtc \x3d $position.xy * 0.5 + 0.5;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsOffscreenRenderer"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n varying vec2 vtc;\r\n\r\n void main() {\r\n vec4 texColor \x3d texture2D(tex, vtc);\r\n gl_FragColor \x3d texColor;\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/environment/materials/StarMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderStar"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tuniform vec4 viewport;\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec4 $color;\r\n attribute float $size;\r\n\r\n\tvarying vec4 vcolor;\r\n\tvarying float vsize;\r\n\r\n\t$alignToPixelCenter\r\n\r\n\tvoid main(void) {\r\n\t\tvec4 posProj \x3d proj * view * model*vec4($position*1.0e25,1.0);//move infinitely far away\r\n\t\tgl_Position \x3d alignToPixelCenter(posProj, viewport.zw); //pixel align position\r\n gl_Position.z \x3d gl_Position.w; // project atmosphere onto the far plane\r\n\t\tvcolor \x3d $color/1.2;\r\n\t\tvsize \x3d size*5.0;\r\n\t\tgl_PointSize \x3d vsize;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderStar"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec4 vcolor;\r\n\tvarying float vsize;\r\n\r\n\tvoid main() {\r\n\t\tfloat cap \x3d 0.7;\r\n\t\tfloat scale \x3d 1.0/cap;\r\n\t\tfloat helper \x3d clamp(length(abs(gl_PointCoord-vec2(0.5))),0.0,cap);\r\n\t\tfloat alpha \x3d clamp((cap-helper)*scale,0.0,1.0);\r\n\t\tfloat intensity \x3d alpha*alpha*alpha;\r\n\t\tif (vsize \x3c 3.0)\r\n\t\t\tintensity *\x3d 0.5;\r\n\t\tgl_FragColor \x3d vec4(1.0,1.0,1.0,intensity);\r\n\t\tgl_FragColor.xyz *\x3d vcolor.xyz;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/highlight.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3c!--\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\nSmartly downsamples a texture, halfing its resolution. This allows for a square\r\nscreen region to check if none, any or all pixels were set.\r\n\r\nThe red channel is always ceiled after interpolating the 4 merged pixels.\r\nThis allows to evaluate:\r\nany(pixels.red !\x3d 0.0) as red \x3d\x3d 1.0\r\nnone(pixels.red !\x3d 0.0) as red \x3d\x3d 0.0\r\n\r\nThe green and blue channels are set to floor(max(green, blue)).\r\nThis allows to evaluate:\r\nall(pixels.green || pixels.blue) as green \x3d\x3d 1.0\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n--\x3e\r\n\r\n\x3csnippet name\x3d"vsConservativeDownsample"\x3e\x3c![CDATA[\r\n\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n\r\n void main()\r\n {\r\n gl_Position \x3d vec4(vec2(1.0) - $position * 2.0, .0, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsConservativeDownsample"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n uniform vec2 invFramebufferDim;\r\n\r\n void main()\r\n {\r\n vec2 coord \x3d gl_FragCoord.xy * invFramebufferDim;\r\n vec4 value \x3d texture2D(tex, coord);\r\n float mx \x3d floor(max(value.g, value.b));\r\n gl_FragColor \x3d vec4(ceil(value.r), mx, mx, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!--\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\nGaussian blur with linear sampling. Supports different number of samples, but\r\nonly 5 samples have proper weights. Uses linear texture interpolation to reduce\r\nthe number of samples taken.\r\n\r\nDefines:\r\nGRID_OPTIMIZATION (set or !set)\r\nGAUSSIAN_SAMPLES (3,5,7)\r\n\r\nThis technique requires linear filtering on source texture\r\nhttp://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n--\x3e\r\n\x3csnippet name\x3d"vsHighlightBlurFastGaussian"\x3e\x3c![CDATA[\r\n\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n attribute vec2 $uv0;\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n uniform sampler2D coverageTex;\r\n varying vec3 blurCoordinate;\r\n #else\r\n uniform vec2 blurSize;\r\n varying vec2 blurCoordinates[GAUSSIAN_SAMPLES];\r\n #endif\r\n\r\n void main()\r\n {\r\n gl_Position \x3d vec4($position, 0.0, 1.0);\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n // sample the coverage texture at the block center\r\n // and if no coverage detected, create degenerate triangle\r\n vec4 cov \x3d texture2D(coverageTex, $uv0);\r\n if (cov.r \x3d\x3d 0.0) {\r\n gl_Position \x3d vec4(0,0,0,0);\r\n }\r\n\r\n // create texture coordinate for blur center\r\n // encode information about fully inside block in z coordinate\r\n blurCoordinate \x3d vec3(gl_Position.xy * .5 + vec2(.5), max(cov.g, cov.b));\r\n #else\r\n vec2 uv \x3d $position.xy * .5 + vec2(.5);\r\n\r\n #if GAUSSIAN_SAMPLES \x3d\x3d 3\r\n // not proper gaussian weights\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 5\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n blurCoordinates[3] \x3d uv + blurSize * 3.294215;\r\n blurCoordinates[4] \x3d uv - blurSize * 3.294215;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 7\r\n // not proper gaussian weights\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n blurCoordinates[3] \x3d uv + blurSize * 3.294215;\r\n blurCoordinates[4] \x3d uv - blurSize * 3.294215;\r\n blurCoordinates[5] \x3d uv + blurSize * 5.1;\r\n blurCoordinates[6] \x3d uv - blurSize * 5.1;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 9\r\n // not proper gaussian weights\r\n blurCoordinates[0] \x3d uv;\r\n blurCoordinates[1] \x3d uv + blurSize * 1.407333;\r\n blurCoordinates[2] \x3d uv - blurSize * 1.407333;\r\n blurCoordinates[3] \x3d uv + blurSize * 3.294215;\r\n blurCoordinates[4] \x3d uv - blurSize * 3.294215;\r\n blurCoordinates[5] \x3d uv + blurSize * 5.1;\r\n blurCoordinates[6] \x3d uv - blurSize * 5.1;\r\n blurCoordinates[7] \x3d uv + blurSize * 7.1;\r\n blurCoordinates[8] \x3d uv - blurSize * 7.1;\r\n #endif\r\n #endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlightBlurFastGaussian"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n uniform vec2 blurSize;\r\n varying vec3 blurCoordinate;\r\n #else\r\n varying vec2 blurCoordinates[GAUSSIAN_SAMPLES];\r\n #endif\r\n\r\n void main()\r\n {\r\n #ifdef GRID_OPTIMIZATION\r\n vec2 uv \x3d blurCoordinate.xy;\r\n vec4 center \x3d texture2D(tex, uv);\r\n\r\n // do not blur if no pixel or all pixels in neighborhood are set\r\n if (blurCoordinate.z \x3d\x3d 1.0) {\r\n gl_FragColor \x3d center;\r\n }\r\n else {\r\n vec4 sum \x3d vec4(0.0);\r\n\r\n #if GAUSSIAN_SAMPLES \x3d\x3d 3\r\n // not proper gaussian weights\r\n sum +\x3d center * 0.204164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.407333) * 0.304005;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 5\r\n sum +\x3d center * 0.204164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv + blurSize * 3.294215) * 0.093913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 3.294215) * 0.093913;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 7\r\n // not proper gaussian weights\r\n sum +\x3d center * 0.204164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.407333) * 0.304005;\r\n sum +\x3d texture2D(tex, uv + blurSize * 3.294215) * 0.093913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 3.294215) * 0.093913;\r\n sum +\x3d texture2D(tex, uv + blurSize * 5.1) * 0.03;\r\n sum +\x3d texture2D(tex, uv - blurSize * 5.1) * 0.03;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 9\r\n // not proper gaussian weights\r\n sum +\x3d center * 0.154164;\r\n sum +\x3d texture2D(tex, uv + blurSize * 1.5) * 0.204005;\r\n sum +\x3d texture2D(tex, uv - blurSize * 1.5) * 0.204005;\r\n sum +\x3d texture2D(tex, uv + blurSize * 3.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 3.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv + blurSize * 5.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv - blurSize * 5.5) * 0.123913;\r\n sum +\x3d texture2D(tex, uv + blurSize * 7.5) * 0.05;\r\n sum +\x3d texture2D(tex, uv - blurSize * 7.5) * 0.05;\r\n #endif\r\n\r\n gl_FragColor \x3d sum;\r\n }\r\n #else\r\n vec4 sum \x3d vec4(0.0);\r\n\r\n #if GAUSSIAN_SAMPLES \x3d\x3d 3\r\n // not proper gaussian weights\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.204164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.304005;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 5\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.204164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[3]) * 0.093913;\r\n sum +\x3d texture2D(tex, blurCoordinates[4]) * 0.093913;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 7\r\n // not proper gaussian weights\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.204164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.304005;\r\n sum +\x3d texture2D(tex, blurCoordinates[3]) * 0.093913;\r\n sum +\x3d texture2D(tex, blurCoordinates[4]) * 0.093913;\r\n sum +\x3d texture2D(tex, blurCoordinates[5]) * 0.03;\r\n sum +\x3d texture2D(tex, blurCoordinates[6]) * 0.03;\r\n #elif GAUSSIAN_SAMPLES \x3d\x3d 9\r\n // not proper gaussian weights\r\n sum +\x3d texture2D(tex, blurCoordinates[0]) * 0.154164;\r\n sum +\x3d texture2D(tex, blurCoordinates[1]) * 0.204005;\r\n sum +\x3d texture2D(tex, blurCoordinates[2]) * 0.204005;\r\n sum +\x3d texture2D(tex, blurCoordinates[3]) * 0.123913;\r\n sum +\x3d texture2D(tex, blurCoordinates[4]) * 0.123913;\r\n sum +\x3d texture2D(tex, blurCoordinates[5]) * 0.09;\r\n sum +\x3d texture2D(tex, blurCoordinates[6]) * 0.09;\r\n sum +\x3d texture2D(tex, blurCoordinates[7]) * 0.05;\r\n sum +\x3d texture2D(tex, blurCoordinates[8]) * 0.05;\r\n #endif\r\n\r\n gl_FragColor \x3d sum;\r\n #endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!--\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\nMerging blurred outlines with source image, advanced version\r\n\r\nDefines:\r\nGRID_OPTIMIZATION (set or !set)\r\nGRID_DEBUG (set or !set)\r\n\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n--\x3e\r\n\x3csnippet name\x3d"vsHighlightApply"\x3e\x3c![CDATA[\r\n\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n varying vec2 uv;\r\n\r\n #ifdef GRID_OPTIMIZATION\r\n attribute vec2 $uv0;\r\n uniform sampler2D coverageTex;\r\n #endif\r\n\r\n void main()\r\n {\r\n #ifdef GRID_OPTIMIZATION\r\n #ifdef GRID_DEBUG\r\n vec4 cov \x3d texture2D(coverageTex, $uv0);\r\n // if no highlight pixel set in this block,\r\n // or all pixels set, hide block\r\n if (cov.r \x3d\x3d 0.0 || cov.g \x3d\x3d 1.0 || cov.b \x3d\x3d 1.0) {\r\n gl_Position \x3d vec4(0,0,0,0);\r\n return;\r\n }\r\n gl_Position \x3d vec4($position, .0, 1.0);\r\n uv \x3d $uv0;\r\n return;\r\n #else\r\n vec4 cov \x3d texture2D(coverageTex, $uv0);\r\n // if no highlight pixel set in this block, hide block\r\n if (cov.r \x3d\x3d 0.0) {\r\n gl_Position \x3d vec4(0,0,0,0);\r\n return;\r\n }\r\n #endif\r\n #endif\r\n\r\n gl_Position \x3d vec4($position, .0, 1.0);\r\n uv \x3d $position.xy * .5 + vec2(.5);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlightApply"\x3e\x3c![CDATA[\r\n\r\n $fsprecisionf\r\n\r\n uniform sampler2D tex;\r\n uniform sampler2D origin;\r\n\r\n uniform vec4 color;\r\n uniform float outlineSize;\r\n uniform float blurSize;\r\n uniform vec4 opacities; // [outline, outlineOccluded, fill, fillOccluded]\r\n\r\n varying vec2 uv;\r\n\r\n void main()\r\n {\r\n #if defined(GRID_OPTIMIZATION) \x26\x26 defined(GRID_DEBUG)\r\n gl_FragColor \x3d vec4(uv, 0, 1.0);\r\n #else\r\n // Read the highlight intensity from the blurred highlight image\r\n vec4 blurredHighlightValue \x3d texture2D(tex, uv);\r\n float highlightIntensity \x3d blurredHighlightValue.a;\r\n\r\n // Discard all pixels which are not affected by highlight\r\n if (highlightIntensity \x3d\x3d 0.0) {\r\n discard;\r\n }\r\n\r\n vec4 origin_color \x3d texture2D(origin, uv);\r\n\r\n float outlineIntensity;\r\n float fillIntensity;\r\n\r\n // if occluded\r\n if (blurredHighlightValue.g \x3e blurredHighlightValue.b) {\r\n outlineIntensity \x3d color.w * opacities[1];\r\n fillIntensity \x3d color.w * opacities[3];\r\n }\r\n // if unoccluded\r\n else {\r\n outlineIntensity \x3d color.w * opacities[0];\r\n fillIntensity \x3d color.w * opacities[2];\r\n }\r\n\r\n float inner \x3d 1.0 - outlineSize / 9.0;\r\n float outer \x3d 1.0 - (outlineSize + blurSize) / 9.0;\r\n\r\n float outlineFactor \x3d smoothstep(outer, inner, highlightIntensity);\r\n //float fillFactor \x3d smoothstep(0.6, 0.72, highlightIntensity);\r\n float fillFactor \x3d any(notEqual(origin_color, vec4(0.0, 0.0, 0.0, 0.0))) ? 1.0 : 0.0;\r\n float intensity \x3d outlineIntensity * outlineFactor * (1.0 - fillFactor) + fillIntensity * fillFactor;\r\n\r\n // Blending equation: gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\r\n // I.e., color should not be premultiplied with alpha\r\n gl_FragColor \x3d vec4(color.xyz, intensity);\r\n #endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/occluded.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsRenderOccludedApply"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n attribute vec2 $position;\r\n varying vec2 uv;\r\n\r\n void main(void) {\r\n gl_Position \x3d vec4($position, 0.0, 1.0);\r\n uv \x3d $position.xy * 0.5 + vec2(0.5);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRenderOccludedApply"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D occludedColorMap;\r\n\r\n varying vec2 uv;\r\n\r\n void main() {\r\n vec4 occludedColor \x3d texture2D(occludedColorMap, uv);\r\n gl_FragColor \x3d occludedColor * vec4(1.0, 1.0, 1.0, 0.4);\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/ssao.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\t\x3csnippet name\x3d"createFsSSAOSrc"\x3e\x3c![CDATA[\r\n\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D rnm;\r\n\tuniform sampler2D normalMap;\r\n\tuniform sampler2D depthMap;\r\n\tuniform float\t\tssaoAtt;\r\n\tuniform vec2\t\trnmScale;\r\n\tuniform float\t\tradius;\r\n\tuniform vec2\t\tnearFar;\r\n\tuniform vec3\t\tpSphere[64];\r\n\r\n\tvarying vec2\t\tuv;\r\n\r\n\tconst\tfloat\t\tstrength \x3d .07;\r\n\tconst\tfloat\t\tfalloff \x3d .000002;\r\n\r\n\t$rgba2float\r\n\tvoid main(void) {\r\n\t\tvec3 fres \x3d normalize((texture2D(rnm, uv * rnmScale).xyz * 2.0) - vec3(1.0));\r\n\t\tfloat currentPixelDepth \x3d rgba2float(texture2D(depthMap, uv));\r\n\t\tvec3 ep \x3d vec3(uv.xy, currentPixelDepth);\r\n\t\tvec3 norm \x3d vec3(-1.0) + 2.0 * texture2D(normalMap, uv).xyz;\r\n\t\tfloat bl \x3d .0;\r\n\t\tfloat f \x3d mix(nearFar.x, nearFar.y, currentPixelDepth) / nearFar.x;\r\n\t\tfloat radD \x3d radius / f;\r\n\t\tradD \x3d min(radD, .5);\r\n\t\tfloat depthDifference;\r\n\t\tvec3 ray;\r\n\r\n\t\tfor(int i \x3d 0; i \x3c NUM_TAP_SAMPLES; ++i) {\r\n\t\t\tray \x3d radD*reflect(pSphere[i], fres);\r\n\t\t\tvec2 tc \x3d ep.xy + sign(dot(ray, norm) ) * ray.xy;\r\n\t\t\tif (tc.x \x3e\x3d .0 \x26\x26 tc.y \x3e\x3d .0 \x26\x26 tc.x \x3c\x3d 1.0 \x26\x26 tc.y \x3c\x3d 1.0) {\r\n\t\t\t\tfloat occluderDepth \x3d rgba2float(texture2D(depthMap, tc));\r\n\t\t\t\tvec3 occluderNormal \x3d vec3(-1.0) + 2.0 * texture2D(normalMap, tc).xyz;\r\n\t\t\t\tdepthDifference \x3d currentPixelDepth - occluderDepth;\r\n\t\t\t\tbl +\x3d step(falloff, depthDifference) * (1.0 - dot(occluderNormal, norm)) * (1.0 - smoothstep(falloff, strength, depthDifference));\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tfloat ao \x3d 1.0 + bl * (-1.38 / float(NUM_TAP_SAMPLES)) * ssaoAtt;\r\n\t\tgl_FragColor.a \x3d ao;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"getDepthLinear"\x3e\x3c![CDATA[\r\n\tfloat getDepthLinear(vec2 ssC) {\r\n\t\treturn -(rgba2float(texture2D(depthMap, ssC))*(nearFar[1] - nearFar[0])+nearFar[0]);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"createFsSSAOSrcObscurance"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform mat4 projMatrixInv;\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform sampler2D depthMap;\r\n\r\n\tuniform float intensity;\r\n\r\n\tuniform float projScale;\r\n\tuniform float radius;\r\n\tuniform vec2 nearFar;\r\n\r\n\tuniform vec4 projInfo;\r\n\r\n\tuniform vec2\t screenDimensions;\r\n\r\n\t//noise texture lookup could be replaced with hash function if WebGL gets XOR functionality\r\n\tuniform vec3\t\tpSphere[NUM_TAP_SAMPLES]; //tap position\r\n\tuniform vec2\t\trnmScale;\r\n\tuniform sampler2D rnm; //noise texture\r\n\r\n\t//set z scaling, used to prevent division in ortho mode\r\n\tuniform vec2 zScale;\r\n\r\n\tvarying vec2 uv;\r\n\tvarying vec4 camPos;\r\n\r\n\t$rgba2float\r\n\t$getDepthLinear\r\n\r\n\t/** Returns a unit vector and a screen-space radius for the tap on a unit disk (the caller should scale by the actual disk radius) */\r\n\t/*uniform float numSpiralTurns;\r\n\tvec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){\r\n\t\t// Radius relative to ssR\r\n\t\tfloat alpha \x3d (float(sampleNumber) + 0.5) * (1.0 / float(NUM_TAP_SAMPLES));\r\n\t\tfloat angle \x3d alpha * (numSpiralTurns * 6.28) + spinAngle;\r\n\r\n\t\tssR \x3d alpha;\r\n\t\treturn vec2(cos(angle), sin(angle));\r\n\t}*/\r\n\r\n\r\n\tfloat fallOffFunction(float vv, float vn, float bias) {\r\n\t float radius2 \x3d radius * radius;\r\n\r\n\t\t// A: From the HPG12 paper\r\n\t\t// Note large epsilon to avoid overdarkening within cracks\r\n\t\t// return float(vv \x3c radius2) * max((vn - bias) / (epsilon + vv), 0.0) * radius2 * 0.6;\r\n\r\n\t\t// B: Smoother transition to zero (lowers contrast, smoothing out corners). [Recommended]\r\n\t\tfloat f \x3d max(radius2 - vv, 0.0); return f * f * f * max(vn-bias, 0.0);\r\n\r\n\t\t// C: Medium contrast (which looks better at high radii), no division. Note that the\r\n\t\t// contribution still falls off with radius^2, but we\'ve adjusted the rate in a way that is\r\n\t\t// more computationally efficient and happens to be aesthetically pleasing.\r\n\t\t// return 4.0 * max(1.0 - vv * invRadius2, 0.0) * max(vn - bias, 0.0);\r\n\r\n\t\t// D: Low contrast, no division operation\r\n\t\t// return 2.0 * float(vv \x3c radius * radius) * max(vn - bias, 0.0);\r\n\t}\r\n\r\n\r\n\t/** Compute the occlusion due to sample point \\a Q about camera-space point \\a C with unit normal \\a n_C */\r\n\tfloat aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {\r\n\t\tvec3 v \x3d Q - C;\r\n\t\tfloat vv \x3d dot(v, v);\r\n\t\tfloat vn \x3d dot(normalize(v), n_C);\r\n\t\treturn fallOffFunction(vv, vn, 0.1);\r\n\t}\r\n\r\n\r\n\t/** Reconstruct camera-space P.xyz from screen-space S \x3d (x, y) in\r\n\t\tpixels and camera-space z \x3c 0. Assumes that the upper-left pixel center\r\n\t\tis at (0.5, 0.5) [but that need not be the location at which the sample tap\r\n\t\twas placed!]\r\n\r\n\t\tCosts 3 MADD. Error is on the order of 10^3 at the far plane, partly due to z precision.\r\n\t */\r\n\tvec3 reconstructCSPosition(vec2 S, float z) {\r\n\t\treturn vec3(( (S.xy) * projInfo.xy + projInfo.zw)*(z*zScale.x+zScale.y), z);\r\n\t}\r\n\r\n\tvoid main(void)\r\n\t{\r\n\r\n\t\t//Hash function used in the HPG12 AlchemyAO paper\r\n\t\t//Not supported in WebGL -\x3e using texture lookup as in old SSAO shader instead\r\n\t\t//ivec2 ssC \x3d ivec2(gl_FragCoord.xy);\r\n\t\t//float randomPatternRotationAngle \x3d float((3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10);\r\n\t\tvec3 fres \x3d normalize((texture2D(rnm, uv * rnmScale).xyz * 2.0) - vec3(1.0));\r\n\r\n\t float currentPixelDepth \x3d getDepthLinear(uv);\r\n\r\n\t if (-currentPixelDepth\x3enearFar.y || -currentPixelDepth\x3cnearFar.x) {\r\n\t\tgl_FragColor \x3d vec4(0);\r\n\t\treturn;\r\n\t }\r\n\r\n\t vec3 currentPixelPos \x3d reconstructCSPosition(gl_FragCoord.xy,currentPixelDepth);\r\n\r\n\t // get the normal of current fragment\r\n\t vec4 norm4 \x3d texture2D(normalMap, uv);\r\n\t vec3 norm \x3d vec3(-1.0) + 2.0 * norm4.xyz;\r\n\t bool isTerrain \x3d norm4.w\x3c0.5;\r\n\r\n\t float sum \x3d .0;\r\n\r\n\t vec4 occluderFragment;\r\n\t vec3 ray;\r\n\r\n\t vec3 tapPixelPos;\r\n\r\n\t // note: the factor 2.0 should not be necessary, but makes ssao much nicer.\r\n\t // bug or deviation from CE somewhere else?\r\n\t float ps \x3d projScale/(2.0*currentPixelPos.z*zScale.x+zScale.y);\r\n\r\n\t for(int i \x3d 0; i \x3c NUM_TAP_SAMPLES; ++i)\r\n\t {\r\n\t\t // get a vector (randomized inside of a sphere with radius 1.0) from a texture and reflect it\r\n\t\t //float ssR;\r\n\t\t //vec2 unitOffset \x3d tapLocation(i, randomPatternRotationAngle, ssR);\r\n\t\t // get the depth of the occluder fragment\r\n\t\t //vec2 offset \x3d vec2(-unitOffset*radius*ssR*ps);\r\n\r\n\t\t vec2 unitOffset \x3d reflect(pSphere[i], fres).xy;\r\n\t\t vec2 offset \x3d vec2(-unitOffset*radius*ps);\r\n\r\n\r\n\t\t //don\'t use current or very nearby samples\r\n\t\t if ( abs(offset.x)\x3c2.0 || abs(offset.y)\x3c2.0) continue;\r\n\r\n\r\n\t\t vec2 tc \x3d vec2(gl_FragCoord.xy + offset);\r\n\t\t if (tc.x \x3c 0.0 || tc.y \x3c 0.0 || tc.x \x3e screenDimensions.x || tc.y \x3e screenDimensions.y) continue;\r\n\t\t vec2 tcTap \x3d tc/screenDimensions;\r\n\t\t float occluderFragmentDepth \x3d getDepthLinear(tcTap);\r\n\r\n\t\t if (isTerrain) {\r\n\t\t \tbool isTerrainTap \x3d texture2D(normalMap, tcTap).w\x3c0.5;\r\n\t\t \tif (isTerrainTap)\r\n\t\t \t\tcontinue;\r\n\t\t }\r\n\r\n\t\t tapPixelPos \x3d reconstructCSPosition(tc, occluderFragmentDepth);\r\n\r\n\t\t sum+\x3d aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);\r\n\t }\r\n\r\n\t // output the result\r\n\r\n\t\tfloat A \x3d max(1.0-sum*intensity/float(NUM_TAP_SAMPLES),0.0);\r\n\r\n\t\t// Anti-tone map to reduce contrast and drag dark region farther\r\n\t\t// (x^0.2 + 1.2 * x^4)/2.2\r\n\t\tA \x3d (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;\r\n\r\n\r\n\t //gl_FragColor \x3d vec4(norm/2.0+0.5, 1.0);\r\n\t //gl_FragColor \x3d vec4(-currentPixelDepth/1000.0);\r\n\t //gl_FragColor \x3d vec4(tapPixelPos.x/100.0);\r\n\t gl_FragColor \x3d vec4(A);\r\n\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsBlurEdgeAware"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform sampler2D depthMap;\r\n\tuniform sampler2D tex;\r\n\r\n\r\n\tuniform vec2 blurSize;\r\n\r\n\r\n\tuniform float g_BlurFalloff;\r\n\tuniform float projScale;\r\n\r\n\r\n\tvarying vec2 uv;\r\n\r\n\tuniform vec2\t\tnearFar;\r\n\r\n\t//set z scaling, used to prevent division in ortho mode\r\n\tuniform vec2 zScale;\r\n\r\n\t$rgba2float\r\n\t$getDepthLinear\r\n\r\n\tfloat BlurFunction(vec2 uv, float r, float center_d, inout float w_total, float sharpness)\r\n\t{\r\n\t\tfloat c \x3d texture2D(tex, uv).r;\r\n\t\tfloat d \x3d getDepthLinear(uv);\r\n\r\n\t\tfloat ddiff \x3d d - center_d;\r\n\r\n\t\tfloat w \x3d exp(-r*r*g_BlurFalloff - ddiff*ddiff*sharpness);\r\n\r\n\t\tw_total +\x3d w;\r\n\r\n\t\treturn w*c;\r\n\t}\r\n\r\n\tvoid main(void)\r\n\t{\r\n\r\n\t\tfloat b \x3d 0.0;\r\n\t\tfloat w_total \x3d 0.0;\r\n\r\n\t\tfloat center_d \x3d getDepthLinear(uv);\r\n\r\n\t\tfloat sharpness \x3d -0.05*projScale/(center_d*zScale.x+zScale.y);\r\n\t\tfor (int r \x3d -RADIUS; r \x3c\x3d RADIUS; ++r)\r\n\t\t{\r\n\t\t\tfloat rf \x3d float(r);\r\n\t\t\tvec2 uvOffset \x3d uv + rf*blurSize;\r\n\t\t\tb +\x3d BlurFunction(uvOffset, rf, center_d, w_total, sharpness);\r\n\t\t}\r\n\r\n\t\tgl_FragColor \x3d vec4(b/w_total);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\t\x3csnippet name\x3d"fsBlurSrc0"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform float blurSize;\r\n\tvarying vec2 uv;\r\n\r\n\tvoid main() {\r\n\t\tint rad \x3d RADIUS - 1;\r\n\r\n\t\tvec4 sum \x3d vec4(0.0);\r\n\t\tfor (int k \x3d -RADIUS; k \x3c\x3d RADIUS; ++k) { \t\t// NOTE for-variable-init must be a const expression\r\n\t\t\tfloat fi \x3d float(k);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsBlurSrc1"\x3e\x3c![CDATA[\r\n\t\t}\r\n\r\n\t\tgl_FragColor \x3d sum / float(RADIUS * RADIUS);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsBlurH"\x3e\x3c![CDATA[\r\n\t$fsBlurSrc0\r\n\t\t\tsum +\x3d texture2D(tex, vec2(uv.x + fi * blurSize, uv.y)) * (float(rad) - abs(fi) + 1.0);\r\n\t$fsBlurSrc1\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fsBlurV"\x3e\x3c![CDATA[\r\n\t$fsBlurSrc0\r\n\t\t\tsum +\x3d texture2D(tex, vec2(uv.x, uv.y + fi * blurSize)) * (float(rad) - abs(fi) + 1.0);\r\n\t$fsBlurSrc1\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/lib/edgeRendering/EdgeRendererUtils.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"EdgeRendererUtils_distanceBasedPerspectiveFactor"\x3e\x3c![CDATA[\r\n uniform float uDistanceFalloffFactor;\r\n\r\n float distanceBasedPerspectiveFactor(float distance) {\r\n return clamp(sqrt(uDistanceFalloffFactor / distance), 0.0, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"EdgeRendererUtils_readComponentColor"\x3e\x3c![CDATA[\r\n uniform sampler2D uComponentColorTex;\r\n uniform vec2 uComponentColorTexInvDim;\r\n\r\n attribute float componentIndex;\r\n\r\n vec4 readComponentColor() {\r\n float normalizedIndex \x3d (componentIndex + 0.5) * uComponentColorTexInvDim.x;\r\n vec2 indexCoord \x3d vec2(\r\n mod(normalizedIndex, 1.0),\r\n (floor(normalizedIndex) + 0.5) * uComponentColorTexInvDim.y\r\n );\r\n return texture2D(uComponentColorTex, indexCoord);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"EdgeRendererUtils_isSilhouetteEdge"\x3e\x3c![CDATA[\r\n // #uniforms: uView, uModel\r\n // #attributes: normalA, normalB\r\n bool isSilhouetteEdge(vec4 viewPos) {\r\n // transform the two face normals\r\n vec3 viewNormalA \x3d (uView * uModel * vec4(normalA, 0.0)).xyz;\r\n vec3 viewNormalB \x3d (uView * uModel * vec4(normalB, 0.0)).xyz;\r\n\r\n // compute the direction from the edge to the camera\r\n vec3 viewDir \x3d -viewPos.xyz;\r\n\r\n // check which of the two faces are visible\r\n // display the edge if exactly one of the two is visible\r\n float faceAVisible \x3d dot(viewDir, viewNormalA); // positive if visible\r\n float faceBVisible \x3d dot(viewDir, viewNormalB); // positive if visible\r\n\r\n // 1 if exactly one face visible, 0 otherwise\r\n return faceAVisible * faceBVisible \x3c 0.0;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"EdgeRendererUtils_adjustProjectedPosition"\x3e\x3c![CDATA[\r\n uniform vec2 uDepthBias;\r\n uniform vec2 uViewportDimInv;\r\n\r\n // Utility function to check for NaN values\r\n bool isNaN(float val) {\r\n return ( val \x3c 0.0 || 0.0 \x3c val || val \x3d\x3d 0.0 ) ? false : true;\r\n // important: some nVidias failed to cope with version below.\r\n // Probably wrong optimization.\r\n /*return ( val \x3c\x3d 0.0 || 0.0 \x3c\x3d val ) ? false : true;*/\r\n }\r\n\r\n // An offset in xy screen space, along the projected normal of the edge\r\n // This reduces depth fighting when looking at a face from a flat angle\r\n vec2 calculateProjectedBiasXY(vec4 projPos, vec3 worldNormal) {\r\n float offsetXY \x3d uDepthBias.x;\r\n float offsetZ \x3d uDepthBias.y;\r\n\r\n // screen space pixel offset\r\n // we multiply by two to account for the fact that NDC go from -1 to 1\r\n // we multiply by projPos.w to compensate for the perspective divison that happens later\r\n // normalizing over xyz means that the xy influence is reduced the more the normal is pointing\r\n // towards the camera\r\n vec4 projNormal \x3d uProj * uView * vec4(worldNormal, 0.0);\r\n\r\n return offsetXY * projPos.w * 2.0 * uViewportDimInv * normalize(projNormal.xyz).xy;\r\n }\r\n\r\n // A z-offset, using a depth based heuristic.\r\n float calculateProjectedBiasZ(vec4 projPos) {\r\n float offsetZ \x3d uDepthBias.y;\r\n return sqrt(projPos.z) * offsetZ;\r\n }\r\n\r\n vec4 adjustProjectedPosition(vec4 projPos, vec3 worldNormal, float lineWidth) {\r\n vec2 offsetXY \x3d calculateProjectedBiasXY(projPos, worldNormal);\r\n\r\n // we currently have to do this check because some geometries come with 0 length edge normals.\r\n // see https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/12890\r\n if (!isNaN(offsetXY.x) \x26\x26 !isNaN(offsetXY.y)) {\r\n projPos.xy +\x3d offsetXY;\r\n }\r\n\r\n projPos.z +\x3d calculateProjectedBiasZ(projPos) * lineWidth;\r\n\r\n return projPos;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"EdgeRendererUtils_worldNormal"\x3e\x3c![CDATA[\r\n vec3 modelToWorldNormal(vec3 normal) {\r\n return (uModel * vec4(normal, 0)).xyz;\r\n }\r\n\r\n vec3 silhouetteWorldNormal(vec3 normalA, vec3 normalB) {\r\n return modelToWorldNormal(normalize(normalA + normalB));\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"EdgeRendererUtils_extensionFalloff"\x3e\x3c![CDATA[\r\n // Fall-off extension length for shorter strokes, starting from strokes that are 256 size,\r\n // fall-off exponentially\r\n float calculateExtensionLength(float extensionLength, float lineLength) {\r\n return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/lib/edgeRendering/RibbonEdgeRenderer.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdgeSketch"\x3e\x3c![CDATA[\r\n#if defined(SKETCH) || defined(UBER)\r\n\r\nuniform vec2 uStrokesTextureScale;\r\nuniform float uStrokesLog2Resolution;\r\nuniform float uStrokeVariants;\r\n\r\nvarying vec2 vStrokeUV;\r\nvarying float vLineIndex;\r\n\r\n void calculateStyleOutputsSketch(float lineLength, UnpackedAttributes unpackedAttributes) {\r\n vec2 sidenessNorm \x3d unpackedAttributes.sidenessNorm;\r\n\r\n float lineIndex \x3d clamp(ceil(log2(lineLength)), 0.0, uStrokesLog2Resolution);\r\n\r\n vStrokeUV \x3d vec2(exp2(lineIndex) * sidenessNorm.y, lineIndex * uStrokeVariants + variantStroke + 0.5) * uStrokesTextureScale;\r\n vStrokeUV.x +\x3d variantOffset;\r\n\r\n vLineIndex \x3d lineIndex;\r\n }\r\n\r\n#endif /* SKETCH || UBER */\r\n\r\n#ifdef SKETCH\r\n\r\n void calculateStyleOutputs(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec4 projPos, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {\r\n calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes);\r\n }\r\n\r\n#endif /* SKETCH */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdgeEmissiveLighting"\x3e\x3c![CDATA[\r\n\r\n#if defined(EMISSIVE_LIGHTING) || defined(UBER)\r\n\r\n void calculateStyleOutputsEmissive(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec4 projPos, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {\r\n }\r\n#endif /* EMISSIVE_LIGHTING || UBER */\r\n\r\n#ifdef EMISSIVE_LIGHTING\r\n\r\n void calculateStyleOutputs(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec4 projPos, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {\r\n calculateStyleOutputsEmissive(viewPosV0, viewPosV1, worldPosV0, worldPosV1, projPos, worldNormal, unpackedAttributes);\r\n }\r\n\r\n#endif /* EMISSIVE_LIGHTING */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdgeUberLighting"\x3e\r\n\x3c![CDATA[\r\n\r\n#ifdef UBER\r\n\r\n varying float vType;\r\n\r\n void calculateStyleOutputs(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec4 projPos, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {\r\n vType \x3d unpackedAttributes.type;\r\n\r\n if (unpackedAttributes.type \x3d\x3d 0.0) {\r\n calculateStyleOutputsEmissive(viewPosV0, viewPosV1, worldPosV0, worldPosV1, projPos, worldNormal, unpackedAttributes);\r\n }\r\n else {\r\n calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes);\r\n }\r\n }\r\n\r\n#endif /* UBER */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdgeLineAmplitudeRegular"\x3e\x3c![CDATA[\r\n\r\n#if defined(UBER) || !defined(SKETCH)\r\n\r\n float calculateLineAmplitudeRegular() {\r\n return 0.0;\r\n }\r\n\r\n#endif /* UBER || !SKETCH */\r\n\r\n#if !defined(UBER) \x26\x26 !defined(SKETCH)\r\n\r\n float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {\r\n return calculateLineAmplitudeRegular();\r\n }\r\n\r\n#endif /* !UBER \x26\x26 !SKETCH */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdgeLineAmplitudeSketch"\x3e\x3c![CDATA[\r\n\r\n#if defined(UBER) || defined(SKETCH)\r\n\r\n uniform float uStrokesAmplitude;\r\n\r\n float calculateLineAmplitudeSketch() {\r\n return uStrokesAmplitude;\r\n }\r\n\r\n#endif /* UBER || SKETCH */\r\n\r\n#ifdef SKETCH\r\n\r\n float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {\r\n return calculateLineAmplitudeSketch();\r\n }\r\n\r\n#endif /* SKETCH */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdgeLineAmplitudeUber"\x3e\x3c![CDATA[\r\n\r\n#ifdef UBER\r\n\r\n float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {\r\n float type \x3d unpackedAttributes.type;\r\n\r\n if (type \x3c\x3d 0.0) {\r\n return calculateLineAmplitudeSketch();\r\n }\r\n else {\r\n return calculateLineAmplitudeRegular();\r\n }\r\n }\r\n\r\n#endif /* UBER */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonEdge"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n // Transformations\r\n uniform mat4 uProj;\r\n uniform mat4 uView;\r\n uniform mat4 uModel;\r\n uniform vec3 uCameraPosition;\r\n\r\n // Line configuration\r\n\r\n#ifndef UBER\r\n\r\n uniform int uLineWidth;\r\n uniform int uExtensionLength;\r\n\r\n#endif\r\n\r\n // Conversion constants\r\n uniform vec2 uPixelToNDC;\r\n uniform vec2 uNDCToPixel;\r\n\r\n // Inputs\r\n attribute vec3 position0;\r\n attribute vec3 position1;\r\n attribute float variantOffset;\r\n attribute float variantStroke;\r\n attribute float variantExtension;\r\n\r\n#ifdef SILHOUETTE\r\n\r\n attribute vec3 normalA;\r\n attribute vec3 normalB;\r\n\r\n#else /* SILHOUETTE */\r\n\r\n attribute vec3 normal;\r\n\r\n#endif /* SILHOUETTE */\r\n\r\nattribute vec2 sidenessAtt;\r\nattribute vec2 packedAttributes;\r\n\r\nstruct UnpackedAttributes {\r\n vec2 sideness;\r\n vec2 sidenessNorm;\r\n float lineWidthPixels;\r\n float extensionLengthPixels;\r\n\r\n#ifdef UBER\r\n\r\n float type;\r\n\r\n#endif\r\n};\r\n\r\n // Output required to compute color\r\n varying vec4 vColor;\r\n\r\n // Output required to compute distance to line/caps\r\n varying vec3 vPosition;\r\n varying float vRadius;\r\n varying float vLineLengthPixels;\r\n varying float vSizeFalloffFactor;\r\n\r\n $EdgeRendererUtils_adjustProjectedPosition\r\n\r\n $vsRibbonEdgeEmissiveLighting\r\n $vsRibbonEdgeSketch\r\n $vsRibbonEdgeUberLighting\r\n\r\n $vsRibbonEdgeLineAmplitudeRegular\r\n $vsRibbonEdgeLineAmplitudeSketch\r\n $vsRibbonEdgeLineAmplitudeUber\r\n\r\n $EdgeRendererUtils_readComponentColor\r\n $EdgeRendererUtils_distanceBasedPerspectiveFactor\r\n $EdgeRendererUtils_worldNormal\r\n $EdgeRendererUtils_extensionFalloff\r\n\r\n#ifdef SILHOUETTE\r\n\r\n $EdgeRendererUtils_isSilhouetteEdge\r\n\r\n#endif /* SILHOUETTE */\r\n\r\n vec4 calculateGeometricOutputs(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {\r\n vec2 sideness \x3d unpackedAttributes.sideness;\r\n vec2 sidenessNorm \x3d unpackedAttributes.sidenessNorm;\r\n\r\n vec4 viewPos \x3d mix(viewPosV0, viewPosV1, sidenessNorm.y);\r\n vec4 projPosV0 \x3d uProj * viewPosV0;\r\n vec4 projPosV1 \x3d uProj * viewPosV1;\r\n vec4 projPos \x3d uProj * viewPos;\r\n\r\n vec3 screenSpaceLineNDC \x3d (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w);\r\n vec2 screenSpaceLinePixels \x3d screenSpaceLineNDC.xy * uNDCToPixel;\r\n float lineLengthPixels \x3d length(screenSpaceLinePixels);\r\n\r\n float dzPerPixel \x3d screenSpaceLineNDC.z / lineLengthPixels;\r\n vec2 screenSpaceDirection \x3d screenSpaceLinePixels / lineLengthPixels;\r\n vec2 perpendicularScreenSpaceDirection \x3d vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x;\r\n\r\n float falloffFactor \x3d distanceBasedPerspectiveFactor(-viewPos.z);\r\n float lineWidthPixels \x3d unpackedAttributes.lineWidthPixels * falloffFactor;\r\n\r\n float extensionLengthPixels \x3d calculateExtensionLength(unpackedAttributes.extensionLengthPixels, lineLengthPixels) * falloffFactor;\r\n float lineAmplitudePixels \x3d calculateLineAmplitude(unpackedAttributes);\r\n\r\n vSizeFalloffFactor \x3d falloffFactor;\r\n\r\n float lineWidthAndAmplitudePixels \x3d lineWidthPixels + lineAmplitudePixels + lineAmplitudePixels;\r\n float extendedLineLengthPixels \x3d lineLengthPixels + extensionLengthPixels + extensionLengthPixels;\r\n\r\n#ifdef ANTIALIASING\r\n\r\n const float aaPaddingPixels \x3d 1.0;\r\n\r\n // Line size with padding\r\n float halfAAPaddedLineWidthAndAmplitudePixels \x3d lineWidthAndAmplitudePixels * 0.5 + aaPaddingPixels;\r\n float aaPaddedRoundedCapSizePixels \x3d lineWidthPixels * 0.5 + aaPaddingPixels;\r\n\r\n // Line length with padding\r\n float aaPaddedLineLengthPixels \x3d extendedLineLengthPixels + aaPaddingPixels + aaPaddingPixels;\r\n float halfAAPaddedLineLengthPixels \x3d aaPaddedLineLengthPixels * 0.5;\r\n\r\n#else /* ANTIALIASING */\r\n\r\n // Even if there is no AA, we still want to do proper \x3c1px rendering,\r\n // so we effectively clamp the pixel sizes to minimum of 1px and compute\r\n // coverage in the fragment shader\r\n float halfAAPaddedLineWidthAndAmplitudePixels \x3d max(lineWidthAndAmplitudePixels, 1.0) * 0.5;\r\n float aaPaddedRoundedCapSizePixels \x3d max(lineWidthPixels, 1.0) * 0.5;\r\n\r\n float halfAAPaddedLineLengthPixels \x3d max(extendedLineLengthPixels, 1.0) * 0.5;\r\n\r\n#endif /* ANTIALIASING */\r\n\r\n // Half line width in NDC including padding for anti aliasing\r\n vec2 halfAAPaddedLineWidthAndAmplitudeNDC \x3d halfAAPaddedLineWidthAndAmplitudePixels * uPixelToNDC;\r\n vec2 aaPaddedRoundedCapSizeNDC \x3d aaPaddedRoundedCapSizePixels * uPixelToNDC;\r\n vec2 extensionLengthNDC \x3d extensionLengthPixels * uPixelToNDC;\r\n\r\n // Compute screen space position of vertex, offsetting for line size and end caps\r\n vec2 ndcOffset \x3d (\r\n screenSpaceDirection * sideness.y * (aaPaddedRoundedCapSizeNDC + extensionLengthNDC)\r\n + perpendicularScreenSpaceDirection * halfAAPaddedLineWidthAndAmplitudeNDC\r\n );\r\n\r\n projPos.xy +\x3d ndcOffset * projPos.w;\r\n projPos.z +\x3d (dzPerPixel * (aaPaddedRoundedCapSizePixels + extensionLengthPixels)) * sideness.y * projPos.w;\r\n\r\n projPos \x3d adjustProjectedPosition(projPos, worldNormal, 1.0 + max((lineWidthAndAmplitudePixels - 1.0) * 0.5, 0.0));\r\n\r\n // Line length with end caps\r\n float aaPaddedLineWithCapsLengthPixels \x3d extendedLineLengthPixels + aaPaddedRoundedCapSizePixels + aaPaddedRoundedCapSizePixels;\r\n\r\n float pixelPositionAlongLine \x3d aaPaddedLineWithCapsLengthPixels * sidenessNorm.y - aaPaddedRoundedCapSizePixels;\r\n\r\n // Position in pixels with origin at first vertex of line segment\r\n vPosition \x3d vec3(\r\n halfAAPaddedLineWidthAndAmplitudePixels * sideness.x,\r\n pixelPositionAlongLine,\r\n pixelPositionAlongLine / extendedLineLengthPixels\r\n );\r\n\r\n // The line width radius in pixels\r\n vRadius \x3d lineWidthPixels * 0.5;\r\n vLineLengthPixels \x3d extendedLineLengthPixels;\r\n\r\n#ifdef SILHOUETTE\r\n\r\n gl_Position \x3d isSilhouetteEdge(viewPosV0) ? projPos : vec4(10, 10, 10, 1);\r\n\r\n#else /* SILHOUETTE */\r\n\r\n gl_Position \x3d projPos;\r\n\r\n#endif /* SILHOUETTE */\r\n\r\n#ifdef UBER\r\n\r\n if (unpackedAttributes.type \x3c\x3d 0.0 \x26\x26 lineLengthPixels \x3c\x3d 3.0) {\r\n gl_Position \x3d vec4(10, 10, 10, 1);\r\n }\r\n\r\n#elif defined(SKETCH)\r\n\r\n if (lineLengthPixels \x3c\x3d 3.0) {\r\n gl_Position \x3d vec4(10, 10, 10, 1);\r\n }\r\n\r\n#endif\r\n\r\n return projPos;\r\n }\r\n\r\n void calculateColorOutputs() {\r\n vColor \x3d readComponentColor();\r\n }\r\n\r\n#ifdef UBER\r\n\r\n#if __VERSION__ !\x3d 100\r\n#define SUPPORTS_BITWISE_OPERATIONS\r\n#endif\r\n\r\n#ifndef SUPPORTS_BITWISE_OPERATIONS\r\n\r\n /**\r\n * Returns whether the first bit in x is set (0 or 1) and shifts\r\n * the input by one bit.\r\n */\r\n int isSetAndShift(inout int x) {\r\n int isSet \x3d x - 2 * (x / 2);\r\n x /\x3d 2;\r\n\r\n return isSet;\r\n }\r\n\r\n#endif /* SUPPORTS_BITWISE_OPERATIONS */\r\n\r\n UnpackedAttributes unpackAttributes() {\r\n int packedTypeAndLineWidth \x3d int(packedAttributes.x);\r\n float extensionLengthPixels \x3d float(packedAttributes.y);\r\n\r\n#ifndef SUPPORTS_BITWISE_OPERATIONS\r\n\r\n int type \x3d isSetAndShift(packedTypeAndLineWidth);\r\n int lineWidthPixels \x3d packedTypeAndLineWidth;\r\n\r\n#else /* SUPPORTS_BITWISE_OPERATIONS */\r\n\r\n int type \x3d (packedTypeAndLineWidth ) \x26 0x01;\r\n int lineWidthPixels \x3d (packedTypeAndLineWidth \x3e\x3e 1) \x26 0xf;\r\n\r\n#endif /* SUPPORTS_BITWISE_OPERATIONS */\r\n\r\n vec2 sidenessNorm \x3d sidenessAtt;\r\n vec2 sideness \x3d sidenessNorm * 2.0 - 1.0;\r\n\r\n float fType \x3d -float(type) + 0.5; // SOLID (\x3d0) needs to be \x3e 0.0, SKETCHY (\x3d1) needs to be \x3c\x3d 0;\r\n\r\n if (fType \x3c\x3d 0.0) {\r\n extensionLengthPixels *\x3d variantExtension * 2.0 - 1.0;\r\n }\r\n\r\n return UnpackedAttributes(sideness, sidenessNorm, float(lineWidthPixels), extensionLengthPixels, fType);\r\n }\r\n\r\n#else /* UBER */\r\n\r\n UnpackedAttributes unpackAttributes() {\r\n vec2 sidenessNorm \x3d sidenessAtt;\r\n vec2 sideness \x3d sidenessNorm * 2.0 - 1.0;\r\n float extensionLengthPixels \x3d float(uExtensionLength);\r\n\r\n#ifdef SKETCH\r\n\r\n extensionLengthPixels *\x3d variantExtension * 2.0 - 1.0;\r\n\r\n#endif /* SKETCH */\r\n\r\n return UnpackedAttributes(sideness, sidenessNorm, float(uLineWidth), extensionLengthPixels);\r\n }\r\n\r\n#endif /* UBER */\r\n\r\n void main() {\r\n\r\n UnpackedAttributes unpackedAttributes \x3d unpackAttributes();\r\n\r\n vec4 worldPosV0 \x3d uModel * vec4(position0, 1.0);\r\n vec4 worldPosV1 \x3d uModel * vec4(position1, 1.0);\r\n\r\n vec4 viewPosV0 \x3d uView * worldPosV0;\r\n vec4 viewPosV1 \x3d uView * worldPosV1;\r\n\r\n#ifdef SILHOUETTE\r\n\r\n vec3 worldNormal \x3d silhouetteWorldNormal(normalA, normalB);\r\n\r\n#else /* SILHOUETTE */\r\n\r\n vec3 worldNormal \x3d modelToWorldNormal(normal);\r\n\r\n#endif /* SILHOUETTE */\r\n\r\n // General geometric computation for all types of edges\r\n vec4 projPos \x3d calculateGeometricOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, worldNormal, unpackedAttributes);\r\n calculateColorOutputs();\r\n\r\n // Specific computation for different edge styles\r\n calculateStyleOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, projPos, worldNormal, unpackedAttributes);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdgeEmissiveLighting"\x3e\x3c![CDATA[\r\n\r\n#if defined(EMISSIVE_LIGHTING) || defined(UBER)\r\n\r\n vec3 evaluateEdgeLightingEmissive(vec2 distance) {\r\n return vColor.rgb;\r\n }\r\n\r\n#endif /* EMISSIVE_LIGHTING || UBER */\r\n\r\n#ifdef EMISSIVE_LIGHTING\r\n\r\n vec3 evaluateEdgeLighting(vec2 distance) {\r\n return evaluateEdgeLightingEmissive(distance);\r\n }\r\n\r\n#endif /* EMISSIVE_LIGHTING */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdgeSketchLighting"\x3e\x3c![CDATA[\r\n\r\n#if defined(SKETCH) || defined(UBER)\r\n\r\n vec3 evaluateEdgeLightingSketch(vec2 distance) {\r\n return vColor.rgb;\r\n }\r\n\r\n#endif /* SKETCH || UBER */\r\n\r\n#ifdef SKETCH\r\n\r\n vec3 evaluateEdgeLighting(vec2 distance) {\r\n return evaluateEdgeLightingSketch(distance);\r\n }\r\n\r\n#endif /* SKETCH */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdgeUberLighting"\x3e\x3c![CDATA[\r\n\r\n#ifdef UBER\r\n\r\n varying float vType;\r\n\r\n vec3 evaluateEdgeLighting(vec2 distance) {\r\n if (vType \x3e 0.0) { // EMISSIVE\r\n return evaluateEdgeLightingEmissive(distance);\r\n }\r\n else { // SKETCH\r\n return evaluateEdgeLightingSketch(distance);\r\n }\r\n }\r\n\r\n#endif\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdgeLineOffsetSketch"\x3e\x3c![CDATA[\r\n\r\n$rgba2float\r\n\r\n#if defined(UBER) || defined(SKETCH)\r\n\r\n uniform sampler2D uStrokesTexture;\r\n uniform float uStrokesNormalizationScale;\r\n\r\n varying vec2 vStrokeUV;\r\n\r\n float calculateLineOffsetSketch() {\r\n float offsetNorm \x3d rgba2float(texture2D(uStrokesTexture, vStrokeUV));\r\n return (offsetNorm - 0.5) * uStrokesNormalizationScale;\r\n }\r\n\r\n float calculateLinePressureSketch() {\r\n\r\n#ifdef PRESSURE\r\n\r\n return rgba2float(texture2D(uStrokesTexture, vStrokeUV + vec2(0, 0.5)));\r\n\r\n#else\r\n\r\n return 1.0;\r\n\r\n#endif /* PRESSURE */\r\n\r\n }\r\n\r\n#endif /* UBER || SKETCH */\r\n\r\n#ifdef SKETCH\r\n\r\n float calculateLineOffset() {\r\n return calculateLineOffsetSketch();\r\n }\r\n\r\n float calculateLinePressure() {\r\n return calculateLinePressureSketch();\r\n }\r\n\r\n#endif /* SKETCH */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdgeLineOffsetRegular"\x3e\x3c![CDATA[\r\n\r\n#if defined(UBER) || !defined(SKETCH)\r\n\r\n float calculateLineOffsetRegular() {\r\n return 0.0;\r\n }\r\n\r\n float calculateLinePressureRegular() {\r\n return 1.0;\r\n }\r\n\r\n#endif /* UBER || !SKETCH */\r\n\r\n#if !defined(UBER) \x26\x26 !defined(SKETCH)\r\n\r\n float calculateLineOffset() {\r\n return calculateLineOffsetRegular();\r\n }\r\n\r\n float calculateLinePressure() {\r\n return calculateLinePressureRegular();\r\n }\r\n\r\n#endif /* !UBER || !SKETCH */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdgeLineOffsetUber"\x3e\x3c![CDATA[\r\n\r\n#ifdef UBER\r\n\r\n float calculateLineOffset() {\r\n if (vType \x3c\x3d 0.0) {\r\n return calculateLineOffsetSketch();\r\n }\r\n else {\r\n return calculateLineOffsetRegular();\r\n }\r\n }\r\n\r\n float calculateLinePressure() {\r\n\r\n#ifdef PRESSURE\r\n\r\n if (vType \x3c\x3d 0.0) {\r\n return calculateLinePressureSketch();\r\n }\r\n else {\r\n return calculateLinePressureRegular();\r\n }\r\n\r\n#else\r\n\r\n return calculateLinePressureRegular();\r\n\r\n#endif /* PRESSURE */\r\n\r\n }\r\n\r\n#endif /* UBER */\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonEdge"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n varying vec4 vColor;\r\n varying float vRadius;\r\n varying vec3 vPosition;\r\n varying float vLineLengthPixels;\r\n varying float vSizeFalloffFactor;\r\n varying float vLineIndex;\r\n\r\n // At which coverage threshold we discard a fragment completely\r\n #define COVERAGE_TEST_THRESHOLD 0.01\r\n\r\n $fsRibbonEdgeEmissiveLighting\r\n $fsRibbonEdgeSketchLighting\r\n $fsRibbonEdgeUberLighting\r\n\r\n $fsRibbonEdgeLineOffsetRegular\r\n $fsRibbonEdgeLineOffsetSketch\r\n $fsRibbonEdgeLineOffsetUber\r\n\r\n vec2 lineWithCapsDistance(float radius, vec2 position, float lineLength) {\r\n float lineOffset \x3d calculateLineOffset();\r\n float positionX \x3d position.x - lineOffset;\r\n\r\n if (radius \x3c 1.0) {\r\n // Handle this specifically for subpixel sizes:\r\n // 1. Compute correct coverage (note coverage is computed by\r\n // 0.5 - dist, so we make sure that that will lead to correct\r\n // subpixel coverage\r\n // 2. Ignore rounded caps\r\n float coverageX \x3d clamp(min(radius, positionX + 0.5) - max(-radius, positionX - 0.5), 0.0, 1.0);\r\n float coverageY \x3d clamp(min(lineLength, position.y + 0.5) - max(0.0, position.y - 0.5), 0.0, 1.0);\r\n\r\n float coverage \x3d min(coverageX, coverageY);\r\n\r\n return vec2(0.5 - coverage, 0.0);\r\n }\r\n else {\r\n // Between -radius -\x3e 0 for start cap, 0 for line, 0 -\x3e radius\r\n float positionOnCap \x3d position.y - clamp(position.y, 0.0, lineLength);\r\n\r\n vec2 lineToPosition \x3d vec2(positionX, positionOnCap);\r\n return vec2(length(lineToPosition) - radius, positionOnCap / radius);\r\n }\r\n }\r\n\r\n void main() {\r\n\r\n float radius \x3d vRadius * calculateLinePressure();\r\n\r\n vec2 distance \x3d lineWithCapsDistance(radius, vPosition.xy, vLineLengthPixels);\r\n float coverage \x3d clamp(0.5 - distance.x, 0.0, 1.0);\r\n\r\n#ifdef ANTIALIASING\r\n\r\n const float coverageLimit \x3d COVERAGE_TEST_THRESHOLD;\r\n\r\n#else /* ANTIALIASING */\r\n\r\n // Use subpixel coverage computation when lines get subpixel widths\r\n // so we still render them appropriately. Otherwise discard anything\r\n // that is not fully within the line\r\n float coverageLimit \x3d radius \x3c\x3d 0.5 ? COVERAGE_TEST_THRESHOLD : 0.75;\r\n\r\n#endif /* ANTIALIASING */\r\n\r\n if (coverage \x3c coverageLimit) {\r\n discard;\r\n }\r\n\r\n vec3 shadedColor \x3d evaluateEdgeLighting(distance);\r\n float alpha \x3d vColor.a * coverage;\r\n\r\n gl_FragColor \x3d vec4(shadedColor, alpha);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/HUDMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderHUD"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n $commonAttributesAndUniformsHUD\r\n\r\n uniform float pixelRatio;\r\n uniform vec2 screenOffset;\r\n uniform vec2 anchorPos;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n uniform vec4 screenSizePerspective;\r\n\r\n#endif\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n varying vec3 debugBorderCoords;\r\n#endif\r\n\r\n attribute vec2 $uv0;\r\n attribute vec4 $color;\r\n attribute vec2 $size;\r\n attribute vec4 $auxpos2;\r\n\r\n varying vec4 vcolor;\r\n\r\n varying vec2 vtc;\r\n varying vec2 vsize;\r\n\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n varying float voccluded;\r\n#endif\r\n\r\n $vvUniforms\r\n\r\n $alignToPixelCenter\r\n $alignToPixelOrigin\r\n $projectPositionHUD\r\n $vvFunctions\r\n\r\n void main(void) {\r\n ProjectHUDAux projectAux;\r\n vec4 posProj \x3d projectPositionHUD(projectAux);\r\n\r\n vec2 inputSize;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n inputSize \x3d screenSizePerspectiveScaleVec2($size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective);\r\n\r\n vec2 screenOffsetScaled \x3d screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);\r\n\r\n#else\r\n\r\n inputSize \x3d $size;\r\n\r\n vec2 screenOffsetScaled \x3d screenOffset;\r\n#endif\r\n\r\n#ifdef VV_SIZE\r\n // only use width (.xx) for proportional scaling\r\n // (if no width was defined in vv, width\r\n // will be a copy of height vv)\r\n inputSize *\x3d vvGetScale($auxpos2).xx;\r\n#endif\r\n\r\n vec2 combinedSize \x3d inputSize * pixelRatio;\r\n vec4 quadOffset \x3d vec4(0);\r\n\r\n#if defined(OCCL_TEST) || defined(BINARY_HIGHLIGHT_OCCLUSION)\r\n bool visible \x3d testVisibilityHUD(posProj);\r\n#endif\r\n\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n voccluded \x3d visible ? 0.0 : 1.0;\r\n#endif\r\n\r\n#ifdef OCCL_TEST\r\n if (visible) {\r\n#endif\r\n // UV goes from 0 to 1.99999, where the integer part is used\r\n // for the normalized vertex coordinates, and the fractional\r\n // part is used for texture sampling\r\n vec2 uv01 \x3d floor($uv0);\r\n vec2 uv \x3d $uv0 - uv01;\r\n\r\n // Displace icon based on anchor position (normalized for size) and\r\n // absolute screen offset. anchorPos is [-0.5, 0.5]\r\n quadOffset.xy \x3d ((uv01 - anchorPos) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;\r\n\r\n#ifdef SIGNED_DISTANCE_FIELD\r\n\r\n // SDF primitives might be scaled so that the SDF texture resolution does\r\n // not match the resolution of the canvas, but we still want to render\r\n // outline-only (\'cross\' and \'x\') primitives cleanly. Aligning to a screen\r\n // pixel border at the geometry center achieves this, since SDF textures\r\n // always have power of 2 dimensions.\r\n posProj \x3d alignToPixelOrigin(posProj, viewport.zw) + quadOffset;\r\n#else\r\n posProj +\x3d quadOffset;\r\n\r\n // Aligning vertex positions to the nearest (using \'floor\') screen pixel\r\n // border renders textures with pixel-perfect results. If the texture\r\n // resolution does not match the canvas resolution then aligning is\r\n // redundant.\r\n if (inputSize.x \x3d\x3d $size.x) {\r\n posProj \x3d alignToPixelOrigin(posProj, viewport.zw);\r\n }\r\n#endif\r\n\r\n gl_Position \x3d posProj;\r\n\r\n vtc \x3d uv;\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n debugBorderCoords \x3d vec3(uv01, 1.0 / combinedSize);\r\n#endif\r\n\r\n vsize \x3d inputSize;\r\n#ifdef OCCL_TEST\r\n } else {\r\n vtc \x3d vec2(.0);\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n debugBorderCoords \x3d vec3(0);\r\n#endif\r\n\r\n }\r\n#endif\r\n\r\n gl_Position \x3d posProj;\r\n\r\n#ifdef VV_COLOR\r\n vcolor \x3d vvGetColor($auxpos2, vvColorValues, vvColorColors);\r\n#else\r\n vcolor \x3d $color / 255.0;\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUDBaseVariables"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n #extension GL_OES_standard_derivatives : require\r\n\r\n uniform sampler2D tex;\r\n uniform vec4 overrideColor;\r\n uniform vec4 outlineColor;\r\n uniform float outlineSize;\r\n\r\n varying vec4 vcolor;\r\n\r\n varying vec2 vtc;\r\n varying vec2 vsize;\r\n\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n varying float voccluded;\r\n#endif\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n varying vec3 debugBorderCoords;\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUDBaseMain"\x3e\x3c![CDATA[\r\n vec4 premultiply(vec4 v) {\r\n return vec4(v.rgb * v.a, v.a);\r\n }\r\n\r\n void main() {\r\n\r\n#ifdef SIGNED_DISTANCE_FIELD\r\n vec4 color \x3d vec4(0.0, 0.0, 0.0, 0.0);\r\n vec4 fillPixelColor \x3d overrideColor * vcolor;\r\n\r\n // Attempt to sample texel centers to avoid thin cross outline\r\n // disappearing with large symbol sizes.\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041\r\n const float txSize \x3d 128.0;\r\n vec2 scaleFactor \x3d ((vsize - txSize) / txSize);\r\n vec2 samplePos \x3d vtc + vec2(1.0, -1.0) * (1.0 / txSize) * scaleFactor;\r\n\r\n // Distance in [-0.5, 0.5]\r\n float d \x3d dot(texture2D(tex, samplePos), vec4(1.0/16777216.0, 1.0/65535.0, 1.0/256.0, 1.0)) - 0.5;\r\n\r\n // Work around loss of precision for \'d \x3d 0.0\'.\r\n // \'0\' gets normalised to 0.5 * 256 \x3d 128 before float packing, but can only\r\n // be stored in the texture as 128 / 255 \x3d 0.502.\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603110\r\n const float diff \x3d (128.0/255.0 - 0.5);\r\n\r\n // adjust all values, not just those close to 0, to avoid discontinuities in\r\n // the outlines of other shapes e.g. circles\r\n d \x3d d - diff;\r\n\r\n // Distance in output units\r\n float dist \x3d d * vsize.x;\r\n\r\n fillPixelColor.a *\x3d clamp(0.5 - dist, 0.0, 1.0);\r\n\r\n if (outlineSize \x3e 0.25) {\r\n vec4 outlinePixelColor \x3d outlineColor;\r\n float clampedOutlineSize \x3d min(outlineSize, 0.5*vsize.x);\r\n outlinePixelColor.a *\x3d clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0);\r\n\r\n // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description)\r\n float compositeAlpha \x3d outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a);\r\n vec3 compositeColor \x3d vec3(outlinePixelColor) * outlinePixelColor.a +\r\n vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a);\r\n\r\n gl_FragColor \x3d vec4(compositeColor, compositeAlpha);\r\n }\r\n else {\r\n gl_FragColor \x3d premultiply(fillPixelColor);\r\n }\r\n\r\n // visualize SDF:\r\n // gl_FragColor \x3d vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0);\r\n#else\r\n\r\n // HUDMaterial is rendered with a blending mode that assumes a pre-multiplied\r\n // fragment color. Input textures should already be pre-multiplied and so\r\n // don\'t require adjustment, but the override and vertex colors must be\r\n // modulated by their alpha values.\r\n\r\n gl_FragColor \x3d texture2D(tex, vtc, -0.5) * premultiply(overrideColor * vcolor);\r\n\r\n#endif\r\n\r\n#ifdef DEBUG_DRAW_BORDER\r\n float isBorder \x3d float(any(lessThan(debugBorderCoords.xy, vec2(debugBorderCoords.z))) || any(greaterThan(debugBorderCoords.xy, vec2(1.0 - debugBorderCoords.z))));\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1, 0, 1, 1), isBorder);\r\n#endif\r\n\r\n if (gl_FragColor.a \x3c 0.1) {\r\n discard;\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUD"\x3e\x3c![CDATA[\r\n$fragmentShaderHUDBaseVariables\r\n$fragmentShaderHUDBaseMain\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderHUDHighlight"\x3e\x3c![CDATA[\r\n$fragmentShaderHUDBaseVariables\r\n\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n$fragmentShaderHUDBaseMain\r\n#ifdef BINARY_HIGHLIGHT_OCCLUSION\r\n // Instead of deciding on a per-pixel basis if the highlight is occluded,\r\n // do it for all highlight pixel based on the centroid occlusion. This\r\n // is a temporary solution for:\r\n // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/9645\r\n if (voccluded \x3d\x3d 1.0) {\r\n gl_FragColor \x3d vec4(1.0, 1.0, 0.0, 1.0);\r\n } else {\r\n gl_FragColor \x3d vec4(1.0, 0.0, 1.0, 1.0);\r\n }\r\n#else\r\n $highlightWrite\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"vertexShaderOcclusionTestPixel"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n $commonAttributesAndUniformsHUD\r\n\r\n $alignToPixelCenter\r\n $projectPositionHUD\r\n\r\n void main(void) {\r\n vec4 posProjCenter;\r\n\r\n // Check for special value of position (0, 0, 0) which is used by the Renderer when graphics\r\n // are removed before the VBO is recompacted. If this is the case, then we just project outside\r\n // of clip space.\r\n if (dot($position, $position) \x3e 0.0) {\r\n // Render single point to center of the pixel to avoid subpixel filtering to affect\r\n // the marker color\r\n ProjectHUDAux projectAux;\r\n vec4 posProj \x3d projectPositionHUD(projectAux);\r\n\r\n posProjCenter \x3d alignToPixelCenter(posProj, viewport.zw);\r\n }\r\n else {\r\n // Project out of clip space\r\n posProjCenter \x3d vec4(1e038, 1e038, 1e038, 1.0);\r\n }\r\n\r\n gl_Position \x3d posProjCenter;\r\n gl_PointSize \x3d 1.0;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/TexOnlyGLMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderTexOnly"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d proj * view * vec4((model * vec4(position, 1.0)).xyz, 1.0);\r\n\t\tvtc \x3d $uv0;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderTexOnly"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform vec4 color;\r\n\tvarying vec2 vtc;\r\n\r\n\tvoid main() {\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tgl_FragColor \x3d texColor * color;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/hud.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"commonAttributesAndUniformsHUD"\x3e\x3c![CDATA[\r\n attribute vec3 $position;\r\n attribute vec3 $normal;\r\n attribute vec4 $auxpos1;\r\n\r\n uniform mat4 proj;\r\n\r\n uniform mat4 view;\r\n uniform mat4 viewNormal;\r\n\r\n uniform mat4 model;\r\n uniform mat4 modelNormal;\r\n\r\n uniform vec4 viewport;\r\n\r\n uniform vec3 camPos;\r\n\r\n uniform float polygonOffset;\r\n uniform float cameraGroundRelative;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\r\n // [ screenLength, distanceFactor, minWorldLength, maxWorldLength ]\r\n uniform vec4 verticalOffset;\r\n\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n // [ divisor, offset, minPixelSize, paddingPixels ]\r\n uniform vec4 screenSizePerspectiveAlignment;\r\n\r\n#endif\r\n\r\n uniform sampler2D hudVisibilityTexture;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"projectPositionHUD"\x3e\x3c![CDATA[\r\n $screenSizePerspective\r\n\r\n // Corresponds to cos(10 deg), used to compare against dot product of two vectors\r\n const float SMALL_OFFSET_ANGLE \x3d 0.984807753012208;\r\n\r\n struct ProjectHUDAux {\r\n vec3 posModel;\r\n vec3 posView;\r\n vec3 vnormal;\r\n\r\n float distanceToCamera;\r\n float absCosAngle;\r\n };\r\n\r\n\r\n /**\r\n * Apply the simulated polygon offset for HUD objects that improves\r\n * issues with Z-fighting.\r\n *\r\n * @param posView {vec3} (inout) the position in view space. Will be modified in place.\r\n * @param pointGroundDistance {float} the distance from the point geometry to the ground surface.\r\n * @param absCosAngle {float} the absolute cosine of the angle between the world-up at the point geometry\r\n * and the view direction.\r\n *\r\n * Dependencies:\r\n *\r\n * Attributes:\r\n * - auxpos1: contains centerOffset and pointGroundDistance\r\n *\r\n * Uniforms:\r\n * - cameraGroundRelative: indicates whether camera is above (1) or below (-1) ground.\r\n * This is used for emulated polygon offset for improved visibility of points sitting on the surface.\r\n * - polygonOffset: a constant polygon offset to bring the point closer to the viewer for\r\n * reduced flickering.\r\n * - viewport: the viewport [x, y, width, height]\r\n */\r\n float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) {\r\n float pointGroundSign \x3d sign(pointGroundDistance);\r\n\r\n if (pointGroundSign \x3d\x3d 0.0) {\r\n pointGroundSign \x3d 1.0;\r\n }\r\n\r\n // cameraGroundRelative is -1 if camera is below ground, 1 if above ground\r\n // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise\r\n float groundRelative \x3d cameraGroundRelative * pointGroundSign;\r\n\r\n // view angle dependent part of polygon offset emulation\r\n // we take the absolute value because the sign that is dropped is\r\n // instead introduced using the ground-relative position of the symbol and the camera\r\n if (polygonOffset \x3e .0) {\r\n float cosAlpha \x3d clamp(absCosAngle, 0.01, 1.0);\r\n\r\n float tanAlpha \x3d sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha;\r\n float factor \x3d (1.0 - tanAlpha / viewport[2]);\r\n\r\n // same side of the terrain\r\n if (groundRelative \x3e 0.0) {\r\n posView *\x3d factor;\r\n }\r\n // opposite sides of the terrain\r\n else {\r\n posView /\x3d factor;\r\n }\r\n }\r\n\r\n return groundRelative;\r\n }\r\n\r\n /**\r\n * Project the 3d position of a HUD object from world space to clip space. In addition\r\n * to standard model view projection, it also emulates a polygon offset to\r\n * help with points above/below ground and icon flickering. The resulting location\r\n * is the anchor of the HUD object, i.e. the position that is used also for testing\r\n * visibility of the HUD object. Note that the returned projected position is not\r\n * aligned to a pixel center or border, it is up to the caller to align if necessary.\r\n *\r\n * Dependencies:\r\n *\r\n * Attributes:\r\n * - position: contains the point world position\r\n * - normal: contains the world normal pointing up at the point\r\n * - auxpos1: contains centerOffset and pointGroundDistance\r\n *\r\n * Uniforms:\r\n * - model: the object -\x3e world transformation matrix\r\n * - modelNormal: the object -\x3e world normal transformation matrix (inv transp of model)\r\n * - view: the world -\x3e view transformation matrix\r\n * - viewNormal: the world -\x3e view normal transformation matrix (inv transp of view)\r\n * - proj: the view -\x3e clip projection matrix\r\n * - verticalOffset: a vec4 containing:\r\n * - the screen height of the vertical offset\r\n * - the screen height of the vertical offset as a fraction of camera distance.\r\n * - the minimum world size vertical offset.\r\n * - the maximum world size vertical offset.\r\n * This will do a screen sized offset of the point along its normal (used for line callouts)\r\n * - screenSizePerspectiveAlignment: a vec3 containing\r\n * - the view distance dependent divisor\r\n * - the view distance dependent offset\r\n * - the minimum pixel size\r\n * - the amount of padding in pixels around the region to be scaled (not used for alignment)\r\n * - cameraGroundRelative: indicates whether camera is above (1) or below (-1) ground.\r\n * This is used for emulated polygon offset for improved visibility of points sitting on the surface.\r\n * - polygonOffset: a constant polygon offset to bring the point closer to the viewer for\r\n * reduced flickering.\r\n * - camPos: the position of the camera in world space\r\n * - viewport: the viewport [x, y, width, height]\r\n */\r\n vec4 projectPositionHUD(out ProjectHUDAux aux) {\r\n // centerOffset is in view space and is used to implement world size offsetting\r\n // of labels with respect to objects. It also pulls the label towards the viewer\r\n // so that the label is visible in front of the object.\r\n vec3 centerOffset \x3d $auxpos1.xyz;\r\n\r\n // The pointGroundDistance is the distance of the geometry to the ground and is\r\n // negative if the point is below the ground, or positive if the point is above\r\n // ground.\r\n float pointGroundDistance \x3d $auxpos1.w;\r\n\r\n aux.posModel \x3d (model * vec4($position, 1.0)).xyz;\r\n aux.posView \x3d (view * vec4(aux.posModel, 1.0)).xyz;\r\n aux.vnormal \x3d (modelNormal * vec4($normal, 1.0)).xyz;\r\n\r\n // Screen sized offset in world space, used for example for line callouts\r\n // Note: keep this implementation in sync with the CPU implementation, see\r\n // - MaterialUtil.verticalOffsetAtDistance\r\n // - HUDMaterial.applyVerticalOffsetTransformation\r\n\r\n aux.distanceToCamera \x3d length(aux.posView);\r\n\r\n vec3 viewDirObjSpace \x3d normalize(camPos - aux.posModel);\r\n float cosAngle \x3d dot(aux.vnormal, viewDirObjSpace);\r\n\r\n aux.absCosAngle \x3d abs(cosAngle);\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n#if defined(VERTICAL_OFFSET) || defined(CENTER_OFFSET_UNITS_SCREEN)\r\n vec4 perspectiveFactor \x3d screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);\r\n#endif\r\n\r\n#endif\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n float verticalOffsetScreenHeight \x3d applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);\r\n#else\r\n float verticalOffsetScreenHeight \x3d verticalOffset.x;\r\n#endif\r\n\r\n float worldOffset \x3d clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w);\r\n vec3 modelOffset \x3d aux.vnormal * worldOffset;\r\n\r\n aux.posModel +\x3d modelOffset;\r\n\r\n vec3 viewOffset \x3d (viewNormal * vec4(modelOffset, 1.0)).xyz;\r\n aux.posView +\x3d viewOffset;\r\n\r\n // Since we elevate the object, we need to take that into account\r\n // in the distance to ground\r\n pointGroundDistance +\x3d worldOffset;\r\n\r\n#endif\r\n\r\n float groundRelative \x3d applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView);\r\n\r\n#ifndef CENTER_OFFSET_UNITS_SCREEN\r\n // Apply x/y in view space, but z in screen space (i.e. along posView direction)\r\n aux.posView +\x3d vec3(centerOffset.x, centerOffset.y, 0);\r\n\r\n // Same material all have same z !\x3d 0.0 condition so should not lead to\r\n // branch fragmentation and will save a normalization if it\'s not needed\r\n if (centerOffset.z !\x3d 0.0) {\r\n aux.posView -\x3d normalize(aux.posView) * centerOffset.z;\r\n }\r\n#endif\r\n\r\n vec4 posProj \x3d proj * vec4(aux.posView, 1.0);\r\n\r\n#ifdef CENTER_OFFSET_UNITS_SCREEN\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n float centerOffsetY \x3d applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);\r\n#else\r\n float centerOffsetY \x3d centerOffset.y;\r\n#endif\r\n\r\n posProj.xy +\x3d vec2(centerOffset.x, centerOffsetY) * 2.0 / viewport.zw * posProj.w;\r\n\r\n#endif\r\n\r\n // constant part of polygon offset emulation\r\n posProj.z -\x3d groundRelative * polygonOffset * posProj.w;\r\n\r\n return posProj;\r\n }\r\n\r\n /**\r\n * Test for visibility of a HUD object.\r\n *\r\n * Dependencies:\r\n *\r\n * Uniforms:\r\n * - hudVisibilityTexture: the texture that contains the visibility information\r\n * - markerColor: the special marker color that is used to write visibility information\r\n * - viewport: the viewport\r\n */\r\n bool testVisibilityHUD(vec4 posProj) {\r\n // For occlusion testing, use the nearest pixel center to avoid\r\n // subpixel filtering messing up the color we use to test for\r\n vec4 posProjCenter \x3d alignToPixelCenter(posProj, viewport.zw);\r\n\r\n return texture2D(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w).r \x3e 0.0;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/util.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"alignToPixelCenter"\x3e\x3c![CDATA[\r\n vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {\r\n // From clip space to (0 : 1), bias towards right pixel edge\r\n vec2 xy \x3d vec2(.500123) + .5 * clipCoord.xy / clipCoord.w;\r\n\r\n // Size of a pixel in range (0 : 1)\r\n vec2 pixelSz \x3d vec2(1.0) / widthHeight;\r\n\r\n // Round to nearest pixel center\r\n vec2 ij \x3d (floor(xy * widthHeight) + vec2(0.5)) * pixelSz;\r\n\r\n // Convert back to clip space\r\n vec2 result \x3d (ij * 2.0 - vec2(1.0)) * clipCoord.w;\r\n\r\n return vec4(result, clipCoord.zw);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"alignToPixelOrigin"\x3e\x3c![CDATA[\r\n vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) {\r\n // From clip space to (0 : 1),\r\n vec2 xy \x3d vec2(.5) + .5 * clipCoord.xy / clipCoord.w;\r\n\r\n // Size of a pixel in range (0 : 1)\r\n vec2 pixelSz \x3d vec2(1.0) / widthHeight;\r\n\r\n // Round to nearest pixel border, (0 : 1)\r\n vec2 ij \x3d floor((xy + .5 * pixelSz) * widthHeight) * pixelSz;\r\n\r\n // Convert back to clip space\r\n vec2 result \x3d (ij * 2.0 - vec2(1.0)) * clipCoord.w;\r\n\r\n return vec4(result, clipCoord.zw);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"float2rgba"\x3e\x3c![CDATA[\r\n // This is the maximum float value representable as 32bit fixed point,\r\n // it is rgba2float(vec4(1)) inlined.\r\n const float MAX_RGBA_FLOAT \x3d\r\n 255.0 / 256.0 +\r\n 255.0 / 256.0 / 256.0 +\r\n 255.0 / 256.0 / 256.0 / 256.0 +\r\n 255.0 / 256.0 / 256.0 / 256.0 / 256.0;\r\n\r\n vec4 float2rgba(const float value) {\r\n // Factors to convert to fixed point, i.e. factors (256^0, 256^1, 256^2, 256^3)\r\n const vec4 fixedPointFactors \x3d vec4(1, 256, 256 * 256, 256 * 256 * 256);\r\n\r\n // Make sure value is in the domain we can represent\r\n float valueInValidDomain \x3d clamp(value, 0.0, MAX_RGBA_FLOAT);\r\n\r\n // Decompose value in 32bit fixed point parts represented as\r\n // uint8 rgba components. Decomposition uses the fractional part after multiplying\r\n // by a power of 256 (this removes the bits that are represented in the previous\r\n // component) and then converts the fractional part to 8bits.\r\n vec4 fixedPointU8 \x3d floor(fract(valueInValidDomain * fixedPointFactors) * 256.0);\r\n\r\n // Convert uint8 values (from 0 to 255) to floating point representation for\r\n // the shader\r\n const float toU8AsFloat \x3d 1.0 / 255.0;\r\n\r\n return fixedPointU8 * toU8AsFloat;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"rgba2float"\x3e\x3c![CDATA[\r\n float rgba2float(vec4 rgba) {\r\n // Convert components from 0-\x3e1 back to 0-\x3e255 and then\r\n // add the components together with their corresponding\r\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\r\n const vec4 factors \x3d vec4(\r\n 255.0 / (256.0),\r\n 255.0 / (256.0 * 256.0),\r\n 255.0 / (256.0 * 256.0 * 256.0),\r\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\r\n );\r\n\r\n\t\treturn dot(rgba, factors);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"calcFragDepth"\x3e\x3c![CDATA[\r\n\t#ifdef GL_OES_standard_derivatives\r\n\t\t#extension GL_OES_standard_derivatives : enable\r\n\t#endif\r\n\r\n\tfloat calcFragDepth(const in float depth) {\r\n\t\t//calc polygon offset\r\n\t\tconst float SLOPE_SCALE \x3d 2.0;\r\n\t\tconst float BIAS \x3d 2.0 * .000015259;\t\t// 1 / (2^16 - 1)\r\n\t\tfloat m \x3d max(abs(dFdx(depth)), abs(dFdy(depth)));\r\n\t\tfloat result \x3d depth + SLOPE_SCALE * m + BIAS;\r\n\t\treturn clamp(result, .0, .999999);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"evalShadow"\x3e\x3c![CDATA[\r\n\t$rgba2float\r\n\r\n\t// "matrix" parameter used to have const qualifier as well, but IE11 couldn\'t deal with it at time of writing.\r\n\t// once IE11 is fine with it, const should probably be re-introduced\r\n\tfloat evalShadow(const in vec3 vpos, const in float depth, const in sampler2D depthTex, const int num, const in vec4 distance, in mat4 matrix[4], const in float halfPxSz) {\r\n\t\t//choose correct cascade\r\n\t\tint i \x3d depth \x3c distance[1] ? 0 : depth \x3c distance[2] ? 1 : depth \x3c distance[3] ? 2 : 3;\r\n\r\n\t\tif (i \x3e\x3d num) return .0;\r\n\r\n\t\tmat4 mat \x3d i \x3d\x3d 0 ? matrix[0] : i \x3d\x3d 1 ? matrix[1] : i \x3d\x3d 2 ? matrix[2] : matrix[3];\r\n\r\n\t\tvec4 lv \x3d mat * vec4(vpos, 1.0);\r\n\t\tlv.xy /\x3d lv.w;\r\n\r\n\t\t//vertex completely outside? -\x3e no shadow\r\n\t\tvec3 lvpos \x3d .5 * lv.xyz + vec3(.5);\r\n\t\tif (lvpos.z \x3e\x3d 1.0) return .0;\r\n\t\tif (lvpos.x \x3c .0 || lvpos.x \x3e 1.0 || lvpos.y \x3c .0 || lvpos.y \x3e 1.0) return .0;\r\n\r\n\t\t//calc coord in cascade texture\r\n\t\tvec2 uv \x3d vec2(float(i - 2 * (i / 2)) *.5, float(i / 2) * .5) + .5 * lvpos.xy;\r\n\r\n\t\tfloat texSize \x3d .5 / halfPxSz;\r\n\r\n\t\t//filter, offset by half pixels\r\n\t\tvec2 st \x3d fract((vec2(halfPxSz) + uv) * texSize);\r\n\r\n\t\tfloat s00 \x3d rgba2float(texture2D(depthTex, uv + vec2(-halfPxSz, -halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\t\tfloat s10 \x3d rgba2float(texture2D(depthTex, uv + vec2(halfPxSz, -halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\t\tfloat s11 \x3d rgba2float(texture2D(depthTex, uv + vec2(halfPxSz, halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\t\tfloat s01 \x3d rgba2float(texture2D(depthTex, uv + vec2(-halfPxSz, halfPxSz))) \x3c lvpos.z ? 1.0 : .0;\r\n\r\n\t\treturn mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3c!--\r\n\tScene Lighting Definitions:\r\n\t\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\r\n\r\n\tdefines:\r\n\t\t- SH_ORDER: 1|2|3\r\n\tinput:\r\n\t\t- normal: vec3\r\n\t\t- albedo: vec3\r\n\t - shadow: float\r\n\t\t- ssao: float\r\n\treturn:\r\n\t - color: vec3\r\n--\x3e\r\n\x3csnippet name\x3d"sceneLightingDefinitions"\x3e\x3c![CDATA[\r\n\t$viewingMode\r\n\r\n\t// main light\r\n\t/////////////////////////////////////////\r\n\tuniform vec3 lightingMainDirection;\r\n\tuniform vec3 lightingMainIntensity;\r\n\r\n\t// ambient lighting\r\n\t/////////////////////////////////////////\r\n\t#ifndef SH_ORDER\r\n\t\t#define SH_ORDER 2\r\n\t#endif\r\n\r\n\t#if SH_ORDER \x3d\x3d 0\r\n\t\tuniform vec3 lightingAmbientSH0;\r\n\t#elif SH_ORDER \x3d\x3d 1\r\n\t\tuniform vec4 lightingAmbientSH_R;\r\n\t\tuniform vec4 lightingAmbientSH_G;\r\n\t\tuniform vec4 lightingAmbientSH_B;\r\n\t#elif SH_ORDER \x3d\x3d 2\r\n\t\tuniform vec3 lightingAmbientSH0;\r\n\t\tuniform vec4 lightingAmbientSH_R1;\r\n\t\tuniform vec4 lightingAmbientSH_G1;\r\n\t\tuniform vec4 lightingAmbientSH_B1;\r\n\t\tuniform vec4 lightingAmbientSH_R2;\r\n\t\tuniform vec4 lightingAmbientSH_G2;\r\n\t\tuniform vec4 lightingAmbientSH_B2;\r\n\t#endif\r\n\r\n\t// special tweaking\r\n\t//////////////////////////////////////////\r\n\t\tuniform float lightingFixedFactor;\r\n\t\tuniform float lightingGlobalFactor;\r\n\r\n\t\tuniform float ambientBoostFactor;\r\n\r\n\t// evaluation\r\n\t//////////////////////////////////////////\r\n\r\n\tvec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {\r\n\t\t// evaluate the main light\r\n\t\tfloat dotVal \x3d mix(clamp(-dot(normal, lightingMainDirection), 0.0, 1.0), 1.0, lightingFixedFactor);\r\n\t\tvec3 mainLight \x3d (1.0 - shadow) * lightingMainIntensity * dotVal;\r\n\r\n\t\t// evaluate the sh ambient light\r\n\t\t#if SH_ORDER \x3d\x3d 0\r\n\t\t\tvec3 ambientLight \x3d 0.282095 * lightingAmbientSH0;\r\n\t\t#elif SH_ORDER \x3d\x3d 1\r\n\t\t\tvec4 sh0 \x3d vec4(\r\n\t\t\t\t0.282095,\r\n\t\t\t\t0.488603 * normal.x,\r\n\t\t\t\t0.488603 * normal.z,\r\n\t\t\t\t0.488603 * normal.y\r\n\t\t\t);\r\n\t\t\tvec3 ambientLight \x3d vec3(\r\n\t\t\t\tdot(lightingAmbientSH_R, sh0),\r\n\t\t\t\tdot(lightingAmbientSH_G, sh0),\r\n\t\t\t\tdot(lightingAmbientSH_B, sh0)\r\n\t\t\t);\r\n\t\t#elif SH_ORDER \x3d\x3d 2\r\n\t\t\tvec3 ambientLight \x3d 0.282095 * lightingAmbientSH0;\r\n\r\n\t\t\tvec4 sh1 \x3d vec4(\r\n\t\t\t\t0.488603 * normal.x,\r\n\t\t\t\t0.488603 * normal.z,\r\n\t\t\t\t0.488603 * normal.y,\r\n\t\t\t\t1.092548 * normal.x * normal.y\r\n\t\t\t);\r\n\t\t\tvec4 sh2 \x3d vec4(\r\n\t\t\t\t1.092548 * normal.y * normal.z,\r\n\t\t\t\t0.315392 * (3.0 * normal.z * normal.z - 1.0),\r\n\t\t\t\t1.092548 * normal.x * normal.z,\r\n\t\t\t\t0.546274 * (normal.x * normal.x - normal.y * normal.y)\r\n\t\t\t);\r\n\t\t\tambientLight +\x3d vec3(\r\n\t\t\t\tdot(lightingAmbientSH_R1, sh1),\r\n\t\t\t\tdot(lightingAmbientSH_G1, sh1),\r\n\t\t\t\tdot(lightingAmbientSH_B1, sh1)\r\n\t\t\t);\r\n\t\t\tambientLight +\x3d vec3(\r\n\t\t\t\tdot(lightingAmbientSH_R2, sh2),\r\n\t\t\t\tdot(lightingAmbientSH_G2, sh2),\r\n\t\t\t\tdot(lightingAmbientSH_B2, sh2)\r\n\t\t\t);\r\n\t\t#endif\r\n\t\tambientLight *\x3d (1.0 - ssao);\r\n\r\n\t\t// inverse gamma correction on the albedo color\r\n\t\tfloat gamma \x3d 2.1;\r\n\t\tvec3 albedoGammaC \x3d pow(albedo, vec3(gamma));\r\n\r\n\t\t// physically correct BRDF normalizes by PI\r\n\t\tconst float PI \x3d 3.14159;\r\n\t\tvec3 totalLight \x3d mainLight + ambientLight + additionalLight;\r\n\t\ttotalLight \x3d min(totalLight, vec3(PI, PI, PI));\r\n\t\tvec3 outColor \x3d vec3((albedoGammaC / PI) * (totalLight));\r\n\r\n\t\t// apply gamma correction to the computed color\r\n\t\toutColor \x3d pow(outColor, vec3(1.0/gamma));\r\n\r\n\t\treturn outColor;\r\n\t}\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"sceneLightingAdditionalLightGlobal"\x3e\x3c![CDATA[\r\n vec3 sceneLightingAdditionalLightGlobal(vec3 worldPos, float ssao, out float additionalAmbientScale) {\r\n // heuristic lighting model originally used in the terrain shading\r\n // now used to generated additional ambient light\r\n\r\n#ifdef VIEWING_MODE_GLOBAL\r\n\r\n float vndl \x3d -dot(normalize(worldPos), lightingMainDirection);\r\n\r\n#else\r\n\r\n float vndl \x3d -dot(vec3(0,0,1), lightingMainDirection);\r\n\r\n#endif\r\n\r\n additionalAmbientScale \x3d smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));\r\n return ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"normal2envTC"\x3e\x3c![CDATA[\r\n\tvec2 normal2envTC(vec3 normal) {\r\n\t\tfloat v \x3d .5 + .5 * asin(normal.y) * 0.63661977;\r\n\t\tfloat u \x3d .5 - .5 * atan(normal.z, normal.x) * 0.31830988;\r\n\t\treturn vec2(u, v);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderShowDepth"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tattribute vec2 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d proj * vec4($position.x, $position.y, .0, 1.0);\r\n\t\tvtc \x3d $uv0;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\t\x3csnippet name\x3d"fragmentShaderShowDepth"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D depthTex;\r\n\tvarying vec2 vtc;\r\n\t$rgba2float\r\n\tvoid main() {\r\n\t//\tgl_FragColor \x3d vec4(vec3(texture2D(depthTex, vtc).a), 1.0);\r\n\t\tgl_FragColor \x3d vec4(rgba2float(texture2D(depthTex, vtc)));\r\n\t//\tgl_FragColor \x3d texture2D(depthTex, vtc);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsUVQuad"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $position;\r\n\tvarying vec2 uv;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d vec4($position.x, $position.y, .0, 1.0);\r\n\t\tuv \x3d $position * .5 + vec2(.5);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"toScreenCoords"\x3e\x3c![CDATA[\r\n\tvec4 toScreenCoords(vec3 vertex) {\r\n\t\tvec4 vClipSpace \x3d proj * view * vec4((model * vec4(vertex, 1.0)).xyz, 1.0);\r\n\t\tvClipSpace.xy *\x3d screenSize;\r\n\t\treturn vClipSpace/abs(vClipSpace.w);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vvUniforms"\x3e\x3c![CDATA[\r\n#if defined(VV_SIZE)\r\n\t#define VV_CUSTOM_MODEL_MATRIX\r\n#endif\r\n\r\n#if defined(VV_SIZE)\r\n\tuniform vec3 vvSizeMinSize;\r\n\tuniform vec3 vvSizeMaxSize;\r\n\tuniform vec3 vvSizeOffset;\r\n\tuniform vec3 vvSizeFactor;\r\n#elif defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tuniform vec3 vvSizeValue;\r\n#endif\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\tuniform mat3 vvSymbolRotation;\r\n#endif\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\tuniform vec3 vvSymbolAnchor;\r\n#endif\r\n\r\n#ifdef VV_COLOR\r\n\t#define VV_COLOR_N 8\r\n\tuniform float vvColorValues[VV_COLOR_N];\r\n\tuniform vec4 vvColorColors[VV_COLOR_N];\r\n#endif\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vvFunctions"\x3e\x3c![CDATA[\r\n// Evaluation of size\r\n#if defined(VV_SIZE)\r\n\tvec3 vvGetScale(vec4 featureAttribute) {\r\n\t\treturn clamp(vvSizeOffset + featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);\r\n\t}\r\n#elif defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tvec3 vvGetScale(vec4 featureAttribute) {\r\n\t\treturn vvSizeValue;\r\n\t}\r\n#endif\r\n\r\n// Applying the model matrix\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\tvec4 vvTransformPosition(vec3 position, vec4 featureAttribute) {\r\n\t\treturn vec4(vvSymbolRotation * (vvGetScale(featureAttribute) * (position + vvSymbolAnchor)), 1.0);\r\n\t}\r\n\r\n\tvec4 vvTransformNormal(vec3 normal, vec4 featureAttribute) {\r\n\t\t// Normal transform is the inverse transpose of model transform\r\n\t\treturn vec4(vvSymbolRotation * normal / vvGetScale(featureAttribute), 1.0);\r\n\t}\r\n#endif\r\n\r\n#ifdef VV_COLOR\r\n\tvec4 vvGetColor(vec4 featureAttribute, float values[VV_COLOR_N], vec4 colors[VV_COLOR_N]) {\r\n\t\tfloat value \x3d featureAttribute.y;\r\n\t\tif (value \x3c\x3d values[0]) {\r\n\t\t\treturn colors[0];\r\n\t\t}\r\n\r\n\t\tfor (int i \x3d 1; i \x3c VV_COLOR_N; ++i) {\r\n\t\t\tif (values[i] \x3e\x3d value) {\r\n\t\t\t\tfloat f \x3d (value - values[i-1]) / (values[i] - values[i-1]);\r\n\t\t\t\treturn mix(colors[i-1], colors[i], f);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn colors[VV_COLOR_N - 1];\r\n\t}\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"rgb2hsv"\x3e\x3c![CDATA[\r\nvec3 rgb2hsv(vec3 c)\r\n{\r\n\tvec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\r\n\tvec4 p \x3d mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\r\n\tvec4 q \x3d mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\r\n\r\n\tfloat d \x3d q.x - min(q.w, q.y);\r\n\tfloat e \x3d 1.0e-10;\r\n\treturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"hsv2rgb"\x3e\x3c![CDATA[\r\nvec3 hsv2rgb(vec3 c)\r\n{\r\n\tvec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\r\n\tvec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\r\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"colorMixMode"\x3e\x3c![CDATA[\r\n$rgb2hsv\r\n$hsv2rgb\r\n\r\n\r\n/*\r\n * The color mix modes are encoded in the symbol color as follows:\r\n * - Fully transparent symbols are represented with alpha 0 for\r\n * all color mix modes (except ignore).\r\n * - color mix mode ignore is encoded as multiply with white\r\n * - the other 3 color mix modes (tint, replace, multiply) are\r\n * equally distributed on the remaining 255 alpha values, which\r\n * gives us 85 possible alpha values\r\n *\r\n * alpha 0 : fully transparent\r\n * alpha in [ 1 - 85]: tint\r\n * alpha in [ 86 - 170]: replace\r\n * alpha in [171 - 255]: multiply\r\n */\r\nvec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {\r\n float symbolAlpha \x3d 0.0;\r\n\r\n const float maxTint \x3d 85.0;\r\n const float maxReplace \x3d 170.0;\r\n const float scaleAlpha \x3d 3.0;\r\n\r\n if (symbolColor.a \x3d\x3d 0.0) {\r\n colorMixMode \x3d 1; // fully transparent -\x3e multiply\r\n symbolAlpha \x3d 0.0;\r\n }\r\n else if (symbolColor.a \x3c\x3d maxTint) {\r\n colorMixMode \x3d 0; // tint\r\n symbolAlpha \x3d scaleAlpha * symbolColor.a;\r\n }\r\n else if (symbolColor.a \x3c\x3d maxReplace) {\r\n colorMixMode \x3d 3; // replace\r\n symbolAlpha \x3d scaleAlpha * (symbolColor.a - maxTint);\r\n }\r\n else {\r\n colorMixMode \x3d 1; // multiply\r\n symbolAlpha \x3d scaleAlpha * (symbolColor.a - maxReplace);\r\n }\r\n\r\n return vec4(symbolColor.rgb, symbolAlpha);\r\n}\r\n\r\nvec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {\r\n\r\n // workaround for artifacts in OSX using Intel Iris Pro\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475\r\n vec3 internalMixed \x3d internalColor * textureColor;\r\n vec3 allMixed \x3d internalMixed * externalColor;\r\n\r\n if (mode \x3d\x3d 1 /* multiply */) {\r\n return allMixed;\r\n }\r\n else if (mode \x3d\x3d 2 /* ignore */ ) {\r\n return internalMixed;\r\n }\r\n else if (mode \x3d\x3d 3 /* replace */ ) {\r\n return externalColor;\r\n }\r\n else {\r\n // tint (or something invalid)\r\n vec3 hsvIn \x3d rgb2hsv(internalMixed);\r\n vec3 hsvTint \x3d rgb2hsv(externalColor);\r\n vec3 hsvOut \x3d vec3(hsvTint.x, hsvTint.y, hsvIn.z * hsvTint.z);\r\n return hsv2rgb(hsvOut);\r\n }\r\n}\r\n\r\nfloat mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {\r\n\r\n // workaround for artifacts in OSX using Intel Iris Pro\r\n // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475\r\n float internalMixed \x3d internalOpacity * textureOpacity;\r\n float allMixed \x3d internalMixed * externalOpacity;\r\n\r\n if (mode \x3d\x3d 2 /* ignore */ ) {\r\n return internalMixed;\r\n }\r\n else if (mode \x3d\x3d 3 /* replace */ ) {\r\n return externalOpacity;\r\n }\r\n else {\r\n // multiply or tint (or something invalid)\r\n return allMixed;\r\n }\r\n}\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"highlightWrite"\x3e\x3c![CDATA[\r\n // the following uniforms are common to all highlight shaders:\r\n // uniform sampler2D depthTex\r\n // uniform vec4 highlightViewportPixelSz\r\n float sceneDepth \x3d texture2D(depthTex, (gl_FragCoord.xy - highlightViewportPixelSz.xy) * highlightViewportPixelSz.zw).r;\r\n if (gl_FragCoord.z \x3e sceneDepth + 5e-6) {\r\n gl_FragColor \x3d vec4(1.0, 1.0, 0.0, 1.0);\r\n }\r\n else {\r\n gl_FragColor \x3d vec4(1.0, 0.0, 1.0, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"screenSizePerspective"\x3e\x3c![CDATA[\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n// Note that the implementation here should be kept in sync with the corresponding\r\n// CPU implementation (used for hitTest etc) in screenSizePerspectiveUtils.ts\r\n\r\n/**\r\n * Compute the screen size perspective lower bound from pre-computed screen\r\n * size perspective factors (or parameters, since both store the pixel lower\r\n * bound information in the same place). When computing the minimum size,\r\n * the padding (e.g. text halo) is scaled with the same factor as the\r\n * original size scales to reach the minimum size.\r\n *\r\n * {\r\n * x: N/A\r\n * y: N/A\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nfloat screenSizePerspectiveMinSize(float size, vec4 factor) {\r\n\r\n // Original calculation:\r\n // padding \x3d 2 * factor.w\r\n // minSize \x3d factor.z\r\n //\r\n // minSize + minSize / size * padding\r\n //\r\n // Incorporates padding (factor.w, e.g. text halo size) into the\r\n // minimum bounds calculation, taking into account that padding\r\n // would scale down proportionally to the size.\r\n //\r\n // Calculation below is the same, but avoids division by zero when\r\n // size would be zero, without branching using step.\r\n // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10683\r\n\r\n // nonZeroSize is 1 if size \x3e 0, and 0 otherwise\r\n float nonZeroSize \x3d 1.0 - step(size, 0.0);\r\n\r\n return (\r\n factor.z * (\r\n 1.0 +\r\n nonZeroSize * // Multiply by nzs ensures if size is 0, then we ignore\r\n // proportionally scaled padding\r\n 2.0 * factor.w / (\r\n size + (1.0 - nonZeroSize) // Adding 1 - nzs ensures we divide either by size, or by 1\r\n )\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * Computes the view angle dependent screen size perspective factor. The goal\r\n * of this factor is that:\r\n *\r\n * 1. There is no perspective when looking top-down\r\n * 2. There is a smooth and quick transition to full perspective when\r\n * tilting.\r\n */\r\nfloat screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {\r\n return absCosAngle * absCosAngle * absCosAngle;\r\n}\r\n\r\n/**\r\n * Precomputes a set of factors that can be used to apply screen size perspective\r\n * The factors are based on the viewing angle, distance to camera and the screen size\r\n * perspective parameters:\r\n * {\r\n * x: distanceDivisor,\r\n * y: distanceOffset,\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n *\r\n * The result is a set of factors that can be used to apply the perspective:\r\n *\r\n * {\r\n * x: distance based relative scale factor (0 -\x3e 1)\r\n * y: view dependent scale factor\r\n * z: minPixelSize (abs)\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nvec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {\r\n return vec4(min(params.x / (distanceToCamera - params.y), 1.0), screenSizePerspectiveViewAngleDependentFactor(absCosAngle), params.z, params.w);\r\n}\r\n\r\n/**\r\n * Applies screen size perspective factors to a single dimension size, given the viewing angle,\r\n * distance to camera and perspective parameters. The factors can be calculated from the screen size\r\n * perspective parameters using screenSizePerspectiveScaleFactorFloat.\r\n *\r\n * Note that for single scale application, the screenSizePerspectiveScaleFloat can be used, which\r\n * will call this method, providing it the factors calculated from screenSizePerspectiveScaleFactorFloat.\r\n */\r\n\r\nfloat applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {\r\n return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));\r\n}\r\n\r\n/**\r\n * Applies screen size perspective parameters to a single dimension size, given the viewing angle,\r\n * distance to camera and perspective parameters\r\n * {\r\n * x: distanceDivisor,\r\n * y: distanceOffset,\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nfloat screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {\r\n return applyScreenSizePerspectiveScaleFactorFloat(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));\r\n}\r\n\r\n/**\r\n * Applies screen size perspective factors to a vec2 size (width/height), given the viewing angle,\r\n * distance to camera and perspective parameters. The factors can be calculated from the screen size\r\n * perspective parameters using screenSizePerspectiveScaleFactorVec2.\r\n *\r\n * Note that for single scale application, the screenSizePerspectiveScaleVec2 can be used, which\r\n * will call this method, providing it the factors calculated from screenSizePerspectiveScaleFactorVec2.\r\n */\r\nvec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {\r\n return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / size.y, 1.0), size, factor.y);\r\n}\r\n\r\n/**\r\n * Applies screen size perspective parameters to a vec2 size (width/height), given the viewing angle,\r\n * distance to camera and perspective parameters\r\n * {\r\n * x: distanceDivisor,\r\n * y: distanceOffset,\r\n * z: minPixelSize (abs),\r\n * w: sizePaddingInPixels (abs)\r\n * }\r\n */\r\nvec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {\r\n return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));\r\n}\r\n\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"computeNormal"\x3e\x3c![CDATA[\r\n #ifdef GROUND_NORMAL_SHADING\r\n #ifdef VIEWING_MODE_GLOBAL\r\n vec3 normal \x3d normalize(vpos + localOrigin);\r\n #else\r\n vec3 normal \x3d vec3(0,0,1);\r\n #endif\r\n #else\r\n // compute normal\r\n #ifdef DOUBLESIDED\r\n vec3 normal \x3d dot(vnormal, viewDir)\x3e0.0 ? -vnormal : vnormal;\r\n #elif defined(WINDINGORDERDOUBLESIDED)\r\n vec3 normal \x3d gl_FrontFacing ? vnormal : -vnormal;\r\n #else\r\n vec3 normal \x3d vnormal;\r\n #endif\r\n normal \x3d normalize(normal);\r\n #endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"decodeNormal"\x3e\x3c![CDATA[\r\nvec3 decodeNormal(vec2 f)\r\n{\r\n float z \x3d 1.0 - abs(f.x) - abs(f.y);\r\n return vec3(f + sign(f) * min(z, 0.0), z);\r\n}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/CheckerBoardMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsCheckerBoard"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform mat4 model;\r\n\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n\r\n varying vec2 vUV;\r\n\r\n void main(void) {\r\n vUV \x3d $uv0;\r\n gl_Position \x3d proj * view * vec4((model * vec4($position, 1.0)).xyz, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsCheckerBoard"\x3e\x3c![CDATA[\r\n#ifdef GL_OES_standard_derivatives\r\n#extension GL_OES_standard_derivatives : enable\r\n#endif\r\n\r\n $fsprecisionf\r\n\r\n uniform vec2 size;\r\n uniform vec4 color1;\r\n uniform vec4 color2;\r\n\r\n varying vec2 vUV;\r\n\r\n void main() {\r\n vec2 uvScaled \x3d vUV / (2.0 * size);\r\n\r\n#ifdef GL_OES_standard_derivatives\r\n vec2 uv \x3d fract(uvScaled - 0.25);\r\n vec2 ab \x3d clamp((abs(uv - 0.5) - 0.25) / fwidth(uvScaled), -0.5, 0.5);\r\n float fade \x3d smoothstep(0.25, 0.5, max(fwidth(uvScaled.x), fwidth(uvScaled.y)));\r\n float t \x3d mix(abs(ab.x + ab.y), 0.5, fade);\r\n#else\r\n vec2 ab \x3d step(0.5, fract(uvScaled));\r\n float t \x3d abs(1.0 - ab.x - ab.y);\r\n#endif\r\n\r\n gl_FragColor \x3d mix(color2, color1, t);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/ColorMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderColorMaterial"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\r\n\tattribute vec3 $position;\r\n#ifdef VERTEXCOLORS\r\n\tattribute vec4 $color;\r\n\r\n\tvarying vec4 vColor;\r\n#endif\r\n\r\n\tvoid main(void) {\r\n#ifdef VERTEXCOLORS\r\n\t\tvColor \x3d $color * 0.003921568627451; // \x3d 1/255;\r\n#endif\r\n\t\tgl_Position \x3d proj * view * vec4((model * vec4($position, 1.0)).xyz, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderColorMaterial"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec4 eColor;\r\n#ifdef VERTEXCOLORS\r\n\tvarying vec4 vColor;\r\n#endif\r\n\r\n\tvoid main() {\r\n#ifdef VERTEXCOLORS\r\n\t\tgl_FragColor \x3d vColor * eColor;\r\n#else\r\n\t\tgl_FragColor \x3d eColor;\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/DefaultMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"calculateVerticalOffset"\x3e\x3c![CDATA[\r\n $viewingMode\r\n\r\n#ifdef VERTICAL_OFFSET\r\n // [ verticalOffsetPerDistance, minWorldLength, maxWorldLength ]\r\n uniform vec4 verticalOffset;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n uniform vec4 screenSizePerspectiveAlignment;\r\n\r\n $screenSizePerspective\r\n\r\n#endif\r\n\r\n vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {\r\n float viewDistance \x3d length((view * vec4(worldPos, 1)).xyz);\r\n float verticalOffsetOffsetDistance \x3d verticalOffset.x * viewDistance;\r\n\r\n#ifdef VIEWING_MODE_GLOBAL\r\n vec3 worldNormal \x3d normalize(worldPos + localOrigin);\r\n#else\r\n vec3 worldNormal \x3d vec3(0, 0, 1);\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n float cosAngle \x3d dot(worldNormal, normalize(worldPos - camPos));\r\n\r\n float verticalOffsetScreenHeight \x3d screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);\r\n#else\r\n float verticalOffsetScreenHeight \x3d verticalOffset.x;\r\n#endif\r\n\r\n // Screen sized offset in world space, used for example for line callouts\r\n float worldOffset \x3d clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);\r\n\r\n return worldNormal * worldOffset;\r\n }\r\n#endif\r\n]]\x3e\r\n\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhongSrc"\x3e\x3c![CDATA[\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n\r\n\tuniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n attribute mat4 model;\r\n attribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n\tuniform mat4 modelNormal;\r\n#endif\r\n#ifdef INSTANCEDCOLOR\r\n\tattribute vec4 instanceColor;\r\n#endif\r\n\tattribute vec3 $position;\r\n#ifdef COMPRESSED_NORMALS\r\n attribute vec2 $normalCompressed;\r\n#else\r\n attribute vec3 $normal;\r\n#endif\r\n\tvarying vec3 vpos;\r\n\tvarying vec3 vnormal;\r\n\r\n#ifdef COMPONENTCOLORS\r\n uniform sampler2D uComponentColorTex;\r\n uniform vec2 uComponentColorTexInvDim;\r\n\r\n attribute float $componentIndex;\r\n\r\n vec4 readComponentColor() {\r\n float normalizedIndex \x3d ($componentIndex + 0.5) * uComponentColorTexInvDim.x;\r\n vec2 indexCoord \x3d vec2(\r\n mod(normalizedIndex, 1.0),\r\n (floor(normalizedIndex) + 0.5) * uComponentColorTexInvDim.y\r\n );\r\n return texture2D(uComponentColorTex, indexCoord);\r\n }\r\n#endif\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tvarying float linearDepth;\r\n#endif\r\n\r\n#ifdef VERTEXCOLORS\r\n\tattribute vec4 $color;\r\n#endif\r\n\r\n#ifdef SYMBOLVERTEXCOLORS\r\n attribute vec4 $symbolColor;\r\n#endif\r\n\r\n#if defined(VV_SIZE) || defined(VV_COLOR)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\r\n$vvUniforms\r\n\r\n#if defined(VERTEXCOLORS)\r\n\tvarying vec4 vcolor;\r\n#endif\r\n\r\n // Workaround for https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/13452\r\n // We pass the externalColor uniform from VS to FS through the vcolorExt varying because\r\n // there is a driver bug for Intel Integrated Graphics which led to rendering artifacts\r\n // since the introduction of https://devtopia.esri.com/WebGIS/arcgis-js-api/pull/12673\r\n // This should be further cleaned up later with through the following issue:\r\n // https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/12763\r\n\tuniform vec4 externalColor;\r\n\tvarying vec4 vcolorExt;\r\n\r\n#if defined(SYMBOLVERTEXCOLORS) || defined(COMPONENTCOLORS)\r\n\tvarying mediump float colorMixMode; // varying int is not supported in WebGL\r\n#endif\r\n\r\n\t$vvFunctions\r\n\r\n\t$colorMixMode\r\n\r\n $calculateVerticalOffset\r\n\r\n $decodeNormal\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n\t\tvpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\r\n#ifdef COMPRESSED_NORMALS\r\n vnormal \x3d normalize((modelNormal * vvTransformNormal(decodeNormal($normalCompressed), instanceFeatureAttribute)).xyz);\r\n#else\r\n vnormal \x3d normalize((modelNormal * vvTransformNormal($normal, instanceFeatureAttribute)).xyz);\r\n#endif\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\t\tvec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n\t\tvpos \x3d (model * vec4($position, 1.0)).xyz;\r\n#ifdef COMPRESSED_NORMALS\r\n vnormal \x3d normalize((modelNormal * vec4(decodeNormal($normalCompressed), 1.0)).xyz);\r\n#else\r\n vnormal \x3d normalize((modelNormal * vec4($normal, 1.0)).xyz);\r\n#endif\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\t\tvec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n\t\tgl_Position \x3d proj * view * vec4(vpos, 1.0);\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\t\t// Shadowmap\'s cascading index used to be based on \'1.0 / gl_FragCoord.w\'\r\n\t\t// (i.e. the perspective interpolation of \'gl_Position.w\'). Precision\r\n\t\t// issues on iPad/iPhone with the \'w\' component require the depth to be\r\n\t\t// passed as varying to properly drive the cascading shadow map index.\r\n\t\tlinearDepth \x3d gl_Position.w;\r\n#endif\r\n\r\n#ifdef VERTEXCOLORS\r\n\t\tvcolor \x3d $color * 0.003921568627451; // \x3d 1/255\r\n#endif\r\n\r\n\t\tvcolorExt \x3d externalColor;\r\n\r\n#ifdef INSTANCEDCOLOR\r\n\t\tvcolorExt *\x3d instanceColor;\r\n#endif\r\n#ifdef VV_COLOR\r\n\t\tvcolorExt *\x3d vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);\r\n#endif\r\n#ifdef SYMBOLVERTEXCOLORS\r\n int symbolColorMixMode;\r\n vcolorExt *\x3d decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; // \x3d 1/255;\r\n colorMixMode \x3d float(symbolColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts\r\n#endif\r\n#ifdef COMPONENTCOLORS\r\n int symbolColorMixMode;\r\n vcolorExt *\x3d decodeSymbolColor(readComponentColor() * 255.0, symbolColorMixMode) * 0.003921568627451; // \x3d 1/255;\r\n colorMixMode \x3d float(symbolColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts\r\n#endif\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhongSrc"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n\tuniform vec3 camPos;\r\n\tuniform vec3 localOrigin;\r\n\r\n\t$sceneLightingDefinitions\r\n\t$sceneLightingAdditionalLightGlobal\r\n\r\n\t// material parameters\r\n\t//////////////////////////////////////////\r\n\tuniform vec3 ambient;\r\n\tuniform vec3 diffuse;\r\n\tuniform vec3 specular;\r\n\tuniform float opacity;\r\n\tuniform float layerOpacity;\r\n\r\n#if defined(SYMBOLVERTEXCOLORS) || defined(COMPONENTCOLORS)\r\n\tvarying mediump float colorMixMode; // varying int is not supported in WebGL\r\n#else\r\n uniform int colorMixMode;\r\n#endif\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tuniform sampler2D depthTex;\r\n\tuniform int shadowMapNum;\r\n\tuniform vec4 shadowMapDistance;\r\n\tuniform mat4 shadowMapMatrix[4];\r\n\tuniform float depthHalfPixelSz;\r\n#endif\r\n\r\n#ifdef RECEIVE_SSAO\r\n\tuniform sampler2D ssaoTex;\r\n\tuniform vec4 viewportPixelSz;\r\n#endif\r\n\r\n\r\n\tvarying vec3 vpos;\r\n\tvarying vec3 vnormal;\r\n#if defined(VERTEXCOLORS)\r\n\tvarying vec4 vcolor;\r\n#endif\r\n\tvarying vec4 vcolorExt;\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tvarying float linearDepth;\r\n\t$evalShadow\r\n#endif\r\n\r\n\t$colorMixMode\r\n\r\n\tvoid main() {\r\n\t\tvec3 viewDir \x3d normalize(vpos - camPos);\r\n\r\n\t\t$computeNormal\r\n\r\n\t\tvec3 reflDir \x3d normalize(reflect(viewDir, normal));\r\n\r\n\t\t// compute ssao\r\n\t\t#ifdef RECEIVE_SSAO\r\n\t\t\t\tfloat ssao \x3d texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;\r\n\t\t\t\tssao \x3d viewportPixelSz.z \x3c 0.0 ? 1.0 : ssao;\r\n\t\t#else\r\n\t\t\t\tfloat ssao \x3d 1.0;\r\n\t\t#endif\r\n\r\n\t\t// At global scale we create some additional ambient light based on the main light to simulate global illumination\r\n\t\tfloat additionalAmbientScale;\r\n\t\tvec3 additionalLight \x3d sceneLightingAdditionalLightGlobal(vpos + localOrigin, ssao, additionalAmbientScale);\r\n\r\n\t\t// compute shadowing\r\n\t\tfloat shadow \x3d 0.0;\r\n\t\t#ifdef RECEIVE_SHADOWS\r\n\t\t\tshadow \x3d evalShadow(vpos, linearDepth, depthTex, shadowMapNum, shadowMapDistance, shadowMapMatrix, depthHalfPixelSz);\r\n\t\t#elif defined(VIEWING_MODE_GLOBAL)\r\n\t\t\t// at global scale (and in global scenes) we fall back to this approximation\r\n\t\t\t// to shadow objects on the dark side of the earth\r\n\t\t\tshadow \x3d lightingGlobalFactor * (1.0 - additionalAmbientScale);\r\n\t\t#endif\r\n\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c!-- Keep is synchronized with the logic in Material.js:isVisible --\x3e\r\n\x3csnippet name\x3d"externalColorMix"\x3e\x3c![CDATA[\r\n\tvec3 matColor \x3d max(ambient, diffuse); // combine the old material parameters into a single one\r\n\t#if defined(VERTEXCOLORS)\r\n\t\t\t// Internal colors: varying vcolor + uniform ambient/diffuse, external colors: varying vcolorExt\r\n\t\t\tvec3 albedo_ \x3d mixExternalColor(vcolor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\r\n\t\t\tfloat opacity_ \x3d layerOpacity * mixExternalOpacity(vcolor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));\r\n\t#else\r\n\t\t\t// Internal colors: uniform ambient/diffuse, external colors: varying vcolorExt\r\n\t\t\tvec3 albedo_ \x3d mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\r\n\t\t\tfloat opacity_ \x3d layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\r\n\t#endif\r\n\talbedo_+\x3d 0.25 * specular; // don\'t completely ignore specular for now\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhong"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\t$vsPhongSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhong"\x3e\x3c![CDATA[\r\n\t\t$fsprecisionf\r\n\r\n\t\t$fsPhongSrc\r\n\r\n\t\tvec4 texColor \x3d vec4(1,1,1,1);\r\n\t\t$externalColorMix\r\n\r\n\t\tif (opacity_ \x3c 0.001) {\r\n\t\t\tdiscard;\r\n\t\t}\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhongTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsPhongSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhongTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tvarying vec2 vtc;\r\n\r\n\t$fsPhongSrc\r\n\r\n\t\t// read texture color\r\n\t\tvec4 texColor \x3d texture2D(tex, vtc);\r\n\t\tif (texColor.a \x3c .33) discard;\r\n\r\n\t\t$externalColorMix\r\n\r\n\t\tif (opacity_ \x3c 0.001) {\r\n\t\t\tdiscard;\r\n\t\t}\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsPhongAtlasTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec4 $uv0;\r\n\tattribute vec4 $region;\r\n\tvarying vec2 vtc;\r\n\tvarying vec4 regionV;\r\n\t$vsPhongSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0.xy;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t\tregionV \x3d $region/65535.0;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsPhongAtlasTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform vec2 texSize;\r\n\tvarying vec2 vtc;\r\n\tvarying vec4 regionV;\r\n\r\n\tfloat calcMipMapLevel(const vec2 ddx, const vec2 ddy) {\r\n\t\t// from:\r\n\t\t// - OpenGLES Common Profile Specification Version 2.0.25, Section 3.7.7 - Texture Minification\r\n\t\t// - https://www.opengl.org/discussion_boards/showthread.php/171485-Texture-LOD-calculation-(useful-for-atlasing)\r\n\t\t// - http://www.linedef.com/virtual-texture-demo.html\r\n\t\tfloat deltaMaxSqr \x3d max(dot(ddx, ddx), dot(ddy, ddy));\r\n\t\treturn max(0.5 * log2(deltaMaxSqr), 0.0);\r\n\t}\r\n\r\n\t$fsPhongSrc\r\n\r\n\t\tvec2 uv \x3d vtc;\r\n\t\tuv \x3d fract(uv);\r\n\t\t//[umin, vmin, umax, vmax]\r\n\r\n\t\tvec2 atlasScale \x3d regionV.zw - regionV.xy;\r\n\t\tuv \x3d uv.xy * atlasScale + regionV.xy;\r\n\r\n\t\tvec4 texColor;\r\n\t\t#ifdef GL_OES_standard_derivatives\r\n\t\t\t#extension GL_OES_standard_derivatives : enable\r\n\r\n\t\t\t// calculate derivative of continuous texture coordinate\r\n\t\t\t// to avoid mipmapping artifacts caused by manual wrapping in shader\r\n\t\t\tvec2 dUVdx \x3d dFdx(vtc) * atlasScale;\r\n\t\t\tvec2 dUVdy \x3d dFdy(vtc) * atlasScale;\r\n\r\n\t\t\t#ifdef GL_EXT_shader_texture_lod\r\n\t\t\t\t#extension GL_EXT_shader_texture_lod : enable\r\n\r\n\t\t\t\t// workaround for artifacts in Windows 10 using Intel HD Graphics 4000 series\r\n\t\t\t\t// see: https://devtopia.esri.com/Zurich-R-D-Center/arcgis-js-api-canvas3d-issues/issues/768\r\n\t\t\t\tconst float epsilon \x3d 1.0E-32;\r\n\t\t\t\tfloat zeroUVShift \x3d uv.x \x3d\x3d 0.0 \x26\x26 uv.y \x3d\x3d 0.0 ? epsilon : 0.0;\r\n\r\n\t\t\t\ttexColor \x3d texture2DGradEXT(tex, uv + zeroUVShift, dUVdx, dUVdy);\r\n\t\t\t#else\r\n\t\t\t\t// use bias to compensate for difference in automatic vs desired mipmap level\r\n\t\t\t\tvec2 dUVdxAuto \x3d dFdx(uv);\r\n\t\t\t\tvec2 dUVdyAuto \x3d dFdy(uv);\r\n\t\t\t\tfloat mipMapLevel \x3d calcMipMapLevel(dUVdx * texSize, dUVdy * texSize);\r\n\t\t\t\tfloat autoMipMapLevel \x3d calcMipMapLevel(dUVdxAuto * texSize, dUVdyAuto * texSize);\r\n\t\t\t\ttexColor \x3d texture2D(tex, uv, mipMapLevel - autoMipMapLevel);\r\n\t\t\t#endif\r\n\t\t#else\r\n\t\t\ttexColor \x3d texture2D(tex, uv);\r\n\t\t#endif\r\n\r\n\t\tif (texColor.a \x3c .33) discard;\r\n\r\n\t\t$externalColorMix\r\n\r\n\t\tif (opacity_ \x3c 0.001) {\r\n\t\t\tdiscard;\r\n\t\t}\r\n\r\n\t\tvec3 shadedColor \x3d evaluateSceneLighting(normal, albedo_, shadow, 1.0 - ssao, additionalLight);\r\n\t\tgl_FragColor \x3d vec4(shadedColor, opacity_);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsDepthSrc"\x3e\x3c![CDATA[\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n uniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n\tattribute mat4 model;\r\n attribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n uniform mat4 modelNormal;\r\n#endif\r\n\tuniform vec2 nearFar;\r\n\tattribute vec3 $position;\r\n\tvarying float depth;\r\n\r\n\t$vvUniforms\r\n#if defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\t$vvFunctions\r\n\r\n $calculateVerticalOffset\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n vec3 vpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n\t\tvec3 vpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n\t\tvec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n vec4 eye \x3d view * vec4(vpos, 1);\r\n\r\n\t\tgl_Position \x3d proj * eye;\r\n\t\tdepth \x3d (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsDepth"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\t$vsDepthSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsDepthTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsDepthSrc\r\n#ifndef FLIPV\r\n vtc \x3d $uv0;\r\n#else\r\n vtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsNormalSrc"\x3e\x3c![CDATA[\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n uniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n\tattribute mat4 model;\r\n\tattribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n\tuniform mat4 modelNormal;\r\n#endif\r\n\tuniform mat4 viewNormal;\r\n\tattribute vec3 $position;\r\n#ifdef COMPRESSED_NORMALS\r\n attribute vec2 $normalCompressed;\r\n#else\r\n attribute vec3 $normal;\r\n#endif\r\n\tvarying vec3 vnormal;\r\n\r\n\t$vvUniforms\r\n#if defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\t$vvFunctions\r\n\r\n $calculateVerticalOffset\r\n\r\n $decodeNormal\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n vec3 vpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n#ifdef COMPRESSED_NORMALS\r\n vnormal \x3d normalize((viewNormal * modelNormal * vvTransformNormal(decodeNormal($normalCompressed), instanceFeatureAttribute)).xyz);\r\n#else\r\n\t\tvnormal \x3d normalize((viewNormal * modelNormal * vvTransformNormal($normal, instanceFeatureAttribute)).xyz);\r\n#endif\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\t\tvec3 vpos \x3d (model * vec4($position, 1.0)).xyz;\r\n#ifdef COMPRESSED_NORMALS\r\n vnormal \x3d normalize((viewNormal * modelNormal * vec4(decodeNormal($normalCompressed), 1.0)).xyz);\r\n#else\r\n\t\tvnormal \x3d normalize((viewNormal * modelNormal * vec4($normal, 1.0)).xyz);\r\n#endif\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n gl_Position \x3d proj * view * vec4(vpos, 1);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsNormal"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\t$vsNormalSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsNormalTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsNormalSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsHighlightSrc"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n uniform vec3 camPos;\r\n uniform vec3 localOrigin;\r\n\r\n#ifdef INSTANCED\r\n\tattribute mat4 model;\r\n attribute mat4 modelNormal;\r\n#else\r\n\tuniform mat4 model;\r\n uniform mat4 modelNormal;\r\n#endif\r\n\tattribute vec3 $position;\r\n\r\n\t$vvUniforms\r\n#if defined(VV_CUSTOM_MODEL_MATRIX)\r\n\tattribute vec4 instanceFeatureAttribute;\r\n#endif\r\n\t$vvFunctions\r\n\r\n $calculateVerticalOffset\r\n\r\n\tvoid main(void) {\r\n\r\n#ifdef VV_CUSTOM_MODEL_MATRIX\r\n\r\n vec3 vpos \x3d (model * vvTransformPosition($position, instanceFeatureAttribute)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vvTransformPosition(vec3(0, 0, 0), instanceFeatureAttribute)).xyz;\r\n#endif\r\n\r\n#else /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n vec3 vpos \x3d (model * vec4($position, 1.0)).xyz;\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vec3 centerPos \x3d (model * vec4(vec3(0, 0, 0), 1.0)).xyz;\r\n#endif\r\n\r\n#endif /* VV_CUSTOM_MODEL_MATRIX */\r\n\r\n#ifdef VERTICAL_OFFSET\r\n vpos +\x3d calculateVerticalOffset(centerPos, localOrigin);\r\n#endif\r\n\r\n\t\tgl_Position \x3d proj * view * vec4(vpos, 1);\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsHighlight"\x3e\x3c![CDATA[\r\n\t$vsHighlightSrc\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsHighlightTextured"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\t$vsHighlightSrc\r\n#ifndef FLIPV\r\n\t\tvtc \x3d $uv0;\r\n#else\r\n\t\tvtc \x3d vec2($uv0.x, 1.0-$uv0.y);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsDepthSrc"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\tvarying float depth;\r\n\r\n\tvoid main() {\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsDepth"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\t$calcFragDepth\r\n\t$float2rgba\r\n\t$fsDepthSrc\r\n#ifndef BIAS_SHADOWMAP\r\n\t\tgl_FragColor \x3d float2rgba(depth);\r\n#else\r\n\t\tgl_FragColor \x3d float2rgba(calcFragDepth(depth));\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsDepthTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform sampler2D tex;\r\n\tvarying vec2 vtc;\r\n\t$calcFragDepth\r\n\t$float2rgba\r\n\r\n\t$fsDepthSrc\r\n\t\tif (texture2D(tex, vtc).a \x3c .33) discard;\r\n#ifndef BIAS_SHADOWMAP\r\n\t\tgl_FragColor \x3d float2rgba(depth);\r\n#else\r\n\t\tgl_FragColor \x3d float2rgba(calcFragDepth(depth));\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsNormal"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec3 vnormal;\r\n\tvoid main() {\r\n\t\tvec3 normal \x3d normalize(vnormal);\r\n\t\tif (gl_FrontFacing \x3d\x3d false) normal \x3d -normal;\r\n\r\n#ifndef ALPHA_ZERO\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 1.0);\r\n#else\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 0.0);\r\n#endif\r\n\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsNormalTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec3 vnormal;\r\n\tvarying vec2 vtc;\r\n\tuniform sampler2D tex;\r\n\tvoid main() {\r\n\t\tif (texture2D(tex, vtc).a \x3c .33) discard;\r\n\t\tvec3 normal \x3d normalize(vnormal);\r\n\t\tif (gl_FrontFacing \x3d\x3d false) normal \x3d -normal;\r\n#ifndef ALPHA_ZERO\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 1.0);\r\n#else\r\n\t\tgl_FragColor \x3d vec4(vec3(.5) + .5 * normal, 0.0);\r\n#endif\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlight"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n\tvoid main() {\r\n\t\t$highlightWrite\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsHighlightTextured"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tvarying vec2 vtc;\r\n\tuniform sampler2D tex;\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n\tvoid main() {\r\n\t\tif (texture2D(tex, vtc).a \x3c .33) discard;\r\n\r\n\t\t$highlightWrite\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/LineCalloutMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderLineCallout"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n $commonAttributesAndUniformsHUD\r\n\r\n attribute vec2 $uv0;\r\n\r\n uniform float lineSize;\r\n uniform vec2 pixelToNDC;\r\n uniform float borderSize;\r\n uniform vec2 screenOffset;\r\n\r\n varying vec4 coverageSampling;\r\n varying vec2 lineSizes;\r\n\r\n $alignToPixelOrigin\r\n $alignToPixelCenter\r\n\r\n $projectPositionHUD\r\n\r\n void main(void) {\r\n ProjectHUDAux projectAux;\r\n vec4 endPoint \x3d projectPositionHUD(projectAux);\r\n\r\n#ifdef OCCL_TEST\r\n if (!testVisibilityHUD(endPoint)) {\r\n gl_Position \x3d vec4(1e38, 1e38, 1e38, 1);\r\n }\r\n else {\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n vec4 perspectiveFactor \x3d screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);\r\n vec2 screenOffsetScaled \x3d applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor);\r\n#else\r\n vec2 screenOffsetScaled \x3d screenOffset;\r\n#endif\r\n\r\n // Add view dependent polygon offset to get exact same original starting point. This is mostly\r\n // used to get the correct depth value\r\n vec3 posView \x3d (view * model * vec4($position, 1.0)).xyz;\r\n applyHUDViewDependentPolygonOffset($auxpos1.w, projectAux.absCosAngle, posView);\r\n\r\n vec4 startPoint \x3d proj * vec4(posView, 1);\r\n\r\n // Apply screen offset to both start and end point\r\n vec2 screenOffsetNorm \x3d screenOffsetScaled * 2.0 / viewport.zw;\r\n\r\n startPoint.xy +\x3d screenOffsetNorm * startPoint.w;\r\n endPoint.xy +\x3d screenOffsetNorm * endPoint.w;\r\n\r\n // Align start and end to pixel origin\r\n vec4 startAligned \x3d alignToPixelOrigin(startPoint, viewport.zw);\r\n vec4 endAligned \x3d alignToPixelOrigin(endPoint, viewport.zw);\r\n\r\n#ifdef DEPTH_HUD\r\n\r\n#ifdef DEPTH_HUD_ALIGN_START\r\n endAligned \x3d vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);\r\n#else\r\n startAligned \x3d vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);\r\n#endif\r\n\r\n#endif\r\n\r\n vec4 projectedPosition \x3d mix(startAligned, endAligned, $uv0.y);\r\n\r\n // The direction of the line in screen space\r\n vec2 screenSpaceDirection \x3d normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w);\r\n vec2 perpendicularScreenSpaceDirection \x3d vec2(screenSpaceDirection.y, -screenSpaceDirection.x);\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE\r\n\r\n float lineSizeScaled \x3d applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor);\r\n float borderSizeScaled \x3d applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor);\r\n\r\n#else\r\n\r\n float lineSizeScaled \x3d lineSize;\r\n float borderSizeScaled \x3d borderSize;\r\n\r\n#endif\r\n\r\n float halfPixelSize \x3d lineSizeScaled * 0.5;\r\n\r\n // Calculate a pixel offset from the edge of the pixel, s.t. we keep the line aligned\r\n // to pixels if it has a full pixel size. Since pixel aligned biases to the bottom-left,\r\n // we bias the size to the right (for odd sizes) to balance out the bias. Grow sub-pixel\r\n // sizes towards the left or right s.t. there is a smooth transition (e.g. from 2 to 3 px).\r\n float halfWholePixelSize \x3d floor(lineSizeScaled) * 0.5;\r\n float halfPixelSizeInt \x3d floor(halfWholePixelSize);\r\n\r\n // Sub-pixel offset if we need to grow sub-pixels to the left\r\n float subpixelOffset \x3d -fract(lineSizeScaled) * float(halfWholePixelSize \x3e 0.0);\r\n\r\n // Pixel offset aligning to whole pixels and adding subpixel offset if needed\r\n float pixelOffset \x3d -halfPixelSizeInt + subpixelOffset;\r\n\r\n // Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size\r\n float padding \x3d 1.0 + borderSizeScaled;\r\n vec2 ndcOffset \x3d (pixelOffset - padding + $uv0.x * (lineSizeScaled + padding + padding)) * pixelToNDC;\r\n\r\n // Offset x/y from the center of the line in screen space\r\n projectedPosition.xy +\x3d perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w;\r\n\r\n // Compute a coverage varying which we can use in the fragment shader to determine\r\n // how much a pixel is actually covered by the line (i.e. to anti alias the line).\r\n // This works by computing two coordinates that can be linearly interpolated and then\r\n // subtracted to find out how far away from the line edge we are.\r\n float edgeDirection \x3d ($uv0.x * 2.0 - 1.0);\r\n\r\n float halfBorderSize \x3d 0.5 * borderSizeScaled;\r\n float halfPixelSizeAndBorder \x3d halfPixelSize + halfBorderSize;\r\n float outerEdgeCoverageSampler \x3d edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0);\r\n\r\n float isOneSided \x3d float(lineSizeScaled \x3c 2.0 \x26\x26 borderSize \x3c 2.0);\r\n\r\n coverageSampling \x3d vec4(\r\n // Edge coordinate\r\n outerEdgeCoverageSampler,\r\n\r\n // Border edge coordinate\r\n outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided,\r\n\r\n // Line offset\r\n halfPixelSize - 0.5,\r\n\r\n // Border offset\r\n halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided)\r\n );\r\n\r\n lineSizes \x3d vec2(lineSizeScaled, borderSizeScaled);\r\n\r\n gl_Position \x3d projectedPosition;\r\n\r\n#ifdef OCCL_TEST\r\n }\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet\x3e\x3c![CDATA[\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderLineCallout"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform vec4 color;\r\n uniform vec4 borderColor;\r\n\r\n varying vec4 coverageSampling;\r\n varying vec2 lineSizes;\r\n\r\n void main() {\r\n // Mix between line and border coverage offsets depending on whether we need\r\n // a border (based on the sidedness).\r\n vec2 coverage \x3d min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes);\r\n\r\n // Mix between border and line color based on the line coverage (conceptually the line\r\n // blends on top of the border background).\r\n //\r\n // Anti-alias by blending final result using the full (including optional border) coverage\r\n // and the color alpha\r\n float borderAlpha \x3d color.a * borderColor.a * coverage.y;\r\n float colorAlpha \x3d color.a * coverage.x;\r\n\r\n float finalAlpha \x3d mix(borderAlpha, 1.0, colorAlpha);\r\n\r\n#ifdef DEPTH_HUD\r\n\r\n if (finalAlpha \x3c 0.01) {\r\n discard;\r\n }\r\n\r\n#else\r\n\r\n // Compute the finalRgb, but keep it pre-multiplied (for unpre-multiplied you\r\n // need to divide by finalAlpha). We avoid the division here by setting the\r\n // appropriate blending function in the material.\r\n vec3 finalRgb \x3d mix(borderColor.rgb * borderAlpha, color.rgb, colorAlpha);\r\n\r\n gl_FragColor \x3d vec4(finalRgb, finalAlpha);\r\n\r\n#endif\r\n\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/MeasurementArrowMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsMeasurementArrow"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform mat4 model;\r\n\r\n uniform float width;\r\n\r\n attribute vec3 $position;\r\n attribute vec3 $normal;\r\n attribute vec2 $uv0;\r\n attribute float $auxpos1;\r\n\r\n varying vec2 vtc;\r\n varying float vlength;\r\n varying float vradius;\r\n\r\n void main(void) {\r\n vec3 bitangent \x3d $normal;\r\n\r\n vtc \x3d $uv0;\r\n vlength \x3d $auxpos1;\r\n vradius \x3d 0.5 * width;\r\n\r\n vec4 pos \x3d view * vec4((model * vec4($position + vradius * bitangent * $uv0.y, 1.0)).xyz, 1.0);\r\n gl_Position \x3d proj * pos;\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsMeasurementArrow"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform float outlineSize;\r\n uniform vec4 outlineColor;\r\n uniform float stripeLength;\r\n uniform vec4 stripeEvenColor;\r\n uniform vec4 stripeOddColor;\r\n\r\n varying vec2 vtc;\r\n varying float vlength;\r\n varying float vradius;\r\n\r\n #define INV_SQRT2 (1.0 / sqrt(2.0))\r\n\r\n vec4 arrowColor(vec2 tc, float len) {\r\n float d \x3d INV_SQRT2 * (tc.x - abs(tc.y));\r\n d \x3d min(d, INV_SQRT2 * (len - tc.x - abs(tc.y)));\r\n d \x3d min(d, 1.0 - abs(tc.y));\r\n\r\n if (d \x3c 0.0) {\r\n return vec4(0.0);\r\n } else if (d \x3c outlineSize) {\r\n return outlineColor;\r\n } else {\r\n return fract(0.5 / stripeLength * tc.x * vradius) \x3e\x3d 0.5 ? stripeOddColor : stripeEvenColor;\r\n }\r\n }\r\n\r\n void main(void) {\r\n vec2 ntc \x3d vec2(vtc.x / vradius, vtc.y);\r\n vec4 color \x3d arrowColor(ntc, vlength / vradius);\r\n if (color.a \x3d\x3d 0.0) {\r\n discard;\r\n }\r\n gl_FragColor \x3d color;\r\n }\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/RibbonLineMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsRibbonLine"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\r\n\tuniform float extLineWidth;\r\n\tuniform float nearPlane;\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\tvarying vec2 vtc;\r\n\r\n\tattribute vec4 $color;\r\n\tvarying vec4 vColor;\r\n\r\n\tattribute float size;\r\n\r\n#ifndef WALL\r\n\tuniform float miterLimit;\r\n\tattribute vec3 $auxpos1;\r\n\tattribute vec3 $auxpos2;\r\n#endif\r\n\r\n#ifdef SCREENSCALE\r\n\tuniform vec2 screenSize;\r\n\t$toScreenCoords\r\n#define VECTYPE vec2\r\n#define ZEROVEC vec2(0.0, 0.0)\r\n#define PERPENDICULAR(v) vec2(v.y, -v.x);\r\n#define ISOUTSIDE (left.x * right.y - left.y * right.x)*$uv0.y \x3e 0.0\r\n\r\n#else //ifdef SCREENSCALE\r\n\r\n#define VECTYPE vec3\r\n#define ZEROVEC vec3(0.0, 0.0, 0.0)\r\n// these macros are only valid for "strip" type lines:\r\n#define PERPENDICULAR(v) cross(up/*vec3(0.0, 1.0, 0.0)*/, v)\r\n#define ISOUTSIDE dot(cross(left, right), up/*vec3(0.0, 1.0, 0.0)*/)*$uv0.y \x3c 0.0\r\n\r\n#endif //ifdef SCREENSCALE\r\n\r\n\tfloat interp(float ncp, vec4 a, vec4 b) {\r\n\t\treturn (-ncp - a.z) / (b.z - a.z);\r\n\t}\r\n\r\n#ifdef SCREENSCALE\r\n\r\n void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next) {\r\n\t\tfloat vnp \x3d nearPlane*0.99;\r\n\r\n\t\t//We have four vertices per point on the line. Start and end vertices\r\n\t\t//are treated differently --\x3e d \x3e 0, d \x3c 0\r\n\t\tfloat d \x3d abs($uv0.y) - 1.1;\r\n\r\n\t\t//current pos behind ncp --\x3e we need to clip\r\n\t\tif(pos.z \x3e -nearPlane) {\r\n\t\t\tif (d \x3c 0.0) {\r\n\t\t\t\t//previous in front of ncp\r\n\t\t\t\tif(prev.z \x3c -nearPlane) {\r\n\t\t\t\t\tpos \x3d mix(prev, pos, interp(vnp, prev, pos));\r\n\t\t\t\t\tnext \x3d pos;\r\n\t\t\t\t} else {\r\n\t\t\t\t pos \x3d vec4(0, 0, 0, 1);\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t//next in front of ncp\r\n\t\t\tif(d \x3e 0.0) {\r\n\t\t\t\tif(next.z \x3c -nearPlane) {\r\n\t\t\t\t\tpos \x3d mix(pos, next, interp(vnp, pos, next));\r\n\t\t\t\t\tprev \x3d pos;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpos \x3d vec4(0, 0, 0, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\telse {\r\n\t\t\t//current position visible\r\n\t\t\t//previous behind ncp\r\n\t\t\tif (prev.z \x3e -nearPlane) {\r\n\t\t\t\tprev \x3d mix(pos, prev, interp(vnp, pos, prev));\r\n\t\t\t}\r\n\t\t\t//next behind ncp\r\n\t\t\tif (next.z \x3e -nearPlane) {\r\n\t\t\t\tnext \x3d mix(next, pos, interp(vnp, next, pos));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tpos\x3d proj * pos;\r\n\t\tpos.xy *\x3d screenSize;\r\n\t\tpos /\x3d pos.w;\r\n\r\n\t\tnext \x3d proj * next;\r\n\t\tnext.xy *\x3d screenSize;\r\n\t\tnext /\x3d next.w;\r\n\r\n\t\tprev \x3d proj * prev;\r\n\t\tprev.xy *\x3d screenSize;\r\n\t\tprev /\x3d prev.w;\r\n }\r\n\r\n#endif // SCREENSCALE\r\n\r\n\tvoid main(void) {\r\n\r\n\tfloat lineWidth \x3d extLineWidth + $size;\r\n\r\n#ifdef SCREENSCALE\r\n\r\n#if 0\r\n\t\tvec4 pos \x3d toScreenCoords($position.xyz);\r\n\t\tvec2 left \x3d (pos - toScreenCoords($auxpos1)).xy;\r\n\t\tvec2 right \x3d (toScreenCoords($auxpos2) - pos).xy;\r\n#else\r\n\t\tvec4 pos \x3d view * vec4((model * vec4($position.xyz, 1.0)).xyz, 1.0);\r\n\t\tvec4 prev \x3d view * vec4((model * vec4($auxpos1.xyz, 1.0)).xyz, 1.0);\r\n\t\tvec4 next \x3d view * vec4((model * vec4($auxpos2.xyz, 1.0)).xyz, 1.0);\r\n\r\n\t\tclipAndTransform(pos, prev, next);\r\n\r\n\t\tvec2 left \x3d (pos - prev).xy;\r\n\t\tvec2 right \x3d (next - pos).xy;\r\n#endif\r\n\r\n#else // ifdef SCREENSCALE\r\n\t\tvec4 pos \x3d vec4($position, 1.0);\r\n#ifndef WALL\r\n\t\tvec3 left \x3d $position.xyz - $auxpos1;\r\n\t\tvec3 right \x3d $auxpos2 - $position.xyz;\r\n\t\tvec3 up \x3d normalize($position.xyz);\r\n#endif // ifndef WALL\r\n#endif // ifdef SCREENSCALE\r\n\r\n#ifdef WALL\r\n\t\tfloat displacementLen \x3d lineWidth;\r\n\t\tvec3 displacementDir \x3d normalize($position.xyz);//vec3(0.0, 1.0, 0.0);\r\n#else // ifdef WALL\r\n\r\n\t\tfloat leftLen \x3d length(left);\r\n\t\tleft \x3d (leftLen \x3e 0.001) ? left/leftLen : ZEROVEC;\r\n\r\n\t\tfloat rightLen \x3d length(right);\r\n\t\tright \x3d (rightLen \x3e 0.001) ? right/rightLen : ZEROVEC;\r\n\r\n\t\t// determine if vertex is on the "outside or "inside" of the join\r\n\t\tbool isOutside \x3d ISOUTSIDE;\r\n\r\n\t\t// compute miter join position first\r\n\t\tfloat displacementLen \x3d lineWidth;\r\n\t\tVECTYPE displacementDir \x3d normalize(left + right);\r\n\t\tdisplacementDir \x3d PERPENDICULAR(displacementDir);\r\n\t\tif (leftLen \x3e 0.001 \x26\x26 rightLen \x3e 0.001) {\r\n\t\t\tfloat nDotSeg \x3d dot(displacementDir, left);\r\n\t\t\tdisplacementLen /\x3d length(nDotSeg*left - displacementDir);\r\n\r\n\t\t\t// limit displacement of inner vertices\r\n\t\t\tif (!isOutside)\r\n\t\t\t\tdisplacementLen \x3d min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));\r\n\t\t}\r\n\r\n\t\tif (isOutside \x26\x26 (displacementLen \x3e miterLimit*lineWidth)) {\r\n\t\t\t// convert to bevel join if miterLimit is exceeded\r\n\t\t\tif (leftLen \x3c 0.001)\r\n\t\t\t displacementDir \x3d right;\r\n\t\t\telse if (rightLen \x3c 0.001)\r\n\t\t\t\tdisplacementDir \x3d left;\r\n\t\t\telse\r\n\t\t\t\tdisplacementDir \x3d (abs($uv0.y) - 1.1 \x3c 0.0) ? left : right;\r\n\t\t\tdisplacementDir \x3d normalize(displacementDir);\r\n\t\t\tdisplacementDir \x3d PERPENDICULAR(displacementDir);\r\n\t\t\tdisplacementLen \x3d lineWidth;\r\n\t\t}\r\n\r\n#endif // ifdef WALL\r\n\r\n#ifdef SCREENSCALE\r\n\t\tpos.xy +\x3d displacementDir * floor($uv0.y + 0.5) * displacementLen;\r\n\t\tpos.xy /\x3d screenSize;\r\n#else\r\n\t\tpos.xyz +\x3d displacementDir * floor($uv0.y + 0.5) * displacementLen;\r\n\t\tpos \x3d proj * view * model * pos;\r\n#endif\r\n\r\n\t\tvtc \x3d $uv0;\r\n\t\tvColor \x3d $color * 0.003921568627451; // \x3d 1/255\r\n\t\tgl_Position \x3d pos;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\r\n\x3csnippet name\x3d"fsRibbonLine"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n\tuniform vec4 eColor;\r\n\tvarying vec4 vColor;\r\n\tvarying vec2 vtc;\r\n\r\n#ifdef STIPPLE\r\n uniform float stippleLengthDoubleInv;\r\n#endif\r\n\r\n\tvoid main() {\r\n\r\n#ifdef STIPPLE\r\n if (fract(vtc.x * stippleLengthDoubleInv) \x3e 0.5) {\r\n discard;\r\n }\r\n#endif\r\n\r\n gl_FragColor \x3d eColor * vColor;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsRibbonLineHighlight"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n#ifdef STIPPLE\r\n uniform float stippleLengthDoubleInv;\r\n#endif\r\n\r\n\tvoid main() {\r\n#ifdef STIPPLE\r\n if (fract(vtc.x * stippleLengthDoubleInv) \x3e 0.5) {\r\n discard;\r\n }\r\n#endif\r\n\r\n\t\tgl_FragColor \x3d vec4(1.0, 1.0, 1.0, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/BlendLayers.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderBlendLayers"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tattribute vec3 $position;\r\n\tattribute vec2 $uv0;\r\n\r\n\tuniform float scale;\r\n\tuniform vec2 offset;\r\n\r\n\tvarying vec2 uv;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d vec4($position, 1.0);\r\n\t\tuv \x3d $uv0 * scale + offset;;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderBlendLayers"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n\tvarying vec2 uv;\r\n\r\n\tuniform sampler2D tex;\r\n\tuniform float opacity;\r\n\r\n\tvoid main() {\r\n\t\tvec4 color \x3d texture2D(tex, uv);\r\n\r\n // Note: output in pre-multiplied alpha for correct alpha compositing\r\n\t\tgl_FragColor \x3d vec4(color.xyz, 1.0) * color.a * opacity;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/webgl-engine/materials/internal/SimpleGLMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vertexShaderSimple"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n\tuniform mat4 proj;\r\n\tuniform mat4 view;\r\n\tuniform mat4 model;\r\n\tattribute vec3 $position;\r\n\r\n\tvoid main(void) {\r\n\t\tgl_Position \x3d proj * view * vec4((model * vec4($position, 1.0)).xyz, 1.0);\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fragmentShaderSimple"\x3e\x3c![CDATA[\r\n\t$fsprecisionf\r\n\r\n\tuniform vec4 color;\r\n\r\n\tvoid main() {\r\n\t\tgl_FragColor \x3d color;\r\n\t}\r\n]]\x3e\x3c/snippet\x3e\r\n\x3c/snippets\x3e\r\n',
- "url:esri/views/3d/terrain/TerrainMaterial.xml":'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8"?\x3e\r\n\r\n\x3csnippets\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrain"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform vec3 origin;\r\n uniform vec2 texOffset;\r\n uniform float texScale;\r\n uniform mat4 viewNormal;\r\n\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n varying vec2 vtc;\r\n varying vec3 vpos;\r\n varying vec3 vnormal;\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n varying float linearDepth;\r\n#endif\r\n\r\n#if defined(WIREFRAME) || defined(TILE_BORDERS)\r\n varying vec2 vuv;\r\n#endif\r\n\r\n#ifdef ATMOSPHERE\r\n uniform vec3 lightDirection;\r\n varying vec3 wpos;\r\n varying vec3 wview;\r\n varying vec3 wnormal;\r\n varying vec3 wlight;\r\n#endif\r\n\r\n#ifdef OVERLAY\r\n uniform vec2 overlayTexOffset;\r\n uniform vec2 overlayTexScale;\r\n varying vec2 vtcOverlay;\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n\r\n uniform vec4 screenSizePerspective;\r\n\r\n varying float screenSizeDistanceToCamera;\r\n varying float screenSizeCosAngle;\r\n\r\n#endif\r\n\r\n void main(void) {\r\n vpos \x3d $position;\r\n\r\n#ifdef SPHERICAL\r\n vnormal \x3d normalize(vpos + origin);\r\n#else\r\n vnormal \x3d vec3(0, 0, 1); // WARNING: up-axis dependent code\r\n#endif\r\n\r\n#ifdef ATMOSPHERE\r\n wpos \x3d (view * vec4(vpos, 1.0)).xyz;\r\n wnormal \x3d (viewNormal * vec4(normalize(vpos+origin), 1.0)).xyz;\r\n wlight \x3d (view * vec4(lightDirection, 1.0)).xyz;\r\n#endif\r\n\r\n#if defined(WIREFRAME) || defined(TILE_BORDERS)\r\n vuv \x3d $uv0;\r\n#endif\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n\r\n vec3 viewPos \x3d (view * vec4(vpos, 1.0)).xyz;\r\n\r\n screenSizeDistanceToCamera \x3d length(viewPos);\r\n\r\n vec3 viewSpaceNormal \x3d (viewNormal * vec4(normalize(vpos + origin), 1.0)).xyz;\r\n screenSizeCosAngle \x3d abs(viewSpaceNormal.z);\r\n\r\n#endif\r\n\r\n gl_Position \x3d proj * view * vec4(vpos, 1.0);\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n // Shadowmap\'s cascading index used to be based on \'1.0 / gl_FragCoord.w\'\r\n // (i.e. the perspective interpolation of \'gl_Position.w\'). Precision\r\n // issues on iPad/iPhone with the \'w\' component require the depth to be\r\n // passed as varying to properly drive the cascading shadow map index.\r\n linearDepth \x3d gl_Position.w;\r\n#endif\r\n\r\n vtc \x3d $uv0*texScale + texOffset;\r\n\r\n#ifdef OVERLAY\r\n vtcOverlay \x3d $uv0*overlayTexScale + overlayTexOffset;\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainCommon"\x3e\x3c![CDATA[\r\n uniform vec3 lightDirection;\r\n uniform vec3 viewDirection;\r\n uniform sampler2D depthTex;\r\n uniform int shadowMapNum;\r\n uniform vec4 shadowMapDistance;\r\n uniform mat4 shadowMapMatrix[4];\r\n uniform float depthHalfPixelSz;\r\n uniform sampler2D ssaoTex;\r\n uniform vec4 viewportPixelSz;\r\n uniform sampler2D tex;\r\n uniform float opacity;\r\n\r\n varying vec3 vpos;\r\n varying vec3 vnormal;\r\n varying vec2 vtc;\r\n\r\n#if defined(WIREFRAME) || defined(TILE_BORDERS)\r\n varying vec2 vuv;\r\n#endif\r\n\r\n#ifdef ATMOSPHERE\r\n varying vec3 wpos;\r\n varying vec3 wview;\r\n varying vec3 wnormal;\r\n varying vec3 wlight;\r\n#endif\r\n\r\n $sceneLightingDefinitions\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n $screenSizePerspective\r\n\r\n uniform vec4 screenSizePerspective;\r\n\r\n varying float screenSizeDistanceToCamera;\r\n varying float screenSizeCosAngle;\r\n#endif\r\n\r\n const vec3 ambient \x3d vec3(0.2,0.2,0.2);\r\n const vec3 diffuse \x3d vec3(0.8,0.8,0.8);\r\n const float diffuseHardness \x3d 2.5;\r\n\r\n#ifdef OVERLAY\r\n uniform sampler2D overlayTex;\r\n uniform float overlayOpacity;\r\n varying vec2 vtcOverlay;\r\n#endif\r\n\r\n#ifdef RECEIVE_SHADOWS\r\n\tvarying float linearDepth;\r\n\t$evalShadow\r\n#endif\r\n\r\n float lum(vec3 c) {\r\n float max \x3d max(max(c.r, c.g), c.b);\r\n float min \x3d min(min(c.r, c.g), c.b);\r\n return (min + max) * 0.5;\r\n }\r\n\r\n#ifdef ATMOSPHERE\r\n vec3 atmosphere(vec3 lightPos, vec3 normal, vec3 view) {\r\n vec3 surfaceColor \x3d vec3(0.0);\r\n vec3 fuzzySpecColor \x3d vec3(1.0);\r\n vec3 subColor \x3d vec3(0.0);\r\n float rollOff \x3d 1.0;\r\n\r\n vec3 Ln \x3d normalize(lightPos);\r\n vec3 Nn \x3d normalize(normal);\r\n vec3 Hn \x3d normalize(view + Ln);\r\n\r\n float ldn \x3d dot(Ln, Nn);\r\n float diffComp \x3d max(0.0, ldn);\r\n float vdn \x3d 1.0 - dot(view, Nn);\r\n float ndv \x3d dot(view, Ln);\r\n\r\n vec3 diffContrib \x3d surfaceColor * diffComp;\r\n float subLamb \x3d max(0.0, smoothstep(-rollOff, 1.0, ldn) - smoothstep(0.0, 1.0, ldn));\r\n\r\n vec3 subContrib \x3d subLamb * subColor;\r\n vec3 vecColor \x3d vec3(vdn);\r\n\r\n vec3 diffuseContrib \x3d (subContrib + diffContrib);\r\n vec3 specularContrib \x3d (vecColor * fuzzySpecColor);\r\n\r\n return (diffContrib + specularContrib) * rollOff;\r\n }\r\n#endif\r\n\r\n void main() {\r\n vec3 a \x3d ambient;\r\n\r\n float shadow \x3d 0.0;\r\n#ifdef RECEIVE_SHADOWS\r\n shadow \x3d evalShadow(vpos, linearDepth, depthTex, shadowMapNum, shadowMapDistance, shadowMapMatrix, depthHalfPixelSz);\r\n#endif\r\n float vndl \x3d dot(normalize(vnormal), lightDirection);\r\n float k \x3d smoothstep(0.0, 1.0, clamp(vndl*diffuseHardness, 0.0, 1.0));\r\n vec3 d \x3d (1.0 - shadow/1.8) * diffuse * k;\r\n\r\n float ssao \x3d viewportPixelSz.w \x3c .0 ? 1.0 : texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;\r\n vec4 texCol \x3d texture2D(tex, vtc);\r\n\r\n#ifdef OVERLAY\r\n if ((vtcOverlay.x \x3e 0.0) \x26\x26 (vtcOverlay.y \x3e 0.0) \x26\x26 (vtcOverlay.x \x3c 1.0) \x26\x26 (vtcOverlay.y \x3c 1.0)) {\r\n vec4 overlayTexCol \x3d texture2D(overlayTex, vtcOverlay);\r\n overlayTexCol *\x3d overlayOpacity;\r\n texCol \x3d texCol * (1.0 - overlayTexCol.a) + overlayTexCol; // texCol and overlayTexCol have pre-multiplied alpha\r\n }\r\n#endif\r\n\r\n vec3 atm \x3d vec3(0.0);\r\n#ifdef ATMOSPHERE\r\n float ndotl \x3d max(0.0, min(1.0, vndl));\r\n atm \x3d atmosphere(wlight, wnormal, -viewDirection);\r\n atm *\x3d max(0.0, min(1.0, (1.0-lum(texCol.rgb)*1.5))); //avoid atmosphere on bright base maps\r\n atm *\x3d max(0.0, min(1.0, ndotl*2.0)); // avoid atmosphere on dark side of the globe\r\n#endif\r\n\r\n vec3 albedo \x3d atm + texCol.rgb;\r\n vec3 normal \x3d normalize(vnormal);\r\n\r\n // heuristic shading function used in the old terrain, now used to add ambient lighting\r\n float additionalAmbientScale \x3d smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0));\r\n\t\tvec3 additionalLight \x3d ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\r\n\r\n gl_FragColor \x3d vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), texCol.a) * opacity;\r\n\r\n#ifdef SCREEN_SIZE_PERSPECTIVE /* debug only */\r\n // This is only used for debug rendering the screenSize perspective\r\n\r\n float perspectiveScale \x3d screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, screenSizePerspective);\r\n\r\n if (perspectiveScale \x3c\x3d 0.25) {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1, 0, 0, 1), perspectiveScale * 4.0);\r\n }\r\n else if (perspectiveScale \x3c\x3d 0.5) {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(0, 0, 1, 1), (perspectiveScale - 0.25) * 4.0);\r\n }\r\n else if (perspectiveScale \x3e\x3d 0.99) {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(0, 1, 0, 1), 0.2);\r\n }\r\n else {\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1, 0, 1, 1), (perspectiveScale - 0.5) * 2.0);\r\n }\r\n\r\n#endif\r\n\r\n // closing } is missing here, it\'s in the shaders using this snippet below\r\n\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainWireframe"\x3e\x3c![CDATA[\r\n#ifdef GL_OES_standard_derivatives\r\n#extension GL_OES_standard_derivatives : enable\r\n#endif\r\n\r\n $fsprecisionf\r\n\r\n struct WireframeSettings {\r\n float width;\r\n float falloff;\r\n float subdivision;\r\n vec4 color;\r\n float wireOpacity;\r\n float surfaceOpacity;\r\n };\r\n\r\n uniform WireframeSettings wireframe;\r\n\r\n $fsTerrainCommon\r\n\r\n vec2 vuvScaled \x3d vuv * wireframe.subdivision;\r\n vec2 vuvMod \x3d fract(vuvScaled);\r\n\r\n#ifdef GL_OES_standard_derivatives\r\n vec2 dVuv \x3d fwidth(vuvScaled);\r\n dVuv \x3d max(vec2(0.00001), dVuv); // workaround against flickering skirts, see #10245\r\n#else\r\n // Something that reasonably works\r\n vec2 dVuv \x3d vec2(0.05);\r\n#endif\r\n\r\n vec2 edgeFactors \x3d smoothstep((wireframe.width - wireframe.falloff) * dVuv,\r\n wireframe.width * dVuv, min(vuvMod, 1.0 - vuvMod));\r\n\r\n float edgeFactor \x3d 1.0 - min(edgeFactors.x, edgeFactors.y);\r\n\r\n#ifdef WIREFRAME\r\n gl_FragColor \x3d vec4(mix(gl_FragColor.rgb, wireframe.color.rgb, edgeFactor * wireframe.color.a),\r\n mix(wireframe.surfaceOpacity, wireframe.wireOpacity, edgeFactor));\r\n#endif\r\n\r\n\r\n#ifdef TILE_BORDERS\r\n dVuv \x3d fwidth(vuv);\r\n edgeFactors \x3d smoothstep((wireframe.width - wireframe.falloff) * dVuv,\r\n wireframe.width * dVuv, min(vuv, 1.0 - vuv));\r\n edgeFactor \x3d 1.0 - min(edgeFactors.x, edgeFactors.y);\r\n\r\n gl_FragColor \x3d mix(gl_FragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);\r\n#endif\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrain"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n $fsTerrainCommon\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrainNormal"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform vec3 origin;\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform mat4 viewNormal;\r\n attribute vec3 $position;\r\n varying vec3 vnormal;\r\n\r\n void main(void) {\r\n#ifdef SPHERICAL\r\n vec4 normal \x3d vec4(normalize($position + origin), 1.0);\r\n#else\r\n vec4 normal \x3d vec4(0.0, 1.0, 0.0, 1.0);\r\n#endif\r\n\r\n gl_Position \x3d proj * view * vec4($position, 1.0);\r\n vnormal \x3d normalize((viewNormal * normal).xyz);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrainDepthOnly"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n\r\n attribute vec3 $position;\r\n\r\n void main() {\r\n gl_Position \x3d proj * view * vec4($position, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainDepthOnly"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n void main() {\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"vsTerrainHighlight"\x3e\x3c![CDATA[\r\n $vsprecisionf\r\n\r\n uniform mat4 proj;\r\n uniform mat4 view;\r\n uniform vec2 overlayTexScale;\r\n uniform vec2 overlayTexOffset;\r\n\r\n attribute vec3 $position;\r\n attribute vec2 $uv0;\r\n\r\n varying vec2 vtcOverlay;\r\n\r\n void main() {\r\n vtcOverlay \x3d $uv0*overlayTexScale + overlayTexOffset;\r\n\r\n gl_Position \x3d proj * view * vec4($position, 1.0);\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3csnippet name\x3d"fsTerrainHighlight"\x3e\x3c![CDATA[\r\n $fsprecisionf\r\n\r\n uniform sampler2D overlayTex;\r\n\r\n uniform sampler2D depthTex;\r\n uniform vec4 highlightViewportPixelSz;\r\n\r\n varying vec2 vtcOverlay;\r\n\r\n void main() {\r\n vec4 texCol \x3d vec4(0,0,0,0);\r\n if ((vtcOverlay.x \x3e 0.0) \x26\x26 (vtcOverlay.y \x3e 0.0) \x26\x26 (vtcOverlay.x \x3c 1.0) \x26\x26 (vtcOverlay.y \x3c 1.0)) {\r\n texCol \x3d texture2D(overlayTex, vtcOverlay);\r\n }\r\n\r\n if (texCol.a \x3d\x3d 0.0) {\r\n // Here we have to write black, instead of discarding the fragment in order to overwrite\r\n // the highlights which might have been written by skirts of other tiles.\r\n // As a consequence skirts are not visible, but terrain overwrites draped highlights.\r\n gl_FragColor \x3d vec4(0,0,0,0);\r\n return;\r\n }\r\n\r\n $highlightWrite\r\n }\r\n]]\x3e\x3c/snippet\x3e\r\n\r\n\x3c/snippets\x3e\r\n',
- "*now":function(r){r(['dojo/i18n!*preload*esri/views/nls/SceneView*["ar","ca","cs","da","de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])},"*noref":1}});
- define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/dom dojo/when ../Camera ../geometry ../Graphic ../Viewpoint ../core/Error ../core/Handles ../core/Logger ../core/promiseUtils ../core/scheduling ../core/sniff ../core/watchUtils ../core/accessorSupport/decorators ../core/accessorSupport/watch ../geometry/HeightModelInfo ../geometry/support/scaleUtils ../geometry/support/webMercatorUtils ./BreakpointsOwner ./DOMContainer ./View ./ViewAnimation ./3d/constraints/Constraints ./3d/environment/SceneViewEnvironment ./3d/environment/SceneViewEnvironmentManager ./3d/input/SceneInputManager ./3d/layers/GraphicsView3D ./3d/layers/graphics/Deconflictor ./3d/lib/glMatrix ./3d/state/ViewState ./3d/state/ViewStateManager ./3d/support/CombinedElevationProvider ./3d/support/debugFlags ./3d/support/DisplayQualityProfile ./3d/support/HighlightOptions ./3d/support/MapCoordsHelper ./3d/support/projectionUtils ./3d/support/QualitySettings ./3d/support/RenderCoordsHelper ./3d/support/ResourceController ./3d/support/SharedSymbolResources ./3d/support/pointsOfInterest/PointsOfInterest ./3d/terrain/TerrainSurface ./3d/terrain/terrainUtils ./3d/webgl-engine/Stage ./3d/webgl-engine/lib/Selector ./support/screenshotUtils ./support/WebGLRequirements ./ui/3d/DefaultUI3D ../webscene/Environment".split(" "),function(r,
- h,f,a,e,c,g,d,b,k,l,p,n,t,u,q,v,x,m,B,z,C,A,D,E,F,I,P,G,M,H,J,O,N,S,R,Y,X,Q,K,L,V,U,ca,ga,da,ka,Z,ea,ja,aa,fa,qa,T){var ha=n.getLogger("esri.views.SceneView");r=function(h){function n(a){a=h.call(this)||this;a._layerViewsUpdatingHandles={};a._clippingArea=null;a._internallyReady=!1;a._userClippingArea=null;a._initialDefaultSpatialReference=null;a._defaults={};a._externallySet={environment:!1};a._stageHandles=new p;a._graphicsView=null;a._surfaceReadyWatchHandle=null;a._updateUpdatingMonitorsHandle=
- null;a._mapLayersChangeHandle=null;a._updateDrawingOrderHandle=null;a._stageFrameTask=null;a.onViewExtentUpdateHandle=null;a.resourceController=new ca(a);a.deconflictor=new J(a);a.renderSpatialReference=null;a.sharedSymbolResources=null;a.basemapTerrain=null;a.elevationProvider=null;a.camera=null;a.canvas=null;a.center=null;a.constraints=new I.default;a.extent=null;a.fullOpacity=1;a.map=null;a.screenSizePerspectiveEnabled=!0;a.state=null;a.scale=null;a.isHeightModelInfoRequired=!0;a.type="3d";a.ui=
- new qa;a.updating=!1;a.updatingPercentage=0;a.viewpoint=null;a.zoom=null;a.highlightOptions=new Q;v.when(a,"ready",a._viewReadyHandler.bind(a));a._evaluateUpdating=a._evaluateUpdating.bind(a);a.watch("map",function(a){a&&a.load&&a.load()});a.inputManager=new M({view:a});a.stateManager=new S.ViewStateManager({view:a});return a}f(n,h);n.prototype.getDefaults=function(a){var b=this.inherited(arguments);b.environment||a.environment||(this._defaults.environment=new P.default,b.environment=this._defaults.environment);
- return b};n.prototype.initialize=function(){var a=this;this.environmentManager=new G.default({view:this});this._updateUpdatingMonitorsHandle=this.allLayerViews.on("change",this._updateUpdatingMonitors.bind(this));this._updateUpdatingMonitors({added:this.allLayerViews.toArray(),removed:[]});v.whenNot(this,"ready",this._viewUnreadyHandler.bind(this));this.resourceController.getMemoryEvents().on("updating-changed",function(){return a._evaluateUpdating()});v.init(this.qualitySettings,"gpuMemoryLimit",
- function(b){a.resourceController&&a.resourceController.setMaxGpuMemory(b)});v.init(Y,"SCENEVIEW_LOCKING_LOG",function(b){a.defaultsFromMap.logDebugInformation=b})};n.prototype.destroy=function(){this.activeTool=null;m.dispatchTarget(this);this.environmentManager.destroy();this._disposeGraphicsView();this._updateUpdatingMonitorsHandle.remove();this._updateUpdatingMonitorsHandle=null;this._stageHandles.remove();this.inputManager&&(this.inputManager.destroy(),this._set("inputManager",null))};Object.defineProperty(n.prototype,
- "activeTool",{set:function(a){if(a&&!this.ready)ha.error("#activeTool\x3d","cannot set active tool while view is not ready");else{var b=this._get("activeTool");a!==b&&(b&&b.deactivate(),this._set("activeTool",a),a&&a.activate())}},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"clippingArea",{get:function(){if("global"===this.viewingMode)return null;if(this._userClippingArea)return this._userClippingArea;var a=this.get("map.clippingEnabled"),b=this.get("map.clippingArea");if(!a||
- !b)return this._clippingArea=null;if(!(b instanceof d.Extent))return ha.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea;if(C.canProject(b.spatialReference,this.spatialReference))b=C.project(b,this.spatialReference);else return ha.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea;return this._clippingArea&&b&&this._clippingArea.equals(b)?this._clippingArea:this._clippingArea=b},set:function(a){this.ready&&
- "global"===this.viewingMode&&a?ha.error("#clippingArea\x3d","Clipping area is only supported in local viewingMode"):(this._userClippingArea=a,this.notifyChange("clippingArea"))},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"dataExtent",{get:function(){var a=[],b=this.spatialReference||d.SpatialReference.WGS84,c=this.clippingArea;c&&(c=C.project(c,b));var e=function(d){d&&(d=C.project(d,b))&&(c&&(d=d.intersection(c)),d&&a.push(d))},f=this._get("basemapTerrain");f&&f.spatialReference&&
- e(new d.Extent({xmin:f.extent[0],ymin:f.extent[1],zmin:0,xmax:f.extent[2],ymax:f.extent[3],zmax:0,spatialReference:f.spatialReference}));this.map&&this.map.allLayers.forEach(function(a){e(a.fullExtent)});return 0<a.length?(f=a.reduce(function(a,b){return a.union(b)}),f.hasZ?(f.zmin=Math.min(0,f.zmin),f.zmax=Math.max(0,f.zmax)):(f.zmin=0,f.zmax=0),f):new d.Extent({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:b})},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"environment",
- {set:function(a){a!==this._defaults.environment&&(this._externallySet.environment=!0);a?a instanceof P.default?this._set("environment",a):a instanceof T?this.environment.lighting=a.lighting:a.declaredClass?this._set("environment",a):this._set("environment",new P.default(a)):this._set("environment",new P.default)},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"groundExtent",{get:function(){var a=this._get("basemapTerrain");if(a&&a.spatialReference){var b=a.extent;return new d.Extent({xmin:b[0],
- ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:a.spatialReference})}return new d.Extent({spatialReference:this.spatialReference||d.SpatialReference.WGS84})},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"initialExtentRequired",{get:function(){return!this.stateManager.hasInitialView},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"interacting",{get:function(){return!!this.state&&this.state.interacting},enumerable:!0,configurable:!0});n.prototype._mapSetter=function(a){a!==
- this._get("map")&&(this._mapLayersChangeHandle&&(this._mapLayersChangeHandle.remove(),this._mapLayersChangeHandle=null),a&&(this._mapLayersChangeHandle=a.allLayers.on("change",this.notifyChange.bind(this,"dataExtent"))),this.inherited(arguments))};Object.defineProperty(n.prototype,"qualityProfile",{get:function(){return this._get("qualityProfile")||X.getDefaultProfile()},set:function(a){X.isValidProfile(a)&&(X.apply(a,this.qualitySettings),this._set("qualityProfile",a))},enumerable:!0,configurable:!0});
- Object.defineProperty(n.prototype,"resolution",{get:function(){return null!=this.spatialReference?z.getResolutionForScale(this.scale,this.spatialReference):0},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"heightModelInfo",{get:function(){var a=this.getDefaultHeightModelInfo();return null!=a?B.deriveUnitFromSR(a,this.spatialReference):null},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"viewingMode",{get:function(){var a=this.get("map.initialViewProperties.viewingMode"),
- b=this.spatialReference;a||(a=!b||b.isWebMercator||b.isWGS84?"global":"local");return a},set:function(a){this._internallyReady?ha.error("#viewingMode","viewingMode cannot be set once view is ready"):0<=["local","global"].indexOf(a)?this._override("viewingMode",a):void 0===a&&this._clearOverride("viewingMode")},enumerable:!0,configurable:!0});n.prototype.on=function(a,b,c){var d=this.inputManager.viewEvents.register(a,b,c);return d?d:this.inherited(arguments)};n.prototype.hasEventListener=function(a){return this.inherited(arguments)||
- this.inputManager&&this.inputManager.viewEvents.hasHandler(a)};n.prototype.toMap=function(a,b,c){if(!this.ready)return ha.error("#toMap()","Scene view cannot be used before it is ready"),null;var d;"number"===typeof a?(d=a,a=b):(d=a.x,a=a.y,c=b);b=this._stage.pick([d,this.height-a]).getMinResult();return this._computeMapPointFromIntersectionResult(b,c)};n.prototype.toScreen=function(a,b,c,d){if(!this.ready)return ha.error("#toScreen()","Scene view cannot be used before it is ready"),null;"number"===
- typeof a?("object"===typeof c&&(d=c),L.vectorToVector([a,b,"number"===typeof c?c:0],this.spatialReference,ia,this.renderSpatialReference)):(L.pointToVector(a,ia,this.renderSpatialReference),d=b);return this.engineToScreen(ia,d)};n.prototype.pixelSizeAt=function(a,b){if(!this.ready)return ha.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if("number"===typeof a){if(a=this._stage.pick([a,this.height-b]).getMinResult(),!a.getIntersectionPoint(ia))return 0}else if(a instanceof
- d.Point)L.pointToVector(a,ia,this.renderSpatialReference);else if(a=this._stage.pick([a.x,this.height-a.y]).getMinResult(),!a.getIntersectionPoint(ia))return 0;return this.state.camera.computePixelSizeAt(ia)};n.prototype.hitTest=function(a,b){if(!this.ready)return ha.error("#hitTest()","Scene view cannot be used before it is ready"),null;var e,f;"number"===typeof a?(e=a,f=b):(e=a.x,f=a.y);var g=this._stage.pick([e,this.height-f],null,!0);a=g.getMinResult();var h=this._computeMapPointFromIntersectionResult(a),
- k;switch(a.targetType){case "None":k=null;break;case "StageObject":k=this._getGraphicFromStageObject(a.target,a.triangleNr);break;case "StagePoint":k=c(this._getGraphicFromStagePoint(a.target))}return c(k).catch(function(){return null}).then(function(a){var b=[];(a||h)&&b.push({mapPoint:h,graphic:a});a={screenPoint:new d.ScreenPoint({x:e,y:f}),results:b};Y.SCENEVIEW_HITTEST_RETURN_SELECTOR&&(a.selector=g);return a})};n.prototype.goTo=function(a,b){return this.stateManager.goTo(a,b)};n.prototype.takeScreenshot=
- function(a){var b=this;if(this.ready)return a=aa.adjustScreenshotSettings(a,this),t.create(function(c){b._stage.requestScreenCapture(a,function(a){u.schedule(function(){c(a)})})});ha.error("#takeScreenshot()","Scene view cannot be used before it is ready")};n.prototype.destroyLayerViews=function(){for(var a in this._layerViewsUpdatingHandles)this._layerViewsUpdatingHandles[a].remove();this._layerViewsUpdatingHandles={};this.stateManager.deinit();this._disposeSurface();this.inherited(arguments);this._stage&&
- (this._stage.dispose(),this._stage=null,this._stageHandles.remove());this._set("canvas",null);this.deconflictor.destroy();this.deconflictor=null;this.resourceController.destroy();this.resourceController=null};n.prototype.getDefaultSpatialReference=function(){return this.get("map.initialViewProperties.spatialReference")||this.get("defaultsFromMap.spatialReference")||this.get("defaultsFromMap.isSpatialReferenceDone")&&this._initialDefaultSpatialReference||null};n.prototype.validate=function(){var a=
- fa.check();q("safari")&&9>q("safari")&&(a=new l("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari \x3c 9)",{type:"safari",requiredVersion:9,detectedVersion:q("safari")}));return a?(ha.warn("#validate()",a.message),t.reject(a)):t.resolve()};n.prototype.isSpatialReferenceSupported=function(a,b,c){var d=a.isGeographic,e=a.isWebMercator,f=a.isWGS84,g="local"===this.viewingMode,h=!(!this._isOverridden("viewingMode")&&!this.get("map.initialViewProperties.viewingMode"));
- if(h){if(g&&d)return c&&c("Layer "+b.id+" is ignored because it is GCS and viewing mode is local"),!1;if(!g&&!e&&!f)return c&&c("Layer "+b.id+" is ignored because its spatial reference is not supported in global viewing mode"),!1}else if(d&&!f)return c&&c("Layer "+b.id+" is ignored because its spatial reference is geographic but not WGS84"),!1;if(b)if(Z.isTiledLayer(b)){if(d=void 0,h?h=Z.getTiledLayerInfo(b,a,this.viewingMode):(h=Z.getTiledLayerInfo(b,a,"global"),null==h.tileInfo&&(h=Z.getTiledLayerInfo(b,
- a,"local"))),d=null!=h.tileInfo,!d)return c&&c("Layer "+b.id+" is ignored because it is tiled but\n its tiling scheme is not supported or compatible with the viewing mode"),!1}else if((f||e)&&!g)return null==this._initialDefaultSpatialReference&&(this._initialDefaultSpatialReference=a),h||this._internallyReady||(this.viewingMode="global",c&&c("Viewing mode locked to global due to reprojectable layer "+b.id)),c&&c("Layer "+b.id+" is ignored because it supports server-side reprojection"),
- !1;return!0};n.prototype.engineToScreen=function(a,b){var c=O.vec3d.create();this.state.camera.projectPoint(a,c);a=c[0];var e=this.height-c[1],c=c[2];return b?(b.x=a,b.y=e,b.z=c,b):new d.ScreenPoint({x:a,y:e,z:c})};n.prototype.flushDisplayModifications=function(){this._stage.processDirty()};n.prototype.getDrawingOrder=function(a){return this.allLayerViews.findIndex(function(b){return b.layer&&b.layer.uid===a})};n.prototype.getViewForGraphic=function(a){return a.layer?this.allLayerViews.find(function(b){return b.layer===
- a.layer}):this._graphicsView};n.prototype.whenViewForGraphic=function(a){return a.layer?this.whenLayerView(a.layer):t.resolve(this._graphicsView)};n.prototype._computeMapPointFromIntersectionResult=function(a,b){if(a.getIntersectionPoint(ia)){b=this._computeMapPointFromVec3d(ia,b);var c=this._get("basemapTerrain");"terrain"===a.intersector&&c&&(a=c.getElevation(b),null!==a&&(b.z=a));return b}return null};n.prototype._computeMapPointFromVec3d=function(a,b){var c=this.spatialReference||d.SpatialReference.WGS84;
- L.vectorToVector(a,this.renderSpatialReference,a,c)||(c=d.SpatialReference.WGS84,L.vectorToVector(a,this.renderSpatialReference,a,c));b?(b.x=a[0],b.y=a[1],b.z=a[2],b.spatialReference=c):b=new d.Point(a,c);return b};n.prototype._getGraphicFromStageObject=function(a,b){var c=a.getMetadata();if(null!=c&&null!=c.layerUid){if(c.layerUid===this._graphicsView.mockLayerId)return this._graphicsView.getGraphicsFromStageObject(a,b);if(c=this.map.findLayerByUid(c.layerUid))return this.whenLayerView(c).then(function(c){if(c&&
- null!=c.getGraphicsFromStageObject&&!c.suspended)return c.getGraphicsFromStageObject(a,b)})}return null};n.prototype._getGraphicFromStagePoint=function(a){var c=this._computeMapPointFromVec3d(a.point),c=new b(c);a=a.metadata.layerUid;null!=a&&c.set("layer",this.map.findLayerByUid(a));return c};n.prototype._viewingModeToManifold=function(a){switch(a){case "global":return"spherical";case "local":return"planar"}};n.prototype._initBasemapTerrain=function(a){this._disposeBasemapTerrain();this._set("basemapTerrain",
- new ka(this,this._viewingModeToManifold(a)));this._set("elevationProvider",new R({view:this}));this.elevationProvider.register("ground",this.basemapTerrain)};n.prototype._initGlobe=function(a){this._initCoordinateSystem();this._initState();this._stage.setViewParams({backgroundColor:[0,0,0,0],maxFarNearRatio:0,frustumCullingEnabled:!1});this._initBasemapTerrain(a);this._set("pointsOfInterest",new da.default({view:this}));this._initStateManager()};n.prototype._initCoordinateSystem=function(){if(this.spatialReference){var a=
- this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(a)||this._set("mapCoordsHelper",new K.default(this.map,a));var b="global"===this.viewingMode,a=b?L.SphericalECEFSpatialReference:a;a!==this.renderSpatialReference&&(this.renderSpatialReference=a,this._set("renderCoordsHelper",U.createRenderCoordsHelper(b?"global":"local",a)),this._stage&&this._stage.setIntersectTolerance(ja.DEFAULT_TOLERANCE/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",
- null),this._set("renderCoordsHelper",null),this.renderSpatialReference=null};n.prototype._evaluateUpdating=function(){var a=0,b=0,c=!1;this.allLayerViews.forEach(function(d){d.updating&&(c=!0,d=d.updatingPercentage,null!=d&&(++b,a+=d))});if(this._graphicsView&&this._graphicsView.updating||this.resourceController&&this.resourceController.isUpdating())c=!0;c!==this.updating&&this._set("updating",c);a=0!==b?a/b:c?100:0;this.updatingPercentage!==a&&this._set("updatingPercentage",a)};n.prototype._updateUpdatingMonitors=
- function(a){for(var b=0;b<a.removed.length;b++){var c=a.removed[b],d=this._layerViewsUpdatingHandles[c.uid];d&&(delete this._layerViewsUpdatingHandles[c.uid],c.destroyed||d.remove())}for(b=0;b<a.added.length;b++)c=a.added[b],c.destroyed||(d=c.watch(["updating","updatingPercentage"],this._evaluateUpdating),this._layerViewsUpdatingHandles[c.uid]=d);this._evaluateUpdating()};n.prototype._pickRay=function(a,b,c,d,e,f,g){return this._stage?this._stage.pickRay(a,b,c,d,e,f,g):null};n.prototype._pickRayWithBeginPoint=
- function(a,b,c,d,e){this._stage&&this._stage.pickRayWithBeginPoint(a,b,c,d,e)};n.prototype._disposeSurface=function(){var a=function(a){a&&a.remove();return null};this._stageFrameTask=a(this._stageFrameTask);this._updateDrawingOrderHandle=a(this._updateDrawingOrderHandle);this.onViewExtentUpdateHandle=a(this.onViewExtentUpdateHandle);this._mapLayersChangeHandle=a(this._mapLayersChangeHandle);this.pointsOfInterest&&(this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null));this._disposeBasemapTerrain();
- this.environmentManager&&this.environmentManager.disposeRendering()};n.prototype._disposeBasemapTerrain=function(){var a=this._get("basemapTerrain");a&&(a.destroy(),this._set("basemapTerrain",null))};n.prototype._initStage=function(){var a=this,b={};b.renderContext=this.renderContext;b.deactivatedWebGLExtensions=this.deactivatedWebGLExtensions;b.viewingMode=this.viewingMode;this.renderCanvas&&(b.canvas=this.renderCanvas);this._stage=new ea(this.viewingMode,e.byId(this.surface),b);this._stageHandles.add(v.init(this.qualitySettings,
- "antialiasingEnabled",function(){a._stage.setRenderParams({antialiasingEnabled:a.qualitySettings.antialiasingEnabled})}));b=function(){a._stage.setRenderParams({defaultHighlightOptions:Q.toEngineOptions(a.highlightOptions)})};this._stageHandles.add(this.watch(["highlightOptions","highlightOptions.color","highlightOptions.haloOpacity","highlightOptions.fillOpacity"],b));b();this.renderCoordsHelper&&this._stage.setIntersectTolerance(ja.DEFAULT_TOLERANCE/this.renderCoordsHelper.unitInMeters);this._set("canvas",
- this._stage.getCanvas());this._stageFrameTask=u.addFrameTask(this._stage.getFrameTask())};n.prototype._initSurface=function(){this._initStage();this._initGlobe(this.viewingMode);this.sharedSymbolResources=new ga.default({stage:this._stage,viewingMode:this.viewingMode,resourceController:this.resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})};n.prototype._initGraphicsView=function(){var a=this;this._surfaceReadyWatchHandle=v.whenTrueOnce(this,"basemapTerrain.ready",function(){a._graphicsView=
- new H({view:a,graphics:a.graphics});a._surfaceReadyWatchHandle=null;a._layerViewsUpdatingHandles[a._graphicsView.mockLayerId]=v.init(a._graphicsView,"updating",a._evaluateUpdating)})};n.prototype._disposeGraphicsView=function(){this._surfaceReadyWatchHandle&&(this._surfaceReadyWatchHandle.remove(),this._surfaceReadyWatchHandle=null);if(this._graphicsView){var a=this._graphicsView.mockLayerId;this._layerViewsUpdatingHandles[a].remove();delete this._layerViewsUpdatingHandles[a];this._graphicsView.destroy();
- this._graphicsView=null}};n.prototype._initState=function(){this._set("state",new N.default({viewingMode:this.viewingMode,spatialReference:this.spatialReference}))};n.prototype._initStateManager=function(){this.stateManager.init()};n.prototype._viewReadyHandler=function(a,b){b||("global"===this.viewingMode&&(this._clippingArea=null),this._internallyReady=!0,this._initSurface(),this._initGraphicsView(),!this._externallySet.environment&&(a=this.get("map.initialViewProperties.environment"))&&(this.environment=
- a),this._updateDrawingOrderHandle=this.allLayerViews.on("change",this._updateDrawingOrder.bind(this)),this._updateDrawingOrder(),this.environmentManager.updateReadyChange(!0))};n.prototype._viewUnreadyHandler=function(a,b){b&&(this.activeTool&&(this.activeTool.deactivate(),this._set("activeTool",null)),this._initialDefaultSpatialReference=null,this.environmentManager.updateReadyChange(!1),this._disposeGraphicsView(),this._internallyReady=!1,this.stateManager.deinit(),this._disposeSurface(),this.state.destroy(),
- this._set("state",null),this.sharedSymbolResources&&(this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null),this._stage&&(this._stage.dispose(),this._stage=null,this._stageHandles.remove()),this._set("canvas",null))};n.prototype._updateDrawingOrder=function(){var a=this.allLayerViews.length-1;this.allLayerViews.forEach(function(b,c){null!=b.drawingOrder&&(b.drawingOrder=a-c)})};a([x.property({value:null})],n.prototype,"activeTool",null);a([x.property({type:F,readOnly:!0,aliasOf:"state.animation"})],
- n.prototype,"animation",void 0);a([x.property({readOnly:!0})],n.prototype,"basemapTerrain",void 0);a([x.property({readOnly:!0})],n.prototype,"elevationProvider",void 0);a([x.property({type:g,aliasOf:"stateManager.camera"})],n.prototype,"camera",void 0);a([x.property({readOnly:!0})],n.prototype,"canvas",void 0);a([x.property({type:d.Point,aliasOf:"stateManager.center"})],n.prototype,"center",void 0);a([x.property({type:d.Extent,dependsOn:["map.clippingArea","map.clippingEnabled","viewingMode"]})],
- n.prototype,"clippingArea",null);a([x.property({type:I.default})],n.prototype,"constraints",void 0);a([x.property({type:d.Extent,dependsOn:["basemapTerrain.extent","clippingArea","map"],readOnly:!0})],n.prototype,"dataExtent",null);a([x.property({value:null})],n.prototype,"environment",null);a([x.property()],n.prototype,"environmentManager",void 0);a([x.property({type:d.Extent,aliasOf:"stateManager.extent"})],n.prototype,"extent",void 0);a([x.property({type:d.ScreenPoint,readOnly:!0,aliasOf:"stateManager.screenCenter"})],
- n.prototype,"screenCenter",void 0);a([x.property({aliasOf:"stateManager.frustum"})],n.prototype,"frustum",void 0);a([x.property({type:Number,readOnly:!0})],n.prototype,"fullOpacity",void 0);a([x.property({type:d.Extent,dependsOn:["basemapTerrain.extent"],readOnly:!0})],n.prototype,"groundExtent",null);a([x.property({type:Boolean,dependsOn:["stateManager.hasInitialView"]})],n.prototype,"initialExtentRequired",null);a([x.property({type:Boolean,dependsOn:["state.interacting"],readOnly:!0})],n.prototype,
- "interacting",null);a([x.property()],n.prototype,"map",void 0);a([x.property({readOnly:!0})],n.prototype,"mapCoordsHelper",void 0);a([x.property({aliasOf:"stateManager.padding"})],n.prototype,"padding",void 0);a([x.property({type:da.default,readOnly:!0})],n.prototype,"pointsOfInterest",void 0);a([x.property({type:Boolean})],n.prototype,"screenSizePerspectiveEnabled",void 0);a([x.property({constructOnly:!0})],n.prototype,"deactivatedWebGLExtensions",void 0);a([x.property({constructOnly:!0})],n.prototype,
- "renderCanvas",void 0);a([x.property({readOnly:!0})],n.prototype,"state",void 0);a([x.property({readOnly:!0})],n.prototype,"inputManager",void 0);a([x.property({readOnly:!0})],n.prototype,"stateManager",void 0);a([x.property()],n.prototype,"qualityProfile",null);a([x.property({type:V,get:function(){var a=this._get("qualitySettings");a||(a=new V,X.apply(this.qualityProfile,a));return a}})],n.prototype,"qualitySettings",void 0);a([x.property({dependsOn:["viewingMode"]})],n.prototype,"ready",void 0);
- a([x.property({readOnly:!0})],n.prototype,"renderCoordsHelper",void 0);a([x.property({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],n.prototype,"resolution",null);a([x.property({type:Number,aliasOf:"stateManager.scale"})],n.prototype,"scale",void 0);a([x.property()],n.prototype,"heightModelInfo",null);a([x.property({dependsOn:["map.initialViewProperties.spatialReference","defaultsFromMap.isSpatialReferenceDone"]})],n.prototype,"spatialReference",void 0);a([x.property({type:Boolean})],
- n.prototype,"isHeightModelInfoRequired",void 0);a([x.property()],n.prototype,"type",void 0);a([x.property({type:qa})],n.prototype,"ui",void 0);a([x.property({type:Boolean,readOnly:!0})],n.prototype,"updating",void 0);a([x.property({type:Number,readOnly:!0})],n.prototype,"updatingPercentage",void 0);a([x.property({type:String,dependsOn:["map.initialViewProperties.viewingMode","spatialReference"]})],n.prototype,"viewingMode",null);a([x.property({type:k,aliasOf:"stateManager.viewpoint"})],n.prototype,
- "viewpoint",void 0);a([x.property({type:Number,aliasOf:"stateManager.zoom"})],n.prototype,"zoom",void 0);a([x.property({type:Q})],n.prototype,"highlightOptions",void 0);return n=a([x.subclass("esri.views.SceneView")],n)}(x.declared(D,E,A));var ia=O.vec3d.create();return r});
|