main_2020_edit.js 2.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653
  1. var dom = {
  2. getOffset: function(e, t, i) {
  3. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  4. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  5. left += "left" == e ? t.offsetLeft : t.offsetTop;
  6. return left
  7. }
  8. };
  9. if (function() {
  10. "use strict";
  11. function o(e, t) {
  12. return typeof e === t
  13. }
  14. function a(e, t) {
  15. return e instanceof t
  16. }
  17. function s(e) {
  18. return e && e.nodeType
  19. }
  20. function l(e) {
  21. return s(e) ? e : a(e, y) ? e[0] : void 0
  22. }
  23. function e(e, i, n) {
  24. return y.each(e, function(e, t) {
  25. n = i.call(t, n, e, t)
  26. }),
  27. n
  28. }
  29. function t(e, t, i) {
  30. var n, r, o;
  31. if (e === t)
  32. return !0;
  33. if (!e || !t || e.constructor !== t.constructor)
  34. return !1;
  35. for (n = 0,
  36. r = i.length; n < r; n += 1) {
  37. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  38. return !1;
  39. if (e[o] !== t[o])
  40. return !1
  41. }
  42. return !0
  43. }
  44. function c(e, t, i, n) {
  45. this.left = w(e),
  46. this.top = w(t),
  47. this.width = w(i),
  48. this.height = w(n),
  49. this.right = this.left + this.width,
  50. this.bottom = this.top + this.height
  51. }
  52. function h(e, t, i, n) {
  53. this.visible = e || 0,
  54. this.viewport = t || 0,
  55. this.possible = i || 0,
  56. this.rects = n && I({}, n) || null
  57. }
  58. function r(e, t) {
  59. this.els = e,
  60. this.viewport = t
  61. }
  62. function n(e, t) {
  63. return e.val - t.val
  64. }
  65. function u(e, t) {
  66. return t.val - e.val
  67. }
  68. function d(e) {
  69. var t = c.ofContent(e, !0)
  70. , i = c.ofViewport(e, !0)
  71. , n = t.width - i.width
  72. , r = t.height - i.height;
  73. this.content = t,
  74. this.viewport = i,
  75. this.width = n <= 0 ? null : i.left / n,
  76. this.height = r <= 0 ? null : i.top / r,
  77. this.left = i.left,
  78. this.top = i.top,
  79. this.right = t.right - i.right,
  80. this.bottom = t.bottom - i.bottom
  81. }
  82. function p(e) {
  83. this.el = e || window
  84. }
  85. function f(e, t) {
  86. this.context = e,
  87. this.viewport = t,
  88. this.init()
  89. }
  90. function g(e, t, i, n) {
  91. this.context = new r(e,t),
  92. this.property = i,
  93. this.descending = n,
  94. this.init()
  95. }
  96. function m(e) {
  97. e && e !== window && e !== document ? (this.context = e,
  98. this.$autoTarget = y(e)) : this.context = window,
  99. this.init()
  100. }
  101. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  102. v = 1,
  103. function(e) {
  104. return e ? (i[e] || (i[e] = v,
  105. v += 1),
  106. i[e]) : 0
  107. }
  108. );
  109. I(c.prototype, {
  110. equals: function(e) {
  111. return t(this, e, ["left", "top", "width", "height"])
  112. },
  113. area: function() {
  114. return this.width * this.height
  115. },
  116. relativeTo: function(e) {
  117. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  118. },
  119. intersection: function(e) {
  120. if (!a(e, c))
  121. return null;
  122. var t = _(this.left, e.left)
  123. , i = b(this.right, e.right)
  124. , n = _(this.top, e.top)
  125. , r = i - t
  126. , o = b(this.bottom, e.bottom) - n;
  127. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  128. },
  129. envelope: function(e) {
  130. if (!a(e, c))
  131. return this;
  132. var t = b(this.left, e.left)
  133. , i = _(this.right, e.right)
  134. , n = b(this.top, e.top);
  135. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  136. }
  137. }),
  138. I(c, {
  139. ofContent: function(e, t) {
  140. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  141. },
  142. ofViewport: function(e, t) {
  143. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  144. },
  145. ofElement: function(e) {
  146. var t = y(e);
  147. if (!t.is(":visible"))
  148. return null;
  149. var i = t.offset();
  150. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  151. }
  152. }),
  153. I(h.prototype, {
  154. equals: function(e) {
  155. return this.fracsEqual(e) && this.rectsEqual(e)
  156. },
  157. fracsEqual: function(e) {
  158. return t(this, e, ["visible", "viewport", "possible"])
  159. },
  160. rectsEqual: function(e) {
  161. return t(this.rects, e.rects, ["document", "element", "viewport"])
  162. }
  163. }),
  164. I(h, {
  165. of: function(e, t) {
  166. var i, n, r;
  167. return e = s(e) && c.ofElement(e) || e,
  168. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  169. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  170. r = b(e.width, t.width) * b(e.height, t.height),
  171. new h(n / e.area(),n / t.area(),n / r,{
  172. document: i,
  173. element: i.relativeTo(e),
  174. viewport: i.relativeTo(t)
  175. })) : new h
  176. }
  177. });
  178. var x = ["width", "height", "left", "right", "top", "bottom"]
  179. , S = ["possible", "visible", "viewport"];
  180. I(r.prototype, {
  181. sorted: function(t, e) {
  182. var i = this.viewport;
  183. return y.map(this.els, function(e) {
  184. return {
  185. el: e,
  186. val: function(e, t, i) {
  187. var n;
  188. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  189. n ? n[i] : 0
  190. }(e, i, t)
  191. }
  192. }).sort(e ? u : n)
  193. },
  194. best: function(e, t) {
  195. return this.els.length ? this.sorted(e, t)[0] : null
  196. }
  197. }),
  198. I(d.prototype, {
  199. equals: function(e) {
  200. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  201. }
  202. }),
  203. I(p.prototype, {
  204. equals: function(e) {
  205. return t(this, e, ["el"])
  206. },
  207. scrollState: function() {
  208. return new d(this.el)
  209. },
  210. scrollTo: function(e, t, i) {
  211. var n = y(this.el === window ? "html,body" : this.el);
  212. e = e || 0,
  213. t = t || 0,
  214. i = isNaN(i) ? 1e3 : i,
  215. n.stop(!0).animate({
  216. scrollLeft: e,
  217. scrollTop: t
  218. }, i)
  219. },
  220. scroll: function(e, t, i) {
  221. var n = this.el === window ? A : y(this.el);
  222. e = e || 0,
  223. t = t || 0,
  224. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  225. },
  226. scrollToRect: function(e, t, i, n) {
  227. t = t || 0,
  228. i = i || 0,
  229. this.scrollTo(e.left - t, e.top - i, n)
  230. },
  231. scrollToElement: function(e, t, i, n) {
  232. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  233. this.scrollToRect(r, t, i, n)
  234. }
  235. });
  236. var M = {
  237. init: function() {
  238. this.callbacks = y.Callbacks("memory unique"),
  239. this.currVal = null,
  240. this.prevVal = null,
  241. this.checkProxy = y.proxy(this.check, this),
  242. this.autoCheck()
  243. },
  244. bind: function(e) {
  245. this.callbacks.add(e)
  246. },
  247. unbind: function(e) {
  248. e ? this.callbacks.remove(e) : this.callbacks.empty()
  249. },
  250. trigger: function() {
  251. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  252. },
  253. check: function(e) {
  254. var t = this.updatedValue(e);
  255. return void 0 !== t && (this.prevVal = this.currVal,
  256. this.currVal = t,
  257. this.trigger(),
  258. !0)
  259. },
  260. $autoTarget: A,
  261. autoEvents: "load resize scroll",
  262. autoCheck: function(e) {
  263. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  264. }
  265. };
  266. I(f.prototype, M, {
  267. updatedValue: function() {
  268. var e = h.of(this.context, this.viewport);
  269. return this.currVal && this.currVal.equals(e) ? void 0 : e
  270. }
  271. }),
  272. I(g.prototype, M, {
  273. updatedValue: function() {
  274. var e = this.context.best(this.property, this.descending);
  275. return e && (e = 0 < e.val ? e.el : null,
  276. this.currVal !== e) ? e : void 0
  277. }
  278. }),
  279. I(m.prototype, M, {
  280. updatedValue: function() {
  281. var e = new d(this.context);
  282. return this.currVal && this.currVal.equals(e) ? void 0 : e
  283. }
  284. });
  285. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  286. function H(e, t, i, n) {
  287. return i = N(i) ? i.apply(e, t) : i,
  288. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  289. }
  290. R = U,
  291. P = {
  292. statics: {
  293. version: "0.15.0",
  294. Rect: c,
  295. Fractions: h,
  296. Group: r,
  297. ScrollState: d,
  298. Viewport: p,
  299. FracsCallbacks: f,
  300. GroupCallbacks: g,
  301. ScrollStateCallbacks: m,
  302. fracs: function(e, t) {
  303. return h.of(e, t)
  304. }
  305. },
  306. methods: {
  307. content: function(e) {
  308. return this.length ? c.ofContent(this[0], e) : null
  309. },
  310. envelope: function() {
  311. return e(this, function(e) {
  312. var t = c.ofElement(this);
  313. return e ? e.envelope(t) : t
  314. })
  315. },
  316. fracs: function(e, i, n) {
  317. o(e, "string") || (n = i,
  318. i = e,
  319. e = null),
  320. E(i) || (n = i,
  321. i = null),
  322. n = l(n);
  323. var r = U + ".fracs." + T(n);
  324. return "unbind" === e ? this.each(function() {
  325. var e = y(this).data(r);
  326. e && e.unbind(i)
  327. }) : "check" === e ? this.each(function() {
  328. var e = y(this).data(r);
  329. e && e.check()
  330. }) : E(i) ? this.each(function() {
  331. var e = y(this)
  332. , t = e.data(r);
  333. t || (t = new f(this,n),
  334. e.data(r, t)),
  335. t.bind(i)
  336. }) : this.length ? h.of(this[0], n) : null
  337. },
  338. intersection: function() {
  339. return e(this, function(e) {
  340. var t = c.ofElement(this);
  341. return e ? e.intersection(t) : t
  342. })
  343. },
  344. max: function(e, t, i) {
  345. return E(t) || (i = t,
  346. t = null),
  347. i = l(i),
  348. t ? (new g(this,i,e,!0).bind(t),
  349. this) : this.pushStack(new r(this,i).best(e, !0).el)
  350. },
  351. min: function(e, t, i) {
  352. return E(t) || (i = t,
  353. t = null),
  354. i = l(i),
  355. t ? (new g(this,i,e).bind(t),
  356. this) : this.pushStack(new r(this,i).best(e).el)
  357. },
  358. rect: function() {
  359. return this.length ? c.ofElement(this[0]) : null
  360. },
  361. scrollState: function(e, i) {
  362. var n = U + ".scrollState";
  363. return o(e, "string") || (i = e,
  364. e = null),
  365. "unbind" === e ? this.each(function() {
  366. var e = y(this).data(n);
  367. e && e.unbind(i)
  368. }) : "check" === e ? this.each(function() {
  369. var e = y(this).data(n);
  370. e && e.check()
  371. }) : E(i) ? this.each(function() {
  372. var e = y(this)
  373. , t = e.data(n);
  374. t || (t = new m(this),
  375. e.data(n, t)),
  376. t.bind(i)
  377. }) : this.length ? new d(this[0]) : null
  378. },
  379. scroll: function(e, t, i) {
  380. return this.each(function() {
  381. new p(this).scroll(e, t, i)
  382. })
  383. },
  384. scrollTo: function(e, t, i, n) {
  385. return y.isNumeric(e) && (n = i,
  386. i = t,
  387. t = e,
  388. e = null),
  389. e = l(e),
  390. this.each(function() {
  391. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  392. })
  393. },
  394. scrollToThis: function(e, t, i, n) {
  395. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  396. this
  397. },
  398. softLink: function(t, i, n, r) {
  399. return r = new p(l(r)),
  400. this.filter("a[href^=#]").each(function() {
  401. var e = y(this);
  402. e.on("click", function() {
  403. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  404. })
  405. })
  406. },
  407. sort: function(e, t, i) {
  408. return o(t, "boolean") || (i = t,
  409. t = null),
  410. i = l(i),
  411. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  412. return e.el
  413. }))
  414. },
  415. viewport: function(e) {
  416. return this.length ? c.ofViewport(this[0], e) : null
  417. }
  418. },
  419. defaultStatic: "fracs",
  420. defaultMethod: "fracs"
  421. },
  422. O = [].slice,
  423. L = jQuery,
  424. D = L.extend,
  425. N = L.isFunction,
  426. F = D({}, P),
  427. B = function() {
  428. return H(this, O.call(arguments), F.defaultStatic, B)
  429. }
  430. ,
  431. V = function(e) {
  432. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  433. }
  434. ,
  435. (k = function(e) {
  436. e && (D(B, e.statics),
  437. D(V, e.methods)),
  438. B.modplug = k
  439. }
  440. ).prev = {
  441. statics: L[R],
  442. methods: L.fn[R]
  443. },
  444. k(P),
  445. L[R] = B,
  446. L.fn[R] = V
  447. }(),
  448. "undefined" == typeof jQuery)
  449. throw new Error("Bootstrap's JavaScript requires jQuery");
  450. !function(m) {
  451. "use strict";
  452. function r(e, t) {
  453. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  454. this.init("tooltip", e, t)
  455. }
  456. r.VERSION = "3.2.0",
  457. r.DEFAULTS = {
  458. animation: !0,
  459. placement: "top",
  460. selector: !1,
  461. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  462. trigger: "hover focus",
  463. title: "",
  464. delay: 0,
  465. html: !1,
  466. container: !1,
  467. viewport: {
  468. selector: "body",
  469. padding: 0
  470. }
  471. },
  472. r.prototype.init = function(e, t, i) {
  473. this.enabled = !0,
  474. this.type = e,
  475. this.$element = m(t),
  476. this.options = this.getOptions(i),
  477. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  478. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  479. var o = n[r];
  480. if ("click" == o)
  481. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  482. else if ("manual" != o) {
  483. var a = "hover" == o ? "mouseenter" : "focusin"
  484. , s = "hover" == o ? "mouseleave" : "focusout";
  485. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  486. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  487. }
  488. }
  489. this.options.selector ? this._options = m.extend({}, this.options, {
  490. trigger: "manual",
  491. selector: ""
  492. }) : this.fixTitle()
  493. }
  494. ,
  495. r.prototype.getDefaults = function() {
  496. return r.DEFAULTS
  497. }
  498. ,
  499. r.prototype.getOptions = function(e) {
  500. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  501. show: e.delay,
  502. hide: e.delay
  503. }),
  504. e
  505. }
  506. ,
  507. r.prototype.getDelegateOptions = function() {
  508. var i = {}
  509. , n = this.getDefaults();
  510. return this._options && m.each(this._options, function(e, t) {
  511. n[e] != t && (i[e] = t)
  512. }),
  513. i
  514. }
  515. ,
  516. r.prototype.enter = function(e) {
  517. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  518. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  519. m(e.currentTarget).data("bs." + this.type, t)),
  520. clearTimeout(t.timeout),
  521. t.hoverState = "in",
  522. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  523. }
  524. ,
  525. r.prototype.leave = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "out",
  531. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  532. "out" == t.hoverState && t.hide()
  533. }, t.options.delay.hide)) : t.hide()
  534. }
  535. ,
  536. r.prototype.show = function() {
  537. var e = m.Event("show.bs." + this.type);
  538. if (this.hasContent() && this.enabled) {
  539. this.$element.trigger(e);
  540. var t = m.contains(document.documentElement, this.$element[0]);
  541. if (e.isDefaultPrevented() || !t)
  542. return;
  543. var i = this
  544. , n = this.tip()
  545. , r = this.getUID(this.type);
  546. this.setContent(),
  547. n.attr("id", r),
  548. this.$element.attr("aria-describedby", r),
  549. this.options.animation && n.addClass("fade");
  550. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  551. , a = /\s?auto?\s?/i
  552. , s = a.test(o);
  553. s && (o = o.replace(a, "") || "top"),
  554. n.detach().css({
  555. top: 0,
  556. left: 0,
  557. display: "block"
  558. }).addClass(o).data("bs." + this.type, this),
  559. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  560. var l = this.getPosition()
  561. , c = n[0].offsetWidth
  562. , h = n[0].offsetHeight;
  563. if (s) {
  564. var u = o
  565. , d = this.$element.parent()
  566. , p = this.getPosition(d);
  567. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  568. n.removeClass(u).addClass(o)
  569. }
  570. var f = this.getCalculatedOffset(o, l, c, h);
  571. this.applyPlacement(f, o);
  572. var g = function() {
  573. i.$element.trigger("shown.bs." + i.type),
  574. i.hoverState = null
  575. };
  576. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  577. }
  578. }
  579. ,
  580. r.prototype.applyPlacement = function(e, t) {
  581. var i = this.tip()
  582. , n = i[0].offsetWidth
  583. , r = i[0].offsetHeight
  584. , o = parseInt(i.css("margin-top"), 10)
  585. , a = parseInt(i.css("margin-left"), 10);
  586. isNaN(o) && (o = 0),
  587. isNaN(a) && (a = 0),
  588. e.top = e.top + o,
  589. e.left = e.left + a,
  590. m.offset.setOffset(i[0], m.extend({
  591. using: function(e) {
  592. i.css({
  593. top: Math.round(e.top),
  594. left: Math.round(e.left)
  595. })
  596. }
  597. }, e), 0),
  598. i.addClass("in");
  599. var s = i[0].offsetWidth
  600. , l = i[0].offsetHeight;
  601. "top" == t && l != r && (e.top = e.top + r - l);
  602. var c = this.getViewportAdjustedDelta(t, e, s, l);
  603. c.left ? e.left += c.left : e.top += c.top;
  604. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  605. , u = c.left ? "left" : "top"
  606. , d = c.left ? "offsetWidth" : "offsetHeight";
  607. i.offset(e),
  608. this.replaceArrow(h, i[0][d], u)
  609. }
  610. ,
  611. r.prototype.replaceArrow = function(e, t, i) {
  612. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  613. }
  614. ,
  615. r.prototype.setContent = function() {
  616. var e = this.tip()
  617. , t = this.getTitle();
  618. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  619. e.removeClass("fade in top bottom left right")
  620. }
  621. ,
  622. r.prototype.hide = function() {
  623. function e() {
  624. "in" != t.hoverState && i.detach(),
  625. t.$element.trigger("hidden.bs." + t.type)
  626. }
  627. var t = this
  628. , i = this.tip()
  629. , n = m.Event("hide.bs." + this.type);
  630. if (this.$element.removeAttr("aria-describedby"),
  631. this.$element.trigger(n),
  632. !n.isDefaultPrevented())
  633. return i.removeClass("in"),
  634. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  635. this.hoverState = null,
  636. this
  637. }
  638. ,
  639. r.prototype.fixTitle = function() {
  640. var e = this.$element;
  641. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  642. }
  643. ,
  644. r.prototype.hasContent = function() {
  645. return this.getTitle()
  646. }
  647. ,
  648. r.prototype.getPosition = function(e) {
  649. var t = (e = e || this.$element)[0]
  650. , i = "BODY" == t.tagName;
  651. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  652. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  653. width: i ? m(window).width() : e.outerWidth(),
  654. height: i ? m(window).height() : e.outerHeight()
  655. }, i ? {
  656. top: 0,
  657. left: 0
  658. } : e.offset())
  659. }
  660. ,
  661. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  662. return "bottom" == e ? {
  663. top: t.top + t.height,
  664. left: t.left + t.width / 2 - i / 2
  665. } : "top" == e ? {
  666. top: t.top - n,
  667. left: t.left + t.width / 2 - i / 2
  668. } : "left" == e ? {
  669. top: t.top + t.height / 2 - n / 2,
  670. left: t.left - i
  671. } : {
  672. top: t.top + t.height / 2 - n / 2,
  673. left: t.left + t.width
  674. }
  675. }
  676. ,
  677. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  678. var r = {
  679. top: 0,
  680. left: 0
  681. };
  682. if (!this.$viewport)
  683. return r;
  684. var o = this.options.viewport && this.options.viewport.padding || 0
  685. , a = this.getPosition(this.$viewport);
  686. if (/right|left/.test(e)) {
  687. var s = t.top - o - a.scroll
  688. , l = t.top + o - a.scroll + n;
  689. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  690. } else {
  691. var c = t.left - o
  692. , h = t.left + o + i;
  693. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  694. }
  695. return r
  696. }
  697. ,
  698. r.prototype.getTitle = function() {
  699. var e = this.$element
  700. , t = this.options;
  701. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  702. }
  703. ,
  704. r.prototype.getUID = function(e) {
  705. for (; e += ~~(1e6 * Math.random()),
  706. document.getElementById(e); )
  707. ;
  708. return e
  709. }
  710. ,
  711. r.prototype.tip = function() {
  712. return this.$tip = this.$tip || m(this.options.template)
  713. }
  714. ,
  715. r.prototype.arrow = function() {
  716. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  717. }
  718. ,
  719. r.prototype.validate = function() {
  720. this.$element[0].parentNode || (this.hide(),
  721. this.$element = null,
  722. this.options = null)
  723. }
  724. ,
  725. r.prototype.enable = function() {
  726. this.enabled = !0
  727. }
  728. ,
  729. r.prototype.disable = function() {
  730. this.enabled = !1
  731. }
  732. ,
  733. r.prototype.toggleEnabled = function() {
  734. this.enabled = !this.enabled
  735. }
  736. ,
  737. r.prototype.toggle = function(e) {
  738. var t = this;
  739. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  740. m(e.currentTarget).data("bs." + this.type, t))),
  741. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  742. }
  743. ,
  744. r.prototype.destroy = function() {
  745. clearTimeout(this.timeout),
  746. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  747. }
  748. ;
  749. var e = m.fn.tooltip;
  750. m.fn.tooltip = function(n) {
  751. return this.each(function() {
  752. var e = m(this)
  753. , t = e.data("bs.tooltip")
  754. , i = "object" == typeof n && n;
  755. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  756. "string" == typeof n && t[n]())
  757. })
  758. }
  759. ,
  760. m.fn.tooltip.Constructor = r,
  761. m.fn.tooltip.noConflict = function() {
  762. return m.fn.tooltip = e,
  763. this
  764. }
  765. }(jQuery),
  766. function(e, t, i) {
  767. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  768. }(0, this, function() {
  769. "use strict";
  770. function Keen() {
  771. return _init.apply(this, arguments)
  772. }
  773. function _init(e) {
  774. if (_isUndefined(e))
  775. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  776. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  777. throw new Error("Please provide a projectId");
  778. this.configure(e)
  779. }
  780. function _extend(e) {
  781. for (var t = 1; t < arguments.length; t++)
  782. for (var i in arguments[t])
  783. e[i] = arguments[t][i];
  784. return e
  785. }
  786. function _isUndefined(e) {
  787. return void 0 === e
  788. }
  789. function _type(e) {
  790. var t = e && e.constructor ? e.constructor.toString() : void 0;
  791. return t ? t.match(/function (.*)\(/)[1] : "Null"
  792. }
  793. function _each(e, t, i) {
  794. var n;
  795. if (!e)
  796. return 0;
  797. if (i = i || e,
  798. "array" === _type(e)) {
  799. for (n = 0; n < e.length; n++)
  800. if (!1 === t.call(i, e[n], n, e))
  801. return 0
  802. } else
  803. for (n in e)
  804. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  805. return 0;
  806. return 1
  807. }
  808. function _parse_params(e) {
  809. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  810. return decodeURIComponent(e.replace(n, " "))
  811. }, a = e.split("?")[1]; t = r.exec(a); )
  812. i[o(t[1])] = o(t[2]);
  813. return i
  814. }
  815. function _set_protocol(e) {
  816. switch (e) {
  817. case "http":
  818. return "http";
  819. case "auto":
  820. return location.protocol.replace(/:/g, "");
  821. case "https":
  822. case void 0:
  823. default:
  824. return "https"
  825. }
  826. }
  827. function _set_request_type(e) {
  828. var t = e || "jsonp"
  829. , i = !1;
  830. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  831. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  832. }
  833. function _build_url(e) {
  834. return this.client.endpoint + "/projects/" + this.client.projectId + e
  835. }
  836. function _uploadEvent(e, t, i, n, r) {
  837. var o = _build_url.apply(this, ["/events/" + e])
  838. , a = {};
  839. for (var s in i = !1 !== i,
  840. this.client.globalProperties && (a = this.client.globalProperties(e)),
  841. t)
  842. t.hasOwnProperty(s) && (a[s] = t[s]);
  843. switch (this.client.requestType) {
  844. case "xhr":
  845. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  846. break;
  847. case "jsonp":
  848. var l = JSON.stringify(a)
  849. , c = Keen.Base64.encode(l);
  850. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  851. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  852. break;
  853. case "beacon":
  854. l = JSON.stringify(a),
  855. c = Keen.Base64.encode(l);
  856. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  857. o += "&c=clv1",
  858. _request.beacon.apply(this, [o, null, n, r])
  859. }
  860. }
  861. Keen.prototype.configure = function(e) {
  862. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  863. e.protocol = _set_protocol(e.protocol),
  864. e.requestType = _set_request_type(e.requestType),
  865. this.client = {
  866. projectId: e.projectId,
  867. writeKey: e.writeKey,
  868. readKey: e.readKey,
  869. globalProperties: null,
  870. endpoint: e.protocol + "://" + e.host,
  871. requestType: e.requestType
  872. },
  873. Keen.trigger("client", this, e),
  874. this.trigger("ready"),
  875. this
  876. }
  877. ;
  878. var _request = {
  879. xhr: function(e, t, i, n, r, o, a, s) {
  880. if (!r)
  881. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  882. var l = new XMLHttpRequest;
  883. if (l.onreadystatechange = function() {
  884. if (4 == l.readyState)
  885. if (200 <= l.status && l.status < 300) {
  886. var e;
  887. try {
  888. e = JSON.parse(l.responseText)
  889. } catch (e) {
  890. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  891. s && s(l, e)
  892. }
  893. a && e && a(e)
  894. } else
  895. Keen.log("HTTP request failed."),
  896. s && s(l, null)
  897. }
  898. ,
  899. l.open(e, t, o),
  900. r && l.setRequestHeader("Authorization", r),
  901. n && l.setRequestHeader("Content-Type", "application/json"),
  902. i)
  903. for (var c in i)
  904. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  905. var h = n ? JSON.stringify(n) : null;
  906. l.send(h)
  907. },
  908. jsonp: function(e, t, i, n) {
  909. if (!t)
  910. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  911. if (t && e.indexOf("api_key") < 0) {
  912. var r = 0 < e.indexOf("?") ? "&" : "?";
  913. e = e + r + "api_key=" + t
  914. }
  915. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  916. o += "a";
  917. var a = !1;
  918. window[o] = function(e) {
  919. a = !0,
  920. i && e && i(e),
  921. window[o] = void 0
  922. }
  923. ,
  924. e = e + "&jsonp=" + o;
  925. var s = document.createElement("script");
  926. s.id = "keen-jsonp",
  927. s.src = e,
  928. document.getElementsByTagName("head")[0].appendChild(s),
  929. s.onreadystatechange = function() {
  930. !1 === a && "loaded" === this.readyState && (a = !0,
  931. n && n())
  932. }
  933. ,
  934. s.onerror = function() {
  935. !1 === a && (a = !0,
  936. n && n())
  937. }
  938. },
  939. beacon: function(e, t, i, n) {
  940. if (t && e.indexOf("api_key") < 0) {
  941. var r = 0 < e.indexOf("?") ? "&" : "?";
  942. e = e + r + "api_key=" + t
  943. }
  944. var o = document.createElement("img");
  945. o.onload = function() {
  946. if (!0,
  947. "naturalHeight"in this) {
  948. if (this.naturalHeight + this.naturalWidth === 0)
  949. return void this.onerror()
  950. } else if (this.width + this.height === 0)
  951. return void this.onerror();
  952. i && i({
  953. created: !0
  954. })
  955. }
  956. ,
  957. o.onerror = function() {
  958. !0,
  959. n && n()
  960. }
  961. ,
  962. o.src = e
  963. }
  964. }
  965. , Events = Keen.Events = {
  966. on: function(e, t) {
  967. return this.listeners || (this.listeners = {}),
  968. (this.listeners[e] || (this.listeners[e] = [])).push({
  969. callback: t
  970. }),
  971. this
  972. },
  973. off: function(e, t) {
  974. if (!e && !t)
  975. return this.listeners = void 0,
  976. delete this.listeners,
  977. this;
  978. for (var i = this.listeners[e] || [], n = i.length; n--; )
  979. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  980. t && 0 != i.length || (this.listeners[e] = void 0,
  981. delete this.listeners[e]);
  982. return this
  983. },
  984. trigger: function(e) {
  985. if (!this.listeners)
  986. return this;
  987. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  988. i[n].callback.apply(this, t);
  989. return this
  990. }
  991. };
  992. _extend(Keen.prototype, Events),
  993. _extend(Keen, Events),
  994. Keen.loaded = !0,
  995. Keen.utils = {
  996. each: _each,
  997. extend: _extend,
  998. parseParams: _parse_params
  999. },
  1000. Keen.ready = function(e) {
  1001. Keen.loaded ? e() : Keen.on("ready", e)
  1002. }
  1003. ,
  1004. Keen.log = function(e) {
  1005. "object" == typeof console && console.log("[Keen IO]", e)
  1006. }
  1007. ;
  1008. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1009. Keen.prototype.addEvent = function() {
  1010. _uploadEvent.apply(this, arguments)
  1011. }
  1012. ,
  1013. Keen.prototype.addEventSync = function(e, t, i, n) {
  1014. _uploadEvent.apply(this, [e, t, !1, i, n])
  1015. }
  1016. ,
  1017. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1018. var o = e
  1019. , a = o.metaKey
  1020. , s = o.target
  1021. , l = !1
  1022. , c = function() {};
  1023. return void 0 === n && (n = 500),
  1024. "A" === s.nodeName ? c = function() {
  1025. a || l || (l = !0,
  1026. window.location = s.href)
  1027. }
  1028. : "FORM" === s.nodeName && (c = function() {
  1029. l || (l = !0,
  1030. s.submit())
  1031. }
  1032. ),
  1033. r && (c = function() {
  1034. l || (l = !0,
  1035. r())
  1036. }
  1037. ),
  1038. _uploadEvent.call(this, t, i, c, c),
  1039. setTimeout(function() {
  1040. c()
  1041. }, n),
  1042. !!a && void 0
  1043. }
  1044. ,
  1045. Keen.prototype.setGlobalProperties = function(e) {
  1046. if (!this.client)
  1047. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1048. if (!e || "function" != typeof e)
  1049. throw new Error("Invalid value for global properties: " + e);
  1050. this.client.globalProperties = e
  1051. }
  1052. ,
  1053. Keen.Base64 = {
  1054. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1055. encode: function(e) {
  1056. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1057. for (e = this.utf8.encode(e); c < e.length; )
  1058. t = e.charCodeAt(c++),
  1059. i = e.charCodeAt(c++),
  1060. n = e.charCodeAt(c++),
  1061. r = t >> 2,
  1062. o = (3 & t) << 4 | i >> 4,
  1063. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1064. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1065. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1066. return l
  1067. },
  1068. decode: function(e) {
  1069. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1070. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1071. t = c.indexOf(e.charAt(l++)),
  1072. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1073. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1074. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1075. return this.utf8.decode(s)
  1076. },
  1077. utf8: {
  1078. encode: function(e) {
  1079. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1080. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1081. return i
  1082. },
  1083. decode: function(e) {
  1084. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1085. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1086. return i
  1087. }
  1088. }
  1089. },
  1090. "object" != typeof JSON && (JSON = {}),
  1091. function() {
  1092. function f(e) {
  1093. return e < 10 ? "0" + e : e
  1094. }
  1095. function quote(e) {
  1096. return escapable.lastIndex = 0,
  1097. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1098. var t = meta[e];
  1099. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1100. }) + '"' : '"' + e + '"'
  1101. }
  1102. function str(e, t) {
  1103. var i, n, r, o, a, s = gap, l = t[e];
  1104. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1105. "function" == typeof rep && (l = rep.call(t, e, l)),
  1106. typeof l) {
  1107. case "string":
  1108. return quote(l);
  1109. case "number":
  1110. return isFinite(l) ? String(l) : "null";
  1111. case "boolean":
  1112. case "null":
  1113. return String(l);
  1114. case "object":
  1115. if (!l)
  1116. return "null";
  1117. if (gap += indent,
  1118. a = [],
  1119. "[object Array]" === Object.prototype.toString.apply(l)) {
  1120. for (o = l.length,
  1121. i = 0; i < o; i += 1)
  1122. a[i] = str(i, l) || "null";
  1123. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1124. gap = s,
  1125. r
  1126. }
  1127. if (rep && "object" == typeof rep)
  1128. for (o = rep.length,
  1129. i = 0; i < o; i += 1)
  1130. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1131. else
  1132. for (n in l)
  1133. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1134. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1135. gap = s,
  1136. r
  1137. }
  1138. }
  1139. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1140. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1141. }
  1142. ,
  1143. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1144. return this.valueOf()
  1145. }
  1146. );
  1147. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1148. "\b": "\\b",
  1149. "\t": "\\t",
  1150. "\n": "\\n",
  1151. "\f": "\\f",
  1152. "\r": "\\r",
  1153. '"': '\\"',
  1154. "\\": "\\\\"
  1155. }, rep;
  1156. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1157. var n;
  1158. if (indent = gap = "",
  1159. "number" == typeof i)
  1160. for (n = 0; n < i; n += 1)
  1161. indent += " ";
  1162. else
  1163. "string" == typeof i && (indent = i);
  1164. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1165. throw new Error("JSON.stringify");
  1166. return str("", {
  1167. "": e
  1168. })
  1169. }
  1170. ),
  1171. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1172. function walk(e, t) {
  1173. var i, n, r = e[t];
  1174. if (r && "object" == typeof r)
  1175. for (i in r)
  1176. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1177. return reviver.call(e, t, r)
  1178. }
  1179. var j;
  1180. if (text = String(text),
  1181. cx.lastIndex = 0,
  1182. cx.test(text) && (text = text.replace(cx, function(e) {
  1183. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1184. })),
  1185. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1186. return j = eval("(" + text + ")"),
  1187. "function" == typeof reviver ? walk({
  1188. "": j
  1189. }, "") : j;
  1190. throw new SyntaxError("JSON.parse")
  1191. }
  1192. )
  1193. }(),
  1194. Hh = Keen.utils,
  1195. Ih = function(i) {
  1196. function e(e) {
  1197. for (u = 1; e = n.shift(); )
  1198. e()
  1199. }
  1200. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1201. return r[l] && r[l](s, t = function() {
  1202. r.removeEventListener(s, t, !1),
  1203. e()
  1204. }
  1205. , !1),
  1206. a && r.attachEvent(c, t = function() {
  1207. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1208. e())
  1209. }
  1210. ),
  1211. i = a ? function(t) {
  1212. self != top ? u ? t() : n.push(t) : function() {
  1213. try {
  1214. o.doScroll("left")
  1215. } catch (e) {
  1216. return setTimeout(function() {
  1217. i(t)
  1218. }, 50)
  1219. }
  1220. t()
  1221. }()
  1222. }
  1223. : function(e) {
  1224. u ? e() : n.push(e)
  1225. }
  1226. }
  1227. ,
  1228. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1229. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1230. if (loaded && cached) {
  1231. for (var instance in clients = cached.clients || {},
  1232. ready = cached.ready || [],
  1233. clients)
  1234. if (clients.hasOwnProperty(instance)) {
  1235. var client = clients[instance];
  1236. for (var method in Keen.prototype)
  1237. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1238. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1239. ,
  1240. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1241. ,
  1242. client._config && (client.configure.call(client, client._config),
  1243. delete client._config),
  1244. client._setGlobalProperties) {
  1245. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1246. client.setGlobalProperties.apply(client, globals[i]);
  1247. delete client._setGlobalProperties
  1248. }
  1249. if (client._addEvent) {
  1250. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1251. client.addEvent.apply(client, queue[i]);
  1252. delete client._addEvent
  1253. }
  1254. var callback = client._on || [];
  1255. if (client._on) {
  1256. for (var i = 0; i < callback.length; i++)
  1257. client.on.apply(client, callback[i]);
  1258. client.trigger("ready"),
  1259. delete client._on
  1260. }
  1261. }
  1262. for (var i = 0; i < ready.length; i++) {
  1263. var callback = ready[i];
  1264. Keen.on("ready", function() {
  1265. callback()
  1266. })
  1267. }
  1268. }
  1269. return Keen.loaded && setTimeout(function() {
  1270. Keen.utils.domready(function() {
  1271. Keen.trigger("ready")
  1272. })
  1273. }, 0),
  1274. Keen
  1275. }),
  1276. function() {
  1277. var i = window.analytics = window.analytics || [];
  1278. if (!i.initialize) {
  1279. if (i.invoked)
  1280. return window.console && console.error && console.error("Segment snippet included twice.");
  1281. i.invoked = !0,
  1282. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1283. i.factory = function(t) {
  1284. return function() {
  1285. var e = Array.prototype.slice.call(arguments);
  1286. return e.unshift(t),
  1287. i.push(e),
  1288. i
  1289. }
  1290. }
  1291. ;
  1292. for (var e = 0; e < i.methods.length; e++) {
  1293. var t = i.methods[e];
  1294. i[t] = i.factory(t)
  1295. }
  1296. i.load = function(e) {
  1297. var t = document.createElement("script");
  1298. t.type = "text/javascript",
  1299. t.async = !0,
  1300. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1301. var i = document.getElementsByTagName("script")[0];
  1302. i.parentNode.insertBefore(t, i)
  1303. }
  1304. ,
  1305. i.SNIPPET_VERSION = "4.0.0"
  1306. }
  1307. }(),
  1308. function(i, u) {
  1309. "use strict";
  1310. var d = "function"
  1311. , p = "undefined"
  1312. , f = "object"
  1313. , e = "major"
  1314. , t = "model"
  1315. , n = "name"
  1316. , r = "type"
  1317. , o = "vendor"
  1318. , a = "version"
  1319. , s = "architecture"
  1320. , l = "console"
  1321. , c = "mobile"
  1322. , h = "tablet"
  1323. , g = {
  1324. has: function(e, t) {
  1325. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1326. },
  1327. lowerize: function(e) {
  1328. return e.toLowerCase()
  1329. }
  1330. }
  1331. , m = {
  1332. rgx: function() {
  1333. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1334. var c = l[s]
  1335. , h = l[s + 1];
  1336. if (typeof e == p)
  1337. for (n in e = {},
  1338. h)
  1339. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1340. for (t = i = 0; t < c.length; t++)
  1341. if (o = c[t].exec(this.getUA())) {
  1342. for (n = 0; n < h.length; n++)
  1343. a = o[++i],
  1344. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1345. break
  1346. }
  1347. if (o)
  1348. break
  1349. }
  1350. return e
  1351. },
  1352. str: function(e, t) {
  1353. for (var i in t)
  1354. if (typeof t[i] == f && 0 < t[i].length) {
  1355. for (var n = 0; n < t[i].length; n++)
  1356. if (g.has(t[i][n], e))
  1357. return "?" === i ? u : i
  1358. } else if (g.has(t[i], e))
  1359. return "?" === i ? u : i;
  1360. return e
  1361. }
  1362. }
  1363. , v = {
  1364. browser: {
  1365. oldsafari: {
  1366. major: {
  1367. 1: ["/8", "/1", "/3"],
  1368. 2: "/4",
  1369. "?": "/"
  1370. },
  1371. version: {
  1372. "1.0": "/8",
  1373. 1.2: "/1",
  1374. 1.3: "/3",
  1375. "2.0": "/412",
  1376. "2.0.2": "/416",
  1377. "2.0.3": "/417",
  1378. "2.0.4": "/419",
  1379. "?": "/"
  1380. }
  1381. }
  1382. },
  1383. device: {
  1384. sprint: {
  1385. model: {
  1386. "Evo Shift 4G": "7373KT"
  1387. },
  1388. vendor: {
  1389. HTC: "APA",
  1390. Sprint: "Sprint"
  1391. }
  1392. }
  1393. },
  1394. os: {
  1395. windows: {
  1396. version: {
  1397. ME: "4.90",
  1398. "NT 3.11": "NT3.51",
  1399. "NT 4.0": "NT4.0",
  1400. 2e3: "NT 5.0",
  1401. XP: ["NT 5.1", "NT 5.2"],
  1402. Vista: "NT 6.0",
  1403. 7: "NT 6.1",
  1404. 8: "NT 6.2",
  1405. 8.1: "NT 6.3",
  1406. RT: "ARM"
  1407. }
  1408. }
  1409. }
  1410. }
  1411. , y = {
  1412. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1413. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1414. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1415. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1416. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1417. }
  1418. , A = function(e) {
  1419. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1420. return this instanceof A ? (this.getBrowser = function() {
  1421. return m.rgx.apply(this, y.browser)
  1422. }
  1423. ,
  1424. this.getCPU = function() {
  1425. return m.rgx.apply(this, y.cpu)
  1426. }
  1427. ,
  1428. this.getDevice = function() {
  1429. return m.rgx.apply(this, y.device)
  1430. }
  1431. ,
  1432. this.getEngine = function() {
  1433. return m.rgx.apply(this, y.engine)
  1434. }
  1435. ,
  1436. this.getOS = function() {
  1437. return m.rgx.apply(this, y.os)
  1438. }
  1439. ,
  1440. this.getResult = function() {
  1441. return {
  1442. ua: this.getUA(),
  1443. browser: this.getBrowser(),
  1444. engine: this.getEngine(),
  1445. os: this.getOS(),
  1446. device: this.getDevice(),
  1447. cpu: this.getCPU()
  1448. }
  1449. }
  1450. ,
  1451. this.getUA = function() {
  1452. return t
  1453. }
  1454. ,
  1455. this.setUA = function(e) {
  1456. return t = e,
  1457. this
  1458. }
  1459. ,
  1460. void this.setUA(t)) : new A(e).getResult()
  1461. };
  1462. if (typeof exports != p)
  1463. typeof module != p && module.exports && (exports = module.exports = A),
  1464. exports.UAParser = A;
  1465. else if (i.UAParser = A,
  1466. typeof define == d && define.amd && define(function() {
  1467. return A
  1468. }),
  1469. typeof i.jQuery != p) {
  1470. var C = i.jQuery
  1471. , I = new A;
  1472. C.ua = I.getResult(),
  1473. C.ua.get = function() {
  1474. return I.getUA()
  1475. }
  1476. ,
  1477. C.ua.set = function(e) {
  1478. I.setUA(e);
  1479. var t = I.getResult();
  1480. for (var i in t)
  1481. C.ua[i] = t[i]
  1482. }
  1483. }
  1484. }(this),
  1485. window.Modernizr = function(e, t) {
  1486. function i(e, t) {
  1487. return typeof e === t
  1488. }
  1489. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1490. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1491. return t in e && i(e.constructor.prototype[t], "undefined")
  1492. }
  1493. : function(e, t) {
  1494. return p.call(e, t)
  1495. }
  1496. ,
  1497. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1498. var r = this;
  1499. if ("function" != typeof r)
  1500. throw new TypeError;
  1501. var o = d.call(arguments, 1)
  1502. , a = function() {
  1503. if (this instanceof a) {
  1504. function e() {}
  1505. e.prototype = r.prototype;
  1506. var t = new e
  1507. , i = r.apply(t, o.concat(d.call(arguments)));
  1508. return Object(i) === i ? i : t
  1509. }
  1510. return r.apply(n, o.concat(d.call(arguments)))
  1511. };
  1512. return a
  1513. }
  1514. ),
  1515. h.webgl = function() {
  1516. return !!e.WebGLRenderingContext
  1517. }
  1518. ,
  1519. h)
  1520. r(h, f) && (n = f.toLowerCase(),
  1521. a[n] = h[f](),
  1522. u.push((a[n] ? "" : "no-") + n));
  1523. return a.addTest = function(e, t) {
  1524. if ("object" == typeof e)
  1525. for (var i in e)
  1526. r(e, i) && a.addTest(i, e[i]);
  1527. else {
  1528. if (e = e.toLowerCase(),
  1529. void 0 !== a[e])
  1530. return a;
  1531. t = "function" == typeof t ? t() : t,
  1532. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1533. a[e] = t
  1534. }
  1535. return a
  1536. }
  1537. ,
  1538. o = "",
  1539. c.cssText = o,
  1540. l = null,
  1541. a._version = "2.8.2",
  1542. a
  1543. }(this, this.document),
  1544. function(xe, e, Se) {
  1545. "use strict";
  1546. function Me(s, e, n) {
  1547. function a(e) {
  1548. var t = Q.length;
  1549. if (G.old = xe.extend({}, G),
  1550. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1551. Y = W[F.horizontal ? "width" : "height"](),
  1552. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1553. Q.length = 0,
  1554. G.start = 0,
  1555. G.end = nt(z - H, 0),
  1556. le) {
  1557. $.length,
  1558. J = U.children(F.itemSelector),
  1559. $.length = 0;
  1560. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1561. z = 0,
  1562. J.each(function(e, t) {
  1563. var i = xe(t)
  1564. , n = t.getBoundingClientRect()
  1565. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1566. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1567. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1568. , s = r + o + a
  1569. , l = !o || !a
  1570. , c = {};
  1571. c.el = t,
  1572. c.size = l ? r : s,
  1573. c.half = c.size / 2,
  1574. c.start = z + (l ? o : 0),
  1575. c.center = c.start - it(H / 2 - c.size / 2),
  1576. c.end = c.start - H + c.size,
  1577. e || (z += u),
  1578. z += s,
  1579. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1580. e === g && (c.end += d,
  1581. z += d,
  1582. f = l ? a : 0),
  1583. $.push(c),
  1584. h = c
  1585. }),
  1586. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1587. z -= f,
  1588. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1589. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1590. }
  1591. if (G.center = it(G.end / 2 + G.start / 2),
  1592. v(),
  1593. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1594. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1595. X.end = Y - q,
  1596. _e || c()),
  1597. !V && 0 < H) {
  1598. var n = G.start
  1599. , r = "";
  1600. if (le)
  1601. xe.each($, function(e, t) {
  1602. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1603. Q.push(n),
  1604. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1605. });
  1606. else
  1607. for (; n - H < G.end; )
  1608. Q.push(n),
  1609. n += H;
  1610. if (Z[0] && t !== Q.length) {
  1611. for (var o = 0; o < Q.length; o++)
  1612. r += F.pageBuilder.call(B, o);
  1613. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1614. }
  1615. }
  1616. if (ee.slideeSize = z,
  1617. ee.frameSize = H,
  1618. ee.sbSize = Y,
  1619. ee.handleSize = q,
  1620. le) {
  1621. e && null != F.startAt && (m(F.startAt),
  1622. B[se ? "toCenter" : "toStart"](F.startAt));
  1623. var a = $[ee.activeItem];
  1624. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1625. } else
  1626. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1627. L("load")
  1628. }
  1629. function l(e, t, i) {
  1630. if (le && Ie.released && !i) {
  1631. var n = d(e)
  1632. , r = e > G.start && e < G.end;
  1633. se ? (r && (e = $[n.centerItem].center),
  1634. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1635. }
  1636. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1637. Ae.start = +new Date,
  1638. Ae.time = 0,
  1639. Ae.from = G.cur,
  1640. Ae.to = e,
  1641. Ae.delta = e - G.cur,
  1642. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1643. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1644. Ie.tweese = 0,
  1645. e !== G.dest && (G.dest = e,
  1646. L("change"),
  1647. _e || o()),
  1648. g(),
  1649. v(),
  1650. p(),
  1651. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1652. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1653. L("activePage", ye.page))
  1654. }
  1655. function o() {
  1656. if (B.initialized) {
  1657. if (!_e)
  1658. return _e = Ge(o),
  1659. void (Ie.released && L("moveStart"));
  1660. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1661. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1662. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1663. Ae.to === G.cur ? (G.cur = Ae.to,
  1664. Ie.tweese = _e = 0) : _e = Ge(o),
  1665. L("move"),
  1666. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1667. !_e && Ie.released && L("moveEnd"),
  1668. c()
  1669. }
  1670. }
  1671. function c() {
  1672. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1673. X.cur = Fe(it(X.cur), X.start, X.end),
  1674. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1675. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1676. }
  1677. function t() {
  1678. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1679. Te = Ie.init ? Ge(t) : 0,
  1680. Ce.now = +new Date,
  1681. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1682. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1683. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1684. Ce.lastTime = Ce.now
  1685. }
  1686. function i(e, t, i) {
  1687. if ("boolean" === Re(t) && (i = t,
  1688. t = Se),
  1689. t === Se)
  1690. l(G[e], i);
  1691. else {
  1692. if (se && "center" !== e)
  1693. return;
  1694. var n = B.getPos(t);
  1695. n && l(n[e], i, !se)
  1696. }
  1697. }
  1698. function h(e) {
  1699. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1700. }
  1701. function u(e) {
  1702. return h(De(e) && e < 0 ? e + $.length : e)
  1703. }
  1704. function m(e, t) {
  1705. var i = h(e);
  1706. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1707. J.eq(i).addClass(F.activeClass),
  1708. ye.active = ee.activeItem = i,
  1709. p(),
  1710. L("active", i)),
  1711. i)
  1712. }
  1713. function d(e) {
  1714. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1715. var t = {}
  1716. , i = ae ? 0 : H / 2;
  1717. if (!V)
  1718. for (var n = 0, r = Q.length; n < r; n++) {
  1719. if (e >= G.end || n === Q.length - 1) {
  1720. t.activePage = Q.length - 1;
  1721. break
  1722. }
  1723. if (e <= Q[n] + i) {
  1724. t.activePage = n;
  1725. break
  1726. }
  1727. }
  1728. if (le) {
  1729. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1730. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1731. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1732. l === c - 1 || e <= $[l].end + $[l].half) {
  1733. a = l;
  1734. break
  1735. }
  1736. t.firstItem = De(o) ? o : 0,
  1737. t.centerItem = De(s) ? s : t.firstItem,
  1738. t.lastItem = De(a) ? a : t.centerItem
  1739. }
  1740. return t
  1741. }
  1742. function v(e) {
  1743. xe.extend(ee, d(e))
  1744. }
  1745. function p() {
  1746. var e = G.dest <= G.start
  1747. , t = G.dest >= G.end
  1748. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1749. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1750. ge.is("button,input") && ge.prop("disabled", e),
  1751. me.is("button,input") && me.prop("disabled", t),
  1752. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1753. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1754. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1755. de.is("button,input") && de.prop("disabled", e),
  1756. ue.is("button,input") && ue.prop("disabled", t)),
  1757. le && null != ee.activeItem) {
  1758. var n = 0 === ee.activeItem
  1759. , r = ee.activeItem >= $.length - 1
  1760. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1761. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1762. pe.is("button,input") && pe.prop("disabled", n),
  1763. fe.is("button,input") && fe.prop("disabled", r),
  1764. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1765. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1766. }
  1767. }
  1768. function r(e, t, i) {
  1769. if (e = u(e),
  1770. t = u(t),
  1771. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1772. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1773. var n = e < t ? e : i ? t : t - 1
  1774. , r = t < e ? e : i ? t + 1 : t
  1775. , o = t < e;
  1776. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1777. a()
  1778. }
  1779. }
  1780. function f(e, t) {
  1781. for (var i = 0, n = ve[e].length; i < n; i++)
  1782. if (ve[e][i] === t)
  1783. return i;
  1784. return -1
  1785. }
  1786. function g() {
  1787. Ie.released && !B.isPaused && B.resume()
  1788. }
  1789. function y(e) {
  1790. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1791. }
  1792. function A() {
  1793. Ie.history[0] = Ie.history[1],
  1794. Ie.history[1] = Ie.history[2],
  1795. Ie.history[2] = Ie.history[3],
  1796. Ie.history[3] = Ie.delta
  1797. }
  1798. function C(e) {
  1799. Ie.released = 0,
  1800. Ie.source = e,
  1801. Ie.slidee = "slidee" === e
  1802. }
  1803. function I(e) {
  1804. var t = "touchstart" === e.type
  1805. , i = e.data.source
  1806. , n = "slidee" === i;
  1807. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1808. C(i),
  1809. Ie.init = 0,
  1810. Ie.$source = xe(e.target),
  1811. Ie.touch = t,
  1812. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1813. Ie.initX = Ie.pointer.pageX,
  1814. Ie.initY = Ie.pointer.pageY,
  1815. Ie.initPos = n ? G.cur : X.cur,
  1816. Ie.start = +new Date,
  1817. Ie.time = 0,
  1818. Ie.path = 0,
  1819. Ie.delta = 0,
  1820. Ie.locked = 0,
  1821. Ie.history = [0, 0, 0, 0],
  1822. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1823. We.on(t ? qe : Ye, E),
  1824. B.pause(1),
  1825. (n ? U : j).addClass(F.draggedClass),
  1826. L("moveStart"),
  1827. n && (be = setInterval(A, 10)))
  1828. }
  1829. function E(e) {
  1830. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1831. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1832. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1833. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1834. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1835. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1836. Ie.released || !(Ie.path < 1)) {
  1837. if (!Ie.init) {
  1838. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1839. return _();
  1840. Ie.init = 1
  1841. }
  1842. Pe(e),
  1843. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1844. Ie.$source.on(Ze, Oe)),
  1845. Ie.released && (_(),
  1846. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1847. Ie.delta += Ie.swing,
  1848. Ie.tweese = 10 < $e(Ie.swing))),
  1849. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1850. }
  1851. }
  1852. function _() {
  1853. clearInterval(be),
  1854. Ie.released = !0,
  1855. We.off(Ie.touch ? qe : Ye, E),
  1856. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1857. setTimeout(function() {
  1858. Ie.$source.off(Ze, Oe)
  1859. }),
  1860. G.cur === G.dest && Ie.init && L("moveEnd"),
  1861. B.resume(1),
  1862. Ie.init = 0
  1863. }
  1864. function b(e) {
  1865. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1866. }
  1867. function w() {
  1868. B.stop(),
  1869. We.off("mouseup", w)
  1870. }
  1871. function T(e) {
  1872. switch (Pe(e),
  1873. this) {
  1874. case ue[0]:
  1875. case de[0]:
  1876. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1877. We.on("mouseup", w);
  1878. break;
  1879. case pe[0]:
  1880. B.prev();
  1881. break;
  1882. case fe[0]:
  1883. B.next();
  1884. break;
  1885. case ge[0]:
  1886. B.prevPage();
  1887. break;
  1888. case me[0]:
  1889. B.nextPage()
  1890. }
  1891. }
  1892. function x(e) {
  1893. e.originalEvent[He] = B;
  1894. var t = +new Date;
  1895. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1896. ot = t;
  1897. else if (F.scrollBy && G.start !== G.end) {
  1898. var i = function(e) {
  1899. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1900. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1901. le ? (Ue = +new Date,
  1902. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1903. Ee.last = Ue,
  1904. Ee.delta += Ee.curDelta,
  1905. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1906. Ee.delta %= 1),
  1907. Ee.finalDelta) : Ee.curDelta
  1908. }(e.originalEvent);
  1909. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1910. B.slideBy(F.scrollBy * i)
  1911. }
  1912. }
  1913. function S(e) {
  1914. F.clickBar && e.target === W[0] && (Pe(e),
  1915. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1916. }
  1917. function M(e) {
  1918. if (F.keyboardNavBy)
  1919. switch (e.which) {
  1920. case F.horizontal ? 37 : 38:
  1921. Pe(e),
  1922. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1923. break;
  1924. case F.horizontal ? 39 : 40:
  1925. Pe(e),
  1926. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1927. }
  1928. }
  1929. function R(e) {
  1930. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1931. }
  1932. function P() {
  1933. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1934. }
  1935. function O(e) {
  1936. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1937. }
  1938. function L(e, t) {
  1939. if (ve[e]) {
  1940. for (N = ve[e].length,
  1941. Je.length = 0,
  1942. D = 0; D < N; D++)
  1943. Je.push(ve[e][D]);
  1944. for (D = 0; D < N; D++)
  1945. Je[D].call(B, e, t)
  1946. }
  1947. }
  1948. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1949. start: 0,
  1950. center: 0,
  1951. end: 0,
  1952. cur: 0,
  1953. dest: 0
  1954. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1955. start: 0,
  1956. end: 0,
  1957. cur: 0
  1958. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1959. firstItem: 0,
  1960. lastItem: 0,
  1961. centerItem: 0,
  1962. activeItem: null,
  1963. activePage: 0
  1964. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1965. released: 1
  1966. }, Ee = {
  1967. last: 0,
  1968. delta: 0,
  1969. resetTime: 200
  1970. }, _e = 0, be = 0, we = 0, Te = 0;
  1971. V || (s = k[0]),
  1972. B.initialized = 0,
  1973. B.frame = s,
  1974. B.slidee = U[0],
  1975. B.pos = G,
  1976. B.rel = ee,
  1977. B.items = $,
  1978. B.pages = Q,
  1979. B.isPaused = 0,
  1980. B.options = F,
  1981. B.dragging = Ie,
  1982. B.reload = function() {
  1983. a()
  1984. }
  1985. ,
  1986. B.getPos = function(e) {
  1987. if (le) {
  1988. var t = h(e);
  1989. return -1 !== t && $[t]
  1990. }
  1991. var i = U.find(e).eq(0);
  1992. if (i[0]) {
  1993. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1994. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1995. return {
  1996. start: n,
  1997. center: n - H / 2 + r / 2,
  1998. end: n - H + r,
  1999. size: r
  2000. }
  2001. }
  2002. return !1
  2003. }
  2004. ,
  2005. B.moveBy = function(e) {
  2006. Ce.speed = e,
  2007. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2008. Ce.startPos = G.cur,
  2009. C("button"),
  2010. Ie.init = 1,
  2011. L("moveStart"),
  2012. ze(Te),
  2013. t())
  2014. }
  2015. ,
  2016. B.stop = function() {
  2017. "button" === Ie.source && (Ie.init = 0,
  2018. Ie.released = 1)
  2019. }
  2020. ,
  2021. B.prev = function() {
  2022. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2023. }
  2024. ,
  2025. B.next = function() {
  2026. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2027. }
  2028. ,
  2029. B.prevPage = function() {
  2030. B.activatePage(ee.activePage - 1)
  2031. }
  2032. ,
  2033. B.nextPage = function() {
  2034. B.activatePage(ee.activePage + 1)
  2035. }
  2036. ,
  2037. B.slideBy = function(e, t) {
  2038. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2039. }
  2040. ,
  2041. B.slideTo = function(e, t) {
  2042. l(e, t)
  2043. }
  2044. ,
  2045. B.toStart = function(e, t) {
  2046. i("start", e, t)
  2047. }
  2048. ,
  2049. B.toEnd = function(e, t) {
  2050. i("end", e, t)
  2051. }
  2052. ,
  2053. B.toCenter = function(e, t) {
  2054. i("center", e, t)
  2055. }
  2056. ,
  2057. B.getIndex = h,
  2058. B.activate = function(e, t) {
  2059. var i = m(e);
  2060. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2061. }
  2062. ,
  2063. B.activatePage = function(e, t) {
  2064. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2065. }
  2066. ,
  2067. B.resume = function(e) {
  2068. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2069. we ? we = clearTimeout(we) : L("resume"),
  2070. we = setTimeout(function() {
  2071. switch (L("cycle"),
  2072. F.cycleBy) {
  2073. case "items":
  2074. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2075. break;
  2076. case "pages":
  2077. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2078. }
  2079. }, F.cycleInterval))
  2080. }
  2081. ,
  2082. B.pause = function(e) {
  2083. e < B.isPaused || (B.isPaused = e || 100,
  2084. we && (we = clearTimeout(we),
  2085. L("pause")))
  2086. }
  2087. ,
  2088. B.toggle = function() {
  2089. B[we ? "pause" : "resume"]()
  2090. }
  2091. ,
  2092. B.set = function(e, t) {
  2093. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2094. }
  2095. ,
  2096. B.add = function(e, t) {
  2097. var i = xe(e);
  2098. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2099. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2100. a()
  2101. }
  2102. ,
  2103. B.remove = function(e) {
  2104. if (le) {
  2105. var t = u(e);
  2106. if (-1 < t) {
  2107. J.eq(t).remove();
  2108. var i = t === ee.activeItem;
  2109. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2110. a(),
  2111. i && (ye.active = null,
  2112. B.activate(ee.activeItem))
  2113. }
  2114. } else
  2115. xe(e).remove(),
  2116. a()
  2117. }
  2118. ,
  2119. B.moveAfter = function(e, t) {
  2120. r(e, t, 1)
  2121. }
  2122. ,
  2123. B.moveBefore = function(e, t) {
  2124. r(e, t)
  2125. }
  2126. ,
  2127. B.on = function(e, t) {
  2128. if ("object" === Re(e))
  2129. for (var i in e)
  2130. e.hasOwnProperty(i) && B.on(i, e[i]);
  2131. else if ("function" === Re(t))
  2132. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2133. ve[n[r]] = ve[n[r]] || [],
  2134. -1 === f(n[r], t) && ve[n[r]].push(t);
  2135. else if ("array" === Re(t))
  2136. for (var a = 0, s = t.length; a < s; a++)
  2137. B.on(e, t[a])
  2138. }
  2139. ,
  2140. B.one = function(t, i) {
  2141. B.on(t, function e() {
  2142. i.apply(B, arguments),
  2143. B.off(t, e)
  2144. })
  2145. }
  2146. ,
  2147. B.off = function(e, t) {
  2148. if (t instanceof Array)
  2149. for (var i = 0, n = t.length; i < n; i++)
  2150. B.off(e, t[i]);
  2151. else
  2152. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2153. if (ve[r[o]] = ve[r[o]] || [],
  2154. null == t)
  2155. ve[r[o]].length = 0;
  2156. else {
  2157. var s = f(r[o], t);
  2158. -1 !== s && ve[r[o]].splice(s, 1)
  2159. }
  2160. }
  2161. ,
  2162. B.destroy = function() {
  2163. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2164. We.off("keydown", M),
  2165. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2166. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2167. Z.empty(),
  2168. V || (k.off("." + He),
  2169. te.restore(),
  2170. ie.restore(),
  2171. ne.restore(),
  2172. re.restore(),
  2173. xe.removeData(s, He)),
  2174. $.length = Q.length = 0,
  2175. ye = {},
  2176. B.initialized = 0,
  2177. B
  2178. }
  2179. ,
  2180. B.init = function() {
  2181. if (!B.initialized) {
  2182. B.on(n);
  2183. var e = ["overflow", "position"]
  2184. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2185. te.save.apply(te, e),
  2186. ne.save.apply(ne, e),
  2187. ie.save.apply(ie, t),
  2188. re.save.apply(re, t);
  2189. var i = j;
  2190. return V || (i = i.add(U),
  2191. k.css("overflow", "hidden"),
  2192. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2193. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2194. i.css({
  2195. position: "absolute"
  2196. })),
  2197. F.forward && ue.on(Ke, T),
  2198. F.backward && de.on(Ke, T),
  2199. F.prev && pe.on(Ze, T),
  2200. F.next && fe.on(Ze, T),
  2201. F.prevPage && ge.on(Ze, T),
  2202. F.nextPage && me.on(Ze, T),
  2203. ce.on(Xe, x),
  2204. W[0] && W.on(Ze, S),
  2205. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2206. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2207. he.on(je, {
  2208. source: "slidee"
  2209. }, I),
  2210. j && j.on(je, {
  2211. source: "handle"
  2212. }, I),
  2213. We.on("keydown", M),
  2214. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2215. k.on("scroll." + He, Le)),
  2216. B.initialized = 1,
  2217. a(!0),
  2218. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2219. B
  2220. }
  2221. }
  2222. }
  2223. function Re(e) {
  2224. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2225. }
  2226. function Pe(e, t) {
  2227. e.preventDefault(),
  2228. t && e.stopPropagation()
  2229. }
  2230. function Oe(e) {
  2231. Pe(e, 1),
  2232. xe(this).off(e.type, Oe)
  2233. }
  2234. function Le() {
  2235. this.scrollLeft = 0,
  2236. this.scrollTop = 0
  2237. }
  2238. function De(e) {
  2239. return !isNaN(parseFloat(e)) && isFinite(e)
  2240. }
  2241. function Ne(e, t) {
  2242. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2243. }
  2244. function Fe(e, t, i) {
  2245. return e < t ? t : i < e ? i : e
  2246. }
  2247. function Be(t) {
  2248. var i = {
  2249. style: {},
  2250. save: function() {
  2251. if (t && t.nodeType) {
  2252. for (var e = 0; e < arguments.length; e++)
  2253. i.style[arguments[e]] = t.style[arguments[e]];
  2254. return i
  2255. }
  2256. },
  2257. restore: function() {
  2258. if (t && t.nodeType) {
  2259. for (var e in i.style)
  2260. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2261. return i
  2262. }
  2263. }
  2264. };
  2265. return i
  2266. }
  2267. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2268. function t(e) {
  2269. for (var t = 0, i = r.length; t < i; t++) {
  2270. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2271. if (null != o.style[n])
  2272. return n
  2273. }
  2274. }
  2275. We.on(Xe, function(e) {
  2276. var t = e.originalEvent[He]
  2277. , i = +new Date;
  2278. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2279. }),
  2280. function(t) {
  2281. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2282. var t = (new Date).getTime()
  2283. , i = Math.max(0, 16 - (t - r))
  2284. , n = setTimeout(e, i);
  2285. return r = t,
  2286. n
  2287. }
  2288. ;
  2289. var r = (new Date).getTime()
  2290. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2291. ze = function(e) {
  2292. i.call(t, e)
  2293. }
  2294. }(window),
  2295. r = ["", "webkit", "moz", "ms", "o"],
  2296. o = document.createElement("div"),
  2297. Ve = t("transform"),
  2298. ke = t("perspective") ? "translateZ(0) " : "",
  2299. e.Sly = Me,
  2300. xe.fn.sly = function(n, r) {
  2301. var o, a;
  2302. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2303. a = Array.prototype.slice.call(arguments, 1)),
  2304. n = {}),
  2305. this.each(function(e, t) {
  2306. var i = xe.data(t, He);
  2307. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2308. })
  2309. }
  2310. ,
  2311. Me.defaults = {
  2312. slidee: null,
  2313. horizontal: !1,
  2314. itemNav: null,
  2315. itemSelector: null,
  2316. smart: !1,
  2317. activateOn: null,
  2318. activateMiddle: !1,
  2319. scrollSource: null,
  2320. scrollBy: 0,
  2321. scrollHijack: 300,
  2322. scrollTrap: !1,
  2323. dragSource: null,
  2324. mouseDragging: !1,
  2325. touchDragging: !1,
  2326. releaseSwing: !1,
  2327. swingSpeed: .2,
  2328. elasticBounds: !1,
  2329. interactive: null,
  2330. scrollBar: null,
  2331. dragHandle: !1,
  2332. dynamicHandle: !1,
  2333. minHandleSize: 50,
  2334. clickBar: !1,
  2335. syncSpeed: .5,
  2336. pagesBar: null,
  2337. activatePageOn: null,
  2338. pageBuilder: function(e) {
  2339. return "<li>" + (e + 1) + "</li>"
  2340. },
  2341. forward: null,
  2342. backward: null,
  2343. prev: null,
  2344. next: null,
  2345. prevPage: null,
  2346. nextPage: null,
  2347. cycleBy: null,
  2348. cycleInterval: 5e3,
  2349. pauseOnHover: !1,
  2350. startPaused: !1,
  2351. moveBy: 300,
  2352. speed: 0,
  2353. easing: "swing",
  2354. startAt: null,
  2355. keyboardNavBy: null,
  2356. draggedClass: "dragged",
  2357. activeClass: "active",
  2358. disabledClass: "disabled"
  2359. }
  2360. }(jQuery, window),
  2361. function o(a, s, l) {
  2362. function c(i, e) {
  2363. if (!s[i]) {
  2364. if (!a[i]) {
  2365. var t = "function" == typeof require && require;
  2366. if (!e && t)
  2367. return t(i, !0);
  2368. if (h)
  2369. return h(i, !0);
  2370. var n = new Error("Cannot find module '" + i + "'");
  2371. throw n.code = "MODULE_NOT_FOUND",
  2372. n
  2373. }
  2374. var r = s[i] = {
  2375. exports: {}
  2376. };
  2377. a[i][0].call(r.exports, function(e) {
  2378. var t = a[i][1][e];
  2379. return c(t || e)
  2380. }, r, r.exports, o, a, s, l)
  2381. }
  2382. return s[i].exports
  2383. }
  2384. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2385. c(l[e]);
  2386. return c
  2387. }({
  2388. 1: [function(p, f, e) {
  2389. (function(e) {
  2390. "use strict";
  2391. function t(e) {
  2392. this.player = null,
  2393. this.director = null,
  2394. this.modelManager = null,
  2395. this.container = null,
  2396. this.tagManager = null,
  2397. this.fadeInSpeed = e,
  2398. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2399. }
  2400. var r = p("three")
  2401. , i = p("./util/logger")
  2402. , n = (p("./util/common"),
  2403. p("./enum/PlayerEvents"))
  2404. , o = p("./enum/DirectorEvents")
  2405. , a = p("./settings")
  2406. , s = p("./enum/Viewmode")
  2407. , l = (p("./enum/WarpStyle"),
  2408. p("./enum/BlackoutStyle"),
  2409. p("./enum/ModelManagerEvents"))
  2410. , c = p("./enum/tagEvents")
  2411. , h = p("./util/transitions")
  2412. , u = p("./util/lerp")
  2413. , d = new i(e);
  2414. window.THREE = r,
  2415. t.prototype.init = function(e, t, i, n, r) {
  2416. (window.app = this).player = t,
  2417. this.director = e,
  2418. this.modelManager = i,
  2419. this.tagManager = n,
  2420. this.container = r,
  2421. this.updateModel(),
  2422. this.bindEvents()
  2423. }
  2424. ,
  2425. t.prototype.bindEvents = function() {
  2426. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2427. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2428. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2429. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2430. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2431. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2432. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2433. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2434. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2435. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2436. }
  2437. ,
  2438. t.prototype.updateModel = function() {
  2439. this.model = this.modelManager.getActiveModel()
  2440. }
  2441. ,
  2442. t.prototype.handleWarpStarted = function() {
  2443. this.hidePlayerReticule()
  2444. }
  2445. ,
  2446. t.prototype.ontagActivated = function() {
  2447. this.hidePlayerReticule()
  2448. }
  2449. ,
  2450. t.prototype.onNavigationTotag = function() {
  2451. this.hidePlayerReticule()
  2452. }
  2453. ,
  2454. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2455. var n = this.modelManager.getActiveModel()
  2456. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2457. n.fadePanoMarkers(r),
  2458. n.setMode(t)
  2459. }
  2460. ,
  2461. t.prototype.handlePlayerModeChanged = function(e, t) {
  2462. var i = this.modelManager.getActiveModel()
  2463. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2464. i.setSide(n),
  2465. i.setMode(t)
  2466. }
  2467. ,
  2468. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2469. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2470. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2471. }
  2472. ,
  2473. t.prototype.handleActionInterruption = function() {}
  2474. ,
  2475. t.prototype.handleStartInside = function(e) {
  2476. var t = a[this.player.mode]
  2477. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2478. this.fadeIn(this.fadeInSpeed),
  2479. this.model.alpha = 0,
  2480. this.model.skybox.material.uniforms.opacity.value = 1,
  2481. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2482. var n = this.player.reticule;
  2483. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2484. }
  2485. ,
  2486. t.prototype.handleStartOutside = function(e) {
  2487. this.fadeIn(e)
  2488. }
  2489. ,
  2490. t.prototype.fadeIn = function(e) {
  2491. null != e || (e = 2e3,
  2492. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2493. $(this.container).fadeIn(e)
  2494. }
  2495. ,
  2496. t.prototype.hidePlayerReticule = function() {
  2497. this.player.reticule.hide()
  2498. }
  2499. ,
  2500. f.exports = t
  2501. }
  2502. ).call(this, "/js/DisplayController.js")
  2503. }
  2504. , {
  2505. "./enum/BlackoutStyle": 18,
  2506. "./enum/DirectorEvents": 23,
  2507. "./enum/tagEvents": 32,
  2508. "./enum/ModelManagerEvents": 33,
  2509. "./enum/PlayerEvents": 40,
  2510. "./enum/Viewmode": 51,
  2511. "./enum/WarpStyle": 52,
  2512. "./settings": 166,
  2513. "./util/common": 185,
  2514. "./util/lerp": 188,
  2515. "./util/logger": 189,
  2516. "./util/transitions": 195,
  2517. three: 217
  2518. }],
  2519. 2: [function(e, t, i) {
  2520. "use strict";
  2521. function n() {
  2522. this.baseStartTime = performance.timing.navigationStart,
  2523. this.loadingStartTime = null,
  2524. this.waitingStartTime = null,
  2525. this.appReadyTime = null
  2526. }
  2527. n.prototype.setBaseStartTime = function(e) {
  2528. this.baseStartTime = e || Date.now()
  2529. }
  2530. ,
  2531. n.prototype.setWaitingStartTime = function(e) {
  2532. this.waitingStartTime = e || Date.now()
  2533. }
  2534. ,
  2535. n.prototype.setLoadingStartTime = function(e) {
  2536. this.loadingStartTime = e || Date.now()
  2537. }
  2538. ,
  2539. n.prototype.setAppReadyTime = function(e) {
  2540. this.appReadyTime = e || Date.now()
  2541. }
  2542. ,
  2543. n.prototype.calcFullLoadingTime = function() {
  2544. var e = this.appReadyTime - this.baseStartTime;
  2545. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2546. e
  2547. }
  2548. ,
  2549. t.exports = n
  2550. }
  2551. , {}],
  2552. 3: [function(i, n, e) {
  2553. (function(e) {
  2554. "use strict";
  2555. function a() {
  2556. return 100 * Math.random()
  2557. }
  2558. var t = i("./util/logger")
  2559. , s = i("./util/browser")
  2560. , l = new t(e)
  2561. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2562. initialized: !1,
  2563. init: function(e, t) {
  2564. if (t = t || {},
  2565. !this.initialized) {
  2566. for (var i in this.initialized = !0,
  2567. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2568. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2569. e) {
  2570. var n = i.match("^sc_tilegen_([0-9]+)$");
  2571. n && (c.tilegen = a() < parseInt(n[1]));
  2572. var r = i.match("^sc_imgopt_([0-9]+)$");
  2573. r && (c.imgopt = a() < parseInt(r[1]))
  2574. }
  2575. for (var o in t)
  2576. c[o] = t[o],
  2577. l.debug("A/B override:", o, c[o])
  2578. }
  2579. },
  2580. changeIfTileGenerating: function(e) {
  2581. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2582. e += ""),
  2583. e
  2584. },
  2585. changeIfImageOptimzing: function(e) {
  2586. if(e.includes("blob:http"))return e;//add
  2587. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2588. e += ""),
  2589. e
  2590. },
  2591. tilegen: !1,
  2592. imgopt: !1
  2593. };
  2594. n.exports = c
  2595. }
  2596. ).call(this, "/js/ab.js")
  2597. }
  2598. , {
  2599. "./util/browser": 182,
  2600. "./util/logger": 189
  2601. }],
  2602. 4: [function(u, d, e) {
  2603. (function(e) {
  2604. "use strict";
  2605. function r(n, e, t, i) {
  2606. function r(e) {
  2607. a[e.sid] = !0;
  2608. var t = e.billboard.media && e.billboard.media.type
  2609. , i = {
  2610. tag_id: e.sid,
  2611. tags_visited: Object.keys(a).length,
  2612. tag_count: Object.keys(n.tags).length,
  2613. tag_view_count: ++d,
  2614. has_media: !!t
  2615. };
  2616. t && (i.media_type = t),
  2617. g("tag_opened", i)
  2618. }
  2619. var o, a = {}, s = Date.now() - P, l = null;
  2620. i && (l = Date.now() - window.navigationStart);
  2621. try {
  2622. o = n.data.player_options.highlight_reel && 0 < n.heroLocations.length
  2623. } catch (n) {
  2624. o = !1
  2625. }
  2626. var c, h = n.supportsVR;
  2627. h || (c = "VR disabled at the model/account level",
  2628. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2629. g("model_loaded", {
  2630. duration: s,
  2631. duration_from_navigation_start: l,
  2632. has_hlr: o,
  2633. has_vr: h,
  2634. vr_reason: c
  2635. });
  2636. var u = 0;
  2637. n.panos.forEach(function(e) {
  2638. e.on("enter", function() {
  2639. f("pano_viewed", {
  2640. pano_id: e.id,
  2641. pano_view_count: ++u,
  2642. alignment_type: e.alignmentType,
  2643. interaction_source: R,
  2644. navigation_source: v
  2645. })
  2646. })
  2647. });
  2648. var d = 0;
  2649. for (var p in n.tags)
  2650. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2651. e.on("tour_auto", function(e) {
  2652. v = "tour_" + e
  2653. }),
  2654. e.on("tour_manual", function(e) {
  2655. R = "gui-" + e,
  2656. v = "tour_manual"
  2657. }),
  2658. t.on(C.InteractionKey, function() {
  2659. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2660. }),
  2661. t.on(C.InteractionDirect, function() {
  2662. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2663. }),
  2664. function(t) {
  2665. I.on(T.OPENED, function() {
  2666. f("showcase_share_intent", {
  2667. pano_id: t.currentPano && t.currentPano.id
  2668. })
  2669. }),
  2670. I.on(T.LINK_CLICKED, function(e) {
  2671. f("showcase_share_action", {
  2672. channel: e.channel,
  2673. pano_id: t.currentPano && t.currentPano.id
  2674. })
  2675. }),
  2676. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2677. f("showcase_share_origin_link_clicked")
  2678. })
  2679. }(e),
  2680. function() {
  2681. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2682. gui_action: "click_vr_button"
  2683. })),
  2684. _.on(S.LAUNCH, function(e) {
  2685. f("showcase_gui", {
  2686. gui_action: "launch_vr",
  2687. vr_platform: e.vr_platform,
  2688. vr_app: e.vr_app
  2689. })
  2690. }),
  2691. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2692. gui_action: "vr_modal_prev"
  2693. })),
  2694. _.on(S.NEXT, function(e) {
  2695. f("showcase_gui", {
  2696. gui_action: e.nextAction
  2697. })
  2698. }),
  2699. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2700. gui_action: "vr_modal_close"
  2701. })),
  2702. _.on(S.falseICECHOSEN, function(e) {
  2703. f("showcase_gui", {
  2704. gui_action: e.name + " "
  2705. })
  2706. }),
  2707. _.on(S.STORE, function(e) {
  2708. f("showcase_gui", {
  2709. gui_action: "launch_store",
  2710. store: e
  2711. })
  2712. })
  2713. }()
  2714. }
  2715. function f(e, t) {
  2716. if (t = t || {},
  2717. i)
  2718. try {
  2719. window.analytics.track(e, s.extendObject(t, c), {
  2720. context: {
  2721. app: {
  2722. name: "showcase",
  2723. version: "2.25.6-0-gd87e5b1"
  2724. },
  2725. screen: {
  2726. width: window.screen.width,
  2727. height: window.screen.height,
  2728. density: window.devicePixelRatio
  2729. }
  2730. }
  2731. })
  2732. } catch (t) {
  2733. console.warn("Failed to send data to segment for " + e)
  2734. }
  2735. }
  2736. function g(e, t) {
  2737. f(e, t = t || {})
  2738. }
  2739. function m(e, t) {
  2740. R = e === C.InteractionGui ? "gui-" + t : e,
  2741. v = "self_guided"
  2742. }
  2743. var v, o, a = (u("three"),
  2744. u("./util/ajax"),
  2745. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2746. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2747. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2748. d.exports = {
  2749. report: function(e, t, i, n) {
  2750. !function(e, t) {
  2751. if (o)
  2752. try {
  2753. o.addEvent(e, s.extendObject({
  2754. host: window.location.host,
  2755. keen: {
  2756. addons: [{
  2757. name: "keen:ua_parser",
  2758. input: {
  2759. ua_string: "user_agent"
  2760. },
  2761. output: "parsed_user_agent"
  2762. }]
  2763. },
  2764. user_agent: "${keen.user_agent}",
  2765. referrer: {
  2766. url: s.normalizeUrl(document.referrer),
  2767. domain: s.domainFromUrl(document.referrer),
  2768. url_original: document.referrer
  2769. },
  2770. embedded: y.inIframe(),
  2771. is_mobile: y.isMobile(),
  2772. version: "2.25.6-0-gd87e5b1"
  2773. }, t))
  2774. } catch (e) {
  2775. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2776. }
  2777. }("Session starts", {
  2778. model: e,
  2779. status: t,
  2780. loadtime: Date.now() - (P || Date.now()),
  2781. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2782. autoplay: i,
  2783. quickstart: n,
  2784. ab_tilegen: a.tilegen,
  2785. ab_imgopt: a.imgopt
  2786. })
  2787. },
  2788. impression: function(e) {
  2789. g("impression", {
  2790. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2791. url_params: (void 0 !== e.immediate && e.immediate,
  2792. window.location.search.substr(1).split("&"))
  2793. })
  2794. },
  2795. initKeen: function(e) {
  2796. return e.token && e.appId ? void (o = new Keen({
  2797. projectId: e.appId,
  2798. writeKey: e.token,
  2799. readKey: "",
  2800. requestType: "xhr"
  2801. })) : void l.warn("no keen token/appId")
  2802. },
  2803. initSegment: function(e) {
  2804. return e.token ? (i = e.token,
  2805. window.analytics.load(e.token),
  2806. c = {
  2807. model_id: e.model,
  2808. start_source: e.startSource,
  2809. autoplay: e.autoplay,
  2810. quickstart: e.quickstart,
  2811. language_tag: t.languageTag,
  2812. is_mobile: y.isMobile(),
  2813. iframe: y.inIframe(),
  2814. aspect_ratio: y.aspectRatio(),
  2815. session_id: h,
  2816. window: {
  2817. width: $("#player").width(),
  2818. height: $("#player").height()
  2819. },
  2820. platform: {
  2821. browser: {
  2822. name: $.ua.browser.name,
  2823. major: $.ua.browser.major,
  2824. version: $.ua.browser.version
  2825. },
  2826. os: {
  2827. name: $.ua.os.name,
  2828. version: $.ua.os.version
  2829. },
  2830. device: {
  2831. vendor: $.ua.device.vendor,
  2832. model: $.ua.device.model,
  2833. type: $.ua.device.type
  2834. }
  2835. }
  2836. },
  2837. n = Math.random() < t.analytics.sessionTrackingRate,
  2838. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2839. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2840. },
  2841. sessionStart: function(e) {
  2842. l.debug("analytics user_session_start"),
  2843. f("session_started"),
  2844. P = Date.now(),
  2845. window.addEventListener("unload", function() {
  2846. !function(e, t) {
  2847. if (t = t || {},
  2848. navigator.sendBeacon && i)
  2849. try {
  2850. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2851. event: e,
  2852. anonymousId: window.analytics.user().anonymousId(),
  2853. properties: s.extendObject(t, c),
  2854. writeKey: i,
  2855. sentAt: Date.now(),
  2856. type: "track",
  2857. context: {
  2858. userAgent: y.userAgent(),
  2859. library: {
  2860. name: "showcase-beacon",
  2861. version: "2.25.6-0-gd87e5b1"
  2862. },
  2863. app: {
  2864. name: "showcase",
  2865. version: "2.25.6-0-gd87e5b1"
  2866. }
  2867. }
  2868. }))
  2869. } catch (e) {
  2870. console.warn("Failed to send async segment request")
  2871. }
  2872. }("session_ended", {
  2873. duration: Date.now() - P
  2874. })
  2875. })
  2876. },
  2877. modelLoaded: function(e, t, i, n) {
  2878. r(e, t, i, n)
  2879. },
  2880. loadComplete: function(e) {
  2881. f("load_times", {
  2882. time_to_app_start: e
  2883. })
  2884. },
  2885. track: function(e, t) {
  2886. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2887. f(e, t))
  2888. },
  2889. trackAlways: function(e, t) {
  2890. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2891. f(e, t)
  2892. },
  2893. getSessionId: function() {
  2894. return h
  2895. },
  2896. updateInteraction: m
  2897. }
  2898. }
  2899. ).call(this, "/js/analytics.js")
  2900. }
  2901. , {
  2902. "./ab": 3,
  2903. "./enum/ControlEvents": 21,
  2904. "./enum/PlayerEvents": 40,
  2905. "./enum/VROption": 47,
  2906. "./enum/VRPlatforms": 49,
  2907. "./enum/Viewmode": 51,
  2908. "./gui/sharing/ShareEvents": 76,
  2909. "./gui/sharing/modal": 77,
  2910. "./gui/title/TitleEvents": 80,
  2911. "./gui/title/titleBar": 82,
  2912. "./gui/vr/vrEvent": 85,
  2913. "./gui/vr/vrModal": 87,
  2914. "./localization/localize": 108,
  2915. "./tag/Billboard/BillboardEvent": 120,
  2916. "./settings": 166,
  2917. "./util/ajax": 181,
  2918. "./util/browser": 182,
  2919. "./util/common": 185,
  2920. "./util/logger": 189,
  2921. three: 217
  2922. }],
  2923. 5: [function(e, t, i) {
  2924. "use strict";
  2925. function n() {
  2926. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2927. this.controls = null
  2928. }
  2929. var r = e("three")
  2930. , o = e("../constants")
  2931. , a = e("../util/cameraLight");
  2932. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2933. this.aspect = e,
  2934. this.updateProjectionMatrix()
  2935. }
  2936. ,
  2937. t.exports = n
  2938. }
  2939. , {
  2940. "../constants": 8,
  2941. "../util/cameraLight": 184,
  2942. three: 217
  2943. }],
  2944. 6: [function(e, t, i) {
  2945. "use strict";
  2946. function n() {
  2947. var e = $("#player").width() / $("#player").height();
  2948. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2949. this.controls = null,
  2950. this.updateAspect(e)
  2951. }
  2952. var r = e("three")
  2953. , o = e("../constants");
  2954. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2955. this.aspect = e,
  2956. this.top = o.orthoBase / e,
  2957. this.bottom = -o.orthoBase / e,
  2958. this.updateProjectionMatrix()
  2959. }
  2960. ,
  2961. t.exports = n
  2962. }
  2963. , {
  2964. "../constants": 8,
  2965. three: 217
  2966. }],
  2967. 7: [function(e, t, i) {
  2968. "use strict";
  2969. function n() {
  2970. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2971. this.controls = null
  2972. }
  2973. var r = e("three")
  2974. , o = e("../settings")
  2975. , a = e("../util/cameraLight");
  2976. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2977. this.aspect = e,
  2978. this.updateProjectionMatrix()
  2979. }
  2980. ,
  2981. t.exports = n
  2982. }
  2983. , {
  2984. "../settings": 166,
  2985. "../util/cameraLight": 184,
  2986. three: 217
  2987. }],
  2988. 8: [function(e, t, i) {
  2989. "use strict";
  2990. t.exports = {
  2991. signedUrlDefaultExpireTime: 24e4,
  2992. signedUrlCheckInterval: 1e4,
  2993. signedUrlRefreshBuffer: 15e3,
  2994. dollhouseFOV: 70,
  2995. dollhouseNear: 1,
  2996. dollhouseFar: 5e3,
  2997. insideFOV: 70,
  2998. insideFOVMax: 120,
  2999. insideNear: .1,
  3000. insideFar: 5e3,
  3001. insideLookSpeed: .12,
  3002. insideLookLimitUp: 40,
  3003. insideLookLimitDown: -40,
  3004. orthoNear: 1,
  3005. orthoFar: 5e3,
  3006. orthoBase: 10,
  3007. narrowLandscapeHeight: 290,
  3008. reallyNarrowLandscapeHeight: 250,
  3009. visionTilingStartDate: new Date("8/26/2016"),
  3010. visionTilingStartVersion: "1.1.407.13667",
  3011. windowHeightHighQualityThreshold: 900,
  3012. tourStepDelayDefault: 3500,
  3013. tourStepDelaySlideShow: 5e3,
  3014. workshopApsect: 9 / 16,
  3015. highQualityMaxZoom: 2,
  3016. ultraHighQualityMaxZoom: 3
  3017. }
  3018. }
  3019. , {}],
  3020. 9: [function(e, t, i) {
  3021. "use strict";
  3022. function n() {
  3023. this.activeControl = null,
  3024. this.controls = {},
  3025. this.cameras = {}
  3026. }
  3027. var a = e("./PanoramaControls")
  3028. , s = e("./DollhouseControls")
  3029. , l = e("./FloorplanControls")
  3030. , c = e("../cameras/PanoramaCamera")
  3031. , h = e("../cameras/DollhouseCamera")
  3032. , u = e("../cameras/FloorplanCamera")
  3033. , r = e("events").EventEmitter
  3034. , d = e("../enum/ControlEvents")
  3035. , o = e("../enum/ModelManagerEvents")
  3036. , p = e("../enum/Viewmode")
  3037. , f = e("../settings");
  3038. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3039. this.setUpControls(),
  3040. this.bindEvents(e, t)
  3041. }
  3042. ,
  3043. n.prototype.activateControls = function(e) {
  3044. this.activeControl && (this.activeControl.reset(),
  3045. this.activeControl.enabled = !1),
  3046. this.controls[e] && (this.controls[e].enabled = !0),
  3047. this.activeControl = this.controls[e]
  3048. }
  3049. ,
  3050. n.prototype.setUpControls = function() {
  3051. var i = {}
  3052. , n = {}
  3053. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3054. , r = [c, h, u]
  3055. , o = [a, s, l];
  3056. e.forEach(function(e, t) {
  3057. i[e] = new r[t],
  3058. n[e] = new o[t](i[e]),
  3059. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3060. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3061. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3062. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3063. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3064. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3065. }
  3066. .bind(this)),
  3067. this.controls = n,
  3068. this.cameras = i
  3069. }
  3070. ,
  3071. n.prototype.bindEvents = function(e, t) {
  3072. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3073. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3074. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3075. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3076. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3077. passive: !1
  3078. }),
  3079. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3080. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3081. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3082. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3083. e.addEventListener("contextmenu", function(e) {
  3084. e.preventDefault()
  3085. }),
  3086. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3087. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3088. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3089. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3090. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3091. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3092. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3093. t.on(o.ActiveModelChanged, function(e) {
  3094. this.setModelForControls(e.model)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.setModelForControls = function(e) {
  3100. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3101. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3102. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3103. this.controls[e].setBounds(t)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.onMouseDown = function(e) {
  3109. e.preventDefault(),
  3110. this.activeControl && this.activeControl.onMouseDown(e)
  3111. }
  3112. ,
  3113. n.prototype.onMouseMove = function(e) {
  3114. e.preventDefault(),
  3115. this.activeControl && this.activeControl.onMouseMove(e)
  3116. }
  3117. ,
  3118. n.prototype.onMouseUp = function(e) {
  3119. e.preventDefault(),
  3120. this.activeControl && this.activeControl.onMouseUp(e)
  3121. }
  3122. ,
  3123. n.prototype.onMouseOver = function(e) {
  3124. e.preventDefault(),
  3125. this.activeControl && this.activeControl.onMouseOver(e)
  3126. }
  3127. ,
  3128. n.prototype.onMouseWheel = function(e) {
  3129. e.preventDefault(),
  3130. this.activeControl && this.activeControl.onMouseWheel(e)
  3131. }
  3132. ,
  3133. n.prototype.onTouchStart = function(e) {
  3134. e.preventDefault(),
  3135. this.activeControl && this.activeControl.onTouchStart(e),
  3136. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3137. $("#hotListContent ul .active").removeClass("active"),
  3138. $("#hotList")[0].classList.remove("active")
  3139. }
  3140. ,
  3141. n.prototype.onTouchMove = function(e) {
  3142. e.preventDefault(),
  3143. this.activeControl && this.activeControl.onTouchMove(e)
  3144. }
  3145. ,
  3146. n.prototype.onTouchEnd = function(e) {
  3147. e.preventDefault(),
  3148. this.activeControl && this.activeControl.onTouchEnd(e)
  3149. }
  3150. ,
  3151. n.prototype.onPointerDown = function(e) {
  3152. if (e.preventDefault(),
  3153. this.activeControl)
  3154. switch (e.pointerType) {
  3155. case "mouse":
  3156. this.activeControl.onMouseDown(e);
  3157. break;
  3158. default:
  3159. this.activeControl.onPointerDown(e)
  3160. }
  3161. }
  3162. ,
  3163. n.prototype.onPointerMove = function(e) {
  3164. if (e.preventDefault(),
  3165. this.activeControl)
  3166. switch (e.pointerType) {
  3167. case "mouse":
  3168. this.activeControl.onMouseMove(e);
  3169. break;
  3170. default:
  3171. this.activeControl.onPointerMove(e)
  3172. }
  3173. }
  3174. ,
  3175. n.prototype.onPointerUp = function(e) {
  3176. if (e.preventDefault(),
  3177. this.activeControl)
  3178. switch (e.pointerType) {
  3179. case "mouse":
  3180. this.activeControl.onMouseUp(e);
  3181. break;
  3182. default:
  3183. this.activeControl.onPointerUp(e)
  3184. }
  3185. }
  3186. ,
  3187. n.prototype.onPointerCancel = function(e) {
  3188. e.preventDefault(),
  3189. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3190. }
  3191. ,
  3192. n.prototype.onKeyDown = function(e) {
  3193. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3194. this.activeControl && this.activeControl.onKeyDown(e))
  3195. }
  3196. ,
  3197. n.prototype.onKeyUp = function(e) {
  3198. e.preventDefault(),
  3199. this.activeControl && this.activeControl.onKeyUp(e)
  3200. }
  3201. ,
  3202. t.exports = n
  3203. }
  3204. , {
  3205. "../cameras/DollhouseCamera": 5,
  3206. "../cameras/FloorplanCamera": 6,
  3207. "../cameras/PanoramaCamera": 7,
  3208. "../enum/ControlEvents": 21,
  3209. "../enum/ModelManagerEvents": 33,
  3210. "../enum/Viewmode": 51,
  3211. "../settings": 166,
  3212. "./DollhouseControls": 10,
  3213. "./FloorplanControls": 11,
  3214. "./PanoramaControls": 13,
  3215. events: 202
  3216. }],
  3217. 10: [function(e, t, i) {
  3218. "use strict";
  3219. function n(e) {
  3220. a.call(this, e),
  3221. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3222. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3223. this.minDistance = o.dollhouseDefault.minDistance,
  3224. this.maxDistance = o.dollhouseDefault.maxDistance,
  3225. this.adjustedMinDistance = this.minDistance,
  3226. this.adjustedMaxDistance = this.maxDistance
  3227. }
  3228. var r = e("three")
  3229. , o = e("../settings")
  3230. , a = e("./OutsideControls");
  3231. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3232. this.camera.updateMatrix();
  3233. var i = this.camera.position.clone().sub(this.target).length();
  3234. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3235. this.panLeft(2 * e * i / $("#player").height()),
  3236. this.panUp(-2 * t * i / $("#player").height())
  3237. }
  3238. ,
  3239. n.prototype.updateZoom = function() {
  3240. return this.offset.length() * this.scale
  3241. }
  3242. ,
  3243. n.prototype.setZoomBounds = function(e) {
  3244. var t = e.min.distanceTo(e.max);
  3245. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3246. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3247. this.minDistance = this.adjustedMinDistance,
  3248. this.maxDistance = this.adjustedMaxDistance
  3249. }
  3250. ,
  3251. n.prototype.resetRanges = function(e, t) {
  3252. e ? (this.minDistance = Math.min(e, this.minDistance),
  3253. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3254. this.maxDistance = this.adjustedMaxDistance),
  3255. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3256. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3257. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3258. }
  3259. ,
  3260. n.prototype.toJSON = function() {
  3261. return a.prototype.toJSON.call(this)
  3262. }
  3263. ,
  3264. t.exports = n
  3265. }
  3266. , {
  3267. "../settings": 166,
  3268. "./OutsideControls": 12,
  3269. three: 217
  3270. }],
  3271. 11: [function(e, t, i) {
  3272. "use strict";
  3273. function n(e) {
  3274. c.call(this, e),
  3275. this.minDistance = 15,
  3276. this.maxDistance = 50,
  3277. this.noRotateUpDown = !0,
  3278. this.minPolarAngle = 0,
  3279. this.maxPolarAngle = 0,
  3280. this.mouseActions[u.LEFT] = h.PAN,
  3281. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3282. this.mouseActions[u.RIGHT] = h.ROTATE,
  3283. this.touchActions[1] = h.PAN,
  3284. this.touchActions[2] = h.ROTATE_DOLLY,
  3285. this.absoluteScale = 1,
  3286. this.currentScale = 1
  3287. }
  3288. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3289. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3290. var t = Math.max(e.x, e.z)
  3291. , i = Math.min(e.x, e.z)
  3292. , n = Math.max(t, i * this.camera.aspect)
  3293. , r = Math.max(i, t * this.camera.aspect);
  3294. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3295. this.currentScale = this.absoluteScale
  3296. }
  3297. ,
  3298. n.prototype.rotateToView = function(e, t) {
  3299. var i = 0;
  3300. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3301. this.rotateLeft(i),
  3302. this.update(0)
  3303. }
  3304. ,
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix(),
  3307. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3308. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3309. }
  3310. ,
  3311. n.prototype.updateZoom = function() {
  3312. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3313. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3314. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3315. this.camera.left = -l.orthoBase * this.currentScale,
  3316. this.camera.right = l.orthoBase * this.currentScale,
  3317. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3318. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3319. this.camera.updateProjectionMatrix(),
  3320. this.offset.length()
  3321. }
  3322. ,
  3323. n.prototype.toJSON = (r = new s.Quaternion,
  3324. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3325. a = new s.Quaternion,
  3326. function() {
  3327. var e = c.prototype.toJSON.call(this);
  3328. return r.copy(e.camera_quaternion),
  3329. a.copy(o),
  3330. a.multiply(r),
  3331. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3332. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3333. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3334. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3335. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3336. e
  3337. }
  3338. ),
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../enum/ControlActions": 20,
  3343. "../enum/MouseButton": 34,
  3344. "../settings": 166,
  3345. "../util/browser": 182,
  3346. "../util/math": 190,
  3347. "./OutsideControls": 12,
  3348. three: 217
  3349. }],
  3350. 12: [function(e, t, i) {
  3351. "use strict";
  3352. function n(e) {
  3353. this.camera = e,
  3354. (this.camera.controls = this).enabled = !1,
  3355. this.target = new a.Vector3,
  3356. this.targetBounds = new a.Box3,
  3357. this.zoomSpeed = 2,//编辑时缩放快一些
  3358. this.minDistance = 0,
  3359. this.maxDistance = 1 / 0,
  3360. this.noRotateUpDown = !1,
  3361. this.rotateSpeed = 1,
  3362. this.keyboardZoomSpeed = 0,
  3363. this.keyPanSpeed = 7,
  3364. this.autoRotate = !1,
  3365. this.autoRotateSpeed = 2,
  3366. this.autoPan = !1,
  3367. this.autoPanPosition = new a.Vector3,
  3368. this.minPolarAngle = a.Math.degToRad(25),
  3369. this.maxPolarAngle = a.Math.degToRad(65),
  3370. this.rotationAcceleration = new a.Vector2,
  3371. this.rotationSpeed = new a.Vector2,
  3372. this.panAcceleration = new a.Vector2,
  3373. this.panSpeed = new a.Vector2,
  3374. this.rotateStart = new a.Vector2,
  3375. this.rotateEnd = new a.Vector2,
  3376. this.rotateDelta = new a.Vector2,
  3377. this.panStart = new a.Vector2,
  3378. this.panEnd = new a.Vector2,
  3379. this.panDelta = new a.Vector2,
  3380. this.panOffset = new a.Vector3,
  3381. this.offset = new a.Vector3,
  3382. this.dollyStart = new a.Vector2,
  3383. this.dollyEnd = new a.Vector2,
  3384. this.dollyDelta = new a.Vector2,
  3385. this.phiDelta = 0,
  3386. this.thetaDelta = 0,
  3387. this.scale = 1,
  3388. this.panVector = new a.Vector3,
  3389. this.lastPosition = new a.Vector3,
  3390. this.state = u.NONE,
  3391. this.mouseActions = {},
  3392. this.mouseActions[d.LEFT] = u.ROTATE,
  3393. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3394. this.mouseActions[d.RIGHT] = u.PAN,
  3395. this.touchActions = {},
  3396. this.touchActions[1] = u.ROTATE,
  3397. this.touchActions[2] = u.PAN_DOLLY,
  3398. this.lastMoveTime = 0,
  3399. this.pointersLimit = 2,
  3400. this.pointers = []
  3401. }
  3402. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3403. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3404. this.targetBounds = e
  3405. }
  3406. ,
  3407. n.prototype.isEngaged = function() {
  3408. return this.state !== u.NONE
  3409. }
  3410. ,
  3411. n.prototype.rotateLeft = function(e) {
  3412. void 0 === e && (e = this.getAutoRotationAngle()),
  3413. this.thetaDelta -= e
  3414. }
  3415. ,
  3416. n.prototype.rotateUp = function(e) {
  3417. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3418. this.phiDelta -= e)
  3419. }
  3420. ,
  3421. n.prototype.panLeft = function(e) {
  3422. var t = this.camera.matrix.elements;
  3423. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3424. this.panOffset.multiplyScalar(-e),
  3425. this.panVector.add(this.panOffset)
  3426. }
  3427. ,
  3428. n.prototype.panUp = function(e) {
  3429. var t = this.camera.matrix.elements;
  3430. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3431. this.panOffset.multiplyScalar(-e),
  3432. this.panVector.add(this.panOffset)
  3433. }
  3434. ,
  3435. n.prototype.startRotating = function(e, t) {
  3436. e && this.navRotationAcc("x", e),
  3437. t && this.navRotationAcc("y", t)
  3438. }
  3439. ,
  3440. n.prototype.stopRotating = function(e) {
  3441. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3442. this.navRotationAcc("x", 0),
  3443. this.navRotationAcc("y", 0)
  3444. }
  3445. ,
  3446. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3447. o = new a.Vector3,
  3448. function(e, t) {
  3449. r.copy(this.camera.position),
  3450. void 0 === e && null === e || r.setX(e),
  3451. void 0 === t && null === t || r.setZ(t);
  3452. var i = this.camera.position.distanceTo(this.target)
  3453. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3454. this.targetClamped = !1,
  3455. o.copy(r).addScaledVector(n, i),
  3456. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3457. r.copy(o).addScaledVector(n, -i),
  3458. this.targetClamped = !0),
  3459. this.autoPanPosition.x = r.x,
  3460. this.autoPanPosition.z = r.z,
  3461. this.autoPan && this.stopAutoPanning()
  3462. }
  3463. ),
  3464. n.prototype.stopAutoPanning = function() {
  3465. var e = this.autoPan;
  3466. this.autoPan = !1,
  3467. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3468. }
  3469. ,
  3470. n.prototype.dollyIn = function(e) {
  3471. void 0 === e && (e = this.getZoomScale()),
  3472. this.scale /= e
  3473. }
  3474. ,
  3475. n.prototype.dollyOut = function(e) {
  3476. void 0 === e && (e = this.getZoomScale()),
  3477. this.scale *= e
  3478. }
  3479. ,
  3480. n.prototype.updatePan = function(e) {
  3481. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3482. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3483. this.autoPan) {
  3484. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3485. t.setY(0).clampLength(0, 50 * e),
  3486. this.target.add(t),
  3487. this.camera.position.add(t),
  3488. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3489. this.stopAutoPanning())
  3490. }
  3491. }
  3492. ,
  3493. n.prototype.update = function(e) {
  3494. e = e || 1 / 60,
  3495. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3496. this.rotateLeft(-this.rotationSpeed.x),
  3497. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3498. this.updatePan(e);
  3499. var t = this.camera.position;
  3500. this.offset.copy(t).sub(this.target);
  3501. var i = Math.atan2(this.offset.x, this.offset.z)
  3502. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3503. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3504. i += this.thetaDelta,
  3505. n += this.phiDelta,
  3506. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3507. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3508. var r = this.updateZoom();
  3509. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3510. this.target.add(this.panVector),
  3511. this.targetBounds.clampPoint(this.target, this.target),
  3512. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3513. this.offset.y = r * Math.cos(n),
  3514. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3515. t.copy(this.target).add(this.offset),
  3516. this.camera.lookAt(this.target),
  3517. this.thetaDelta = 0,
  3518. this.phiDelta = 0,
  3519. this.scale = 1,
  3520. this.panVector.set(0, 0, 0),
  3521. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3522. }
  3523. ,
  3524. n.prototype.getAutoRotationAngle = function() {
  3525. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3526. }
  3527. ,
  3528. n.prototype.getZoomScale = function() {
  3529. return Math.pow(.95, this.zoomSpeed)
  3530. }
  3531. ,
  3532. n.prototype.onMouseDown = function(e) {
  3533. if (this.enabled) {
  3534. switch (e.preventDefault(),
  3535. this.stopAutoPanning(),
  3536. this.mouseDown = !0,
  3537. this.state = this.mouseActions[e.button],
  3538. this.state) {
  3539. case u.ROTATE:
  3540. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3541. this.rotationSpeed.set(0, 0);
  3542. break;
  3543. case u.DOLLY:
  3544. this.dollyStart.set(e.clientX, e.clientY);
  3545. break;
  3546. case u.PAN:
  3547. this.panStart.set(e.clientX, e.clientY)
  3548. }
  3549. this.emit(f.InputStart, "mouse")
  3550. }
  3551. }
  3552. ,
  3553. n.prototype.onMouseMove = function(e) {
  3554. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3555. switch (e.preventDefault(),
  3556. this.state) {
  3557. case u.ROTATE:
  3558. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3559. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3560. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3561. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3562. this.rotateStart.copy(this.rotateEnd);
  3563. break;
  3564. case u.DOLLY:
  3565. this.dollyEnd.set(e.clientX, e.clientY),
  3566. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3567. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3568. this.dollyStart.copy(this.dollyEnd);
  3569. break;
  3570. case u.PAN:
  3571. this.panEnd.set(e.clientX, e.clientY),
  3572. this.panDelta.subVectors(this.panEnd, this.panStart),
  3573. this.pan(this.panDelta.x, this.panDelta.y),
  3574. this.panStart.copy(this.panEnd)
  3575. }
  3576. this.emit(f.Move, "mouse"),
  3577. this.lastMoveTime = e.timeStamp,
  3578. this.update()
  3579. }
  3580. }
  3581. ,
  3582. n.prototype.onMouseUp = function(e) {
  3583. this.enabled && (this.mouseDown = !1,
  3584. this.state = u.NONE,
  3585. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3586. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3587. this.update(),
  3588. this.rotationAcceleration.set(0, 0),
  3589. this.rotateDelta.set(0, 0)))
  3590. }
  3591. ,
  3592. n.prototype.onMouseOver = function(e) {
  3593. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3594. }
  3595. ,
  3596. n.prototype.onMouseWheel = function(e) {
  3597. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3598. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3599. this.update())
  3600. }
  3601. ,
  3602. n.prototype.onKeyDown = function(e) {
  3603. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3604. this.handleKeyDown(e.which)))
  3605. }
  3606. ,
  3607. n.prototype.navRotationAcc = function(e, t) {
  3608. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3609. }
  3610. ,
  3611. n.prototype.navPanAcc = function(e, t) {
  3612. this.stopAutoPanning(),
  3613. this.panAcceleration[e] = t
  3614. }
  3615. ,
  3616. n.prototype.handleKeyDown = function(e) {
  3617. var t = !0;
  3618. switch (e) {
  3619. case p.UPARROW:
  3620. case p.I:
  3621. this.navRotationAcc("y", 1);
  3622. break;
  3623. case p.DOWNARROW:
  3624. case p.K:
  3625. this.navRotationAcc("y", -1);
  3626. break;
  3627. case p.LEFTARROW:
  3628. case p.J:
  3629. this.navRotationAcc("x", -1);
  3630. break;
  3631. case p.RIGHTARROW:
  3632. case p.L:
  3633. this.navRotationAcc("x", 1);
  3634. break;
  3635. case p.W:
  3636. this.navPanAcc("y", 1);
  3637. break;
  3638. case p.S:
  3639. this.navPanAcc("y", -1);
  3640. break;
  3641. case p.A:
  3642. this.navPanAcc("x", -1);
  3643. break;
  3644. case p.D:
  3645. this.navPanAcc("x", 1);
  3646. break;
  3647. default:
  3648. t = !1
  3649. }
  3650. t && this.emit(f.Move, "key")
  3651. }
  3652. ,
  3653. n.prototype.onKeyUp = function(e) {
  3654. this.enabled && (e.preventDefault(),
  3655. e.stopPropagation(),
  3656. this.handleKeyUp(e.which))
  3657. }
  3658. ,
  3659. n.prototype.handleKeyUp = function(e) {
  3660. switch (e) {
  3661. case p.I:
  3662. case p.K:
  3663. case p.UPARROW:
  3664. case p.DOWNARROW:
  3665. this.keyboardZoomSpeed = 0,
  3666. this.rotationAcceleration.y = 0;
  3667. break;
  3668. case p.J:
  3669. case p.L:
  3670. case p.LEFTARROW:
  3671. case p.RIGHTARROW:
  3672. this.rotationAcceleration.x = 0;
  3673. break;
  3674. case p.S:
  3675. case p.W:
  3676. this.panAcceleration.y = 0;
  3677. break;
  3678. case p.A:
  3679. case p.D:
  3680. this.panAcceleration.x = 0
  3681. }
  3682. }
  3683. ,
  3684. n.prototype.onTouchStart = function(i) {
  3685. if (this.enabled || this.state === u.NONE) {
  3686. i.preventDefault(),
  3687. i.stopPropagation(),
  3688. this.stopAutoPanning();
  3689. var e = function() {
  3690. if (2 === i.touches.length) {
  3691. var e = i.touches[0].pageX - i.touches[1].pageX
  3692. , t = i.touches[0].pageY - i.touches[1].pageY;
  3693. this.dollyStart.set(e, t)
  3694. }
  3695. }
  3696. .bind(this)
  3697. , t = function() {
  3698. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3699. }
  3700. .bind(this)
  3701. , n = function() {
  3702. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3703. }
  3704. .bind(this);
  3705. switch (this.state = this.touchActions[i.touches.length],
  3706. this.state) {
  3707. case u.PAN_DOLLY:
  3708. e();
  3709. case u.PAN:
  3710. t();
  3711. break;
  3712. case u.ROTATE_DOLLY:
  3713. e();
  3714. case u.ROTATE:
  3715. n()
  3716. }
  3717. this.rotationSpeed.set(0, 0),
  3718. this.emit(f.InputStart, "touch")
  3719. }
  3720. }
  3721. ,
  3722. n.prototype.onTouchMove = function(a) {
  3723. if (this.enabled && this.state !== u.NONE) {
  3724. a.preventDefault(),
  3725. a.stopPropagation();
  3726. var s = function() {
  3727. var e = a.touches[0].pageX - a.touches[1].pageX
  3728. , t = a.touches[0].pageY - a.touches[1].pageY;
  3729. this.dollyEnd.set(e, t);
  3730. var i = this.dollyStart.length() - this.dollyEnd.length();
  3731. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3732. this.dollyStart.copy(this.dollyEnd)
  3733. }
  3734. .bind(this)
  3735. , e = function() {
  3736. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3737. this.panDelta.subVectors(this.panEnd, this.panStart),
  3738. this.pan(this.panDelta.x, this.panDelta.y),
  3739. this.panStart.copy(this.panEnd),
  3740. this.rotateDelta.set(0, 0)
  3741. }
  3742. .bind(this)
  3743. , l = function() {
  3744. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd)
  3749. }
  3750. .bind(this)
  3751. , t = function() {
  3752. if (2 === a.touches.length) {
  3753. var e = window.devicePixelRatio || 1
  3754. , t = a.touches[1].pageX - a.touches[0].pageX
  3755. , i = a.touches[1].pageY - a.touches[0].pageY
  3756. , n = Math.sqrt(t * t + i * i);
  3757. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3758. this.state = u.DOLLY,
  3759. s();
  3760. else {
  3761. var r = h.average(a.touches, "pageX")
  3762. , o = h.average(a.touches, "pageY");
  3763. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3764. this.rotateStart.set(r, o),
  3765. l())
  3766. }
  3767. }
  3768. }
  3769. .bind(this);
  3770. switch (this.state) {
  3771. case u.PAN_DOLLY:
  3772. s();
  3773. case u.PAN:
  3774. e();
  3775. break;
  3776. case u.ROTATE_DOLLY:
  3777. t();
  3778. break;
  3779. case u.DOLLY:
  3780. s();
  3781. break;
  3782. case u.ROTATE:
  3783. l();
  3784. break;
  3785. default:
  3786. this.state = u.NONE
  3787. }
  3788. this.lastMoveTime = a.timeStamp,
  3789. this.emit(f.Move, "touch")
  3790. }
  3791. }
  3792. ,
  3793. n.prototype.onTouchEnd = function(e) {
  3794. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3795. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3796. this.state = u.NONE,
  3797. this.update(),
  3798. this.rotationAcceleration.set(0, 0),
  3799. this.rotateDelta.set(0, 0))
  3800. }
  3801. ,
  3802. n.prototype.onPointerDown = function(e) {
  3803. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3804. id: e.pointerId,
  3805. pageX: e.pageX,
  3806. pageY: e.pageY
  3807. }),
  3808. e.touches = this.pointers,
  3809. this.onTouchStart(e)),
  3810. this.emit(f.InputStart, "pointer"))
  3811. }
  3812. ,
  3813. n.prototype.onPointerMove = function(t) {
  3814. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3815. t.pointerId === e.id && (e.pageX = t.pageX,
  3816. e.pageY = t.pageY)
  3817. }),
  3818. t.touches = this.pointers,
  3819. this.onTouchMove(t))
  3820. }
  3821. ,
  3822. n.prototype.onPointerUp = function(i) {
  3823. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3824. i.pointerId === e.id && this.pointers.splice(t, 1)
  3825. }
  3826. .bind(this)),
  3827. i.touches = this.pointers,
  3828. this.onTouchEnd(i))
  3829. }
  3830. ,
  3831. n.prototype.reset = function() {
  3832. this.state = u.NONE,
  3833. this.stopAutoPanning(),
  3834. this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0),
  3836. this.panSpeed.set(0, 0),
  3837. this.panAcceleration.set(0, 0)
  3838. }
  3839. ,
  3840. n.prototype.toJSON = function() {
  3841. return {
  3842. camera_position: {
  3843. x: s.toPrecision(this.camera.position.x, 4),
  3844. y: s.toPrecision(this.camera.position.y, 4),
  3845. z: s.toPrecision(this.camera.position.z, 4)
  3846. },
  3847. camera_quaternion: {
  3848. x: s.toPrecision(this.camera.quaternion.x, 4),
  3849. y: s.toPrecision(this.camera.quaternion.y, 4),
  3850. z: s.toPrecision(this.camera.quaternion.z, 4),
  3851. w: s.toPrecision(this.camera.quaternion.w, 4)
  3852. }
  3853. }
  3854. }
  3855. ,
  3856. t.exports = n
  3857. }
  3858. , {
  3859. "../enum/ControlActions": 20,
  3860. "../enum/ControlEvents": 21,
  3861. "../enum/Keys": 30,
  3862. "../enum/MouseButton": 34,
  3863. "../enum/Vectors": 50,
  3864. "../settings": 166,
  3865. "../util/common": 185,
  3866. "../util/math": 190,
  3867. events: 202,
  3868. three: 217
  3869. }],
  3870. 13: [function(u, d, e) {
  3871. (function(e) {
  3872. "use strict";
  3873. function t(e) {
  3874. this.camera = e,
  3875. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3876. this.lookVector = new s.Vector3,
  3877. this.lookSpeed = .05,
  3878. this.rotationAcc = new s.Vector2,
  3879. this.rotationSpeed = new s.Vector2,
  3880. this.lat = 0,
  3881. this.lon = 0,
  3882. this.phi = 0,
  3883. this.theta = 0,
  3884. this.enabled = !1,
  3885. this.locked = !1,
  3886. this.pointer = new s.Vector2(0,0),
  3887. this.rotationHistory = [],
  3888. this.rotationDifference = new s.Vector2,
  3889. this.pointerDragOn = !1,
  3890. this.pointerDragStart = new s.Vector2(0,0),
  3891. this.pinchDistance = 0,
  3892. this.moveStart = new s.Vector2,
  3893. this.moveTolerance = .01,
  3894. this.pointersLimit = 2,
  3895. this.pointers = []
  3896. }
  3897. var s = u("three")
  3898. , i = u("../util/logger")
  3899. , n = u("../settings")
  3900. , r = u("../util/common")
  3901. , o = u("../util/math")
  3902. , a = (u("../enum/Vectors"),
  3903. u("../enum/MouseButton"))
  3904. , l = u("../enum/Keys")
  3905. , c = u("../enum/ControlEvents")
  3906. , h = u("events").EventEmitter;
  3907. new i(e),
  3908. (t.prototype = Object.create(h.prototype)).usable = function() {
  3909. return this.enabled && !this.locked
  3910. }
  3911. ,
  3912. t.prototype.lookAt = function(e) {
  3913. var t = this.camera.position.clone().sub(e)
  3914. , i = Math.atan(t.z / t.x);
  3915. i += t.x < 0 ? Math.PI : 0,
  3916. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3917. this.lon = s.Math.radToDeg(i) + 180;
  3918. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3919. , r = Math.atan(t.y / n);
  3920. this.lat = -s.Math.radToDeg(r)
  3921. }
  3922. ,
  3923. t.prototype.startRotationFrom = function(e, t) {
  3924. o.convertScreenPositionToNDC(e, t, this.pointer),
  3925. this.pointerDragOn = !0,
  3926. this.pointerDragStart.copy(this.pointer),
  3927. this.moveStart.copy(this.pointer),
  3928. this.rotationHistory = [],
  3929. this.rotationSpeed.set(0, 0)
  3930. }
  3931. ,
  3932. t.prototype.onMouseOver = function(e) {
  3933. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3934. }
  3935. ,
  3936. t.prototype.onTouchStart = function(e) {
  3937. if (this.usable()) {
  3938. switch (e.preventDefault(),
  3939. e.stopPropagation(),
  3940. e.touches.length) {
  3941. case 1:
  3942. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3943. break;
  3944. case 2:
  3945. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3946. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3947. this.pinchDistance = Math.sqrt(t * t + i * i)
  3948. }
  3949. this.emit(c.InputStart, "touch")
  3950. }
  3951. }
  3952. ,
  3953. t.prototype.onPointerDown = function(e) {
  3954. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3955. id: e.pointerId,
  3956. clientX: e.clientX,
  3957. clientY: e.clientY
  3958. }),
  3959. e.touches = this.pointers,
  3960. this.onTouchStart(e),
  3961. this.emit(c.InputStart, "pointer"))
  3962. }
  3963. ,
  3964. t.prototype.onMouseDown = function(e) {
  3965. if (this.usable()) {
  3966. switch (e.preventDefault(),
  3967. e.stopPropagation(),
  3968. e.button) {
  3969. case a.LEFT:
  3970. this.startRotationFrom(e.clientX, e.clientY)
  3971. }
  3972. this.emit(c.InputStart, "mouse")
  3973. }
  3974. }
  3975. ,
  3976. t.prototype.updateRotation = function() {
  3977. if (this.usable() && this.pointerDragOn) {
  3978. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3979. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3980. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3981. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3982. , r = Math.atan2(e.y, i)
  3983. , o = Math.atan2(t.y, n);
  3984. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3985. e.y = 0,
  3986. t.y = 0;
  3987. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3988. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  3989. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  3990. this.pointerDragStart.copy(this.pointer)
  3991. }
  3992. }
  3993. ,
  3994. t.prototype.onMouseMove = function(e) {
  3995. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  3996. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  3997. }
  3998. ,
  3999. t.prototype.onTouchMove = function(e) {
  4000. if (this.usable())
  4001. switch (this.emit(c.Move, "touch"),
  4002. e.touches.length) {
  4003. case 1:
  4004. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4005. break;
  4006. case 2:
  4007. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4008. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4009. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4010. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4011. this.emit(c.Pinch, n),
  4012. this.pinchDistance -= n)
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerMove = function(t) {
  4017. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4018. t.pointerId === e.id && (e.clientX = t.clientX,
  4019. e.clientY = t.clientY)
  4020. }),
  4021. t.touches = this.pointers,
  4022. this.onTouchMove(t))
  4023. }
  4024. ,
  4025. t.prototype.endRotation = function() {
  4026. this.pointerDragOn = !1;
  4027. var e = r.averageVectors(this.rotationHistory);
  4028. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4029. }
  4030. ,
  4031. t.prototype.onTouchEnd = function(e) {
  4032. this.usable() && (e.preventDefault(),
  4033. e.stopPropagation(),
  4034. this.endRotation())
  4035. }
  4036. ,
  4037. t.prototype.onMouseUp = function(e) {
  4038. this.usable() && (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. this.endRotation())
  4041. }
  4042. ,
  4043. t.prototype.onPointerUp = function(i) {
  4044. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4045. i.pointerId === e.id && this.pointers.splice(t, 1)
  4046. }
  4047. .bind(this)),
  4048. i.touches = this.pointers,
  4049. this.onTouchEnd(i))
  4050. }
  4051. ,
  4052. t.prototype.update = function(e) {
  4053. for (this.lon,
  4054. this.lat,
  4055. this.updateRotation(),
  4056. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4057. this.rotationHistory.shift();
  4058. this.lon += this.rotationDifference.x,
  4059. this.lat += this.rotationDifference.y,
  4060. this.rotationDifference.set(0, 0),
  4061. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4062. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4063. this.lon += this.rotationSpeed.x * e,
  4064. this.lat += this.rotationSpeed.y * e,
  4065. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4066. this.phi = s.Math.degToRad(90 - this.lat),
  4067. this.theta = s.Math.degToRad(this.lon),
  4068. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4069. this.lookVector.y = Math.cos(this.phi),
  4070. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4071. this.target.copy(this.lookVector).add(this.camera.position),
  4072. this.camera.lookAt(this.target)
  4073. }
  4074. ,
  4075. t.prototype.onMouseWheel = function(e) {
  4076. if (this.usable()) {
  4077. var t = e.wheelDelta || -e.detail;
  4078. this.emit(c.InteractionDirect),
  4079. this.emit(c.Scroll, t)
  4080. }
  4081. }
  4082. ,
  4083. t.prototype.onKeyDown = function(e) {
  4084. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4085. this.handleKeyDown(e.which)))
  4086. }
  4087. ,
  4088. t.prototype.handleKeyDown = function(e) {
  4089. var t = function(e, t) {
  4090. this.rotationAcc[e] = t
  4091. }
  4092. .bind(this);
  4093. this.emit(c.InteractionKey);
  4094. var i = !0;
  4095. switch (e) {
  4096. case l.LEFTARROW:
  4097. case l.J:
  4098. t("x", -1);
  4099. break;
  4100. case l.RIGHTARROW:
  4101. case l.L:
  4102. t("x", 1);
  4103. break;
  4104. case l.I:
  4105. t("y", 1);
  4106. break;
  4107. case l.K:
  4108. t("y", -1);
  4109. break;
  4110. default:
  4111. i = !1
  4112. }
  4113. i && this.emit(c.Move, "key")
  4114. }
  4115. ,
  4116. t.prototype.onKeyUp = function(e) {
  4117. this.usable() && (e.preventDefault(),
  4118. e.stopPropagation(),
  4119. this.handleKeyUp(e.which))
  4120. }
  4121. ,
  4122. t.prototype.handleKeyUp = function(e) {
  4123. switch (e) {
  4124. case l.LEFTARROW:
  4125. case l.J:
  4126. case l.RIGHTARROW:
  4127. case l.L:
  4128. this.rotationAcc.x = 0;
  4129. break;
  4130. case l.I:
  4131. case l.K:
  4132. this.rotationAcc.y = 0
  4133. }
  4134. }
  4135. ,
  4136. t.prototype.startRotating = function(e, t) {
  4137. e && (this.rotationAcc.x = e),
  4138. t && (this.rotationAcc.y = t)
  4139. }
  4140. ,
  4141. t.prototype.stopRotating = function(e) {
  4142. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4143. this.rotationAcc.set(0, 0)
  4144. }
  4145. ,
  4146. t.prototype.reset = function() {
  4147. this.pointerDragOn = !1,
  4148. this.rotationAcc.set(0, 0),
  4149. this.rotationSpeed.set(0, 0),
  4150. this.pointers = []
  4151. }
  4152. ,
  4153. t.prototype.toJSON = function() {
  4154. return {
  4155. camera_position: {
  4156. x: o.toPrecision(this.camera.position.x, 4),
  4157. y: o.toPrecision(this.camera.position.y, 4),
  4158. z: o.toPrecision(this.camera.position.z, 4)
  4159. },
  4160. camera_quaternion: {
  4161. x: o.toPrecision(this.camera.quaternion.x, 4),
  4162. y: o.toPrecision(this.camera.quaternion.y, 4),
  4163. z: o.toPrecision(this.camera.quaternion.z, 4),
  4164. w: o.toPrecision(this.camera.quaternion.w, 4)
  4165. }
  4166. }
  4167. }
  4168. ,
  4169. t.prototype.setStateFromJSON = function(e) {
  4170. this.camera.position.copy(e.camera_position),
  4171. this.camera.quaternion.copy(e.camera_quaternion)
  4172. }
  4173. ,
  4174. d.exports = t
  4175. }
  4176. ).call(this, "/js/controls/PanoramaControls.js")
  4177. }
  4178. , {
  4179. "../enum/ControlEvents": 21,
  4180. "../enum/Keys": 30,
  4181. "../enum/MouseButton": 34,
  4182. "../enum/Vectors": 50,
  4183. "../settings": 166,
  4184. "../util/common": 185,
  4185. "../util/logger": 189,
  4186. "../util/math": 190,
  4187. events: 202,
  4188. three: 217
  4189. }],
  4190. 14: [function(t, i, e) {
  4191. (function(e) {
  4192. "use strict";
  4193. var c = t("three")
  4194. , h = t("../enum/Viewmode")
  4195. , u = new (t("../util/logger"))(e);
  4196. i.exports = {
  4197. serialize: function(e) {
  4198. return encodeURI(JSON.stringify(e))
  4199. },
  4200. deserialize: function(e) {
  4201. function t(e) {
  4202. return e.reduce(function(e, t) {
  4203. return e && "number" == typeof t && !isNaN(t)
  4204. }, !0)
  4205. }
  4206. try {
  4207. var i = JSON.parse(decodeURI(e))
  4208. , n = {
  4209. mode: h.fromInt(i.camera_mode),
  4210. panoId: i.scan_id,
  4211. position: (new c.Vector3).copy(i.camera_position),
  4212. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4213. zoom: i.ortho_zoom,
  4214. floorVisibility: i.floor_visibility
  4215. }
  4216. , r = n.position;
  4217. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4218. var o = n.quaternion;
  4219. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4220. n
  4221. } catch (i) {
  4222. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4223. try {
  4224. var a = e.split(",")
  4225. , s = {
  4226. x: parseFloat(a[2]),
  4227. y: parseFloat(a[3]),
  4228. z: parseFloat(a[4])
  4229. }
  4230. , l = {
  4231. x: parseFloat(a[5]),
  4232. y: parseFloat(a[6]),
  4233. z: parseFloat(a[7]),
  4234. w: parseFloat(a[8])
  4235. };
  4236. return t([s.x, s.y, s.z]) || (s.x = 0,
  4237. s.y = 0,
  4238. s.z = 0),
  4239. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4240. l.y = 0,
  4241. l.z = 0,
  4242. l.w = 1),
  4243. {
  4244. mode: h.fromInt(a[0]),
  4245. panoId: a[1],
  4246. position: (new c.Vector3).copy(s),
  4247. quaternion: (new c.Quaternion).copy(l)
  4248. }
  4249. } catch (t) {
  4250. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4251. }
  4252. }
  4253. return null
  4254. }
  4255. }
  4256. }
  4257. ).call(this, "/js/controls/serializer.js")
  4258. }
  4259. , {
  4260. "../enum/Viewmode": 51,
  4261. "../util/logger": 189,
  4262. three: 217
  4263. }],
  4264. 15: [function(C, I, e) {
  4265. (function(e) {
  4266. "use strict";
  4267. function t() {
  4268. this.endlessLoop = r.warp.loop,
  4269. this.clock = new i.Clock(!0),
  4270. this.model = null,
  4271. this.player = null,
  4272. this.currentItem = null,
  4273. this.destinationItem = null,
  4274. this.tourIsPlaying = !1,
  4275. this.transitionStage = v.None,
  4276. this.nextFunc = null,
  4277. this.onTheBus = !1,
  4278. this.tourInProgress = !1,
  4279. this.reachSource = null,
  4280. this.interrupted = !1,
  4281. this.nItems = 0,
  4282. this.walkingSectionPaused = !1
  4283. }
  4284. var i = C("three")
  4285. , n = C("./util/logger")
  4286. , r = C("./settings")
  4287. , o = C("./util/transitions")
  4288. , a = C("events").EventEmitter
  4289. , s = C("./enum/Viewmode")
  4290. , l = C("./analytics")
  4291. , c = C("./enum/WarpStyle")
  4292. , h = (o = C("./util/transitions"),
  4293. C("./model/ModelManager"),
  4294. C("./enum/ModelManagerEvents"))
  4295. , u = C("./enum/DirectorEvents")
  4296. , d = C("./enum/PlayerEvents")
  4297. , p = (C("./enum/ControlEvents"),
  4298. C("./enum/BlackoutStyle"))
  4299. , f = C("./enum/PathDiscardMode")
  4300. , g = C("./enum/PathDisplayMode")
  4301. , m = (C("./player"),
  4302. new n(e))
  4303. , v = Object.freeze({
  4304. None: 0,
  4305. Moving: 1,
  4306. Aiming: 2,
  4307. Interlude: 3
  4308. })
  4309. , y = Object.freeze({
  4310. Forward: 1,
  4311. NoChange: 0,
  4312. Backwards: -1
  4313. })
  4314. , A = o.getUniqueId();
  4315. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4316. this.player = e,
  4317. this.modelManager = t,
  4318. this.updateModel(),
  4319. this.resetAll(),
  4320. this.bindEvents()
  4321. }
  4322. ,
  4323. t.prototype.resetAll = function() {
  4324. if (this.currentItem = null,
  4325. this.destinationItem = null,
  4326. this.tourIsPlaying = !1,
  4327. this.bgmReplay(),
  4328. this.transitionStage = v.None,
  4329. this.nextFunc = null,
  4330. this.onTheBus = !1,
  4331. this.reachSource = null,
  4332. this.interrupted = !1,
  4333. this.model) {
  4334. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4335. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4336. } else
  4337. this.defaultWarpStyle = c.BLACK,
  4338. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4339. this.resetSpecialTransition()
  4340. }
  4341. ,
  4342. t.prototype.updateModel = function() {
  4343. this.model = this.modelManager.getActiveModel(),
  4344. this.nItems = this.model.heroLocations.length
  4345. }
  4346. ,
  4347. t.prototype.bindEvents = function() {
  4348. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4349. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4350. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4351. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4352. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4353. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4354. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4355. this.player.once(d.Move, function() {
  4356. o.cancelById(A)
  4357. })
  4358. }
  4359. ,
  4360. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4361. return e === c.WALK && (this.interrupt(p.NONE),
  4362. this.pauseWalkingSection(),
  4363. this.player.fastForwardActivePanoFlight(),
  4364. !0)
  4365. }
  4366. ,
  4367. t.prototype.handlePlayerMove = function(e) {
  4368. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4369. this.emit("update.controls")
  4370. }
  4371. ,
  4372. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4373. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4374. this.emit("update.controls"))
  4375. }
  4376. ,
  4377. t.prototype.handlePlayerModeChanged = function(e, t) {
  4378. this.intermediateState() || e === t || (this.onTheBus = !1,
  4379. this.emit("update.controls"))
  4380. }
  4381. ,
  4382. t.prototype.handlePlayerInputStart = function(e) {
  4383. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4384. }
  4385. ,
  4386. t.prototype.handlePlayerFlyingStarted = function() {
  4387. this.clearWalkingSectionPaused()
  4388. }
  4389. ,
  4390. t.prototype.describe = function() {
  4391. return {
  4392. nItems: this.nItems,
  4393. currentItem: this.currentItem,
  4394. destinationItem: this.destinationItem,
  4395. tourIsPlaying: this.tourIsPlaying,
  4396. onTheBus: this.onTheBus,
  4397. endlessLoop: this.endlessLoop,
  4398. viewMode: this.player.mode,
  4399. inTransition: this._inTransition(),
  4400. transitionStage: this.transitionStage,
  4401. tourInProgress: this.tourInProgress
  4402. }
  4403. }
  4404. ,
  4405. t.prototype._inTransition = function() {
  4406. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4407. }
  4408. ,
  4409. t.prototype.bounceable = function() {
  4410. var e = this.clock.getDelta();
  4411. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4412. }
  4413. ,
  4414. t.prototype.currentMoveDirection = function() {
  4415. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4416. }
  4417. ,
  4418. t.prototype.clearPath = function() {
  4419. this._inTransition() || this.player.path.discardPathObject()
  4420. }
  4421. ,
  4422. t.prototype.allFloors = function() {
  4423. this.model.toggleAllFloors()
  4424. }
  4425. ,
  4426. t.prototype.actionComplete = function(e) {
  4427. if (this.interrupted = !1,
  4428. this.transitionStage = v.None,
  4429. this.resetSpecialTransition(),
  4430. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4431. this.tourIsPlaying || (this.player.disablePreRendering(),
  4432. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4433. this.emit("update.controls"),
  4434. this.nextFunc) {
  4435. var t = this.nextFunc;
  4436. this.nextFunc = null,
  4437. t()
  4438. }
  4439. }
  4440. ,
  4441. t.prototype.awaitCompletion = function(e, t) {
  4442. this.nextFunc = t,
  4443. e()
  4444. }
  4445. ,
  4446. t.prototype.updateSuccessFunction = function(e) {
  4447. this.nextFunc = e
  4448. }
  4449. ,
  4450. t.prototype.interrupt = function(e, t) {
  4451. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4452. this.tourIsPlaying = !1,
  4453. this.bgmReplay(),
  4454. this.interrupted = !0,
  4455. this.nextFunc = null,
  4456. this.emit(u.ActionInterrupted),
  4457. null != e || (e = p.BEGINNING),
  4458. this.player.interruptAndFastForward(e, t),
  4459. !0)
  4460. }
  4461. ,
  4462. t.prototype.wouldInterrupt = function() {
  4463. return this.transitionStage !== v.None
  4464. }
  4465. ,
  4466. t.prototype.intermediateState = function() {
  4467. return this.transitionStage !== v.None
  4468. }
  4469. ,
  4470. t.prototype.isInterrupted = function() {
  4471. return this.interrupted
  4472. }
  4473. ,
  4474. t.prototype.pauseWalkingSection = function() {
  4475. this.walkingSectionPaused = !0
  4476. }
  4477. ,
  4478. t.prototype.clearWalkingSectionPaused = function() {
  4479. this.walkingSectionPaused = !1
  4480. }
  4481. ,
  4482. t.prototype.autoTour = function() {
  4483. var i = Date.now();
  4484. this.model.auxDataPromise.then(function() {
  4485. i = Date.now() - i;
  4486. var e = r.warp.auto
  4487. , t = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4488. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4489. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4490. done: function() {
  4491. this.playTour()
  4492. }
  4493. .bind(this),
  4494. name: "_atr",
  4495. id: A
  4496. })
  4497. }
  4498. .bind(this))
  4499. }
  4500. ,
  4501. t.prototype.atDestinationPano = function() {
  4502. if (!this.player.currentPano || null === this.destinationItem)
  4503. return !1;
  4504. var e = this.player.currentPano.id;
  4505. if (void 0 === e)
  4506. return !1;
  4507. var t = this.model.heroLocations;
  4508. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4509. }
  4510. ,
  4511. t.prototype.redirectToItem = function(e, t) {
  4512. if (null != e)
  4513. if (this.wouldInterrupt())
  4514. if (this.player.mode !== s.TRANSITIONING) {
  4515. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4516. var i = function() {
  4517. o.setTimeout(function() {
  4518. this.setDestinationItem(e),
  4519. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4520. }
  4521. .bind(this), 0)
  4522. }
  4523. .bind(this);
  4524. this.interrupt(p.END, 0),
  4525. this.updateSuccessFunction(i)
  4526. } else
  4527. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4528. else
  4529. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4530. else
  4531. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4532. }
  4533. ,
  4534. t.prototype.useSpecialTransition = function(e) {
  4535. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4536. this.nextWarpStyle = c.BLACK
  4537. }
  4538. ,
  4539. t.prototype.resetSpecialTransition = function() {
  4540. this.nextWarpStyle = this.defaultWarpStyle
  4541. }
  4542. ,
  4543. t.prototype.arrivedAtDestination = function(e) {
  4544. if (this.player.flying || this.player.isWarping())
  4545. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4546. else {
  4547. this.transitionStage = v.Aiming;
  4548. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4549. this.player.model.fadePanoMarkers(0),
  4550. this.awaitCompletion(function() {
  4551. this.resetSpecialTransition(),
  4552. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4553. }
  4554. .bind(this), t)
  4555. }
  4556. }
  4557. ,
  4558. t.prototype.goToDestination = function(e, t, i, n) {
  4559. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4560. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4561. if (r && 0 < r.music.length) {
  4562. var o = g_Prefix + r.music;
  4563. g_tourAudio.src = o,
  4564. g_tourAudio.load(),
  4565. g_tourAudio.crossOrigin = "anonymous",
  4566. g_tourAudio.oncanplaythrough = function() {
  4567. g_tourAudio.play();
  4568. if(g_bgAudio && !g_bgAudio.paused){
  4569. manage.switchBgmState(false);
  4570. g_bgAudio.pauseByTour = true
  4571. }
  4572. g_playAudio = g_tourAudio;
  4573. }
  4574. }
  4575. }
  4576. if (this.onTheBus = !0,
  4577. this.emit("update.controls"),
  4578. this.player.updateLastView(),
  4579. n || !this.atDestinationPano())
  4580. if (this.player.flying || this.player.isWarping())
  4581. m.warn("Cannot go to new destination while player is flying or warping.");
  4582. else {
  4583. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4584. , s = null
  4585. , l = null;
  4586. if (a.isPano()) {
  4587. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4588. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4589. s = this.arrivedAtDestination.bind(this, !0)
  4590. } else
  4591. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4592. s = this.arrivedAtDestination.bind(this, !1);
  4593. this.transitionStage = v.Moving,
  4594. this.model.fadePanoMarkers(0),
  4595. this.awaitCompletion(function() {
  4596. l()
  4597. }
  4598. .bind(this), s),
  4599. this.emit("update.controls")
  4600. }
  4601. else
  4602. this.arrivedAtDestination(!0)
  4603. }
  4604. ,
  4605. t.prototype.tourInterlude = function() {
  4606. if (l.trackAlways("reach_highlight", {
  4607. reach_source: this.reachSource
  4608. }),
  4609. this.model.fadePanoMarkers(0),
  4610. this.emit("update.controls"),
  4611. this.tourIsPlaying)
  4612. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4613. this.stopTour(),
  4614. this.emit(u.TourEnd),
  4615. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4616. this.transitionStage = v.Interlude,
  4617. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4618. }
  4619. .bind(this), this.goNext.bind(this))
  4620. }
  4621. ,
  4622. t.prototype.playTour = function() {
  4623. if (!this.bounceable())
  4624. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4625. this.tourInProgress = !0,
  4626. this.reachSource = "play",
  4627. this.tourIsPlaying = !0,
  4628. this.wasZoomEnabled = this.player.zoomEnabled,
  4629. this.player.zoomEnabled = !1,
  4630. this.resetSpecialTransition(),
  4631. this.emit("update.controls"),
  4632. this.emit(u.TourStart),
  4633. this.player.enablePreRendering(),
  4634. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4635. this.goToDestination()) : this.goNext()))
  4636. }
  4637. ,
  4638. t.prototype.bgmReplay = function() {
  4639. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4640. g_playAudio = g_bgAudio;
  4641. g_tourAudio && g_tourAudio.pause();
  4642. //window.tourAudio && window.tourAudio.pause();
  4643. manage.switchBgmState(true);
  4644. }
  4645. }
  4646. ,
  4647. t.prototype.stopTour = function() {
  4648. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4649. this.tourIsPlaying = !1,
  4650. this.bgmReplay(),
  4651. this.interrupt(),
  4652. this.clearWalkingSectionPaused(),
  4653. this.resetSpecialTransition(),
  4654. this.emit("update.controls")),
  4655. window.tourAudio && window.tourAudio.pause(),
  4656. g_tourAudio && 0 == g_tourAudio.paused && (g_tourAudio.pause(),
  4657. g_tourAudio.src = "")
  4658. }
  4659. ,
  4660. t.prototype.endTourProgress = function() {
  4661. this.tourInProgress = !1,
  4662. this.emit("update.controls"),
  4663. this.emit(u.TourEnd)
  4664. }
  4665. ,
  4666. t.prototype.goToHighlight = function(e) {
  4667. if (this.wouldInterrupt())
  4668. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4669. else {
  4670. if (m.debug("<tour.goto " + e + ">"),
  4671. this.isInterrupted())
  4672. return;
  4673. this.clearWalkingSectionPaused(),
  4674. this.setDestinationItem(e),
  4675. this.useSpecialTransition("Hilight"),
  4676. this.goToDestination(),
  4677. l.trackAlways("reach_highlight", {
  4678. reach_source: "thumb"
  4679. })
  4680. }
  4681. }
  4682. ,
  4683. t.prototype.prevHighlight = function() {
  4684. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4685. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4686. this.reachSource = "prev",
  4687. this.goPrev()))
  4688. }
  4689. ,
  4690. t.prototype.nextHighlight = function() {
  4691. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4692. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4693. this.reachSource = "next",
  4694. this.goNext()))
  4695. }
  4696. ,
  4697. t.prototype.changeMode = function(e) {
  4698. var t = $.Deferred()
  4699. , i = t.resolve.bind(t)
  4700. , n = t.reject.bind(t);
  4701. if (this.emit(u.StartModeChange),
  4702. !function() {
  4703. return this.clearWalkingSectionPaused(),
  4704. !!this.wouldInterrupt() && (this.interrupt(),
  4705. !0)
  4706. }
  4707. .bind(this)()) {
  4708. switch (e) {
  4709. case s.PANORAMA:
  4710. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4711. break;
  4712. case s.DOLLHOUSE:
  4713. case s.FLOORPLAN:
  4714. this.player.flyToNewMode({
  4715. mode: e
  4716. }).done(i).fail(n);
  4717. break;
  4718. case s.OUTDOOR:
  4719. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4720. }
  4721. return t.promise()
  4722. }
  4723. }
  4724. ,
  4725. t.prototype.atEndOfTour = function() {
  4726. return this.currentItem >= this.nItems - 1
  4727. }
  4728. ,
  4729. t.prototype.firstDestination = function() {
  4730. return 0 < this.nItems ? 0 : null
  4731. }
  4732. ,
  4733. t.prototype.finalDestination = function() {
  4734. return 0 < this.nItems ? this.nItems - 1 : null
  4735. }
  4736. ,
  4737. t.prototype.goPrev = function() {
  4738. this.tourAdvance(-1)
  4739. }
  4740. ,
  4741. t.prototype.goNext = function() {
  4742. this.tourAdvance(1)
  4743. }
  4744. ,
  4745. t.prototype.setDestinationItem = function(e) {
  4746. this.destinationItem = e,
  4747. this.emit("update.controls")
  4748. }
  4749. ,
  4750. t.prototype.setCurrentItem = function(e) {
  4751. this.currentItem = e,
  4752. this.emit("update.controls")
  4753. }
  4754. ,
  4755. t.prototype.nextItem = function(e) {
  4756. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4757. }
  4758. ,
  4759. t.prototype.prevItem = function(e) {
  4760. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4761. }
  4762. ,
  4763. t.prototype.tourAdvance = function(e) {
  4764. if (m.debug("tourAdvance(" + e + ")"),
  4765. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4766. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4767. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4768. this.useSpecialTransition("looping back to start")),
  4769. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4770. var i = this.player.zoomLevel;
  4771. this.player.zoomEnabled = !0;
  4772. var t = function(e, t) {
  4773. this.player.zoomTo((1 - e) * i, !0)
  4774. }
  4775. .bind(this);
  4776. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4777. }
  4778. this.goToDestination()
  4779. }
  4780. ,
  4781. I.exports = t
  4782. }
  4783. ).call(this, "/js/director.js")
  4784. }
  4785. , {
  4786. "./analytics": 4,
  4787. "./enum/BlackoutStyle": 18,
  4788. "./enum/ControlEvents": 21,
  4789. "./enum/DirectorEvents": 23,
  4790. "./enum/ModelManagerEvents": 33,
  4791. "./enum/PathDiscardMode": 38,
  4792. "./enum/PathDisplayMode": 39,
  4793. "./enum/PlayerEvents": 40,
  4794. "./enum/Viewmode": 51,
  4795. "./enum/WarpStyle": 52,
  4796. "./model/ModelManager": 140,
  4797. "./player": 155,
  4798. "./settings": 166,
  4799. "./util/logger": 189,
  4800. "./util/transitions": 195,
  4801. events: 202,
  4802. three: 217
  4803. }],
  4804. 16: [function(e, t, i) {
  4805. "use strict";
  4806. var n = e("three")
  4807. , r = e("./enum/Viewmode")
  4808. , o = (e("./settings"),
  4809. e("./util/transitions"))
  4810. , a = e("./enum/PlayerEvents")
  4811. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4812. , l = new n.ShaderPass(n.VerticalBlurShader);
  4813. l.renderToScreen = !0;
  4814. var c = $("#player").width() / $("#player").height();
  4815. isNaN(c) && (c = 1);
  4816. var h = {
  4817. currentBlur: 0,
  4818. aspect: c,
  4819. blurStrength: 1,
  4820. hblurPass: s,
  4821. vblurPass: l,
  4822. bindEvents: function(e) {
  4823. e.on(a.ModeChanged, function(e, t) {
  4824. e === r.PANORAMA && (o.cancel(h.blur),
  4825. o.cancel(h.addBlur),
  4826. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4827. })
  4828. },
  4829. blur: function(e) {
  4830. var t = (h.currentBlur = e) * h.blurStrength;
  4831. l.uniforms.v.value = t / 512 * h.aspect,
  4832. s.uniforms.h.value = t / 512
  4833. },
  4834. addBlur: function(e) {
  4835. e = Math.max(e, h.currentBlur),
  4836. h.blur(e)
  4837. },
  4838. removeBlur: function(e) {
  4839. e = Math.min(1 - e, h.currentBlur),
  4840. h.blur(e)
  4841. }
  4842. };
  4843. h.blur(0),
  4844. t.exports = h
  4845. }
  4846. , {
  4847. "./enum/PlayerEvents": 40,
  4848. "./enum/Viewmode": 51,
  4849. "./settings": 166,
  4850. "./util/transitions": 195,
  4851. three: 217
  4852. }],
  4853. 17: [function(e, t, i) {
  4854. "use strict";
  4855. t.exports = {
  4856. UNKNOWN: 0,
  4857. ALIGNED: 1,
  4858. UNALIGNED: 2,
  4859. PLACED: 3
  4860. }
  4861. }
  4862. , {}],
  4863. 18: [function(e, t, i) {
  4864. "use strict";
  4865. t.exports = {
  4866. NONE: 0,
  4867. MIDDLE: 1,
  4868. END: 2,
  4869. BEGINNING: 3,
  4870. FADEIN: 4
  4871. }
  4872. }
  4873. , {}],
  4874. 19: [function(e, t, i) {
  4875. "use strict";
  4876. var r = e("three");
  4877. t.exports = {
  4878. newBlue: new r.Color(4967932),
  4879. altBlue: new r.Color(47355),
  4880. tagDefault: new r.Color(223357),
  4881. classicBlue: new r.Color(53759),
  4882. mpYellow: new r.Color(16502016),
  4883. mpOrange: new r.Color(16428055),
  4884. mpBlue: new r.Color(12096),
  4885. mpLtGrey: new r.Color(13751252),
  4886. mpDkGrey: new r.Color(10000019),
  4887. mpRed: new r.Color(12525854),
  4888. mpOrangeDesat: new r.Color(16764529),
  4889. mpBlueDesat: new r.Color(4034734),
  4890. mpRedDesat: new r.Color(14705505),
  4891. white: new r.Color(16777215),
  4892. black: new r.Color(0),
  4893. _desat: function(e, t) {
  4894. var i = t || .3
  4895. , n = (new r.Color).copy(e).getHSL();
  4896. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4897. },
  4898. _darken: function(e, t) {
  4899. var i = t || .2
  4900. , n = e.getHSL();
  4901. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4902. }
  4903. }
  4904. }
  4905. , {
  4906. three: 217
  4907. }],
  4908. 20: [function(e, t, i) {
  4909. "use strict";
  4910. t.exports = {
  4911. NONE: -1,
  4912. ROTATE: 0,
  4913. DOLLY: 1,
  4914. PAN: 2,
  4915. ROTATE_DOLLY: 3,
  4916. PAN_DOLLY: 4
  4917. }
  4918. }
  4919. , {}],
  4920. 21: [function(e, t, i) {
  4921. "use strict";
  4922. t.exports = {
  4923. Move: "move",
  4924. InteractionDirect: "interaction.direct",
  4925. InteractionKey: "interaction.key",
  4926. InteractionGui: "interaction.gui",
  4927. FlyInDirection: "fly.direction",
  4928. InputStart: "input.start",
  4929. Pinch: "input.pinch",
  4930. Scroll: "input.scroll",
  4931. AutoPanInterrupt: "autopan.interrupt",
  4932. AutoPanComplete: "autopan.complete",
  4933. AutoPanClamped: "autopan.clamped",
  4934. LongTap: "longtap"
  4935. }
  4936. }
  4937. , {}],
  4938. 22: [function(e, t, i) {
  4939. "use strict";
  4940. t.exports = Object.freeze({
  4941. FORWARD: "FORWARD",
  4942. LEFT: "LEFT",
  4943. RIGHT: "RIGHT",
  4944. BACK: "BACK",
  4945. UP: "UP",
  4946. DOWN: "DOWN"
  4947. })
  4948. }
  4949. , {}],
  4950. 23: [function(e, t, i) {
  4951. "use strict";
  4952. t.exports = {
  4953. ActionInterrupted: "action.interrupted",
  4954. TourStart: "tour.start",
  4955. TourEnd: "tour.end",
  4956. StartModeChange: "mode.startChange"
  4957. }
  4958. }
  4959. , {}],
  4960. 24: [function(e, t, i) {
  4961. "use strict";
  4962. t.exports = Object.freeze({
  4963. None: 0,
  4964. Queued: 1,
  4965. ForceQueued: 2,
  4966. Downloading: 3,
  4967. Downloaded: 4,
  4968. DownloadFailed: 5
  4969. })
  4970. }
  4971. , {}],
  4972. 25: [function(e, t, i) {
  4973. "use strict";
  4974. t.exports = {
  4975. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4976. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4977. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4978. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4979. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4980. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4981. }
  4982. }
  4983. , {}],
  4984. 26: [function(e, t, i) {
  4985. "use strict";
  4986. t.exports = {
  4987. Texture2D: 0,
  4988. TextureCube: 1
  4989. }
  4990. }
  4991. , {}],
  4992. 27: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. SMALL: "small",
  4996. LARGE: "large"
  4997. }
  4998. }
  4999. , {}],
  5000. 28: [function(e, t, i) {
  5001. "use strict";
  5002. var n = e("./Viewmode")
  5003. , r = {
  5004. LANDING: {},
  5005. NAVIGATION: "navigation",
  5006. MORE_HELP: "moreHelp",
  5007. TOUR_INTERACTION: {}
  5008. };
  5009. r.LANDING[n.PANORAMA] = "panorama.landing",
  5010. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5011. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5012. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5013. r.TOUR_INTERACTION.standard = "standard.tour",
  5014. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5015. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5016. t.exports = r
  5017. }
  5018. , {
  5019. "./Viewmode": 51
  5020. }],
  5021. 29: [function(e, t, i) {
  5022. "use strict";
  5023. var n = {
  5024. UP: 1,
  5025. DOWN: -1,
  5026. LEFT: "L",
  5027. RIGHT: "R",
  5028. FORWARD: "F",
  5029. BACK: "B",
  5030. reverse: {},
  5031. opposite: function(e) {
  5032. return this.reverse[e.toString()]
  5033. }
  5034. };
  5035. n.reverse[n.UP] = n.DOWN,
  5036. n.reverse[n.DOWN] = n.UP,
  5037. n.reverse[n.LEFT] = n.RIGHT,
  5038. n.reverse[n.RIGHT] = n.LEFT,
  5039. n.reverse[n.FORWARD] = n.BACK,
  5040. n.reverse[n.BACK] = n.FORWARD,
  5041. t.exports = n
  5042. }
  5043. , {}],
  5044. 30: [function(e, t, i) {
  5045. "use strict";
  5046. var n = {
  5047. ZERO: 48,
  5048. ONE: 49,
  5049. TWO: 50,
  5050. THREE: 51,
  5051. FOUR: 52,
  5052. FIVE: 53,
  5053. SIX: 54,
  5054. SEVEN: 55,
  5055. EIGHT: 56,
  5056. NINE: 57,
  5057. LEFTARROW: 37,
  5058. UPARROW: 38,
  5059. RIGHTARROW: 39,
  5060. DOWNARROW: 40,
  5061. A: 65,
  5062. B: 66,
  5063. C: 67,
  5064. D: 68,
  5065. E: 69,
  5066. F: 70,
  5067. G: 71,
  5068. H: 72,
  5069. I: 73,
  5070. J: 74,
  5071. K: 75,
  5072. L: 76,
  5073. M: 77,
  5074. N: 78,
  5075. O: 79,
  5076. P: 80,
  5077. Q: 81,
  5078. R: 82,
  5079. S: 83,
  5080. T: 84,
  5081. U: 85,
  5082. V: 86,
  5083. W: 87,
  5084. X: 88,
  5085. Y: 89,
  5086. Z: 90,
  5087. SPACE: 32,
  5088. RETURN: 13,
  5089. SEMICOLON: 186,
  5090. PLUSEQUALS: 187,
  5091. DASHUNDERSCORE: 189,
  5092. OPENBRACKET: 219
  5093. };
  5094. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5095. n.PLUSEQUALS = 61,
  5096. n.DASHUNDERSCORE = 173),
  5097. t.exports = n
  5098. }
  5099. , {
  5100. "../util/browser": 182
  5101. }],
  5102. 31: [function(e, t, i) {
  5103. "use strict";
  5104. t.exports = {
  5105. EN_US: "en-US",
  5106. ES_MX: "es-MX",
  5107. FR_FR: "fr-FR",
  5108. DE_DE: "de-DE",
  5109. RU_RU: "ru-RU",
  5110. CN_CN: "cn-CN",
  5111. JP_JP: "jp-JP"
  5112. }
  5113. }
  5114. , {}],
  5115. 32: [function(e, t, i) {
  5116. "use strict";
  5117. t.exports = {
  5118. TagActivated: "tag.activated",
  5119. TagDismissed: "tag.dismissed",
  5120. TagNavigation: "tag.navigation"
  5121. }
  5122. }
  5123. , {}],
  5124. 33: [function(e, t, i) {
  5125. "use strict";
  5126. t.exports = {
  5127. ModelAdded: "model-added",
  5128. ActiveModelChanged: "active-model-changed"
  5129. }
  5130. }
  5131. , {}],
  5132. 34: [function(e, t, i) {
  5133. "use strict";
  5134. t.exports = {
  5135. LEFT: 0,
  5136. MIDDLE: 1,
  5137. RIGHT: 2
  5138. }
  5139. }
  5140. , {}],
  5141. 35: [function(e, t, i) {
  5142. "use strict";
  5143. t.exports = {
  5144. PanoRenderComplete: "panorama.render.complete",
  5145. TileRenderFailure: "panorama.tile.render.failed",
  5146. TileRenderSuccess: "panorama.tile.render.success",
  5147. TileUploadAttempted: "panorama.tile.upload.attempted",
  5148. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5149. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5150. }
  5151. }
  5152. , {}],
  5153. 36: [function(e, t, i) {
  5154. "use strict";
  5155. t.exports = {
  5156. BASE: 1,
  5157. STANDARD: 2,
  5158. HIGH: 3,
  5159. ULTRAHIGH: 4
  5160. }
  5161. }
  5162. , {}],
  5163. 37: [function(e, t, i) {
  5164. "use strict";
  5165. t.exports = {
  5166. LoadComplete: "panorama.load.complete",
  5167. LoadFailed: "panorama.load.failed",
  5168. TileLoaded: "panorama.tile.loaded"
  5169. }
  5170. }
  5171. , {}],
  5172. 38: [function(e, t, i) {
  5173. "use strict";
  5174. t.exports = Object.freeze({
  5175. Standard: 0,
  5176. Slow: 1,
  5177. Retain: 2
  5178. })
  5179. }
  5180. , {}],
  5181. 39: [function(e, t, i) {
  5182. "use strict";
  5183. t.exports = Object.freeze({
  5184. Show: 0,
  5185. Hide: 1,
  5186. Retain: 2
  5187. })
  5188. }
  5189. , {}],
  5190. 40: [function(e, t, i) {
  5191. "use strict";
  5192. t.exports = {
  5193. Move: "move",
  5194. MoveComplete: "move.complete",
  5195. ModeChanged: "mode.changed",
  5196. ModeChanging: "mode.changing",
  5197. PanoChosen: "pano.chosen",
  5198. ClosestPanoChanging: "closest.pano.changing",
  5199. WarpStarted: "warp.started",
  5200. WarpInterrupted: "warp.interrupted",
  5201. WarpEnded: "warp.ended",
  5202. FlyinFinished: "flyin.finished",
  5203. FlyingStarted: "flying.started",
  5204. FlyingInterrupted: "flying.interrupted",
  5205. FlyingEnded: "flying.ended",
  5206. Ready: "ready",
  5207. StartInside: "start.inside",
  5208. StartOutside: "start.outside",
  5209. ViewChanged: "view.changed",
  5210. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5211. InputStart: "input.start"
  5212. }
  5213. }
  5214. , {}],
  5215. 41: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = Object.freeze({
  5218. DEFAULT: 0,
  5219. PANOMARKERS: 1,
  5220. RETICULE: 2,
  5221. TAG: 3
  5222. })
  5223. }
  5224. , {}],
  5225. 42: [function(e, t, i) {
  5226. "use strict";
  5227. t.exports = {
  5228. visibleFloor: 1,
  5229. ghostFloor: 3,
  5230. boundingSkybox: 1,
  5231. panoMarker: 2,
  5232. reticule: 3,
  5233. tagStem: 4,
  5234. tagDisc: 5,
  5235. ribbon: 100
  5236. }
  5237. }
  5238. , {}],
  5239. 43: [function(e, t, i) {
  5240. "use strict";
  5241. t.exports = {
  5242. ContextCreated: "scene-renderer-context-created",
  5243. AfterRender: "after-render",
  5244. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5245. }
  5246. }
  5247. , {}],
  5248. 44: [function(e, t, i) {
  5249. "use strict";
  5250. t.exports = {
  5251. IDLE: "idle",
  5252. BROWSE: "browse",
  5253. EXAMINE: "examine"
  5254. }
  5255. }
  5256. , {}],
  5257. 45: [function(e, t, i) {
  5258. "use strict";
  5259. t.exports = {
  5260. TileDownloadSuccess: "tiledownloader.download.success",
  5261. TileDownloadFailure: "tiledownloader.download.failure",
  5262. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5263. }
  5264. }
  5265. , {}],
  5266. 46: [function(e, t, i) {
  5267. "use strict";
  5268. t.exports = {
  5269. CardboardAndroid: "googlevr",
  5270. GearVR: "gearvr",
  5271. CardboardIOS: "googlevrios",
  5272. Cardboard: "googlevr"
  5273. }
  5274. }
  5275. , {}],
  5276. 47: [function(e, t, i) {
  5277. "use strict";
  5278. t.exports = {
  5279. NONE: 0,
  5280. CONTEXTUAL: 1,
  5281. ANDROID: 2
  5282. }
  5283. }
  5284. , {}],
  5285. 48: [function(e, t, i) {
  5286. "use strict";
  5287. var n = {
  5288. Title: 0,
  5289. Cardboard: 1
  5290. }
  5291. , r = {
  5292. Title: 0,
  5293. Cardboard: 1,
  5294. Gear: 2
  5295. };
  5296. [n, r].forEach(function(e) {
  5297. e.pageCount = Object.keys(e).length
  5298. }),
  5299. t.exports.ios = n,
  5300. t.exports.standard = r
  5301. }
  5302. , {}],
  5303. 49: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. Android: "android",
  5307. IOS: "ios",
  5308. Desktop: "desktop",
  5309. UnsupportedAndroid: "android-unsupported"
  5310. }
  5311. }
  5312. , {}],
  5313. 50: [function(e, t, i) {
  5314. "use strict";
  5315. var n = e("three");
  5316. t.exports = {
  5317. UP: new n.Vector3(0,1,0),
  5318. DOWN: new n.Vector3(0,-1,0),
  5319. LEFT: new n.Vector3(-1,0,0),
  5320. RIGHT: new n.Vector3(1,0,0),
  5321. FORWARD: new n.Vector3(0,0,-1),
  5322. BACK: new n.Vector3(0,0,1)
  5323. }
  5324. }
  5325. , {
  5326. three: 217
  5327. }],
  5328. 51: [function(e, t, i) {
  5329. "use strict";
  5330. var n = e("../exception/ViewmodeConvertException")
  5331. , r = e("./coreViewmodes")
  5332. , o = {
  5333. MESH: "mesh",
  5334. OUTDOOR: "outdoor",
  5335. TRANSITIONING: "transitioning",
  5336. toInt: function(e) {
  5337. switch (e) {
  5338. case this.PANORAMA:
  5339. return 1;
  5340. case this.DOLLHOUSE:
  5341. return 2;
  5342. case this.FLOORPLAN:
  5343. return 3;
  5344. case this.OUTDOOR:
  5345. return 4;
  5346. case this.TRANSITIONING:
  5347. return -1
  5348. }
  5349. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5350. },
  5351. fromInt: function(e) {
  5352. switch (e) {
  5353. case "1":
  5354. case 1:
  5355. return this.PANORAMA;
  5356. case "2":
  5357. case 2:
  5358. return this.DOLLHOUSE;
  5359. case "3":
  5360. case 3:
  5361. return this.FLOORPLAN;
  5362. case "4":
  5363. case 4:
  5364. return this.OUTDOOR
  5365. }
  5366. throw new n("No known conversion for int to viewmode for int: " + e)
  5367. },
  5368. convertWorkshopModeInt: function(e) {
  5369. switch (e) {
  5370. case "0":
  5371. case 0:
  5372. case void 0:
  5373. return this.PANORAMA;
  5374. case "1":
  5375. case 1:
  5376. return this.FLOORPLAN;
  5377. case "2":
  5378. case 2:
  5379. return this.DOLLHOUSE;
  5380. case "3":
  5381. case 3:
  5382. return this.MESH
  5383. }
  5384. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5385. }
  5386. };
  5387. e("../util/common").extendObject(o, r),
  5388. t.exports = o
  5389. }
  5390. , {
  5391. "../exception/ViewmodeConvertException": 58,
  5392. "../util/common": 185,
  5393. "./coreViewmodes": 54
  5394. }],
  5395. 52: [function(e, t, i) {
  5396. "use strict";
  5397. t.exports = {
  5398. BLACK: "black",
  5399. STD: "std",
  5400. WALK: "walk"
  5401. }
  5402. }
  5403. , {}],
  5404. 53: [function(e, t, i) {
  5405. "use strict";
  5406. t.exports = {
  5407. ZoomIn: "zoom.in",
  5408. ZoomOut: "zoom.out",
  5409. ZoomMax: "zoom.max",
  5410. ZoomMin: "zoom.min"
  5411. }
  5412. }
  5413. , {}],
  5414. 54: [function(e, t, i) {
  5415. "use strict";
  5416. t.exports = {
  5417. PANORAMA: "panorama",
  5418. DOLLHOUSE: "dollhouse",
  5419. FLOORPLAN: "floorplan"
  5420. }
  5421. }
  5422. , {}],
  5423. 55: [function(e, t, i) {
  5424. "use strict";
  5425. t.exports = function(e) {
  5426. this.message = e
  5427. }
  5428. }
  5429. , {}],
  5430. 56: [function(e, t, i) {
  5431. "use strict";
  5432. function n(e) {
  5433. r.call(this, e)
  5434. }
  5435. var r = e("./BasicException");
  5436. n.prototype = Object.create(r.prototype),
  5437. t.exports = n
  5438. }
  5439. , {
  5440. "./BasicException": 55
  5441. }],
  5442. 57: [function(e, t, i) {
  5443. "use strict";
  5444. function n(e) {
  5445. r.call(this, e)
  5446. }
  5447. var r = e("./BasicException");
  5448. n.prototype = Object.create(r.prototype),
  5449. t.exports = n
  5450. }
  5451. , {
  5452. "./BasicException": 55
  5453. }],
  5454. 58: [function(e, t, i) {
  5455. "use strict";
  5456. function n(e) {
  5457. r.call(this, e)
  5458. }
  5459. var r = e("./BasicException");
  5460. n.prototype = Object.create(r.prototype),
  5461. t.exports = n
  5462. }
  5463. , {
  5464. "./BasicException": 55
  5465. }],
  5466. 59: [function(a, s, e) {
  5467. (function(e) {
  5468. "use strict";
  5469. var i = a("./util/ajax")
  5470. , n = a("./util/showcase")
  5471. , t = a("./util/logger")
  5472. , r = new t(e)
  5473. , o = {};
  5474. s.exports = {
  5475. loadFeatureFlags: function(e) {
  5476. var t = $.Deferred();
  5477. return i.get(e.urlBase + "", {
  5478. responseType: "json",
  5479. prefetchFrom: "user",
  5480. auth: n.getAuthorizationHeader()
  5481. }).done(function(e) {
  5482. (o = function(e) {
  5483. var t = {};
  5484. if (e) {
  5485. var i = e.flags;
  5486. if (i)
  5487. for (var n in i)
  5488. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5489. return t
  5490. }
  5491. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5492. null
  5493. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5494. }).fail(function() {
  5495. r.debug("Retrieval of feature flags failed."),
  5496. t.reject("loading-failed")
  5497. }),
  5498. t.promise()
  5499. },
  5500. getFlags: function() {
  5501. return o
  5502. },
  5503. updateDependentSettings: function(e, t) {
  5504. (e = e || o).labels && (t.labels.enabled = !0),
  5505. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5506. e.showcase_sdk && (t.sdkInit = !0),
  5507. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5508. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5509. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5510. e.hide_sc_sharing && (t.share.enabled = !1)
  5511. }
  5512. }
  5513. }
  5514. ).call(this, "/js/featureflags.js")
  5515. }
  5516. , {
  5517. "./util/ajax": 181,
  5518. "./util/logger": 189,
  5519. "./util/showcase": 193
  5520. }],
  5521. 60: [function(e, t, i) {
  5522. "use strict";
  5523. var n = (e("../util/common"),
  5524. {
  5525. status: 0,
  5526. set: function(e) {
  5527. if (isNaN(e))
  5528. return !1;
  5529. var t = $(".progressbar");
  5530. e < 0 && (e = 0),
  5531. 100 < e && (e = 100);
  5532. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5533. , n = Math.round(e)
  5534. , r = parseInt(i) - 15;
  5535. t.find(".bar").css("width", i),
  5536. t.find(".label").css("left", r),
  5537. t.find(".perc").text(n + "%"),
  5538. this.status = e
  5539. },
  5540. done: function(e) {
  5541. return e || this.status ? (this.status = null,
  5542. this.set(100)) : this
  5543. }
  5544. });
  5545. t.exports.circleLoader = n
  5546. }
  5547. , {
  5548. "../util/common": 185
  5549. }],
  5550. 61: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = Object.freeze({
  5553. CLOSE: "modal.closer.close"
  5554. })
  5555. }
  5556. , {}],
  5557. 62: [function(e, t, i) {
  5558. "use strict";
  5559. function n(t, e) {
  5560. function i() {
  5561. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5562. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5563. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5564. c.classList.remove("closeByFooter")))
  5565. }
  5566. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5567. }
  5568. var r = e("../../settings")
  5569. , o = (e("../../tag/Media/MediaEvent"),
  5570. e("../../util/browser"))
  5571. , a = e("../../util/common")
  5572. , s = e("./ModalCloserEvent")
  5573. , l = e("events").EventEmitter
  5574. , c = document.getElementsByClassName("footer")[0]
  5575. , h = c.querySelectorAll(".close")[0]
  5576. , u = null
  5577. , d = null
  5578. , p = null
  5579. , f = (o.isMobile(),
  5580. {
  5581. open: function(e) {
  5582. e && (n(e),
  5583. u && h.removeEventListener("click", u, !0),
  5584. u = function(e, t) {
  5585. t && (t.stopPropagation(),
  5586. t.preventDefault()),
  5587. e && this.emit(s.CLOSE, e),
  5588. f.reset()
  5589. }
  5590. .bind(this, e.id),
  5591. h.addEventListener("click", u, !0),
  5592. d && window.removeEventListener("resize", d, !0),
  5593. d = n.bind(this, e),
  5594. window.addEventListener("resize", d, !0))
  5595. },
  5596. reset: function() {
  5597. c.classList.remove("closeByFooter"),
  5598. h.removeEventListener("click", u, !0),
  5599. window.removeEventListener("resize", d, !0),
  5600. u = d = p = null
  5601. }
  5602. });
  5603. a.extendObject(f, l.prototype),
  5604. t.exports = f
  5605. }
  5606. , {
  5607. "../../tag/Media/MediaEvent": 131,
  5608. "../../settings": 166,
  5609. "../../util/browser": 182,
  5610. "../../util/common": 185,
  5611. "./ModalCloserEvent": 61,
  5612. events: 202
  5613. }],
  5614. 63: [function(e, t, i) {
  5615. "use strict";
  5616. var A = e("../lib/dat.gui")
  5617. , C = e("three")
  5618. , I = e("../util/easing")
  5619. , E = e("../enum/Viewmode")
  5620. , _ = e("../enum/Colors")
  5621. , b = e("../enum/WarpStyle")
  5622. , w = e("../settings");
  5623. e("../tag/tag"),
  5624. A.GUI.prototype.removeFolder = function(e) {
  5625. var t = this.__folders[e];
  5626. t && (t.close(),
  5627. this.__ul.removeChild(t.domElement.parentNode),
  5628. delete this.__folders[e],
  5629. this.onResize())
  5630. }
  5631. ,
  5632. t.exports.toggle = function(t, e, i) {
  5633. var n = new A.GUI({
  5634. width: 400
  5635. })
  5636. , r = n.addFolder("Flydown from Dollhouse");
  5637. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5638. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5639. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5640. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5641. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5642. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5643. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5644. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5645. var o = n.addFolder("Transition between panos");
  5646. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5647. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5648. w.transition.flyTime = 0,
  5649. o.__controllers.forEach(function(e) {
  5650. e.updateDisplay()
  5651. })
  5652. }),
  5653. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5654. w.transition.flySpeed = 0,
  5655. o.__controllers.forEach(function(e) {
  5656. e.updateDisplay()
  5657. })
  5658. }),
  5659. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5660. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5661. o.add(w.transition, "movementEasing", Object.keys(I));
  5662. var a = n.addFolder("Path Display");
  5663. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5664. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5665. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5666. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5667. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5668. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5669. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5670. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5671. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5672. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5673. w.path.color = _[w.path.color],
  5674. w.path.colorUp = _._desat(w.path.color),
  5675. w.path.colorDown = _.darken(w.path.color)
  5676. }),
  5677. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5678. w.reticuleColor = _[w.reticuleColor]
  5679. });
  5680. var s = n.addFolder("Warping")
  5681. , l = s.addFolder("Warp/Teleport");
  5682. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5683. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5684. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5685. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5686. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5687. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5688. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5689. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5690. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5691. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5692. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5693. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5694. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5695. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5696. w.path.typ = b[w.path.typ]
  5697. }),
  5698. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5699. e.endlessLoop = w.warp.loop
  5700. }),
  5701. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5702. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5703. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5704. var c = s.addFolder("Long Warp Only");
  5705. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5706. w.warp.flySpeed = 0,
  5707. c.__controllers.forEach(function(e) {
  5708. e.updateDisplay()
  5709. })
  5710. }),
  5711. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5712. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5713. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5714. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5715. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5716. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5717. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5718. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5719. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5720. var h = n.addFolder("Warp Esoterica");
  5721. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5722. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5723. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5724. w.warp.minWarpTime = 0,
  5725. h.__controllers.forEach(function(e) {
  5726. e.updateDisplay()
  5727. })
  5728. }),
  5729. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5730. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5731. h.add(w.warp, "movementEasing", Object.keys(I));
  5732. var u = n.addFolder("Misc");
  5733. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5734. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5735. }),
  5736. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5737. i.cameras[E.PANORAMA].fov = w.insideFOV
  5738. }),
  5739. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5740. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5741. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5742. var d = n.addFolder("Navigation");
  5743. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5744. w.navigation.panoScores || t.panos.forEach(function(e) {
  5745. e.floor.remove(e.text3d),
  5746. e.text3d = null
  5747. })
  5748. }),
  5749. d.add(w.navigation, "mouseDirection"),
  5750. d.add(w.navigation, "filterStrictness", 0, 1),
  5751. d.add(w.navigation, "angleFactor", -60, 0),
  5752. d.add(w.navigation, "directionFactor", 1, 20),
  5753. d.add(w.navigation, "distanceFactor", -5, 5),
  5754. d.add(w.navigation, "optionalityFactor", .1, 10);
  5755. var p = n.addFolder("tags")
  5756. , f = p.addFolder("Tag Creation");
  5757. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5758. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5759. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5760. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5761. var g = p.addFolder("Visibility");
  5762. g.add(w.tags.visibility, "anyDistance"),
  5763. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5764. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5765. g.add(w.tags.visibility, "hideViaFloor"),
  5766. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5767. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5768. var m = p.addFolder("Disc Parameters");
  5769. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5770. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5771. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5772. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5773. }),
  5774. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5775. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5776. }),
  5777. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5778. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5779. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5780. var v = p.addFolder("Navigate");
  5781. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5782. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5783. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5784. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5785. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5786. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5787. var y = n.addFolder("Debug");
  5788. y.add(w, "wireframe").onFinishChange(function() {
  5789. t.chunks.forEach(function(e) {
  5790. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5791. e.wireframeTwin.material.depthWrite = !1,
  5792. e.wireframeTwin.material.depthTest = !1,
  5793. e.wireframeTwin.material.opacity = .5,
  5794. e.wireframeTwin.material.transparent = !0),
  5795. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5796. })
  5797. }),
  5798. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5799. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5800. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5801. t.skybox.wireframe = null)
  5802. }),
  5803. y.add(w, "showSweeps").onFinishChange(function() {
  5804. t.setSweepVisibility(w.showSweeps)
  5805. }),
  5806. y.add(w, "showMesh").onFinishChange(function() {
  5807. t.chunks.forEach(function(e) {
  5808. e.visible = w.showMesh
  5809. })
  5810. }),
  5811. y.add(w, "showFloors").onFinishChange(function() {
  5812. t.floors.forEach(function(e) {
  5813. e.collider.children.forEach(function(e) {
  5814. e.material.visible = w.showFloors
  5815. })
  5816. })
  5817. }),
  5818. y.add(w, "showSkyboxes").onFinishChange(function() {
  5819. t.panos.forEach(function(e) {
  5820. e.skyboxMesh.visible = w.showSkyboxes
  5821. })
  5822. }),
  5823. y.add(w, "showNeighbors").onChange(function() {}),
  5824. y.add(t, "alpha", 0, 1)
  5825. }
  5826. }
  5827. , {
  5828. "../enum/Colors": 19,
  5829. "../enum/Viewmode": 51,
  5830. "../enum/WarpStyle": 52,
  5831. "../lib/dat.gui": 93,
  5832. "../tag/tag": 123,
  5833. "../settings": 166,
  5834. "../util/easing": 186,
  5835. three: 217
  5836. }],
  5837. 64: [function(c, h, e) {
  5838. (function(e) {
  5839. "use strict";
  5840. function i(e, t, i, n) {
  5841. $(".gui-error .error-problem-text").text(e),
  5842. $(".gui-error .error-solution-text").text(t),
  5843. $(".gui-error .error-explanation").text(i),
  5844. $(".gui-error .error-actions").html(n),
  5845. $(window).resize(),
  5846. $(".gui-error").fadeIn(),
  5847. $("#bottom-logo").fadeIn()
  5848. }
  5849. function n(e) {
  5850. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  5851. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5852. r.isMobile() || $("[rel=tiletip]").tooltip({
  5853. placement: "bottom",
  5854. delay: {
  5855. show: 50,
  5856. hide: 0
  5857. },
  5858. trigger: "hover",
  5859. viewport: {
  5860. selector: "body",
  5861. padding: 10
  5862. }
  5863. })
  5864. }
  5865. function t() {
  5866. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5867. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5868. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5869. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5870. e.preventDefault(),
  5871. e.stopPropagation(),
  5872. n(" ")
  5873. })
  5874. }
  5875. var r = c("./../util/browser")
  5876. , o = c("./../analytics")
  5877. , a = c("./../settings")
  5878. , s = c("../localization/localize")
  5879. , l = new (c("./../util/logger"))(e);
  5880. h.exports.error = function(e) {
  5881. if ($("head title").text(a.pageTitle),
  5882. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5883. $("#gui-loading").fadeOut(250),
  5884. $("#quick-blackout").hide(),
  5885. o.track("showcase_error", {
  5886. error_key: e
  5887. }),
  5888. s.locale || s.init(),
  5889. "webgl-unsupported" === e)
  5890. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5891. else if ("webgl-ios" === e)
  5892. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  5893. else if ("webgl-safari" === e)
  5894. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5895. else if ("webgl-generic" === e)
  5896. t();
  5897. else if ("missing-urls" === e)
  5898. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5899. else if ("loading-failed" === e)
  5900. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  5901. else {
  5902. if ("loading-failed-maintenance" !== e)
  5903. return void l.error("Unhandled error: " + e);
  5904. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5905. }
  5906. }
  5907. }
  5908. ).call(this, "/js/gui/error.js")
  5909. }
  5910. , {
  5911. "../localization/localize": 108,
  5912. "./../analytics": 4,
  5913. "./../settings": 166,
  5914. "./../util/browser": 182,
  5915. "./../util/logger": 189
  5916. }],
  5917. 65: [function(Oe, Le, e) {
  5918. (function(e) {
  5919. "use strict";
  5920. function c() {
  5921. for (var e in Ce)
  5922. if (Ce.hasOwnProperty(e)) {
  5923. var t = Ce[e];
  5924. if (!t.visible)
  5925. for (var i = 0; i < t.elements.length; i++)
  5926. $(t.elements[i]).hide()
  5927. }
  5928. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5929. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5930. ge = [],
  5931. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5932. ge.push(".hideTarget", ".pinTop.right")
  5933. }
  5934. function v(e, t) {
  5935. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5936. $("#gui-zoomin").toggle(i),
  5937. $("#gui-zoomout").toggle(i)
  5938. }
  5939. function l() {
  5940. n(),
  5941. $(".pinBottom").toggleClass("open"),
  5942. $("#drawer").toggleClass("open"),
  5943. $(".footer").toggleClass("open"),
  5944. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5945. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5946. O.resetDrawer()),
  5947. setTimeout(function() {
  5948. $("#pullTab").toggleClass("opened")
  5949. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5950. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5951. }
  5952. function t(e) {
  5953. var t;
  5954. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5955. t = e.position().top + e.outerHeight(),
  5956. e.attr("style", "display: none")),
  5957. $("#player").outerHeight() - 130 < t + 25
  5958. }
  5959. function y(e) {
  5960. "touchstart" === e.type && e.preventDefault(),
  5961. e.stopPropagation()
  5962. }
  5963. function n() {
  5964. w && (w.reload(),
  5965. w.init())
  5966. }
  5967. function r() {
  5968. $("#gui-spinner").stop(!0, !0),
  5969. $("#gui-spinner").fadeOut(1e3),
  5970. !(Ae = !0)
  5971. }
  5972. function A(e, t) {
  5973. var i = e.mode
  5974. , n = t || e.currentPano;
  5975. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5976. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5977. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5978. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5979. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5980. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5981. $("#gui-modes-outside").removeClass("desktop-only")),
  5982. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5983. pe = i,
  5984. $("#gui-modes-outside").addClass("hidden"),
  5985. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  5986. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  5987. }
  5988. function C(t, i) {
  5989. function e() {
  5990. document.getElementById("vr").classList.remove("hidden"),
  5991. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  5992. S.supportsFullscreen() ? function(e) {
  5993. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  5994. Q.init(t.data, i, e, x),
  5995. Q.on(J.OPENED, _e.bind(gui, "vr")),
  5996. Q.on(J.SHOW_TERMS, W.show.bind(W))
  5997. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  5998. $(".improper-embed").toggleClass("hidden", !1),
  5999. n())
  6000. }, function(e) {
  6001. n()
  6002. }) : n()
  6003. }
  6004. function n() {
  6005. var e;
  6006. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6007. X.init(t.data, x),
  6008. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6009. function() {
  6010. _e("vr"),
  6011. V.open(e)
  6012. }
  6013. )),
  6014. X.on(Z.CLOSED, V.reset)
  6015. }
  6016. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6017. switch (M.vr.option) {
  6018. case le.CONTEXTUAL:
  6019. e();
  6020. break;
  6021. case le.ANDROID:
  6022. S.detectAndroid() && e();
  6023. break;
  6024. case le.NONE:
  6025. }
  6026. }
  6027. function h(e, i) {
  6028. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6029. if ("372" !== getQueryVariable("m")) {
  6030. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6031. $(".gui-floor").find(".container").prepend(r)
  6032. }
  6033. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6034. n.on("click", function(e) {
  6035. y(e),
  6036. _e("floor"),
  6037. n.toggleClass("open")
  6038. }),
  6039. $(".floorChoice").on("click", function(e) {
  6040. y(e);
  6041. var t = $(this).data("index");
  6042. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6043. i.player.gotoFloor(t),
  6044. R.track("showcase_gui", {
  6045. gui_action: "click_floor_select_button",
  6046. interaction_source: "gui"
  6047. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6048. _e("move"),
  6049. i.allFloors(),
  6050. R.track("showcase_gui", {
  6051. gui_action: "click_toggle_all_floors_button",
  6052. interaction_source: "gui"
  6053. })),
  6054. n.removeClass("open")
  6055. })
  6056. }
  6057. function I(e, t) {
  6058. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6059. $(".gui-floor-icon").hide(),
  6060. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6061. $(".gui-floor-icon").show(),
  6062. $(".gui-floor-title").hide()),
  6063. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6064. $(".gui-floor-number").text(se.FLOOR_ALL),
  6065. $(".floorChoice").removeClass("active"),
  6066. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6067. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6068. $(".floorChoice").removeClass("active"),
  6069. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6070. }
  6071. function E() {
  6072. var e = $("#player").width() - 20
  6073. , t = $("#scroller")
  6074. , i = $("#drawer")
  6075. , n = $(".pinBottom");
  6076. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6077. i.addClass("noScroll"),
  6078. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6079. i.toggleClass("noScroll"),
  6080. n.toggleClass("noScroll"))
  6081. }
  6082. function _(e) {
  6083. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6084. e = e || 0,
  6085. Ae = !1,
  6086. window.setTimeout(function() {
  6087. Ae || (!0,
  6088. $("#gui-spinner").stop(!0, !0).show())
  6089. }
  6090. .bind(this), e)
  6091. }(M.modelComponentLoadSpinnerDelay)
  6092. }
  6093. function b(e, t) {
  6094. for (var i = []; e; )
  6095. i.push(e),
  6096. e = e.parentNode;
  6097. for (; t && -1 === i.indexOf(t); )
  6098. t = t.parentNode;
  6099. return t
  6100. }
  6101. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6102. Oe("../util/ajax"),
  6103. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6104. Oe("../util/camera"),
  6105. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6106. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6107. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6108. Oe("../enum/PathDisplayMode"),
  6109. Oe("../enum/DirectorEvents"),
  6110. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6111. Oe("../enum/WarpStyle"),
  6112. Oe("../enum/AlignmentType"),
  6113. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6114. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6115. coBrand: {
  6116. visible: !0,
  6117. elements: [".co-brand", "#loaderCoBrand"]
  6118. },
  6119. help: {
  6120. visible: !0,
  6121. elements: [".nav-help", "#nav-help"]
  6122. },
  6123. tourControls: {
  6124. visible: !0,
  6125. elements: [".next", ".previous", "#play"]
  6126. },
  6127. highlight: {
  6128. visible: !0,
  6129. elements: ["#drawer", "#pullTab"]
  6130. },
  6131. share: {
  6132. visible: !0,
  6133. elements: [".socialButton", "#share"]
  6134. },
  6135. fullScreen: {
  6136. visible: !0,
  6137. elements: ["#gui-fullscreen"]
  6138. },
  6139. floors: {
  6140. visible: !0,
  6141. elements: [".gui-floor"]
  6142. }
  6143. }, Ie = (g = document.getElementById("drawer"),
  6144. function() {
  6145. $("#player").height() < 400 && g.classList.contains("open") && l()
  6146. }
  6147. ), Ee = (f = document.getElementById("meta-info"),
  6148. function() {
  6149. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6150. }
  6151. ), _e = (i = document.getElementById("meta-info"),
  6152. s = document.getElementById("interaction-modal"),
  6153. u = $("#drawer").eq(0),
  6154. d = $(".gui-floor").eq(0),
  6155. p = $(".vr-popup").eq(0),
  6156. function(e) {
  6157. switch (e) {
  6158. case "info":
  6159. we(),
  6160. Te(),
  6161. Ie(),
  6162. Me(),
  6163. Re(),
  6164. xe(),
  6165. Pe();
  6166. break;
  6167. case "terms":
  6168. be(),
  6169. Te(),
  6170. Se(),
  6171. Me(),
  6172. Re(),
  6173. xe(),
  6174. Pe();
  6175. break;
  6176. case "help":
  6177. be(),
  6178. we(),
  6179. Me(),
  6180. Re(),
  6181. xe(),
  6182. Pe();
  6183. break;
  6184. case "vr":
  6185. be(),
  6186. we(),
  6187. Me(),
  6188. Re(),
  6189. Te(),
  6190. Pe(),
  6191. t(p) && Se();
  6192. break;
  6193. case "highlights":
  6194. Ee(),
  6195. we(),
  6196. Me(),
  6197. Re();
  6198. break;
  6199. case "share":
  6200. be(),
  6201. we(),
  6202. Te(),
  6203. Re(),
  6204. xe(),
  6205. Pe();
  6206. break;
  6207. case "floor":
  6208. we(),
  6209. Me(),
  6210. xe();
  6211. break;
  6212. case "view":
  6213. Re(),
  6214. Me(),
  6215. we(),
  6216. xe();
  6217. break;
  6218. case "tour":
  6219. case "move":
  6220. we(),
  6221. Me(),
  6222. Re(),
  6223. xe();
  6224. break;
  6225. case "resize":
  6226. be(),
  6227. Ie(),
  6228. Re();
  6229. break;
  6230. case "tag":
  6231. we(),
  6232. Te(),
  6233. Me(),
  6234. Re(),
  6235. xe()
  6236. }
  6237. }
  6238. );
  6239. function be() {
  6240. i.classList.contains("expand") && z.toggleMeta(!0)
  6241. }
  6242. function we() {
  6243. W.hide()
  6244. }
  6245. function Te() {
  6246. U.close()
  6247. }
  6248. function xe() {
  6249. X.dismiss()
  6250. }
  6251. function Se() {
  6252. u.hasClass("open") && l()
  6253. }
  6254. function Me() {
  6255. K.hide()
  6256. }
  6257. function Re() {
  6258. d.hasClass("open") && d.removeClass("open")
  6259. }
  6260. function Pe() {
  6261. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6262. }
  6263. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6264. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6265. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6266. setTimeout(function() {
  6267. $(".icon:visible").hide().show(0)
  6268. }, 100)
  6269. }),
  6270. $("#gui-fullscreen").find("a").on("click", function(e) {
  6271. y(e),
  6272. S.requestFullscreen($("body")[0]),
  6273. R.track("showcase_gui", {
  6274. gui_action: "click_enter_fullscreen",
  6275. interaction_source: "gui"
  6276. })
  6277. }),
  6278. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6279. y(e),
  6280. S.exitFullscreen(),
  6281. R.track("showcase_gui", {
  6282. gui_action: "click_exit_fullscreen",
  6283. interaction_source: "gui"
  6284. })
  6285. }),
  6286. $(window).on("resize", function(e) {
  6287. var t = e.target.innerHeight
  6288. , i = e.target.innerWidth;
  6289. t === o && i === a || (Ce.highlight.visible && E(),
  6290. _e("resize"),
  6291. $(".pinTop.right").removeClass("hideUnderMeta"),
  6292. n(),
  6293. o = t,
  6294. a = i)
  6295. }).resize(),
  6296. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6297. $("#pullTab").on("click", function(e) {
  6298. y(e),
  6299. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6300. gui_action: "hide_highlight_reel"
  6301. }),
  6302. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6303. gui_action: "show_highlight_reel"
  6304. }),
  6305. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6306. l()
  6307. }),
  6308. "true" === window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6309. $("#hotList").on("click", function(e) {
  6310. y(e);
  6311. var t = $("#hotListWrap")[0];
  6312. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6313. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6314. this.classList.add("active"))
  6315. }),
  6316. $("#hotListContent ul").on("mouseover", function(e) {
  6317. y(e);
  6318. var t = e.target
  6319. , i = document.getElementById("hotListWrap");
  6320. if ("SPAN" === t.tagName) {
  6321. var n = t.parentElement.parentElement;
  6322. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6323. } else if ("LI" === t.tagName) {
  6324. n = t.parentElement;
  6325. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6326. } else
  6327. i.style.width = ""
  6328. }),
  6329. $("#hotListContent ul").on("click", function(e) {
  6330. y(e),
  6331. this.preElem && this.preElem.classList.remove("active"),
  6332. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6333. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6334. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6335. e.target.hot && e.target.hot.examine(window.player, !0),
  6336. this.preElem = e.target)
  6337. }),
  6338. $("#hotListClose").on("click", function(e) {
  6339. y(e),
  6340. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6341. $("#hotListContent ul .active").removeClass("active"),
  6342. $("#hotList")[0].classList.remove("active")
  6343. })),
  6344. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6345. $("#more-menu-button").on("click", function(e) {
  6346. y(e),
  6347. $("#more-menu").toggleClass("open")
  6348. }),
  6349. Le.exports.init = function(s, l, c, e, t, i, n) {
  6350. var r;
  6351. x = n,
  6352. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6353. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6354. F.init(),
  6355. D.init(s, i),
  6356. ce.init(s, l, e),
  6357. $(".icon").on("mouseover", function() {
  6358. l.player && l.player.reticule.hide()
  6359. }),
  6360. function(e, t) {
  6361. var i = t.player;
  6362. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6363. y(e),
  6364. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6365. R.track("USER", {
  6366. event_type: "showcase_gui",
  6367. gui_action: "click_inside_mode_button"
  6368. }),
  6369. t.changeMode(ie.PANORAMA)
  6370. }),
  6371. $("#gui-modes-outside").find("a").on("click", function(e) {
  6372. y(e),
  6373. R.track("showcase_gui", {
  6374. gui_action: "click_outside_mode_button"
  6375. }),
  6376. t.changeMode(pe)
  6377. }),
  6378. $("#gui-modes-floorplan").on("click", function(e) {
  6379. y(e),
  6380. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6381. gui_action: "click_floorplan_mode_button"
  6382. }),
  6383. t.changeMode(ie.FLOORPLAN))
  6384. }),
  6385. $("#gui-modes-dollhouse").on("click", function(e) {
  6386. y(e),
  6387. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6388. gui_action: "click_dollhouse_mode_button"
  6389. }),
  6390. t.changeMode(ie.DOLLHOUSE))
  6391. })
  6392. }(0, l),
  6393. function(e, t) {
  6394. $("#play").find("a").on("mousedown touchstart", function(e) {
  6395. y(e),
  6396. _e("tour"),
  6397. q.play(),
  6398. R.trackAlways("showcase_gui", {
  6399. gui_action: "play_highlights"
  6400. })
  6401. }),
  6402. window.startAndPlay = function(e) {
  6403. _e("tour"),
  6404. q.play(),
  6405. R.trackAlways("showcase_gui", {
  6406. gui_action: "play_highlights"
  6407. })
  6408. }
  6409. ,
  6410. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6411. y(e),
  6412. q.pause(),
  6413. R.trackAlways("showcase_gui", {
  6414. gui_action: "pause_highlights"
  6415. })
  6416. }),
  6417. $("#gui-zoomin").find("a").on("click", function(e) {
  6418. y(e),
  6419. t.player.zoomInIncrementally()
  6420. }),
  6421. $("#gui-zoomout").find("a").on("click", function(e) {
  6422. y(e),
  6423. t.player.zoomOutIncrementally()
  6424. })
  6425. }(0, l),
  6426. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(s.data.name),
  6427. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6428. function() {
  6429. _e("share"),
  6430. V.open(r)
  6431. }
  6432. )),
  6433. K.on(ae.CLOSED, V.reset)),
  6434. //1 < s.heroLocations.length ? function(e, i, t) {
  6435. 0 < s.heroLocations.length ? function(e, i, t) {
  6436. var n = 100 / (fe = e.heroLocations.length) + "%"
  6437. , r = $("#thumb-container")
  6438. , o = $("#progressBar");
  6439. $("#status").find(".totalSteps").text(fe);
  6440. for (var a = 0; a < fe; a++) {
  6441. var s = e.heroLocations[a]
  6442. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6443. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6444. if (l.attr("data-index", a),
  6445. Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6446. s.name) {
  6447. var c = $('<div class="overlay"></div>').text(s.name);
  6448. l.prepend(c)
  6449. }
  6450. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6451. var h = e.panos.get(s.panoId)
  6452. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6453. l.prepend(u)
  6454. }
  6455. r.append(l),
  6456. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6457. }
  6458. T = 144 * fe,
  6459. 111 * fe,
  6460. $(".thumbImg").on("mouseover", function() {
  6461. !function(e) {
  6462. return e.describe().inTransition
  6463. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6464. }),
  6465. $(".thumbImg").on("mouseout", function() {
  6466. i.clearPath()
  6467. }),
  6468. $(".thumbImg").on("click", function(e) {
  6469. y(e);
  6470. var t = $(this);
  6471. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6472. R.trackAlways("showcase_gui", {
  6473. gui_action: "click_highlight"
  6474. }),
  6475. i.goToHighlight(t.data("index"))
  6476. }),
  6477. $(".previous").find("a").on("click", function(e) {
  6478. y(e),
  6479. R.trackAlways("showcase_gui", {
  6480. gui_action: "prev_highlight"
  6481. }),
  6482. i.prevHighlight()
  6483. }),
  6484. $(".next").find("a").on("click", function(e) {
  6485. y(e),
  6486. R.trackAlways("showcase_gui", {
  6487. gui_action: "next_highlight"
  6488. }),
  6489. i.nextHighlight()
  6490. }),
  6491. $("#drawer").on("mouseleave", function(t) {
  6492. var i;
  6493. y(t);
  6494. try {
  6495. i = new MouseEvent("mouseup",{
  6496. clientX: t.clientX,
  6497. clientY: t.clientY,
  6498. screenX: t.screenX,
  6499. screenY: t.screenY
  6500. })
  6501. } catch (e) {
  6502. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6503. }
  6504. document.dispatchEvent(i)
  6505. }),
  6506. (w = new Sly($("#scrollFrame"),{
  6507. horizontal: !0,
  6508. itemNav: "centered",
  6509. smart: !0,
  6510. scrollTrap: !0,
  6511. scrollBy: 1,
  6512. mouseDragging: !0,
  6513. touchDragging: !0,
  6514. speed: 300,
  6515. dragHandle: !0,
  6516. dynamicHandle: !0,
  6517. clickBar: !0,
  6518. scrollBar: $("#scroller"),
  6519. activateOn: null
  6520. }).init()).on("active", function(e, t) {
  6521. t,
  6522. _e("tour"),
  6523. $(".step").removeClass("active"),
  6524. $("#status").find(".curIdx").text(t + 1);
  6525. for (var i = 0; i <= t; i++)
  6526. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6527. }),
  6528. E()
  6529. }(s, l, c) : (Ce.highlight.visible = !1,
  6530. Ce.tourControls.visible = !1),
  6531. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6532. function() {
  6533. var n;
  6534. document.body.addEventListener("mousedown", function(e) {
  6535. n = 0 === e.button || 1 === e.which ? e.target : null
  6536. }, !0),
  6537. document.body.addEventListener("mouseup", function(t) {
  6538. n !== t.target && (n = b(n, t.target));
  6539. var e = document.getElementById("gui-parent");
  6540. if (b(e, n) !== e && (n = null),
  6541. n) {
  6542. var i;
  6543. try {
  6544. i = new MouseEvent("click",t)
  6545. } catch (e) {
  6546. (i = document.createEvent("MouseEvents")).initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6547. }
  6548. i.syntheticClick = !0,
  6549. n.dispatchEvent(i),
  6550. n = null
  6551. }
  6552. }, !0),
  6553. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6554. e.syntheticClick || (e.stopPropagation(),
  6555. "A" === e.target.nodeName && e.preventDefault())
  6556. }, !0)
  6557. }(),
  6558. A(c),
  6559. C(s, t),
  6560. s.on("floor.changed", I),
  6561. s.on("waiting", function(e) {
  6562. _(e)
  6563. }
  6564. .bind(this, s)),
  6565. s.on("waiting-done", function(e) {
  6566. _(e)
  6567. }
  6568. .bind(this, s)),
  6569. c.on(re.ModeChanged, function(e, t) {
  6570. A(c),
  6571. v(l, c),
  6572. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6573. U.updateMode(t)
  6574. }),
  6575. e.on(oe.Move, _e.bind(this, "move")),
  6576. c.on(re.Ready, function() {
  6577. O.init(e, c, c.tagManager, l),
  6578. c.on(re.ModeChanged, function(e, t) {
  6579. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6580. })
  6581. }),
  6582. c.on(re.PanoChosen, function(e, t) {
  6583. A(c, t),
  6584. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6585. }),
  6586. V.on(k.CLOSE, function(e) {
  6587. switch (e) {
  6588. case "vr-modal":
  6589. X.dismiss();
  6590. break;
  6591. case "share-modal":
  6592. K.hide();
  6593. break;
  6594. case "terms-modal":
  6595. W.hide()
  6596. }
  6597. });
  6598. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6599. l.on("update.controls", function() {
  6600. var e, t, i, n = l.describe();
  6601. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6602. u.show()),
  6603. n.tourInProgress && (d.forEach(function(e) {
  6604. e.classList.add("playing")
  6605. }),
  6606. p.addClass("playing"),
  6607. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6608. u.hide()),
  6609. n.tourInProgress || (q.stopTour(),
  6610. d.forEach(function(e) {
  6611. e.classList.remove("playing")
  6612. }),
  6613. p.removeClass("playing"),
  6614. f.removeClass("playing"))),
  6615. null !== n.currentItem) {
  6616. var r, o;
  6617. $("#status").find(".curIdx").text(n.currentItem + 1),
  6618. n.onTheBus ? (r = "active",
  6619. o = "recent") : (o = "active",
  6620. r = "recent");
  6621. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6622. for (e = 0; e < s.heroLocations.length; e += 1)
  6623. i = g.eq(e),
  6624. t = m.eq(e),
  6625. i.removeClass(o),
  6626. t.removeClass(o),
  6627. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6628. t.addClass(r),
  6629. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6630. t.addClass(r)) : (i.removeClass(r),
  6631. t.removeClass(r))
  6632. } else
  6633. for (e = 0; e < s.heroLocations.length; e += 1)
  6634. i = g.eq(e),
  6635. t = m.eq(e),
  6636. i.removeClass("active recent"),
  6637. t.removeClass("active recent");
  6638. v(l, c)
  6639. }),
  6640. document.addEventListener("keydown", function(e) {
  6641. switch (R.updateInteraction(oe.InteractionKey),
  6642. e.which) {
  6643. case te.ZERO:
  6644. M.debug && s.toggleAlpha();
  6645. break;
  6646. case te.NINE:
  6647. M.debug && B.toggle();
  6648. break;
  6649. case te.ONE:
  6650. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6651. break;
  6652. case te.TWO:
  6653. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6654. break;
  6655. case te.THREE:
  6656. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6657. break;
  6658. case te.FOUR:
  6659. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6660. break;
  6661. case te.SPACE:
  6662. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6663. break;
  6664. case te.RETURN:
  6665. M.debug && s.toggleExplodeUp();
  6666. break;
  6667. case te.P:
  6668. !function(e) {
  6669. me.gui || (me.gui = function(e) {
  6670. var t = new he.GUI;
  6671. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6672. e.setSweepVisibility(M.showSweeps)
  6673. }),
  6674. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6675. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6676. M.transition.flySpeed = 0,
  6677. t.__controllers.forEach(function(e) {
  6678. e.updateDisplay()
  6679. })
  6680. }),
  6681. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6682. $(t.__closeButton).hide(),
  6683. t
  6684. }(me.model)),
  6685. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6686. }(!me.visible);
  6687. break;
  6688. case te.U:
  6689. !function(e) {
  6690. ve.gui || (ve.gui = function(t, i) {
  6691. function e() {
  6692. var e = i.toJSON();
  6693. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6694. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6695. }
  6696. var n = {}
  6697. , r = new he.GUI({
  6698. autoPlace: !0,
  6699. width: "60%"
  6700. });
  6701. return e(),
  6702. i.on(re.ViewChanged, e),
  6703. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6704. r.domElement.id = "datLinks",
  6705. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6706. if (!S.detectSafari()) {
  6707. var t = document.createElement("button");
  6708. t.classList.add("btn-deep-link"),
  6709. t.innerText = se.MENU_COPY,
  6710. e.nextSibling.appendChild(t);
  6711. var n = function() {
  6712. alert(se.LINK_ALERT_COPY),
  6713. t.hide()
  6714. };
  6715. t.addEventListener("click", function(e) {
  6716. try {
  6717. var t = e.target.parentNode.childNodes[0];
  6718. t.select();
  6719. var i = document.execCommand("copy");
  6720. t.blur(),
  6721. i || n()
  6722. } catch (e) {
  6723. n()
  6724. }
  6725. })
  6726. }
  6727. }),
  6728. $(r.__closeButton).hide(),
  6729. r
  6730. }(ve.model, ve.player)),
  6731. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6732. }(!ve.visible);
  6733. break;
  6734. case te.X:
  6735. M.debug && s.toggleExplode();
  6736. break;
  6737. case te.PLUSEQUALS:
  6738. l.player.activatePersistentZooming(!0),
  6739. O.hideUi();
  6740. break;
  6741. case te.DASHUNDERSCORE:
  6742. l.player.activatePersistentZooming(!1),
  6743. O.hideUi();
  6744. break;
  6745. case te.SEVEN:
  6746. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6747. break;
  6748. case te.EIGHT:
  6749. l.player.decreaseZoomSpeed();
  6750. break;
  6751. case te.NINE:
  6752. l.player.increaseZoomSpeed()
  6753. }
  6754. return c && c.reticule.hide(),
  6755. !0
  6756. }
  6757. .bind(this)),
  6758. document.addEventListener("keyup", function(e) {
  6759. switch (e.which) {
  6760. case te.PLUSEQUALS:
  6761. l.player.deactivatePersistentZooming();
  6762. break;
  6763. case te.DASHUNDERSCORE:
  6764. l.player.deactivatePersistentZooming()
  6765. }
  6766. }
  6767. .bind(this)),
  6768. function(e) {
  6769. me = {
  6770. gui: null,
  6771. visible: !1,
  6772. model: e
  6773. }
  6774. }(s),
  6775. function(e, t) {
  6776. ve = {
  6777. gui: null,
  6778. visible: !1,
  6779. model: e,
  6780. player: t
  6781. }
  6782. }(s, l.player),
  6783. function(e) {
  6784. function t(e, i) {
  6785. $(e).find("a").each(function(e, t) {
  6786. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6787. t.style.pointerEvents = i ? "auto" : "none"
  6788. })
  6789. }
  6790. e.on(de.ZoomMax, function() {
  6791. t("#gui-zoomin", !1),
  6792. t("#gui-zoomout", !0)
  6793. }),
  6794. e.on(de.ZoomMin, function() {
  6795. t("#gui-zoomin", !0),
  6796. t("#gui-zoomout", !1)
  6797. }),
  6798. e.on(de.ZoomIn, function() {
  6799. t("#gui-zoomout", !0)
  6800. }),
  6801. e.on(de.ZoomOut, function() {
  6802. t("#gui-zoomin", !0)
  6803. }),
  6804. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6805. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6806. }(c),
  6807. P.setAutoPlay(s.heroCount()),
  6808. U.init(c, i.mode),
  6809. U.on(H.OPENED, _e.bind(this, "help")),
  6810. W.init(),
  6811. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6812. function() {
  6813. _e("terms"),
  6814. V.open(o)
  6815. }
  6816. )),
  6817. W.on(j.CLOSED, V.reset),
  6818. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6819. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6820. M.profiling.enabled && B.show(),
  6821. q.init(l)
  6822. }
  6823. ,
  6824. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6825. function a() {
  6826. o.setLoadingStartTime(),
  6827. function() {
  6828. function e(e) {
  6829. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6830. }
  6831. $("body").css("touch-action", "none"),
  6832. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6833. var t = document.getElementById("terms-text")
  6834. , i = document.getElementById("more-help-wrapper")
  6835. , n = (document.getElementById("navigation-help-wrapper"),
  6836. document.getElementById("help-dialog"),
  6837. document.getElementById("tag-billboards"));
  6838. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6839. passive: !1
  6840. }),
  6841. document.body.addEventListener("DOMMouseScroll", e)),
  6842. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6843. e.stopPropagation()
  6844. })
  6845. }(),
  6846. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6847. l()) : function(e) {
  6848. L.show(e),
  6849. c()
  6850. }(l)
  6851. }
  6852. var s = $.Deferred()
  6853. , l = s.resolve.bind(s);
  6854. return ye = !0,
  6855. _(e),
  6856. e.data.player_options && function(e) {
  6857. Ce.tourControls.visible = e.tour_buttons && S.valueFromHash("gt", 1),
  6858. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6859. Ce.highlight.visible = e.highlight_reel && 1 !== M.specialEdition && M.showHighlights
  6860. }(e.data.player_options),
  6861. 1 === M.specialEdition && $("body").addClass("specialEdition"),
  6862. se.localizeGUI(),
  6863. function(i) {
  6864. function e(e, t) {
  6865. return !!i.player_options[e] && i[t || e]
  6866. }
  6867. $(".model-title").text(i.name);
  6868. var t = M.pageTitle;
  6869. 2 !== S.valueFromHash("mls", 0) && (t = i.name),
  6870. document.title = t,
  6871. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6872. delay: {
  6873. show: 50,
  6874. hide: 0
  6875. },
  6876. trigger: "hover",
  6877. html: !1,
  6878. viewport: {
  6879. selector: "body",
  6880. padding: 10
  6881. }
  6882. }),
  6883. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6884. z.populate({
  6885. name: e("model_name", "name"),
  6886. coBrand: e("presented_by"),
  6887. description: e("model_summary", "summary") || "暂无内容",
  6888. contactName: e("contact_name"),
  6889. address: e("address"),
  6890. phone: e("contact_phone"),
  6891. formattedPhone: i.formatted_contact_phone,
  6892. email: e("contact_email"),
  6893. url: e("external_url"),
  6894. socialSharing: i.enable_social_sharing && i.is_public
  6895. })
  6896. }(e.data),
  6897. r || $(".quick").addClass("hidden"),
  6898. e.data.image && !r && function(e) {
  6899. $("<img/>").attr("src", e).on("load", function() {
  6900. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6901. $(this).remove()
  6902. })
  6903. }(e.data.image),
  6904. n ? (R.impression(),
  6905. a()) : (o.setWaitingStartTime(),
  6906. N.show(r, a)),
  6907. s
  6908. }
  6909. ,
  6910. Le.exports.endLoading = function(e, t, i) {
  6911. var n = t.player;
  6912. function r() {
  6913. i.dismissExaminedTag(),
  6914. i.disableHovering()
  6915. }
  6916. $("#gui-thumb").fadeOut(2500),
  6917. L.hide(function() {
  6918. ye = !1
  6919. }),
  6920. Y.init(e, i),
  6921. z.finishSetup(Object.keys(e.tags).length),
  6922. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6923. X.on(Z.OPENED, r),
  6924. K.on(ae.OPENED, r),
  6925. U.on(H.OPENED, r),
  6926. W.on(j.OPENED, r);
  6927. var o = i.enableHovering.bind(i);
  6928. if (X.on(Z.CLOSED, o),
  6929. K.on(ae.CLOSED, o),
  6930. U.on(H.CLOSED, o),
  6931. W.on(j.CLOSED, o),
  6932. M.labels.enabled && Object.keys(e.labels).length,
  6933. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6934. I(e.currentFloor, n.mode)),
  6935. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6936. h(e, t)),
  6937. c(),
  6938. v(t, t.player),
  6939. $("#gui").fadeIn(1500),
  6940. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6941. l(),
  6942. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6943. }, 2e3),
  6944. !S.isMobile())
  6945. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6946. $(a[s]).addClass("hasHover");
  6947. _(e),
  6948. z.setupToggling(),
  6949. window.editHotPanel && editHotPanel(),
  6950. function() {
  6951. var i = $("#pullTab")
  6952. , e = {
  6953. bottom: {
  6954. "border-bottom-left-radius": "10px",
  6955. "border-bottom-right-radius": "10px"
  6956. },
  6957. top: {
  6958. "border-top-left-radius": "10px",
  6959. "border-top-right-radius": "10px"
  6960. }
  6961. }
  6962. , t = {
  6963. bottom: {
  6964. "border-top-right-radius": "10px",
  6965. "border-bottom-right-radius": "10px"
  6966. },
  6967. top: {
  6968. "border-bottom-left-radius": "10px",
  6969. "border-top-left-radius": "10px"
  6970. }
  6971. };
  6972. function n(e, t) {
  6973. $("#gui-modes-map > div:visible:last").css(e),
  6974. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6975. }
  6976. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6977. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6978. }(),
  6979. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6980. }
  6981. ,
  6982. Le.exports.onProgress = function(e) {
  6983. L.progress(e)
  6984. }
  6985. }
  6986. ).call(this, "/js/gui/gui.js")
  6987. }
  6988. , {
  6989. "../analytics": 4,
  6990. "../controls/serializer": 14,
  6991. "../enum/AlignmentType": 17,
  6992. "../enum/BlackoutStyle": 18,
  6993. "../enum/ControlEvents": 21,
  6994. "../enum/DirectorEvents": 23,
  6995. "../enum/Keys": 30,
  6996. "../enum/PathDiscardMode": 38,
  6997. "../enum/PathDisplayMode": 39,
  6998. "../enum/PlayerEvents": 40,
  6999. "../enum/VROption": 47,
  7000. "../enum/Vectors": 50,
  7001. "../enum/Viewmode": 51,
  7002. "../enum/WarpStyle": 52,
  7003. "../enum/ZoomEvents": 53,
  7004. "../lib/dat.gui": 93,
  7005. "../localization/localize": 108,
  7006. "../tag/Media/MediaEvent": 131,
  7007. "../objects/Snapshot": 153,
  7008. "../settings": 166,
  7009. "../util/ajax": 181,
  7010. "../util/browser": 182,
  7011. "../util/camera": 183,
  7012. "../util/logger": 189,
  7013. "../util/showcase": 193,
  7014. "../util/transitions": 195,
  7015. "./closer/ModalCloserEvent": 61,
  7016. "./closer/modalCloser": 62,
  7017. "./help/HelpEvent": 66,
  7018. "./help/help": 67,
  7019. "./helpManager": 68,
  7020. "./immersiveMode": 69,
  7021. "./konami": 70,
  7022. "./landingScreen": 71,
  7023. "./loadingScreen": 72,
  7024. "./memoryUsage": 73,
  7025. "./playButton": 74,
  7026. "./populateModal": 75,
  7027. "./sharing/ShareEvents": 76,
  7028. "./sharing/modal": 77,
  7029. "./terms/TermsEvent": 78,
  7030. "./terms/terms": 79,
  7031. "./title/TitleEvents": 80,
  7032. "./title/tagToggle": 81,
  7033. "./title/titleBar": 82,
  7034. "./tourInteraction": 84,
  7035. "./vr/vrEvent": 85,
  7036. "./vr/vrModal": 87,
  7037. "./webvr/WebVrEvent": 88,
  7038. "./webvr/webVRgui": 89,
  7039. three: 217
  7040. }],
  7041. 66: [function(e, t, i) {
  7042. "use strict";
  7043. t.exports = Object.freeze({
  7044. OPENED: "help.opened",
  7045. CLOSED: "help.closed"
  7046. })
  7047. }
  7048. , {}],
  7049. 67: [function(e, t, i) {
  7050. "use strict";
  7051. function n() {
  7052. p.on("click", function(e) {
  7053. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7054. setTimeout(function() {
  7055. x = !1
  7056. }, h.help.modalStayDuration),
  7057. S.emit(l.OPENED),
  7058. f.addClass("open " + T),
  7059. p.addClass("open"),
  7060. o(),
  7061. r(),
  7062. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7063. v.classList.add("fadeIn")))
  7064. }),
  7065. E.on("click", function(e) {
  7066. S.close()
  7067. }),
  7068. C.on("click", function(e) {
  7069. T && T !== a.TRANSITIONING && (o(),
  7070. r())
  7071. }),
  7072. I.on("click", function(e) {
  7073. o(),
  7074. I.addClass("underline-tab"),
  7075. c.fill(b, s.MORE_HELP),
  7076. f.addClass("more-help")
  7077. })
  7078. }
  7079. function r() {
  7080. C.addClass("underline-tab"),
  7081. c.fill(_, s.NAVIGATION, T),
  7082. f.addClass(T)
  7083. }
  7084. function o() {
  7085. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7086. A.forEach(function(e) {
  7087. e.classList.remove("underline-tab")
  7088. })
  7089. }
  7090. var a = e("../../enum/Viewmode")
  7091. , s = e("../../enum/HelpModalType")
  7092. , l = e("./HelpEvent")
  7093. , c = (e("../helpManager"),
  7094. e("./../populateModal"))
  7095. , h = e("../../settings")
  7096. , u = e("../../util/common")
  7097. , d = e("events").EventEmitter
  7098. , p = $(".footer-help").eq(0)
  7099. , f = $("#help-dialog").eq(0)
  7100. , g = document.querySelector("#quick-logo")
  7101. , m = document.querySelector("#loaderCoBrand")
  7102. , v = document.querySelector("#help-dialog")
  7103. , y = document.querySelector(".footer")
  7104. , A = $(".help-tabs").children().toArray()
  7105. , C = $(".navigation-tab").eq(0)
  7106. , I = $(".more-help-tab").eq(0)
  7107. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7108. f.find(".close").eq(0))
  7109. , _ = f.find(".interactions").toArray()
  7110. , b = f.find(".ui-instructions").toArray()
  7111. , w = a.PANORAMA
  7112. , T = a.PANORAMA
  7113. , x = !1
  7114. , S = {
  7115. init: function(e, t) {
  7116. w = T = t,
  7117. [v, m, g, y].forEach(function(e) {
  7118. e.classList.add(c.deviceType)
  7119. }),
  7120. n()
  7121. },
  7122. close: function() {
  7123. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7124. p.removeClass("open"),
  7125. f.removeClass("open"),
  7126. v.classList.contains("fadeIn"))) {
  7127. v.classList.remove("fadeIn");
  7128. var e = T === a.TRANSITIONING ? w : T;
  7129. c.clear(_, s.NAVIGATION, e)
  7130. }
  7131. },
  7132. updateMode: function(e) {
  7133. w = T,
  7134. T = e
  7135. }
  7136. };
  7137. u.extendObject(S, d.prototype),
  7138. t.exports = S
  7139. }
  7140. , {
  7141. "../../enum/HelpModalType": 28,
  7142. "../../enum/Viewmode": 51,
  7143. "../../settings": 166,
  7144. "../../util/common": 185,
  7145. "../helpManager": 68,
  7146. "./../populateModal": 75,
  7147. "./HelpEvent": 66,
  7148. events: 202
  7149. }],
  7150. 68: [function(s, l, e) {
  7151. (function(e) {
  7152. "use strict";
  7153. var t = s("../util/browser")
  7154. , i = s("./../util/logger")
  7155. , n = s("./../settings")
  7156. , r = new i(e)
  7157. , o = function() {
  7158. var t;
  7159. try {
  7160. return t = window.localStorage.getItem("visitCount") || "0",
  7161. t = (parseFloat(t) + 1).toString(),
  7162. window.localStorage.setItem("visitCount", t),
  7163. r.debug("visitCount = " + t),
  7164. t
  7165. } catch (e) {
  7166. t = "1",
  7167. r.debug("couldn't set local storage")
  7168. }
  7169. }()
  7170. , a = !1;
  7171. l.exports = {
  7172. isHelpDisabled: function() {
  7173. return "0" === t.valueFromHash("help", null) || a
  7174. },
  7175. isLargeHelpEnabled: function() {
  7176. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7177. },
  7178. isSmallHelpEnabled: function() {
  7179. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7180. },
  7181. isHelpEnabled: function() {
  7182. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7183. },
  7184. setAutoPlay: function(e) {
  7185. a = 0 <= n.warp.auto && 1 < e
  7186. }
  7187. }
  7188. }
  7189. ).call(this, "/js/gui/helpManager.js")
  7190. }
  7191. , {
  7192. "../util/browser": 182,
  7193. "./../settings": 166,
  7194. "./../util/logger": 189
  7195. }],
  7196. 69: [function(e, t, i) {
  7197. "use strict";
  7198. function r(e) {
  7199. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7200. T = !0,
  7201. h.close(),
  7202. function(e) {
  7203. !n(e) && S ? v.forEach(function(e) {
  7204. e.classList.remove("drawerOpen"),
  7205. e.classList.add("duringTour")
  7206. }) : C.hasClass("open") ? v.forEach(function(e) {
  7207. e.classList.remove("duringTour"),
  7208. e.classList.add("drawerOpen")
  7209. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7210. e.classList.add("fadeOut")
  7211. })
  7212. }(e),
  7213. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7214. C.hasClass("playing") || (y.forEach(function(e) {
  7215. e.classList.add("detectHover")
  7216. }),
  7217. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7218. }
  7219. function o() {
  7220. C.hasClass("playing") || (clearTimeout(x),
  7221. x = setTimeout(a, c.immersive.timeToShowAgain))
  7222. }
  7223. function a() {
  7224. clearTimeout(x),
  7225. T = !1,
  7226. m.forEach(function(e) {
  7227. e.classList.remove("drawerOpen")
  7228. }),
  7229. S || v.forEach(function(e) {
  7230. e.classList.remove("duringTour")
  7231. }),
  7232. y.forEach(function(e) {
  7233. e.classList.remove("detectHover")
  7234. })
  7235. }
  7236. function s() {
  7237. T ? a() : r(),
  7238. M = !0,
  7239. setTimeout(function() {
  7240. M = !1
  7241. }, c.immersive.uiStayDuration)
  7242. }
  7243. function n(e) {
  7244. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7245. }
  7246. var l = e("../util/browser")
  7247. , c = e("../settings")
  7248. , h = e("./help/help")
  7249. , u = e("../enum/tagEvents")
  7250. , d = e("../enum/ControlEvents")
  7251. , p = e("../enum/PlayerEvents")
  7252. , f = e("../enum/DirectorEvents")
  7253. , g = (p = e("../enum/PlayerEvents"),
  7254. e("../enum/Viewmode"))
  7255. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7256. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7257. , y = $("#hover-bottom, #hover-top").toArray()
  7258. , A = ($("#pullTab").eq(0),
  7259. $("#playHead").eq(0),
  7260. $(".pinBottom-container").eq(0))
  7261. , C = $("#drawer").eq(0)
  7262. , I = $("#drawer-container").eq(0)
  7263. , E = $("#meta-info").eq(0)
  7264. , _ = $(".pinTop.left").eq(0)
  7265. , b = $("#player").eq(0)
  7266. , w = document.getElementById("pullTab")
  7267. , T = !1
  7268. , x = null
  7269. , S = !1
  7270. , M = !1
  7271. , R = null
  7272. , P = !1;
  7273. t.exports.init = function(e, t, i, n) {
  7274. (function(t, i, e, n) {
  7275. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7276. t.controls[e].on(d.Move, r),
  7277. t.controls[e].on(d.LongTap, s)
  7278. }),
  7279. b.on("mousewheel DOMMouseScroll", r),
  7280. e.on(u.TagActivated, r),
  7281. e.on(u.TagNavigation, r),
  7282. i.on(p.FlyingEnded, o),
  7283. i.on(p.ModeChanging, function(e, t) {
  7284. P = t !== g.PANORAMA && e !== g.PANORAMA
  7285. }),
  7286. i.on(p.ModeChanged, function(e, t) {
  7287. R = i.mode,
  7288. t !== g.TRANSITIONING ? a() : r("modeChange")
  7289. }),
  7290. n.on(f.TourStart, function() {
  7291. S = !0,
  7292. r()
  7293. }),
  7294. n.on(f.TourEnd, function() {
  7295. S = !1,
  7296. a()
  7297. }),
  7298. n.on(f.ActionInterrupted, function() {
  7299. S = !1
  7300. }),
  7301. w.addEventListener("touchend", function() {
  7302. $("#pullTab").hasClass("opened") && !S && a()
  7303. }, !0)
  7304. }
  7305. )(e, t, i, n),
  7306. l.isMobile() ? (y.forEach(function(e) {
  7307. e.classList.add("mobile")
  7308. }),
  7309. A.click(a)) : (y.forEach(function(e) {
  7310. e.addEventListener("mouseleave", function() {
  7311. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7312. }, !0)
  7313. }),
  7314. b.mouseleave(function() {
  7315. y[0].classList.contains("detectHover") && a()
  7316. })),
  7317. R = t.mode
  7318. }
  7319. ,
  7320. t.exports.hideUi = r,
  7321. t.exports.resetDrawer = function() {
  7322. I.hasClass("duringTour") || (S = !1,
  7323. r("gui"),
  7324. a())
  7325. }
  7326. }
  7327. , {
  7328. "../enum/ControlEvents": 21,
  7329. "../enum/DirectorEvents": 23,
  7330. "../enum/tagEvents": 32,
  7331. "../enum/PlayerEvents": 40,
  7332. "../enum/Viewmode": 51,
  7333. "../settings": 166,
  7334. "../util/browser": 182,
  7335. "./help/help": 67
  7336. }],
  7337. 70: [function(i, n, e) {
  7338. (function(e) {
  7339. "use strict";
  7340. var t = i("./../util/logger")
  7341. , o = i("./../settings")
  7342. , a = i("./debug")
  7343. , s = i("./../util/common")
  7344. , l = (i("./gui"),
  7345. new t(e));
  7346. o.console && $("body").append('<div id="debug-console"></div>'),
  7347. n.exports.init = function(i, n, r) {
  7348. l.debug("konami has the modelInstance");
  7349. var t = [];
  7350. $(window).on("keydown", function(e) {
  7351. t.push(e.which),
  7352. t.length > o.secretPanelWord.length && t.shift(),
  7353. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7354. o.debug = !0)
  7355. }),
  7356. $(window).on("keydown", function e(t) {
  7357. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7358. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7359. })
  7360. }
  7361. }
  7362. ).call(this, "/js/gui/konami.js")
  7363. }
  7364. , {
  7365. "./../settings": 166,
  7366. "./../util/common": 185,
  7367. "./../util/logger": 189,
  7368. "./debug": 63,
  7369. "./gui": 65
  7370. }],
  7371. 71: [function(e, t, i) {
  7372. "use strict";
  7373. function r() {
  7374. s.clear(m, l.LANDING[v]),
  7375. g.removeClass("fadeIn")
  7376. }
  7377. var o = e("../settings")
  7378. , a = (e("./help/help"),
  7379. e("./helpManager"))
  7380. , s = e("./populateModal")
  7381. , l = e("../enum/HelpModalType")
  7382. , n = e("../enum/Viewmode")
  7383. , c = e("../enum/DirectorEvents")
  7384. , h = e("../enum/PlayerEvents")
  7385. , u = $("#quick-blackout").eq(0)
  7386. , d = $("#quick-logo").eq(0)
  7387. , p = $(".quick-brand").toArray()
  7388. , f = $("#loaderCoBrand").eq(0)
  7389. , g = $("#interaction-modal").eq(0)
  7390. , m = g.find(".interaction").toArray()
  7391. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7392. "");
  7393. t.exports.delayLanding = function(e) {
  7394. var t = $.Deferred();
  7395. e || t.resolve();
  7396. var i = o.startupFlyinDelay;
  7397. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7398. setTimeout(t.resolve.bind(t), i),
  7399. t
  7400. }
  7401. ,
  7402. t.exports.showMessage = function(e, t, i) {
  7403. var n = 0;
  7404. o.quickstart.enabled && (function(e) {
  7405. e && (f.addClass("quick-brand"),
  7406. d.before(f),
  7407. p = $(".quick-brand").toArray()),
  7408. u.addClass("fadeOut"),
  7409. setTimeout(function() {
  7410. p.forEach(function(e) {
  7411. e.classList.add("fadeIn")
  7412. })
  7413. }, o.quickstart.showTextDelay),
  7414. setTimeout(function() {
  7415. p.forEach(function(e) {
  7416. e.classList.add("fadeOut")
  7417. })
  7418. }, o.quickstart.fadeOutDelay)
  7419. }(i),
  7420. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7421. function(e, t) {
  7422. setTimeout(function() {
  7423. if (a.isHelpEnabled()) {
  7424. if (t(),
  7425. s.init(),
  7426. g.addClass("fadeIn landing " + s.deviceType),
  7427. a.isSmallHelpEnabled())
  7428. return void g.addClass("small");
  7429. s.fill(m, l.LANDING[v]),
  7430. g.addClass(v)
  7431. }
  7432. }, e);
  7433. var i = {
  7434. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7435. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7436. }
  7437. , n = $(".nav-icon .icon");
  7438. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7439. function r(e) {
  7440. e.on("click", function() {
  7441. var e = null;
  7442. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7443. i.length < e || e < 1)
  7444. return !1;
  7445. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7446. "data-page": e,
  7447. src: i.mobile[e - 1]
  7448. }) : n.attr({
  7449. "data-page": e,
  7450. src: i.pc[e - 1]
  7451. })
  7452. })
  7453. }
  7454. r($(".next-button")),
  7455. r($(".prev-button"))
  7456. }(n, function() {
  7457. e.once(h.Move, r),
  7458. t.once(c.TourStart, r)
  7459. })
  7460. }
  7461. ,
  7462. t.exports.init = function(e, t) {
  7463. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7464. }
  7465. ,
  7466. t.exports.dismissModal = r
  7467. }
  7468. , {
  7469. "../enum/DirectorEvents": 23,
  7470. "../enum/HelpModalType": 28,
  7471. "../enum/PlayerEvents": 40,
  7472. "../enum/Viewmode": 51,
  7473. "../settings": 166,
  7474. "./help/help": 67,
  7475. "./helpManager": 68,
  7476. "./populateModal": 75
  7477. }],
  7478. 72: [function(e, t, i) {
  7479. "use strict";
  7480. var n = e("./circleLoader").circleLoader;
  7481. t.exports = {
  7482. element: $("#gui-loading"),
  7483. hide: function(e) {
  7484. n.done(),
  7485. this.element.fadeOut(1500, e)
  7486. },
  7487. show: function(e) {
  7488. this.element.fadeIn(500, function() {
  7489. this.element.css("display", "table"),
  7490. e && e()
  7491. }
  7492. .bind(this))
  7493. },
  7494. progress: function(e) {
  7495. n.set(e)
  7496. }
  7497. }
  7498. }
  7499. , {
  7500. "./circleLoader": 60
  7501. }],
  7502. 73: [function(e, t, i) {
  7503. "use strict";
  7504. var n = e("../settings")
  7505. , r = $("#memory-info")
  7506. , o = r.find("#memory-gpu")
  7507. , a = !1;
  7508. t.exports = {
  7509. show: function() {
  7510. n.profiling.enabled && (r.show(),
  7511. a = !0)
  7512. },
  7513. hide: function() {
  7514. r.hide(),
  7515. a = !1
  7516. },
  7517. toggle: function() {
  7518. a ? this.hide() : this.show()
  7519. },
  7520. update: function(e) {
  7521. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7522. }
  7523. }
  7524. }
  7525. , {
  7526. "../settings": 166
  7527. }],
  7528. 74: [function(e, t, i) {
  7529. "use strict";
  7530. e("../util/browser"),
  7531. e("../analytics");
  7532. e("../settings"),
  7533. t.exports = {
  7534. show: function(e, t) {
  7535. $("#gui-message").fadeOut(500, function() {
  7536. t()
  7537. })
  7538. }
  7539. }
  7540. }
  7541. , {
  7542. "../analytics": 4,
  7543. "../settings": 166,
  7544. "../util/browser": 182
  7545. }],
  7546. 75: [function(e, t, i) {
  7547. "use strict";
  7548. function n(e, t, i, n) {
  7549. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7550. }
  7551. var r = e("../util/browser")
  7552. , o = e("../localization/localize")
  7553. , a = e("../enum/HelpModalType")
  7554. , s = (e("../enum/HelpModalSize"),
  7555. e("../enum/Viewmode"));
  7556. t.exports = {
  7557. init: function() {
  7558. if (!this.hasInitialized) {
  7559. this.hasInitialized = !0,
  7560. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7561. this.assets = {},
  7562. this.assets[a.LANDING[s.PANORAMA]] = {
  7563. desktop: {
  7564. left: {
  7565. "top-info": o.ROTATE,
  7566. "big-image": "images/nav_help_mouse_drag_left.png",
  7567. keyboard: "images/nav_help_keyboard_left_right.png"
  7568. },
  7569. middle: {
  7570. "top-info": o.MOVE,
  7571. "big-image": "images/nav_help_mouse_click.png",
  7572. keyboard: "images/nav_help_keyboard_up_down.png"
  7573. },
  7574. right: {
  7575. "top-info": o.ZOOM,
  7576. "big-image": "images/nav_help_mouse_zoom.png",
  7577. keyboard: "images/nav_help_zoom_keys.png"
  7578. }
  7579. },
  7580. mobile: {
  7581. left: {
  7582. "top-info": o.ROTATE,
  7583. "big-image": "images/nav_help_gesture_drag.png"
  7584. },
  7585. middle: {
  7586. "top-info": o.MOVE,
  7587. "big-image": "images/nav_help_gesture_tap.png"
  7588. },
  7589. right: {
  7590. "top-info": o.ZOOM,
  7591. "big-image": "images/nav_help_gesture_pinch.png"
  7592. }
  7593. }
  7594. },
  7595. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7596. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7597. desktop: {
  7598. left: {
  7599. "top-info": o.ROTATE,
  7600. "big-image": "images/nav_help_mouse_drag_left.png",
  7601. keyboard: "images/nav_help_keyboard_left_right.png"
  7602. },
  7603. middle: {
  7604. "top-info": o.MOVE,
  7605. "big-image": "images/nav_help_mouse_position_right.png"
  7606. }
  7607. },
  7608. mobile: {
  7609. left: {
  7610. "top-info": o.ROTATE,
  7611. "big-image": "images/nav_help_gesture_drag.png"
  7612. },
  7613. middle: {
  7614. "top-info": o.MOVE,
  7615. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7616. }
  7617. }
  7618. },
  7619. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7620. desktop: {
  7621. left: {
  7622. "top-info": o.MOVE,
  7623. "big-image": "images/nav_help_mouse_position_left.png"
  7624. },
  7625. middle: {
  7626. "top-info": o.ROTATE,
  7627. "big-image": "images/nav_help_mouse_drag_right.png",
  7628. keyboard: "images/nav_help_keyboard_left_right.png"
  7629. }
  7630. },
  7631. mobile: {
  7632. left: {
  7633. "top-info": o.MOVE,
  7634. "big-image": "images/nav_help_gesture_position.png"
  7635. },
  7636. middle: {
  7637. "top-info": o.ROTATE,
  7638. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7639. }
  7640. }
  7641. };
  7642. var e = {
  7643. "top-info": o.INSIDE,
  7644. "big-image": "images/nav_help_click_inside.png",
  7645. keyboard: "images/nav_help_inside_key.png"
  7646. };
  7647. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7648. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7649. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7650. var t = {
  7651. "top-info": o.INSIDE,
  7652. "big-image": "images/nav_help_tap_inside.png"
  7653. };
  7654. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7655. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7656. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7657. this.assets[a.NAVIGATION] = {},
  7658. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7659. desktop: {
  7660. left: {
  7661. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7662. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7663. "big-image": "images/nav_help_mouse_drag_left.png",
  7664. keyboard: "images/nav_help_keyboard_left_right.png"
  7665. },
  7666. middle: {
  7667. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7668. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7669. "big-image": "images/nav_help_mouse_click.png",
  7670. keyboard: "images/nav_help_keyboard_up_down.png"
  7671. },
  7672. right: {
  7673. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7674. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7675. "big-image": "images/nav_help_mouse_zoom.png",
  7676. keyboard: "images/nav_help_zoom_keys.png"
  7677. }
  7678. },
  7679. mobile: {
  7680. left: {
  7681. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7682. "big-image": "images/nav_help_gesture_drag.png"
  7683. },
  7684. middle: {
  7685. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7686. "big-image": "images/nav_help_gesture_tap.png"
  7687. },
  7688. right: {
  7689. "top-info": o.HELP_MOBILE_3,
  7690. "big-image": "images/nav_help_gesture_pinch.png"
  7691. }
  7692. }
  7693. },
  7694. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7695. desktop: {
  7696. left: {
  7697. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7698. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7699. "big-image": "images/nav_help_mouse_drag_left.png",
  7700. keyboard: "images/nav_help_keyboard_all.png"
  7701. },
  7702. middle: {
  7703. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7704. "big-image": "images/nav_help_mouse_position_right.png"
  7705. },
  7706. right: {
  7707. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7708. "big-image": "images/nav_help_mouse_zoom.png"
  7709. }
  7710. },
  7711. mobile: {
  7712. left: {
  7713. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7714. "big-image": "images/nav_help_gesture_drag.png"
  7715. },
  7716. middle: {
  7717. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7718. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7719. },
  7720. right: {
  7721. "top-info": o.HELP_MOBILE_3,
  7722. "big-image": "images/nav_help_gesture_pinch.png"
  7723. }
  7724. }
  7725. },
  7726. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7727. desktop: {
  7728. left: {
  7729. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7730. "big-image": "images/nav_help_mouse_position_left.png"
  7731. },
  7732. middle: {
  7733. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7734. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7735. "big-image": "images/nav_help_mouse_drag_right.png",
  7736. keyboard: "images/nav_help_keyboard_left_right.png"
  7737. },
  7738. right: {
  7739. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7740. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7741. "big-image": "images/nav_help_mouse_zoom.png",
  7742. keyboard: "images/nav_help_keyboard_up_down.png"
  7743. }
  7744. },
  7745. mobile: {
  7746. left: {
  7747. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7748. "big-image": "images/nav_help_gesture_position.png"
  7749. },
  7750. middle: {
  7751. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7752. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7753. },
  7754. right: {
  7755. "top-info": o.HELP_MOBILE_3,
  7756. "big-image": "images/nav_help_gesture_pinch.png"
  7757. }
  7758. }
  7759. },
  7760. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7761. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7762. "top-info": o.HELP_DESKTOP_360_2A,
  7763. "bottom-info": o.HELP_DESKTOP_360_2B,
  7764. "big-image": "images/nav_help_click_inside.png",
  7765. keyboard: "images/nav_help_inside_key.png"
  7766. },
  7767. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7768. "top-info": o.HELP_MOBILE_360_2,
  7769. "big-image": "images/nav_help_tap_inside.png"
  7770. },
  7771. this.assets[a.MORE_HELP] = {
  7772. desktop: {
  7773. "more-help-hlr": {
  7774. "top-info": o.HELP_MORE_HLR_A,
  7775. "big-image": "images/nav_help_expand.svg",
  7776. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7777. },
  7778. "more-help-dollhouse": {
  7779. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7780. "big-image": "images/nav_help_dollhouse.svg",
  7781. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7782. },
  7783. "more-help-floors": {
  7784. "top-info": o.HELP_MORE_FLOORS_A,
  7785. "big-image": "images/nav_help_floor picker.svg",
  7786. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7787. },
  7788. "more-help-tag": {
  7789. "top-info": o.HELP_MORE_TAG_A,
  7790. "big-image": "images/nav_help_tag.svg",
  7791. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7792. },
  7793. "more-help-zoom": {
  7794. "top-info": o.HELP_MORE_ZOOM_A,
  7795. "big-image": "images/nav_help_zoom.svg",
  7796. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7797. },
  7798. "more-help-tour": {
  7799. "top-info": o.HELP_MORE_TOUR_A,
  7800. "big-image": "images/nav_help_play.png",
  7801. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7802. },
  7803. "more-help-inside": {
  7804. "top-info": o.HELP_MORE_INSIDE_A,
  7805. "big-image": "images/nav_help_inside.svg",
  7806. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7807. },
  7808. "more-help-vr": {
  7809. "top-info": o.HELP_MORE_VR_A,
  7810. "big-image": "images/nav_help_vr.svg",
  7811. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7812. },
  7813. "more-help-360": {
  7814. "top-info": o.HELP_MORE_360_A,
  7815. "big-image": "images/nav_help_360.svg",
  7816. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7817. },
  7818. "more-help-fullscreen": {
  7819. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7820. "big-image": "images/nav_help_fullscreen.svg",
  7821. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7822. }
  7823. },
  7824. mobile: {
  7825. "more-help-hlr": {
  7826. "top-info": o.HELP_MORE_HLR_A,
  7827. "big-image": "images/nav_help_expand.svg",
  7828. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7829. },
  7830. "more-help-dollhouse": {
  7831. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7832. "big-image": "images/nav_help_dollhouse.svg",
  7833. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7834. },
  7835. "more-help-floors": {
  7836. "top-info": o.HELP_MORE_FLOORS_A,
  7837. "big-image": "images/nav_help_floor picker.svg",
  7838. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7839. },
  7840. "more-help-tag": {
  7841. "top-info": o.HELP_MORE_TAG_A,
  7842. "big-image": "images/nav_help_tag.svg",
  7843. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7844. },
  7845. "more-help-tour": {
  7846. "top-info": o.HELP_MORE_TOUR_A,
  7847. "big-image": "images/nav_help_play.png",
  7848. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7849. },
  7850. "more-help-inside": {
  7851. "top-info": o.HELP_MORE_INSIDE_A,
  7852. "big-image": "images/nav_help_inside.svg",
  7853. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7854. },
  7855. "more-help-vr": {
  7856. "top-info": o.HELP_MORE_VR_A,
  7857. "big-image": "images/webvr.svg",
  7858. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7859. },
  7860. "more-help-360": {
  7861. "top-info": o.HELP_MORE_360_A,
  7862. "big-image": "images/nav_help_360.svg",
  7863. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7864. }
  7865. }
  7866. },
  7867. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7868. desktop: {
  7869. left: {
  7870. "top-info": o.ROTATE,
  7871. "big-image": "images/nav_help_mouse_drag_left.png",
  7872. keyboard: "images/nav_help_keyboard_left_right.png"
  7873. },
  7874. middle: {
  7875. "top-info": o.MOVE,
  7876. "big-image": "images/nav_help_mouse_click.png",
  7877. keyboard: "images/nav_help_keyboard_up_down.png"
  7878. },
  7879. right: {
  7880. "top-info": o.PLAY,
  7881. "big-image": "images/Desktop-help-play-button.svg",
  7882. keyboard: "images/Desktop-help-spacebar-2.svg"
  7883. }
  7884. },
  7885. mobile: {
  7886. left: {
  7887. "top-info": o.ROTATE,
  7888. "big-image": "images/nav_help_gesture_drag.png"
  7889. },
  7890. middle: {
  7891. "top-info": o.MOVE,
  7892. "big-image": "images/nav_help_gesture_tap.png"
  7893. },
  7894. right: {
  7895. "top-info": o.PLAY,
  7896. "big-image": "images/mobile-help-play-button.svg"
  7897. }
  7898. }
  7899. },
  7900. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7901. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7902. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7903. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7904. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7905. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7906. }
  7907. },
  7908. fill: function(e, t, i) {
  7909. n.call(this, e, t, i, !0)
  7910. },
  7911. clear: function(e, t, i) {
  7912. n.call(this, e, t, i, !1)
  7913. }
  7914. }
  7915. }
  7916. , {
  7917. "../enum/HelpModalSize": 27,
  7918. "../enum/HelpModalType": 28,
  7919. "../enum/Viewmode": 51,
  7920. "../localization/localize": 108,
  7921. "../util/browser": 182
  7922. }],
  7923. 76: [function(e, t, i) {
  7924. "use strict";
  7925. t.exports = Object.freeze({
  7926. OPENED: "share.open",
  7927. CLOSED: "share.closed",
  7928. LINK_CLICKED: "share.linked"
  7929. })
  7930. }
  7931. , {}],
  7932. 77: [function(e, t, i) {
  7933. "use strict";
  7934. function n(n) {
  7935. function e(e, t) {
  7936. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7937. I.emit(l.LINK_CLICKED, {
  7938. channel: n
  7939. }),
  7940. window.open(C[n], "shareWindow", i)
  7941. }
  7942. switch (n) {
  7943. case A.FACEBOOK:
  7944. e(580, 420);
  7945. break;
  7946. case A.TWITTER:
  7947. e(550, 440);
  7948. break;
  7949. case A.MAIL:
  7950. I.emit(l.LINK_CLICKED, {
  7951. channel: "email"
  7952. }),
  7953. window.open(C[n], "_blank");
  7954. break;
  7955. case A.LINKEDIN:
  7956. }
  7957. }
  7958. function r(e) {
  7959. I.emit(l.LINK_CLICKED, {
  7960. channel: "copylink"
  7961. });
  7962. var t = document.createRange();
  7963. t.selectNodeContents(v);
  7964. var i = window.getSelection();
  7965. i.removeAllRanges(),
  7966. i.addRange(t),
  7967. document.execCommand("copy"),
  7968. y.classList.remove("hidden"),
  7969. v.classList.add("highlighted")
  7970. }
  7971. function o(e) {
  7972. e && (e.stopPropagation(),
  7973. e.target === v) || (window.getSelection().removeAllRanges(),
  7974. v.classList.remove("highlighted"),
  7975. y.classList.add("hidden"))
  7976. }
  7977. var a = e("../../util/browser")
  7978. , s = e("../../localization/localize")
  7979. , l = e("./ShareEvents")
  7980. , c = e("../../util/common")
  7981. , h = e("events").EventEmitter
  7982. , u = document.getElementById("sharing")
  7983. , d = document.getElementById("share-modal")
  7984. , p = document.getElementById("share-close")
  7985. , f = document.getElementById("facebook-share")
  7986. , g = document.getElementById("twitter-share")
  7987. , m = document.getElementById("mail-share")
  7988. , v = document.getElementById("share-url-text")
  7989. , y = document.getElementById("copy-success")
  7990. , A = Object.freeze({
  7991. FACEBOOK: "facebook",
  7992. TWITTER: "twitter",
  7993. MAIL: "mail",
  7994. LINKEDIN: "linkedin"
  7995. })
  7996. , C = {};
  7997. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  7998. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  7999. C[A.MAIL] = "mailto:?subject=";
  8000. var I = {
  8001. init: function(e) {
  8002. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8003. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8004. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8005. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8006. u.addEventListener("click", this.toggle.bind(this)),
  8007. p.addEventListener("click", this.hide.bind(this)),
  8008. v.addEventListener("click", r),
  8009. d.addEventListener("click", o),
  8010. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8011. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8012. m.addEventListener("click", n.bind(this, A.MAIL)),
  8013. v.textContent = window.location.href + "&utm_source=4",
  8014. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8015. u.classList.remove("hidden")
  8016. },
  8017. show: function() {
  8018. this.emit(l.OPENED),
  8019. d.classList.add("fadeIn")
  8020. },
  8021. hide: function() {
  8022. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8023. document.selection && document.selection.empty(),
  8024. window.getSelection().removeAllRanges(),
  8025. o(),
  8026. d.classList.remove("fadeIn"))
  8027. },
  8028. toggle: function() {
  8029. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8030. }
  8031. };
  8032. c.extendObject(I, h.prototype),
  8033. t.exports = I
  8034. }
  8035. , {
  8036. "../../localization/localize": 108,
  8037. "../../util/browser": 182,
  8038. "../../util/common": 185,
  8039. "./ShareEvents": 76,
  8040. events: 202
  8041. }],
  8042. 78: [function(e, t, i) {
  8043. "use strict";
  8044. t.exports = Object.freeze({
  8045. OPENED: "terms.opened",
  8046. CLOSED: "terms.closed"
  8047. })
  8048. }
  8049. , {}],
  8050. 79: [function(e, t, i) {
  8051. "use strict";
  8052. var n = e("./TermsEvent")
  8053. , r = e("../../localization/localize")
  8054. , o = e("../../analytics")
  8055. , a = e("../../util/ajax")
  8056. , s = e("../../util/common")
  8057. , l = e("events").EventEmitter
  8058. , c = document.getElementById("terms-modal")
  8059. , h = {
  8060. init: function() {
  8061. $(".footer-terms").on("click", function(e) {
  8062. e.preventDefault(),
  8063. this.show()
  8064. }
  8065. .bind(this)),
  8066. $("#terms-modal .close").on("click", this.hide.bind(this))
  8067. },
  8068. show: function() {
  8069. this.emit(n.OPENED),
  8070. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8071. var t = $("#terms-text").html(e);
  8072. o.track("showcase_gui", {
  8073. gui_action: "click_terms_button",
  8074. interaction_source: "gui"
  8075. }),
  8076. t.find("a").attr("target", "_blank")
  8077. }).fail(function() {
  8078. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8079. }),
  8080. c.classList.add("fadeIn")
  8081. },
  8082. hide: function(e) {
  8083. e && e.preventDefault(),
  8084. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8085. c.classList.remove("fadeIn")
  8086. }
  8087. };
  8088. s.extendObject(h, l.prototype),
  8089. t.exports = h
  8090. }
  8091. , {
  8092. "../../analytics": 4,
  8093. "../../localization/localize": 108,
  8094. "../../util/ajax": 181,
  8095. "../../util/common": 185,
  8096. "./TermsEvent": 78,
  8097. events: 202
  8098. }],
  8099. 80: [function(e, t, i) {
  8100. "use strict";
  8101. t.exports = Object.freeze({
  8102. OPEN_INFO: "title.open.info",
  8103. CLOSE_INFO: "title.close.info",
  8104. SHOW_INFO: "title.show.info",
  8105. HIDE_INFO: "title.hide.info",
  8106. LINK_CLICKED: "title.link.click",
  8107. CONTACT_LINK_CLICKED: "title.contact.click",
  8108. ORIGIN_LINK_CLICKED: "title.origin.click"
  8109. })
  8110. }
  8111. , {}],
  8112. 81: [function(e, t, i) {
  8113. "use strict";
  8114. var o = e("../../settings");
  8115. t.exports.init = function(e, t) {
  8116. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8117. function e(e) {
  8118. t.shouldShowtags = "show" === this.value,
  8119. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8120. }
  8121. document.getElementById("tag-toggles").classList.remove("hidden"),
  8122. document.getElementById("radio-tag-show").checked = !0;
  8123. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8124. n[r].addEventListener("change", e)
  8125. }(e, t)
  8126. }
  8127. }
  8128. , {
  8129. "../../settings": 166
  8130. }],
  8131. 82: [function(S, M, e) {
  8132. (function(e) {
  8133. "use strict";
  8134. function i(e) {
  8135. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8136. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8137. _.appendChild(function(e) {
  8138. var t = document.createElement("a");
  8139. return t.id = "url",
  8140. t.target = "_blank",
  8141. t.href = e,
  8142. t.innerText = e,
  8143. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8144. t
  8145. }(e)),
  8146. b.forEach(function(e) {
  8147. e.classList.add("share-link")
  8148. }),
  8149. 0))
  8150. }
  8151. function s(e, t) {
  8152. var i = e
  8153. , n = t;
  8154. return function(e, t) {
  8155. i.push(t || n, e)
  8156. }
  8157. }
  8158. var l = S("../../util/browser")
  8159. , t = S("../../util/common")
  8160. , n = S("../../util/logger")
  8161. , r = S("../../localization/localize")
  8162. , o = S("./titleBarSettings")
  8163. , c = S("../../settings")
  8164. , a = S("./TitleEvents")
  8165. , h = S("events").EventEmitter
  8166. , u = new n(e)
  8167. , d = document.querySelector(".pinTop.left")
  8168. , p = document.getElementsByClassName("title-container")[0]
  8169. , f = document.getElementById("title-toggle").querySelector("i")
  8170. , g = document.getElementById("meta-info-wrapper")
  8171. , m = document.getElementById("meta-info")
  8172. , v = document.getElementById("meta-description")
  8173. , y = document.getElementsByClassName("contact-info")[0]
  8174. , A = document.getElementById("contact-data")
  8175. , C = document.getElementById("addressTxt")
  8176. , I = document.getElementById("tag-toggles")
  8177. , E = document.getElementById("share-origin")
  8178. , _ = document.getElementById("share-link-wrapper")
  8179. , b = [m, g, p]
  8180. , w = !1
  8181. , T = !1
  8182. , x = {
  8183. populate: function(e) {
  8184. if (function(e, t) {
  8185. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8186. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8187. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8188. document.getElementById("gui-name").classList.add("noCoBrand"),
  8189. document.getElementById("cobrandTitle").classList.add("hidden")),
  8190. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8191. !1)
  8192. }(e.name, e.coBrand)) {
  8193. if (function(e) {
  8194. e ? (w = !0,
  8195. v.innerHTML = e) : v.classList.add("hidden")
  8196. }(e.description),
  8197. function(e, t, i, n) {
  8198. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8199. w = !0;
  8200. var r = []
  8201. , o = s(r, "<br>");
  8202. if (e && o('<span id="contactName">' + e + "</span>"),
  8203. t) {
  8204. var a = n || t;
  8205. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8206. }
  8207. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8208. r[0] = "",
  8209. A.innerHTML = r.join("")
  8210. } else
  8211. y.classList.add("hidden")
  8212. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8213. function(e) {
  8214. if ("string" == typeof e)
  8215. try {
  8216. e = JSON.parse(e)
  8217. } catch (e) {
  8218. return u.warn("Unable to parse address data"),
  8219. C.parentElement.classList.add("hidden")
  8220. }
  8221. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8222. w = !0;
  8223. var t = []
  8224. , i = s(t, " ");
  8225. e.address_1 && i(e.address_1),
  8226. e.address_2 && i(e.address_2),
  8227. e.city && i(e.city, ", "),
  8228. e.state && i(e.state, ", "),
  8229. e.zip && i(e.zip, e.state ? " " : ", "),
  8230. t[0] = "",
  8231. C.innerText = t.join("")
  8232. } else
  8233. C.parentElement.classList.add("hidden")
  8234. }(e.address),
  8235. w) {
  8236. var t = document.createElement("br");
  8237. I.insertBefore(t, I.firstElementChild)
  8238. }
  8239. e.socialSharing && c.share.enabled && (T = i(e.url))
  8240. }
  8241. },
  8242. finishSetup: function(e) {
  8243. w = w || !!e,
  8244. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8245. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8246. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8247. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8248. }),
  8249. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8250. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8251. contact_type: e.getAttribute("id")
  8252. }))
  8253. }),
  8254. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8255. },
  8256. toggleMeta: function(e, t) {
  8257. var i = document.getElementById("model-title");
  8258. t && t.preventDefault();
  8259. var n = m.classList.contains("expand");
  8260. e && !n || (n ? (b.forEach(function(e) {
  8261. e.classList.remove("expand")
  8262. }),
  8263. this.emit(a.CLOSE_INFO),
  8264. i.classList.remove("expand")) : (b.forEach(function(e) {
  8265. e.classList.add("expand")
  8266. }),
  8267. i.classList.add("expand"),
  8268. this.emit(a.OPEN_INFO)))
  8269. },
  8270. setupToggling: function() {
  8271. g.style.height = m.offsetHeight + "px",
  8272. m.addEventListener("transitionend", function() {
  8273. g.style.height = m.offsetHeight + "px"
  8274. })
  8275. },
  8276. toggleTitle: function(e) {
  8277. e && e.preventDefault(),
  8278. d.classList.contains("closed") ? (d.classList.add("open"),
  8279. f.classList.remove("icon-dpad-right"),
  8280. f.classList.add("icon-dpad-left"),
  8281. this.emit(a.SHOW_INFO),
  8282. setTimeout(function() {
  8283. d.classList.remove("closed"),
  8284. d.classList.remove("open")
  8285. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8286. f.classList.remove("icon-dpad-left"),
  8287. f.classList.add("icon-dpad-right"),
  8288. this.emit(a.HIDE_INFO))
  8289. }
  8290. };
  8291. t.extendObject(x, h.prototype),
  8292. M.exports = x
  8293. }
  8294. ).call(this, "/js/gui/title/titleBar.js")
  8295. }
  8296. , {
  8297. "../../localization/localize": 108,
  8298. "../../settings": 166,
  8299. "../../util/browser": 182,
  8300. "../../util/common": 185,
  8301. "../../util/logger": 189,
  8302. "./TitleEvents": 80,
  8303. "./titleBarSettings": 83,
  8304. events: 202
  8305. }],
  8306. 83: [function(e, t, i) {
  8307. "use strict";
  8308. t.exports = Object.freeze({
  8309. minTooltipCharacters: 19,
  8310. removeAnimationClasses: 500
  8311. })
  8312. }
  8313. , {}],
  8314. 84: [function(e, t, i) {
  8315. "use strict";
  8316. function n() {
  8317. v.playTour(),
  8318. y && clearTimeout(y),
  8319. c(),
  8320. E.removeClass("fadeIn")
  8321. }
  8322. function r() {
  8323. A.classList.contains("playing") && (v.stopTour(),
  8324. E.addClass("fadeIn"),
  8325. setTimeout(function() {
  8326. E.removeClass("fadeIn")
  8327. }, h.tourInteraction.showPauseButton),
  8328. M || (clearTimeout(y),
  8329. y = setTimeout(s, h.tourInteraction.showModal)),
  8330. setTimeout(function() {
  8331. A.classList.remove("playing")
  8332. }, h.tourInteraction.allowNextClick))
  8333. }
  8334. function o() {
  8335. v.tourInProgress && (v.stopTour(),
  8336. v.endTourProgress(),
  8337. A.classList.remove("playing"))
  8338. }
  8339. function a() {
  8340. _.is(":visible") ? n() : r()
  8341. }
  8342. function s() {
  8343. if (!h.tourInteraction.disabled) {
  8344. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8345. T.addClass("fadeIn tour " + p.deviceType);
  8346. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8347. if (!h.tourInteraction.smallModal)
  8348. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8349. p.fill(x, g.TOUR_INTERACTION[e]),
  8350. T.addClass(e);
  8351. T.addClass(t)
  8352. }
  8353. }
  8354. function l(e, t) {
  8355. if (t) {
  8356. var i = "keydown" === t.type
  8357. , n = t.which === u.SPACE || v.tourIsPlaying;
  8358. i && n || e || (M = !0),
  8359. v.atEndOfTour() && c(),
  8360. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8361. c(),
  8362. t.which !== u.SPACE && o()),
  8363. i && n && a()
  8364. }
  8365. }
  8366. function c() {
  8367. T.removeClass("fadeIn")
  8368. }
  8369. var h = (e("../util/browser"),
  8370. e("../settings"))
  8371. , u = e("../enum/Keys")
  8372. , d = e("../enum/Viewmode")
  8373. , p = (e("./helpManager"),
  8374. e("./populateModal"))
  8375. , f = e("../enum/DirectorEvents")
  8376. , g = e("../enum/HelpModalType")
  8377. , m = e("../enum/HelpModalSize")
  8378. , v = null
  8379. , y = null
  8380. , A = document.getElementById("pause-overlay")
  8381. , C = document.getElementById("player")
  8382. , I = document.getElementById("gui")
  8383. , E = $("#pause-icon").eq(0)
  8384. , _ = $("#play").eq(0)
  8385. , b = $("#playHead").eq(0)
  8386. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8387. , T = $("#interaction-modal").eq(0)
  8388. , x = $("#interaction-modal .interaction").toArray()
  8389. , S = ["touchstart", "mousedown", "pointerdown"]
  8390. , M = !1;
  8391. t.exports.init = function(e) {
  8392. v = e,
  8393. S.forEach(function(t) {
  8394. C.addEventListener(t, l.bind(this, !1), !0),
  8395. I.addEventListener(t, l.bind(this, !0), !0),
  8396. A.addEventListener(t, r, !0),
  8397. w.forEach(function(e) {
  8398. e.addEventListener(t, o, !0)
  8399. }),
  8400. $("#drawer img").on(t, o)
  8401. }),
  8402. document.addEventListener("keydown", l.bind(this, !1), !0),
  8403. v.on(f.TourStart, function() {
  8404. A.classList.add("playing")
  8405. })
  8406. }
  8407. ,
  8408. t.exports.play = n,
  8409. t.exports.pause = r,
  8410. t.exports.pauseWithoutCTA = o,
  8411. t.exports.togglePlay = a,
  8412. t.exports.stopTour = function() {
  8413. b.hasClass("playing") && (clearTimeout(y),
  8414. v.atEndOfTour() ? (A.classList.remove("playing"),
  8415. s()) : E.removeClass("fadeIn"))
  8416. }
  8417. ,
  8418. t.exports.dismissModal = c
  8419. }
  8420. , {
  8421. "../enum/DirectorEvents": 23,
  8422. "../enum/HelpModalSize": 27,
  8423. "../enum/HelpModalType": 28,
  8424. "../enum/Keys": 30,
  8425. "../enum/Viewmode": 51,
  8426. "../settings": 166,
  8427. "../util/browser": 182,
  8428. "./helpManager": 68,
  8429. "./populateModal": 75
  8430. }],
  8431. 85: [function(e, t, i) {
  8432. "use strict";
  8433. t.exports = Object.freeze({
  8434. OPENED: "vr.modal.opened",
  8435. LAUNCH: "vr.modal.launch",
  8436. CLOSED: "vr.modal.closed",
  8437. NEXT: "vr.modal.next",
  8438. PREV: "vr.modal.prev",
  8439. STORE: "vr.modal.store",
  8440. falseICECHOSEN: "vr.modal.device"
  8441. })
  8442. }
  8443. , {}],
  8444. 86: [function(e, t, i) {
  8445. "use strict";
  8446. var h = e("../../util/browser")
  8447. , u = e("../../enum/VRApps")
  8448. , n = e("../../enum/VRPlatforms")
  8449. , d = e("../../util/ajax")
  8450. , p = e("../../settings")
  8451. , r = {};
  8452. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8453. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8454. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8455. u) {
  8456. var a = u[o];
  8457. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8458. }
  8459. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8460. "https://" + s);
  8461. t.exports.init = function(e, t, o) {
  8462. function a(e, t, i, n) {
  8463. function r() {
  8464. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8465. }
  8466. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8467. }
  8468. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8469. , l = g + "/vr/dlist/?ret=" + s
  8470. , c = g + "/vr/show/?ret=" + s;
  8471. switch (e) {
  8472. case n.IOS:
  8473. !function(t, e, i, n) {
  8474. var r = a(t, e, i, n)
  8475. , o = {
  8476. responseType: "json",
  8477. data: {
  8478. branch_key: p.appConfig.branch_key,
  8479. data: {
  8480. m: e,
  8481. full_url: r,
  8482. $desktop_url: "",
  8483. $og_app_id: "331853976762864119",
  8484. $og_title: i,
  8485. $og_description: n,
  8486. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8487. $canonical_url: window.location.href
  8488. }
  8489. }
  8490. };
  8491. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8492. f[t] = e.url
  8493. }).fail(function(e) {
  8494. f[t] = e
  8495. }
  8496. .bind(this, r))
  8497. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8498. break;
  8499. default:
  8500. !function(e, t, i) {
  8501. for (var n in u) {
  8502. var r = u[n]
  8503. , o = a(r, e, t, i);
  8504. f[r] = o
  8505. }
  8506. }(t.sid, t.name, t.summary)
  8507. }
  8508. }
  8509. ,
  8510. t.exports.launch = function(e) {
  8511. var t = f[e];
  8512. window.open(t, "_blank")
  8513. }
  8514. ,
  8515. t.exports.launchStore = function(e) {
  8516. var t = r[e];
  8517. window.open(t, "_blank")
  8518. }
  8519. }
  8520. , {
  8521. "../../enum/VRApps": 46,
  8522. "../../enum/VRPlatforms": 49,
  8523. "../../settings": 166,
  8524. "../../util/ajax": 181,
  8525. "../../util/browser": 182
  8526. }],
  8527. 87: [function(e, t, i) {
  8528. "use strict";
  8529. function c(e) {
  8530. var t;
  8531. switch (e) {
  8532. case y.IOS:
  8533. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8534. case y.Android:
  8535. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8536. }
  8537. return !1
  8538. }
  8539. function h(e) {
  8540. switch (e) {
  8541. case y.Android:
  8542. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8543. x.filter(".gearvr").off().on("click", q.gear),
  8544. n(k, U, "logo-button", "same-line");
  8545. break;
  8546. case y.UnsupportedAndroid:
  8547. n("", H, "", "");
  8548. break;
  8549. case y.IOS:
  8550. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8551. n(k, "", "logo-button", "");
  8552. break;
  8553. case y.Desktop:
  8554. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8555. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8556. n(k, U, "logo-button", "same-line"),
  8557. Q.cardboard()
  8558. }
  8559. }
  8560. function u(e) {
  8561. $(".p1, .p2, .p3").hide(),
  8562. l.insertAfter(T),
  8563. w.removeClass("front-page"),
  8564. w.removeClass("details-page"),
  8565. w.removeClass("lastPage"),
  8566. x.removeClass("logo-button"),
  8567. x.removeClass("same-line"),
  8568. T.removeClass("headsetOptions"),
  8569. S.attr("src", ""),
  8570. S.filter(".second").removeClass("gear"),
  8571. S.css("display", "inline-block"),
  8572. S.off(),
  8573. M.filter(".second").css("display", ""),
  8574. O.css("display", "none"),
  8575. $(".p" + (e + 1) + _).show(),
  8576. S.filter(".third").insertBefore(M.filter(".third"))
  8577. }
  8578. function n(e, t, i, n) {
  8579. w.addClass("front-page"),
  8580. S.filter(".first").attr("src", e),
  8581. S.filter(".second").attr("src", t),
  8582. x.filter(".first").addClass(i),
  8583. x.filter(".second").addClass(i),
  8584. x.addClass(n),
  8585. ".show-desktop" === _ && T.insertAfter(l)
  8586. }
  8587. function r(e, t, i) {
  8588. T.addClass("headsetOptions"),
  8589. x.off(),
  8590. S.filter(".second").attr("src", t),
  8591. O.css("display", "block"),
  8592. M.filter(".second").css("display", "none"),
  8593. O.on("click", function() {
  8594. u(b.Title),
  8595. h(y.Desktop)
  8596. }),
  8597. e && (X.emit(C.falseICECHOSEN, {
  8598. name: v.GearVR
  8599. }),
  8600. S.filter(".first").attr("src", e),
  8601. S.filter(".second").addClass("gear"),
  8602. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8603. Q.gearvr()),
  8604. i && (X.emit(C.falseICECHOSEN, {
  8605. name: v.Cardboard
  8606. }),
  8607. S.filter(".third").attr("src", i),
  8608. S.filter(".third").show(),
  8609. S.filter(".third").insertAfter(S.filter(".second")),
  8610. S.filter(".third").addClass("link"),
  8611. S.filter(".second").addClass("link"),
  8612. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8613. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8614. Q.cardboard())
  8615. }
  8616. function d(e, t) {
  8617. switch (t) {
  8618. case y.IOS:
  8619. j = W,
  8620. Y = G;
  8621. break;
  8622. case y.Desktop:
  8623. e === b.Cardboard ? (j = N,
  8624. Y = B,
  8625. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8626. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8627. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8628. Y = "");
  8629. break;
  8630. default:
  8631. Y = e === b.Cardboard ? (j = H,
  8632. G) : (j = V,
  8633. z)
  8634. }
  8635. }
  8636. function p(e, t, i) {
  8637. w.find(".inner").addClass("details-page"),
  8638. w.addClass("details-page"),
  8639. S.filter(".first").attr("src", e),
  8640. S.filter(".second").attr("src", t),
  8641. S.filter(".third").attr("src", i)
  8642. }
  8643. function f() {
  8644. var e = 1 < g.aspectRatio() && g.isMobile();
  8645. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8646. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8647. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8648. }
  8649. var g = e("../../util/browser")
  8650. , m = e("./vrLink")
  8651. , v = e("../../enum/VRApps")
  8652. , y = e("../../enum/VRPlatforms")
  8653. , A = e("../../enum/VRPages")
  8654. , C = e("./vrEvent")
  8655. , o = (e("../../settings"),
  8656. e("../../constants"))
  8657. , I = e("../../localization/localize")
  8658. , a = e("../../util/common")
  8659. , s = e("events").EventEmitter
  8660. , E = 0
  8661. , _ = null
  8662. , b = A.standard
  8663. , w = $(".vr-popup")
  8664. , l = w.find(".vr-popup-body")
  8665. , T = w.find(".vr-images")
  8666. , x = w.find(".img-container")
  8667. , S = w.find(".vr-sm-image")
  8668. , M = x.find(".vr-img-caption")
  8669. , R = $(".vr-buttons").find(".prev-button")
  8670. , P = $(".vr-buttons").find(".next-button")
  8671. , O = T.find(".front-close")
  8672. , L = $(".vr-page")
  8673. , D = w.find("img")
  8674. , N = "images/apple-store.png"
  8675. , F = "images/badge-oculus.png"
  8676. , B = "images/badge-cardboard.png"
  8677. , V = "images/logo-samsung.png"
  8678. , k = "images/headset-cardboard.png"
  8679. , U = "images/headset-gearvr.png"
  8680. , H = "images/ico-android-robot.png"
  8681. , z = "images/ico-gearvr.png"
  8682. , G = "images/ico-vr.png"
  8683. , W = "images/apple-logo-white.svg"
  8684. , j = null
  8685. , Y = null
  8686. , q = {}
  8687. , X = {
  8688. init: function(e, t) {
  8689. function i(e) {
  8690. X.emit(C.STORE, {
  8691. type: e
  8692. }),
  8693. m.launchStore(e)
  8694. }
  8695. function n(e) {
  8696. switch (e !== b.pageCount && (u(e),
  8697. L.text(e + 1 + " / " + b.pageCount)),
  8698. e) {
  8699. case b.Title:
  8700. R.css("display", "none"),
  8701. P.text(a[e]),
  8702. h(r);
  8703. break;
  8704. case b.Cardboard:
  8705. R.css("display", "block"),
  8706. P.text(a[e]),
  8707. x.filter(".cardboard").off(),
  8708. x.filter(".gearvr").off(),
  8709. d(e, r),
  8710. p(k, j, Y);
  8711. break;
  8712. case b.Gear:
  8713. P.text(a[e]),
  8714. d(e, r),
  8715. w.addClass("lastPage"),
  8716. p(U, j, Y);
  8717. break;
  8718. case b.pageCount:
  8719. w.removeClass("fadeIn"),
  8720. X.emit(C.CLOSED)
  8721. }
  8722. D.filter("[src='']").hide()
  8723. }
  8724. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8725. _ = ".show-supported",
  8726. y.Android) : (w.addClass("unsupported"),
  8727. _ = ".show-unsupported",
  8728. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8729. _ = ".show-ios",
  8730. b = A.ios,
  8731. y.IOS) : (w.addClass("desktop"),
  8732. _ = ".show-desktop",
  8733. y.Desktop);
  8734. function o(e) {
  8735. X.emit(C.LAUNCH, {
  8736. vr_platform: r,
  8737. vr_app: e
  8738. }),
  8739. m.launch(e)
  8740. }
  8741. m.init(r, e, t),
  8742. r !== y.Desktop && w.addClass("mobile"),
  8743. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8744. q.gear = o.bind(this, v.GearVR),
  8745. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8746. f(),
  8747. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8748. $(_).show();
  8749. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8750. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8751. r === y.IOS && (a.splice(1, 1),
  8752. s.splice(1, 1)),
  8753. $("#vr").on("click", function(e) {
  8754. e.preventDefault(),
  8755. window.vrEnabled || (window.vrEnabled = !0,
  8756. this.classList.add("active"),
  8757. $("#gui div").not("#vrOff").addClass("vrHide"),
  8758. $("#vrOffImg").css({
  8759. display: "inline-block"
  8760. }))
  8761. }),
  8762. $("#vrOff").on("click", function() {
  8763. window.vrEnabled = !1,
  8764. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8765. $("#vrOffImg").css({
  8766. display: "none"
  8767. }),
  8768. $("#player canvas").css({
  8769. width: "",
  8770. height: ""
  8771. }),
  8772. $("#vr").removeClass("active")
  8773. });
  8774. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8775. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8776. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8777. $("span.modelLink").text(l),
  8778. R.on("click", function(e) {
  8779. X.emit(C.PREV),
  8780. n(--E)
  8781. }),
  8782. P.on("click", function(e) {
  8783. P.text(),
  8784. X.emit(C.NEXT, {
  8785. nextAction: s[E]
  8786. }),
  8787. n(++E)
  8788. }),
  8789. w.find(".close").on("click", X.dismiss)
  8790. },
  8791. dismiss: function() {
  8792. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8793. X.emit(C.CLOSED))
  8794. },
  8795. isDeviceSupported: c
  8796. };
  8797. a.extendObject(X, s.prototype),
  8798. $(window).resize(f);
  8799. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8800. K = M.filter(".first").find(".gearvr"),
  8801. {
  8802. cardboard: function() {
  8803. K.addClass("hidden"),
  8804. Z.removeClass("hidden")
  8805. },
  8806. gearvr: function() {
  8807. Z.addClass("hidden"),
  8808. K.removeClass("hidden")
  8809. }
  8810. });
  8811. t.exports = X
  8812. }
  8813. , {
  8814. "../../constants": 8,
  8815. "../../enum/VRApps": 46,
  8816. "../../enum/VRPages": 48,
  8817. "../../enum/VRPlatforms": 49,
  8818. "../../localization/localize": 108,
  8819. "../../settings": 166,
  8820. "../../util/browser": 182,
  8821. "../../util/common": 185,
  8822. "./vrEvent": 85,
  8823. "./vrLink": 86,
  8824. events: 202
  8825. }],
  8826. 88: [function(e, t, i) {
  8827. "use strict";
  8828. t.exports = Object.freeze({
  8829. OPENED: "webvr.modal.opened",
  8830. SHOW_TERMS: "webvr.footer.show.terms"
  8831. })
  8832. }
  8833. , {}],
  8834. 89: [function(B, V, e) {
  8835. (function(e) {
  8836. "use strict";
  8837. function a() {
  8838. function t() {
  8839. p.isPresenting || (r.info("exiting webVR"),
  8840. c("webvr_exit_app"),
  8841. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8842. window.removeEventListener("vrdisplaypresentchange", t))
  8843. }
  8844. r.info("Headset mounted"),
  8845. u.suspend();
  8846. var e = document.createElement("canvas");
  8847. for (e.getContext("webgl"),
  8848. e.className = "webvr-canvas",
  8849. document.bgColor = "#000",
  8850. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8851. document.body.removeChild(document.body.firstChild);
  8852. document.body.appendChild(e),
  8853. c("webvr_enter_app"),
  8854. p.requestPresent([{
  8855. source: e,
  8856. predistorted: !0
  8857. }]).catch(function(e) {
  8858. r.error("Failed to present: " + e),
  8859. c("webvr_exit_calibrate"),
  8860. t()
  8861. }),
  8862. d.then(function() {
  8863. window.dispatchEvent(new Event("vrapp-start"))
  8864. }),
  8865. window.addEventListener("vrdisplaypresentchange", t)
  8866. }
  8867. function s() {
  8868. c("webvr_modal_close"),
  8869. _.find(".enter-button").off("click", a),
  8870. E.fadeOut(g.guiAnimationSpeed, function() {
  8871. _.toggleClass("hidden", !1),
  8872. b.toggleClass("hidden", !0),
  8873. f.exitFullscreen()
  8874. }),
  8875. I.fadeIn(g.guiAnimationSpeed)
  8876. }
  8877. function t() {
  8878. M.toggleClass("hidden", !0),
  8879. S.toggleClass("hidden", !1)
  8880. }
  8881. function l() {
  8882. _.toggleClass("hidden"),
  8883. b.toggleClass("hidden")
  8884. }
  8885. function c(e) {
  8886. var t = f.isLandscape() ? "landscape" : "portrait";
  8887. i.trackAlways("showcase_gui", {
  8888. gui_action: e,
  8889. orientation: t
  8890. })
  8891. }
  8892. function h() {
  8893. var e = f.isLandscape();
  8894. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8895. }
  8896. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8897. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8898. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  8899. init: function(e, t, i, n) {
  8900. function r(e) {
  8901. e.preventDefault(),
  8902. o(e.currentTarget.id)
  8903. }
  8904. function o(i) {
  8905. F[i](),
  8906. Object.keys(F).map(function(e, t) {
  8907. $("#" + e).toggleClass("tabs-underlined", e === i)
  8908. })
  8909. }
  8910. p = i,
  8911. u = t,
  8912. y.init(m.Android, e, n),
  8913. h(),
  8914. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8915. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8916. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8917. w.filter(".device-headset-side").attr("src", R),
  8918. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8919. $("#vr").on("click", function(e) {
  8920. e.preventDefault(),
  8921. c("click_webvr_button"),
  8922. E.is(":hidden") && (N.emit(A.OPENED),
  8923. I.fadeOut(g.guiAnimationSpeed),
  8924. E.fadeIn(g.guiAnimationSpeed),
  8925. function() {
  8926. if (!d) {
  8927. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8928. d = new Promise(function(e, t) {
  8929. var i = document.createElement("script");
  8930. i.type = "text/javascript",
  8931. i.src = n,
  8932. i.onload = e,
  8933. document.head.appendChild(i)
  8934. }
  8935. )
  8936. }
  8937. _.find(".enter-button").on("click", a)
  8938. }())
  8939. }),
  8940. $(".webvr-popup .close").on("click", function(e) {
  8941. e.preventDefault(),
  8942. _.hasClass("hidden") ? (c("webvr_help_close"),
  8943. l()) : s()
  8944. }),
  8945. $("#tabcardboard").on("click", r),
  8946. $("#tabdaydream").on("click", r),
  8947. $("#tabnative").on("click", r),
  8948. $(".webvr-popup .open-with-app").on("click", function(e) {
  8949. e.preventDefault(),
  8950. c("webvr_learn_more"),
  8951. o("tabnative"),
  8952. l()
  8953. }),
  8954. $(".webvr-popup .help").on("click", function(e) {
  8955. e.preventDefault(),
  8956. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8957. l()
  8958. }),
  8959. $(".webvr-popup .terms").on("click", function(e) {
  8960. e.preventDefault(),
  8961. c("webvr_click_terms"),
  8962. s(),
  8963. N.emit(A.SHOW_TERMS)
  8964. }),
  8965. T.on("click", function(e) {
  8966. e.preventDefault(),
  8967. c(D),
  8968. window.open(L, "_blank")
  8969. }),
  8970. x.on("click", function(e) {
  8971. e.preventDefault(),
  8972. c("webvr_phone_link"),
  8973. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8974. }),
  8975. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8976. e.preventDefault(),
  8977. c("webvr_cardboard_link"),
  8978. y.launch(v.CardboardAndroid)
  8979. }),
  8980. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8981. e.preventDefault(),
  8982. c("webvr_oculus_link"),
  8983. y.launch(v.GearVR)
  8984. })
  8985. }
  8986. }, F = {
  8987. tabcardboard: function() {
  8988. w.filter(".device-headset").attr("src", R),
  8989. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  8990. L = "https://vr.google.com/cardboard/get-cardboard/",
  8991. D = "webvr_cardboard_link",
  8992. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  8993. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  8994. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  8995. t()
  8996. },
  8997. tabdaydream: function() {
  8998. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  8999. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9000. L = P,
  9001. D = O,
  9002. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9003. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9004. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9005. t()
  9006. },
  9007. tabnative: function() {
  9008. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9009. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9010. M.toggleClass("hidden", !1),
  9011. S.toggleClass("hidden", !0)
  9012. }
  9013. };
  9014. n.extendObject(N, o.prototype),
  9015. $(window).resize(h),
  9016. V.exports = N
  9017. }
  9018. ).call(this, "/js/gui/webvr/webVRgui.js")
  9019. }
  9020. , {
  9021. "../../analytics": 4,
  9022. "../../constants": 8,
  9023. "../../enum/VRApps": 46,
  9024. "../../enum/VRPlatforms": 49,
  9025. "../../localization/localize": 108,
  9026. "../../settings": 166,
  9027. "../../util/browser": 182,
  9028. "../../util/common": 185,
  9029. "../../util/logger": 189,
  9030. "./../gui": 65,
  9031. "./../vr/vrLink": 86,
  9032. "./WebVrEvent": 88,
  9033. events: 202
  9034. }],
  9035. 90: [function(e, t, i) {
  9036. "use strict";
  9037. function n(e, t, i, n, r) {
  9038. this.floorId = n || 0 === n ? n : -1,
  9039. this.roomId = r || "",
  9040. this.labelId = e,
  9041. this.position = (new o.Vector3).copy(t),
  9042. this.text = i
  9043. }
  9044. var o = e("three")
  9045. , r = e("../util/browser");
  9046. n.prototype.build = function() {
  9047. var e = window.document.createElement("div");
  9048. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9049. var t = window.document.createElement("div");
  9050. t.setAttribute("class", "gui-floorplan-label-text");
  9051. var i = window.document.createTextNode(this.text);
  9052. t.appendChild(i),
  9053. e.appendChild(t),
  9054. window.document.body.appendChild(e),
  9055. this.labelGui = e,
  9056. this.textBlock = t,
  9057. $(this.labelGui).hide();
  9058. var n = window.getComputedStyle(this.labelGui);
  9059. this.initialTransform = n.transform || n.webkitTransform
  9060. }
  9061. ,
  9062. t.exports = n
  9063. }
  9064. , {
  9065. "../util/browser": 182,
  9066. three: 217
  9067. }],
  9068. 91: [function(e, t, i) {
  9069. "use strict";
  9070. function n() {
  9071. this.player = null,
  9072. this.modelManager = null,
  9073. this.container = null
  9074. }
  9075. var c, o, r = e("three"), a = (e("../util/common"),
  9076. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9077. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9078. e("../util/transitions"),
  9079. e("../util/lerp"),
  9080. e("../util/browser"));
  9081. n.prototype.init = function(e, t, i) {
  9082. this.player = e,
  9083. this.modelManager = t,
  9084. this.container = i,
  9085. this.updateModel(),
  9086. this.bindEvents()
  9087. }
  9088. ,
  9089. n.prototype.bindEvents = function() {
  9090. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9091. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9092. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9093. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9094. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9095. }
  9096. ,
  9097. n.prototype.updateModel = function() {
  9098. this.model = this.modelManager.getActiveModel()
  9099. }
  9100. ,
  9101. n.prototype.handlePlayerViewChanged = function() {
  9102. this.updateLabelVisibility(),
  9103. this.updateLabelDisplay()
  9104. }
  9105. ,
  9106. n.prototype.getLabelsForFloor = function(t, i) {
  9107. return (i = i || []).length = 0,
  9108. this.model.labels.forEach(function(e) {
  9109. this.labelVisibleForFloor(e, t) && i.push(e)
  9110. }
  9111. .bind(this)),
  9112. i
  9113. }
  9114. ,
  9115. n.prototype.getLabelsForCurrentFloor = function(e) {
  9116. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9117. }
  9118. ,
  9119. n.prototype.labelVisibleForFloor = function(e, t) {
  9120. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9121. if (!this.model.showingLabels || !e.labelGui || !i)
  9122. return !1;
  9123. var n = e.floorId === this.model.floors.size() - 1;
  9124. return this.model.allFloorsVisible ? n : e.floorId === t
  9125. }
  9126. ,
  9127. n.prototype.updateLabelVisibility = function(e) {
  9128. this.model.labels.forEach(function(e) {
  9129. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9130. }
  9131. .bind(this))
  9132. }
  9133. ,
  9134. n.prototype.showAllLabels = function(t, i) {
  9135. this.model.labels.forEach(function(e) {
  9136. this.showLabel(e, t, i)
  9137. }
  9138. .bind(this))
  9139. }
  9140. ,
  9141. n.prototype.hideAllLabels = function(t, i) {
  9142. this.model.labels.forEach(function(e) {
  9143. this.hideLabel(e, t, i)
  9144. }
  9145. .bind(this))
  9146. }
  9147. ,
  9148. n.prototype.showLabel = function(e, t, i) {
  9149. this.model.showingLabels && (e.visible || (e.visible = !0,
  9150. e.labelGui.style.display = "block",
  9151. e.labelGui.style.opacity = 0,
  9152. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9153. }
  9154. ,
  9155. n.prototype.hideLabel = function(e, t, i) {
  9156. e.visible && (e.visible = !1,
  9157. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9158. }
  9159. ,
  9160. n.prototype.supportedMode = function() {
  9161. return this.player.mode === h.FLOORPLAN
  9162. }
  9163. ,
  9164. n.prototype.updateLabelDisplay = (new r.Vector3,
  9165. new r.Vector3,
  9166. o = [],
  9167. function() {
  9168. var e = this.player.getLabelScaleFactor()
  9169. , t = 1.2 * (1 - e) + .6
  9170. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9171. this.getLabelsForCurrentFloor(o);
  9172. for (var n = 0; n < o.length; n++) {
  9173. var r = o[n];
  9174. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9175. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9176. }
  9177. }
  9178. ),
  9179. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9180. new r.Vector3,
  9181. function(e, t, i, n, r) {
  9182. t.style.fontSize = 100 * r + "%";
  9183. var o = .5 * $("#player").width()
  9184. , a = .5 * $("#player").height();
  9185. c.copy(i),
  9186. c.project(this.player.camera);
  9187. var s = c.x * o + o
  9188. , l = -c.y * a + a;
  9189. s -= e.offsetWidth / 2,
  9190. l -= e.offsetHeight / 2,
  9191. e.style.left = s + "px",
  9192. e.style.top = l + "px"
  9193. }
  9194. ),
  9195. n.prototype.handleStartInside = function(e) {
  9196. this.updateLabelVisibility()
  9197. }
  9198. ,
  9199. n.prototype.handleStartOutside = function() {
  9200. this.updateLabelVisibility()
  9201. }
  9202. ,
  9203. t.exports = n
  9204. }
  9205. , {
  9206. "../enum/DirectorEvents": 23,
  9207. "../enum/ModelManagerEvents": 33,
  9208. "../enum/PlayerEvents": 40,
  9209. "../enum/Viewmode": 51,
  9210. "../enum/WarpStyle": 52,
  9211. "../settings": 166,
  9212. "../util/browser": 182,
  9213. "../util/common": 185,
  9214. "../util/lerp": 188,
  9215. "../util/transitions": 195,
  9216. three: 217
  9217. }],
  9218. 92: [function(e, t, i) {
  9219. "use strict";
  9220. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9221. if (null == this)
  9222. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9223. if ("function" != typeof e)
  9224. throw new TypeError("predicate must be a function");
  9225. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9226. if (t = i[o],
  9227. e.call(r, t, o, i))
  9228. return o;
  9229. return -1
  9230. }
  9231. ),
  9232. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9233. value: function(e) {
  9234. if (null == this)
  9235. throw new TypeError('"this" is null or not defined');
  9236. var t = Object(this)
  9237. , i = t.length >>> 0;
  9238. if ("function" != typeof e)
  9239. throw new TypeError("predicate must be a function");
  9240. for (var n = arguments[1], r = 0; r < i; ) {
  9241. var o = t[r];
  9242. if (e.call(n, o, r, t))
  9243. return o;
  9244. r++
  9245. }
  9246. }
  9247. })
  9248. }
  9249. , {}],
  9250. 93: [function(e, t, i) {
  9251. "use strict";
  9252. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9253. function te() {
  9254. this.backgroundElement = document.createElement("div"),
  9255. r.extend(this.backgroundElement.style, {
  9256. backgroundColor: "rgba(0,0,0,0.8)",
  9257. top: 0,
  9258. left: 0,
  9259. display: "none",
  9260. zIndex: "1000",
  9261. opacity: 0,
  9262. WebkitTransition: "opacity 0.2s linear"
  9263. }),
  9264. n.makeFullscreen(this.backgroundElement),
  9265. this.backgroundElement.style.position = "fixed",
  9266. this.domElement = document.createElement("div"),
  9267. r.extend(this.domElement.style, {
  9268. position: "fixed",
  9269. display: "none",
  9270. zIndex: "1001",
  9271. opacity: 0,
  9272. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9273. }),
  9274. document.body.appendChild(this.backgroundElement),
  9275. document.body.appendChild(this.domElement);
  9276. var e = this;
  9277. n.bind(this.backgroundElement, "click", function() {
  9278. e.hide()
  9279. })
  9280. }
  9281. function ie(e, t, i) {
  9282. Object.defineProperty(e, t, {
  9283. get: function() {
  9284. return "RGB" === this.__state.space || re(this, t, i),
  9285. this.__state[t]
  9286. },
  9287. set: function(e) {
  9288. "RGB" !== this.__state.space && (re(this, t, i),
  9289. this.__state.space = "RGB"),
  9290. this.__state[t] = e
  9291. }
  9292. })
  9293. }
  9294. function ne(e, t) {
  9295. Object.defineProperty(e, t, {
  9296. get: function() {
  9297. return "HSV" === this.__state.space || oe(this),
  9298. this.__state[t]
  9299. },
  9300. set: function(e) {
  9301. "HSV" !== this.__state.space && (oe(this),
  9302. this.__state.space = "HSV"),
  9303. this.__state[t] = e
  9304. }
  9305. })
  9306. }
  9307. function re(e, t, i) {
  9308. if ("HEX" === e.__state.space)
  9309. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9310. else {
  9311. if ("HSV" !== e.__state.space)
  9312. throw "Corrupted color state";
  9313. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9314. }
  9315. }
  9316. function oe(e) {
  9317. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9318. l.extend(e.__state, {
  9319. s: t.s,
  9320. v: t.v
  9321. }),
  9322. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9323. }
  9324. function ae() {
  9325. if (this.__state = o.apply(this, arguments),
  9326. !1 === this.__state)
  9327. throw "Failed to interpret color arguments";
  9328. this.__state.a = this.__state.a || 1
  9329. }
  9330. function se(e) {
  9331. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9332. }
  9333. function le(e, t) {
  9334. this.initialValue = e[t],
  9335. this.domElement = document.createElement("div"),
  9336. this.object = e,
  9337. this.property = t,
  9338. this.__onChange = void 0,
  9339. this.__onFinishChange = void 0
  9340. }
  9341. (t.exports = ee).gui = ee.gui || {},
  9342. ee.utils = ee.utils || {},
  9343. ee.controllers = ee.controllers || {},
  9344. ee.dom = ee.dom || {},
  9345. ee.color = ee.color || {},
  9346. ee.utils.css = {
  9347. load: function(e, t) {
  9348. var i = (t = t || document).createElement("link");
  9349. i.type = "text/css",
  9350. i.rel = "stylesheet",
  9351. i.href = e,
  9352. t.getElementsByTagName("head")[0].appendChild(i)
  9353. },
  9354. inject: function(e, t) {
  9355. t = t || document;
  9356. var i = document.createElement("style");
  9357. i.type = "text/css",
  9358. i.innerHTML = e,
  9359. t.getElementsByTagName("head")[0].appendChild(i)
  9360. }
  9361. },
  9362. ee.utils.common = (Q = Array.prototype.forEach,
  9363. J = Array.prototype.slice,
  9364. {
  9365. BREAK: {},
  9366. extend: function(i) {
  9367. return this.each(J.call(arguments, 1), function(e) {
  9368. for (var t in e)
  9369. this.isUndefined(e[t]) || (i[t] = e[t])
  9370. }, this),
  9371. i
  9372. },
  9373. defaults: function(i) {
  9374. return this.each(J.call(arguments, 1), function(e) {
  9375. for (var t in e)
  9376. this.isUndefined(i[t]) && (i[t] = e[t])
  9377. }, this),
  9378. i
  9379. },
  9380. compose: function() {
  9381. var i = J.call(arguments);
  9382. return function() {
  9383. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9384. e = [i[t].apply(this, e)];
  9385. return e[0]
  9386. }
  9387. },
  9388. each: function(e, t, i) {
  9389. if (e)
  9390. if (Q && e.forEach && e.forEach === Q)
  9391. e.forEach(t, i);
  9392. else if (e.length === e.length + 0) {
  9393. for (var n = 0, r = e.length; n < r; n++)
  9394. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9395. return
  9396. } else
  9397. for (var n in e)
  9398. if (t.call(i, e[n], n) === this.BREAK)
  9399. return
  9400. },
  9401. defer: function(e) {
  9402. setTimeout(e, 0)
  9403. },
  9404. toArray: function(e) {
  9405. return e.toArray ? e.toArray() : J.call(e)
  9406. },
  9407. isUndefined: function(e) {
  9408. return void 0 === e
  9409. },
  9410. isNull: function(e) {
  9411. return null === e
  9412. },
  9413. isNaN: function(e) {
  9414. return e != e
  9415. },
  9416. isArray: Array.isArray || function(e) {
  9417. return e.constructor === Array
  9418. }
  9419. ,
  9420. isObject: function(e) {
  9421. return e === Object(e)
  9422. },
  9423. isNumber: function(e) {
  9424. return e === e + 0
  9425. },
  9426. isString: function(e) {
  9427. return e === e + ""
  9428. },
  9429. isBoolean: function(e) {
  9430. return !1 === e || !0 === e
  9431. },
  9432. isFunction: function(e) {
  9433. return "[object Function]" === Object.prototype.toString.call(e)
  9434. }
  9435. }),
  9436. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9437. onChange: function(e) {
  9438. return this.__onChange = e,
  9439. this
  9440. },
  9441. onFinishChange: function(e) {
  9442. return this.__onFinishChange = e,
  9443. this
  9444. },
  9445. setValue: function(e) {
  9446. return this.object[this.property] = e,
  9447. this.__onChange && this.__onChange.call(this, e),
  9448. this.updateDisplay(),
  9449. this
  9450. },
  9451. getValue: function() {
  9452. return this.object[this.property]
  9453. },
  9454. updateDisplay: function() {
  9455. return this
  9456. },
  9457. isModified: function() {
  9458. return this.initialValue !== this.getValue()
  9459. }
  9460. }),
  9461. le),
  9462. ee.dom.dom = function(c) {
  9463. function i(e) {
  9464. if ("0" === e || c.isUndefined(e))
  9465. return 0;
  9466. var t = e.match(n);
  9467. return c.isNull(t) ? 0 : parseFloat(t[1])
  9468. }
  9469. var h = {};
  9470. c.each({
  9471. HTMLEvents: ["change"],
  9472. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9473. KeyboardEvents: ["keydown"]
  9474. }, function(e, t) {
  9475. c.each(e, function(e) {
  9476. h[e] = t
  9477. })
  9478. });
  9479. var n = /(\d+(\.\d+)?)px/
  9480. , r = {
  9481. makeSelectable: function(e, t) {
  9482. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9483. return !1
  9484. }
  9485. : function() {}
  9486. ,
  9487. e.style.MozUserSelect = t ? "auto" : "none",
  9488. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9489. e.unselectable = t ? "on" : "off")
  9490. },
  9491. makeFullscreen: function(e, t, i) {
  9492. c.isUndefined(t) && (t = !0),
  9493. c.isUndefined(i) && (i = !0),
  9494. e.style.position = "absolute",
  9495. t && (e.style.left = 0,
  9496. e.style.right = 0),
  9497. i && (e.style.top = 0,
  9498. e.style.bottom = 0)
  9499. },
  9500. fakeEvent: function(e, t, i, n) {
  9501. i = i || {};
  9502. var r = h[t];
  9503. if (!r)
  9504. throw new Error("Event type " + t + " not supported.");
  9505. var o = document.createEvent(r);
  9506. switch (r) {
  9507. case "MouseEvents":
  9508. var a = i.x || i.clientX || 0
  9509. , s = i.y || i.clientY || 0;
  9510. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9511. break;
  9512. case "KeyboardEvents":
  9513. var l = o.initKeyboardEvent || o.initKeyEvent;
  9514. c.defaults(i, {
  9515. cancelable: !0,
  9516. ctrlKey: !1,
  9517. altKey: !1,
  9518. shiftKey: !1,
  9519. metaKey: !1,
  9520. keyCode: void 0,
  9521. charCode: void 0
  9522. }),
  9523. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9524. break;
  9525. default:
  9526. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9527. }
  9528. c.defaults(o, n),
  9529. e.dispatchEvent(o)
  9530. },
  9531. bind: function(e, t, i, n) {
  9532. return n = n || !1,
  9533. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9534. r
  9535. },
  9536. unbind: function(e, t, i, n) {
  9537. return n = n || !1,
  9538. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9539. r
  9540. },
  9541. addClass: function(e, t) {
  9542. if (void 0 === e.className)
  9543. e.className = t;
  9544. else if (e.className !== t) {
  9545. var i = e.className.split(/ +/);
  9546. -1 == i.indexOf(t) && (i.push(t),
  9547. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9548. }
  9549. return r
  9550. },
  9551. removeClass: function(e, t) {
  9552. if (t)
  9553. if (void 0 === e.className)
  9554. ;
  9555. else if (e.className === t)
  9556. e.removeAttribute("class");
  9557. else {
  9558. var i = e.className.split(/ +/)
  9559. , n = i.indexOf(t);
  9560. -1 != n && (i.splice(n, 1),
  9561. e.className = i.join(" "))
  9562. }
  9563. else
  9564. e.className = void 0;
  9565. return r
  9566. },
  9567. hasClass: function(e, t) {
  9568. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9569. },
  9570. getWidth: function(e) {
  9571. var t = getComputedStyle(e);
  9572. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9573. },
  9574. getHeight: function(e) {
  9575. var t = getComputedStyle(e);
  9576. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9577. },
  9578. getOffset: function(e) {
  9579. var t = {
  9580. left: 0,
  9581. top: 0
  9582. };
  9583. if (e.offsetParent)
  9584. for (; t.left += e.offsetLeft,
  9585. t.top += e.offsetTop,
  9586. e = e.offsetParent; )
  9587. ;
  9588. return t
  9589. },
  9590. isActive: function(e) {
  9591. return e === document.activeElement && (e.type || e.href)
  9592. }
  9593. };
  9594. return r
  9595. }(ee.utils.common),
  9596. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9597. X = ee.dom.dom,
  9598. Z = ee.utils.common,
  9599. (K = function(e, t, i) {
  9600. K.superclass.call(this, e, t);
  9601. var n = this;
  9602. if (this.__select = document.createElement("select"),
  9603. Z.isArray(i)) {
  9604. var r = {};
  9605. Z.each(i, function(e) {
  9606. r[e] = e
  9607. }),
  9608. i = r
  9609. }
  9610. Z.each(i, function(e, t) {
  9611. var i = document.createElement("option");
  9612. i.innerHTML = t,
  9613. i.setAttribute("value", e),
  9614. n.__select.appendChild(i)
  9615. }),
  9616. this.updateDisplay(),
  9617. X.bind(this.__select, "change", function() {
  9618. var e = this.options[this.selectedIndex].value;
  9619. n.setValue(e)
  9620. }),
  9621. this.domElement.appendChild(this.__select)
  9622. }
  9623. ).superclass = q,
  9624. Z.extend(K.prototype, q.prototype, {
  9625. setValue: function(e) {
  9626. var t = K.superclass.prototype.setValue.call(this, e);
  9627. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9628. t
  9629. },
  9630. updateDisplay: function() {
  9631. return this.__select.value = this.getValue(),
  9632. K.superclass.prototype.updateDisplay.call(this)
  9633. }
  9634. }),
  9635. K),
  9636. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9637. j = ee.utils.common,
  9638. (Y = function(e, t, i) {
  9639. Y.superclass.call(this, e, t),
  9640. i = i || {},
  9641. this.__min = i.min,
  9642. this.__max = i.max,
  9643. this.__step = i.step,
  9644. j.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9645. this.__precision = se(this.__impliedStep)
  9646. }
  9647. ).superclass = W,
  9648. j.extend(Y.prototype, W.prototype, {
  9649. setValue: function(e) {
  9650. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9651. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9652. Y.superclass.prototype.setValue.call(this, e)
  9653. },
  9654. min: function(e) {
  9655. return this.__min = e,
  9656. this
  9657. },
  9658. max: function(e) {
  9659. return this.__max = e,
  9660. this
  9661. },
  9662. step: function(e) {
  9663. return this.__step = e,
  9664. this.__impliedStep = e,
  9665. this.__precision = se(e),
  9666. this
  9667. }
  9668. }),
  9669. Y),
  9670. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9671. H = ee.dom.dom,
  9672. z = ee.utils.common,
  9673. (G = function(e, t, i) {
  9674. function n() {
  9675. var e = parseFloat(s.__input.value);
  9676. z.isNaN(e) || s.setValue(e)
  9677. }
  9678. function r(e) {
  9679. var t = a - e.clientY;
  9680. s.setValue(s.getValue() + t * s.__impliedStep),
  9681. a = e.clientY
  9682. }
  9683. function o() {
  9684. H.unbind(window, "mousemove", r),
  9685. H.unbind(window, "mouseup", o)
  9686. }
  9687. this.__truncationSuspended = !1,
  9688. G.superclass.call(this, e, t, i);
  9689. var a, s = this;
  9690. this.__input = document.createElement("input"),
  9691. this.__input.setAttribute("type", "text"),
  9692. H.bind(this.__input, "change", n),
  9693. H.bind(this.__input, "blur", function() {
  9694. n(),
  9695. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9696. }),
  9697. H.bind(this.__input, "mousedown", function(e) {
  9698. H.bind(window, "mousemove", r),
  9699. H.bind(window, "mouseup", o),
  9700. a = e.clientY
  9701. }),
  9702. H.bind(this.__input, "keydown", function(e) {
  9703. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9704. this.blur(),
  9705. s.__truncationSuspended = !1)
  9706. }),
  9707. this.updateDisplay(),
  9708. this.domElement.appendChild(this.__input)
  9709. }
  9710. ).superclass = U,
  9711. z.extend(G.prototype, U.prototype, {
  9712. updateDisplay: function() {
  9713. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9714. var i = Math.pow(10, t);
  9715. return Math.round(e * i) / i
  9716. }(this.getValue(), this.__precision),
  9717. G.superclass.prototype.updateDisplay.call(this)
  9718. }
  9719. }),
  9720. G),
  9721. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9722. F = ee.dom.dom,
  9723. B = ee.utils.css,
  9724. V = ee.utils.common,
  9725. (k = function(e, t, i, n, r) {
  9726. function o(e) {
  9727. e.preventDefault();
  9728. var t = F.getOffset(s.__background)
  9729. , i = F.getWidth(s.__background);
  9730. return s.setValue(function(e, t, i, n, r) {
  9731. return n + (e - t) / (i - t) * (r - n)
  9732. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9733. !1
  9734. }
  9735. function a() {
  9736. F.unbind(window, "mousemove", o),
  9737. F.unbind(window, "mouseup", a),
  9738. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9739. }
  9740. k.superclass.call(this, e, t, {
  9741. min: i,
  9742. max: n,
  9743. step: r
  9744. });
  9745. var s = this;
  9746. this.__background = document.createElement("div"),
  9747. this.__foreground = document.createElement("div"),
  9748. F.bind(this.__background, "mousedown", function(e) {
  9749. F.bind(window, "mousemove", o),
  9750. F.bind(window, "mouseup", a),
  9751. o(e)
  9752. }),
  9753. F.addClass(this.__background, "slider"),
  9754. F.addClass(this.__foreground, "slider-fg"),
  9755. this.updateDisplay(),
  9756. this.__background.appendChild(this.__foreground),
  9757. this.domElement.appendChild(this.__background)
  9758. }
  9759. ).superclass = N,
  9760. k.useDefaultStyles = function() {
  9761. B.inject("/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")
  9762. }
  9763. ,
  9764. V.extend(k.prototype, N.prototype, {
  9765. updateDisplay: function() {
  9766. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9767. return this.__foreground.style.width = 100 * e + "%",
  9768. k.superclass.prototype.updateDisplay.call(this)
  9769. }
  9770. }),
  9771. k),
  9772. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9773. O = ee.dom.dom,
  9774. L = ee.utils.common,
  9775. (D = function(e, t, i) {
  9776. D.superclass.call(this, e, t);
  9777. var n = this;
  9778. this.__button = document.createElement("div"),
  9779. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9780. O.bind(this.__button, "click", function(e) {
  9781. return e.preventDefault(),
  9782. n.fire(),
  9783. !1
  9784. }),
  9785. O.addClass(this.__button, "button"),
  9786. this.domElement.appendChild(this.__button)
  9787. }
  9788. ).superclass = P,
  9789. L.extend(D.prototype, P.prototype, {
  9790. fire: function() {
  9791. this.__onChange && this.__onChange.call(this),
  9792. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9793. this.getValue().call(this.object)
  9794. }
  9795. }),
  9796. D),
  9797. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9798. S = ee.dom.dom,
  9799. M = ee.utils.common,
  9800. (R = function(e, t) {
  9801. R.superclass.call(this, e, t);
  9802. var i = this;
  9803. this.__prev = this.getValue(),
  9804. this.__checkbox = document.createElement("input"),
  9805. this.__checkbox.setAttribute("type", "checkbox"),
  9806. S.bind(this.__checkbox, "change", function() {
  9807. i.setValue(!i.__prev)
  9808. }, !1),
  9809. this.domElement.appendChild(this.__checkbox),
  9810. this.updateDisplay()
  9811. }
  9812. ).superclass = x,
  9813. M.extend(R.prototype, x.prototype, {
  9814. setValue: function(e) {
  9815. var t = R.superclass.prototype.setValue.call(this, e);
  9816. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9817. this.__prev = this.getValue(),
  9818. t
  9819. },
  9820. updateDisplay: function() {
  9821. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9822. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9823. R.superclass.prototype.updateDisplay.call(this)
  9824. }
  9825. }),
  9826. R),
  9827. ee.color.toString = (T = ee.utils.common,
  9828. function(e) {
  9829. if (1 == e.a || T.isUndefined(e.a)) {
  9830. for (var t = e.hex.toString(16); t.length < 6; )
  9831. t = "0" + t;
  9832. return "#" + t
  9833. }
  9834. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9835. }
  9836. ),
  9837. ee.color.interpret = (I = ee.color.toString,
  9838. E = ee.utils.common,
  9839. w = [{
  9840. litmus: E.isString,
  9841. conversions: {
  9842. THREE_CHAR_HEX: {
  9843. read: function(e) {
  9844. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9845. return null !== t && {
  9846. space: "HEX",
  9847. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9848. }
  9849. },
  9850. write: I
  9851. },
  9852. SIX_CHAR_HEX: {
  9853. read: function(e) {
  9854. var t = e.match(/^#([A-F0-9]{6})$/i);
  9855. return null !== t && {
  9856. space: "HEX",
  9857. hex: parseInt("0x" + t[1].toString())
  9858. }
  9859. },
  9860. write: I
  9861. },
  9862. CSS_RGB: {
  9863. read: function(e) {
  9864. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9865. return null !== t && {
  9866. space: "RGB",
  9867. r: parseFloat(t[1]),
  9868. g: parseFloat(t[2]),
  9869. b: parseFloat(t[3])
  9870. }
  9871. },
  9872. write: I
  9873. },
  9874. CSS_RGBA: {
  9875. read: function(e) {
  9876. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9877. return null !== t && {
  9878. space: "RGB",
  9879. r: parseFloat(t[1]),
  9880. g: parseFloat(t[2]),
  9881. b: parseFloat(t[3]),
  9882. a: parseFloat(t[4])
  9883. }
  9884. },
  9885. write: I
  9886. }
  9887. }
  9888. }, {
  9889. litmus: E.isNumber,
  9890. conversions: {
  9891. HEX: {
  9892. read: function(e) {
  9893. return {
  9894. space: "HEX",
  9895. hex: e,
  9896. conversionName: "HEX"
  9897. }
  9898. },
  9899. write: function(e) {
  9900. return e.hex
  9901. }
  9902. }
  9903. }
  9904. }, {
  9905. litmus: E.isArray,
  9906. conversions: {
  9907. RGB_ARRAY: {
  9908. read: function(e) {
  9909. return 3 == e.length && {
  9910. space: "RGB",
  9911. r: e[0],
  9912. g: e[1],
  9913. b: e[2]
  9914. }
  9915. },
  9916. write: function(e) {
  9917. return [e.r, e.g, e.b]
  9918. }
  9919. },
  9920. RGBA_ARRAY: {
  9921. read: function(e) {
  9922. return 4 == e.length && {
  9923. space: "RGB",
  9924. r: e[0],
  9925. g: e[1],
  9926. b: e[2],
  9927. a: e[3]
  9928. }
  9929. },
  9930. write: function(e) {
  9931. return [e.r, e.g, e.b, e.a]
  9932. }
  9933. }
  9934. }
  9935. }, {
  9936. litmus: E.isObject,
  9937. conversions: {
  9938. RGBA_OBJ: {
  9939. read: function(e) {
  9940. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9941. space: "RGB",
  9942. r: e.r,
  9943. g: e.g,
  9944. b: e.b,
  9945. a: e.a
  9946. }
  9947. },
  9948. write: function(e) {
  9949. return {
  9950. r: e.r,
  9951. g: e.g,
  9952. b: e.b,
  9953. a: e.a
  9954. }
  9955. }
  9956. },
  9957. RGB_OBJ: {
  9958. read: function(e) {
  9959. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9960. space: "RGB",
  9961. r: e.r,
  9962. g: e.g,
  9963. b: e.b
  9964. }
  9965. },
  9966. write: function(e) {
  9967. return {
  9968. r: e.r,
  9969. g: e.g,
  9970. b: e.b
  9971. }
  9972. }
  9973. },
  9974. HSVA_OBJ: {
  9975. read: function(e) {
  9976. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9977. space: "HSV",
  9978. h: e.h,
  9979. s: e.s,
  9980. v: e.v,
  9981. a: e.a
  9982. }
  9983. },
  9984. write: function(e) {
  9985. return {
  9986. h: e.h,
  9987. s: e.s,
  9988. v: e.v,
  9989. a: e.a
  9990. }
  9991. }
  9992. },
  9993. HSV_OBJ: {
  9994. read: function(e) {
  9995. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  9996. space: "HSV",
  9997. h: e.h,
  9998. s: e.s,
  9999. v: e.v
  10000. }
  10001. },
  10002. write: function(e) {
  10003. return {
  10004. h: e.h,
  10005. s: e.s,
  10006. v: e.v
  10007. }
  10008. }
  10009. }
  10010. }
  10011. }],
  10012. function() {
  10013. b = !1;
  10014. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10015. return E.each(w, function(e) {
  10016. if (e.litmus(i))
  10017. return E.each(e.conversions, function(e, t) {
  10018. if (_ = e.read(i),
  10019. !1 === b && !1 !== _)
  10020. return (b = _).conversionName = t,
  10021. _.conversion = e,
  10022. E.BREAK
  10023. }),
  10024. E.BREAK
  10025. }),
  10026. b
  10027. }
  10028. ),
  10029. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10030. function y(e, t, i, n) {
  10031. if (void 0 === t[i])
  10032. throw new Error("Object " + t + ' has no property "' + i + '"');
  10033. var r;
  10034. if (n.color)
  10035. r = new g(t,i);
  10036. else {
  10037. var o = [t, i].concat(n.factoryArgs);
  10038. r = c.apply(e, o)
  10039. }
  10040. n.before instanceof h && (n.before = n.before.__li),
  10041. C(e, r),
  10042. m.addClass(r.domElement, "c");
  10043. var a = document.createElement("span");
  10044. m.addClass(a, "property-name"),
  10045. a.innerHTML = r.property;
  10046. var s = document.createElement("div");
  10047. s.appendChild(a),
  10048. s.appendChild(r.domElement);
  10049. var l = A(e, s, n.before);
  10050. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10051. m.addClass(l, typeof r.getValue()),
  10052. function(t, i, n) {
  10053. if (n.__li = i,
  10054. n.__gui = t,
  10055. v.extend(n, {
  10056. options: function(e) {
  10057. return 1 < arguments.length ? (n.remove(),
  10058. y(t, n.object, n.property, {
  10059. before: n.__li.nextElementSibling,
  10060. factoryArgs: [v.toArray(arguments)]
  10061. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10062. y(t, n.object, n.property, {
  10063. before: n.__li.nextElementSibling,
  10064. factoryArgs: [e]
  10065. })) : void 0
  10066. },
  10067. name: function(e) {
  10068. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10069. n
  10070. },
  10071. listen: function() {
  10072. return n.__gui.listen(n),
  10073. n
  10074. },
  10075. remove: function() {
  10076. return n.__gui.remove(n),
  10077. n
  10078. }
  10079. }),
  10080. n instanceof f) {
  10081. var r = new p(n.object,n.property,{
  10082. min: n.__min,
  10083. max: n.__max,
  10084. step: n.__step
  10085. });
  10086. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10087. var t = n[e]
  10088. , i = r[e];
  10089. n[e] = r[e] = function() {
  10090. var e = Array.prototype.slice.call(arguments);
  10091. return t.apply(n, e),
  10092. i.apply(r, e)
  10093. }
  10094. }),
  10095. m.addClass(i, "has-slider"),
  10096. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10097. } else if (n instanceof p) {
  10098. var e = function(e) {
  10099. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10100. y(t, n.object, n.property, {
  10101. before: n.__li.nextElementSibling,
  10102. factoryArgs: [n.__min, n.__max, n.__step]
  10103. })) : e
  10104. };
  10105. n.min = v.compose(e, n.min),
  10106. n.max = v.compose(e, n.max)
  10107. } else
  10108. n instanceof u ? (m.bind(i, "click", function() {
  10109. m.fakeEvent(n.__checkbox, "click")
  10110. }),
  10111. m.bind(n.__checkbox, "click", function(e) {
  10112. e.stopPropagation()
  10113. })) : n instanceof d ? (m.bind(i, "click", function() {
  10114. m.fakeEvent(n.__button, "click")
  10115. }),
  10116. m.bind(i, "mouseover", function() {
  10117. m.addClass(n.__button, "hover")
  10118. }),
  10119. m.bind(i, "mouseout", function() {
  10120. m.removeClass(n.__button, "hover")
  10121. })) : n instanceof g && (m.addClass(i, "color"),
  10122. n.updateDisplay = v.compose(function(e) {
  10123. return i.style.borderLeftColor = n.__color.toString(),
  10124. e
  10125. }, n.updateDisplay),
  10126. n.updateDisplay());
  10127. n.setValue = v.compose(function(e) {
  10128. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10129. e
  10130. }, n.setValue)
  10131. }(e, l, r),
  10132. e.__controllers.push(r),
  10133. r
  10134. }
  10135. function A(e, t, i) {
  10136. var n = document.createElement("li");
  10137. return t && n.appendChild(t),
  10138. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10139. e.onResize(),
  10140. n
  10141. }
  10142. function C(e, t) {
  10143. var i = e.getRoot()
  10144. , n = i.__rememberedObjects.indexOf(t.object);
  10145. if (-1 != n) {
  10146. var r = i.__rememberedObjectIndecesToControllers[n];
  10147. if (void 0 === r && (r = {},
  10148. i.__rememberedObjectIndecesToControllers[n] = r),
  10149. r[t.property] = t,
  10150. i.load && i.load.remembered) {
  10151. var o, a = i.load.remembered;
  10152. if (a[e.preset])
  10153. o = a[e.preset];
  10154. else {
  10155. if (!a[T])
  10156. return;
  10157. o = a[T]
  10158. }
  10159. if (o[n] && void 0 !== o[n][t.property]) {
  10160. var s = o[n][t.property];
  10161. t.initialValue = s,
  10162. t.setValue(s)
  10163. }
  10164. }
  10165. }
  10166. }
  10167. function I(e, t) {
  10168. return document.location.href + "." + t
  10169. }
  10170. function l(e, t) {
  10171. e.domElement.style.width = t + "px",
  10172. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10173. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10174. }
  10175. function a(r, o) {
  10176. var a = {};
  10177. return v.each(r.__rememberedObjects, function(e, t) {
  10178. var i = {}
  10179. , n = r.__rememberedObjectIndecesToControllers[t];
  10180. v.each(n, function(e, t) {
  10181. i[t] = o ? e.initialValue : e.getValue()
  10182. }),
  10183. a[t] = i
  10184. }),
  10185. a
  10186. }
  10187. function E(e, t, i) {
  10188. var n = document.createElement("option");
  10189. n.innerHTML = t,
  10190. n.value = t,
  10191. e.__preset_select.appendChild(n),
  10192. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10193. }
  10194. function _(e, t) {
  10195. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10196. i.innerHTML = t ? i.value + "*" : i.value
  10197. }
  10198. e.inject(".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n");
  10199. var b, w, T = "Default", x = function() {
  10200. try {
  10201. return "localStorage"in window && null !== window.localStorage
  10202. } catch (e) {
  10203. return !1
  10204. }
  10205. }(), S = !0, s = !1, M = [], R = function(t) {
  10206. var i = this;
  10207. this.domElement = document.createElement("div"),
  10208. this.__ul = document.createElement("ul"),
  10209. this.domElement.appendChild(this.__ul),
  10210. m.addClass(this.domElement, "dg"),
  10211. this.__folders = {},
  10212. this.__controllers = [],
  10213. this.__rememberedObjects = [],
  10214. this.__rememberedObjectIndecesToControllers = [],
  10215. this.__listening = [],
  10216. t = t || {},
  10217. t = v.defaults(t, {
  10218. autoPlace: !0,
  10219. width: R.DEFAULT_WIDTH
  10220. }),
  10221. t = v.defaults(t, {
  10222. resizable: t.autoPlace,
  10223. hideable: t.autoPlace
  10224. }),
  10225. v.isUndefined(t.load) ? t.load = {
  10226. preset: T
  10227. } : t.preset && (t.load.preset = t.preset),
  10228. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10229. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10230. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10231. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10232. if (Object.defineProperties(this, {
  10233. parent: {
  10234. get: function() {
  10235. return t.parent
  10236. }
  10237. },
  10238. scrollable: {
  10239. get: function() {
  10240. return t.scrollable
  10241. }
  10242. },
  10243. autoPlace: {
  10244. get: function() {
  10245. return t.autoPlace
  10246. }
  10247. },
  10248. preset: {
  10249. get: function() {
  10250. return i.parent ? i.getRoot().preset : t.load.preset
  10251. },
  10252. set: function(e) {
  10253. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10254. function(e) {
  10255. for (var t = 0; t < e.__preset_select.length; t++)
  10256. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10257. }(this),
  10258. i.revert()
  10259. }
  10260. },
  10261. width: {
  10262. get: function() {
  10263. return t.width
  10264. },
  10265. set: function(e) {
  10266. t.width = e,
  10267. l(i, e)
  10268. }
  10269. },
  10270. name: {
  10271. get: function() {
  10272. return t.name
  10273. },
  10274. set: function(e) {
  10275. t.name = e,
  10276. a && (a.innerHTML = t.name)
  10277. }
  10278. },
  10279. closed: {
  10280. get: function() {
  10281. return t.closed
  10282. },
  10283. set: function(e) {
  10284. t.closed = e,
  10285. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10286. this.onResize(),
  10287. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10288. }
  10289. },
  10290. load: {
  10291. get: function() {
  10292. return t.load
  10293. }
  10294. },
  10295. useLocalStorage: {
  10296. get: function() {
  10297. return r
  10298. },
  10299. set: function(e) {
  10300. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10301. localStorage.setItem(I(0, "isLocal"), e))
  10302. }
  10303. }
  10304. }),
  10305. v.isUndefined(t.parent)) {
  10306. if (t.closed = !1,
  10307. m.addClass(this.domElement, R.CLASS_MAIN),
  10308. m.makeSelectable(this.domElement, !1),
  10309. x && r) {
  10310. i.useLocalStorage = !0;
  10311. var o = localStorage.getItem(I(0, "gui"));
  10312. o && (t.load = JSON.parse(o))
  10313. }
  10314. this.__closeButton = document.createElement("div"),
  10315. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10316. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10317. this.domElement.appendChild(this.__closeButton),
  10318. m.bind(this.__closeButton, "click", function() {
  10319. i.closed = !i.closed
  10320. })
  10321. } else {
  10322. void 0 === t.closed && (t.closed = !0);
  10323. var a = document.createTextNode(t.name);
  10324. m.addClass(a, "controller-name");
  10325. var s = A(i, a);
  10326. m.addClass(this.__ul, R.CLASS_CLOSED),
  10327. m.addClass(s, "title"),
  10328. m.bind(s, "click", function(e) {
  10329. return e.preventDefault(),
  10330. i.closed = !i.closed,
  10331. !1
  10332. }),
  10333. t.closed || (this.closed = !1)
  10334. }
  10335. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10336. m.addClass(w, "dg"),
  10337. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10338. document.body.appendChild(w),
  10339. S = !1),
  10340. w.appendChild(this.domElement),
  10341. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10342. this.parent || l(i, t.width)),
  10343. m.bind(window, "resize", function() {
  10344. i.onResize()
  10345. }),
  10346. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10347. i.onResize()
  10348. }),
  10349. m.bind(this.__ul, "transitionend", function() {
  10350. i.onResize()
  10351. }),
  10352. m.bind(this.__ul, "oTransitionEnd", function() {
  10353. i.onResize()
  10354. }),
  10355. this.onResize(),
  10356. t.resizable && function(t) {
  10357. function e(e) {
  10358. return e.preventDefault(),
  10359. r = e.clientX,
  10360. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10361. m.bind(window, "mousemove", i),
  10362. m.bind(window, "mouseup", n),
  10363. !1
  10364. }
  10365. function i(e) {
  10366. return e.preventDefault(),
  10367. t.width += r - e.clientX,
  10368. t.onResize(),
  10369. r = e.clientX,
  10370. !1
  10371. }
  10372. function n() {
  10373. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10374. m.unbind(window, "mousemove", i),
  10375. m.unbind(window, "mouseup", n)
  10376. }
  10377. var r;
  10378. t.__resize_handle = document.createElement("div"),
  10379. v.extend(t.__resize_handle.style, {
  10380. width: "6px",
  10381. marginLeft: "-3px",
  10382. height: "200px",
  10383. cursor: "ew-resize",
  10384. position: "absolute"
  10385. }),
  10386. m.bind(t.__resize_handle, "mousedown", e),
  10387. m.bind(t.__closeButton, "mousedown", e),
  10388. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10389. }(this),
  10390. n = function() {
  10391. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10392. }
  10393. ,
  10394. this.saveToLocalStorageIfPossible = n,
  10395. i.getRoot(),
  10396. t.parent || ((e = i.getRoot()).width += 1,
  10397. v.defer(function() {
  10398. e.width -= 1
  10399. }))
  10400. };
  10401. return R.toggleHide = function() {
  10402. s = !s,
  10403. v.each(M, function(e) {
  10404. e.domElement.style.zIndex = s ? -999 : 999,
  10405. e.domElement.style.opacity = s ? 0 : 1
  10406. })
  10407. }
  10408. ,
  10409. R.CLASS_AUTO_PLACE = "a",
  10410. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10411. R.CLASS_MAIN = "main",
  10412. R.CLASS_CONTROLLER_ROW = "cr",
  10413. R.CLASS_TOO_TALL = "taller-than-window",
  10414. R.CLASS_CLOSED = "closed",
  10415. R.CLASS_CLOSE_BUTTON = "close-button",
  10416. R.CLASS_DRAG = "drag",
  10417. R.DEFAULT_WIDTH = 245,
  10418. R.TEXT_CLOSED = "Close Controls",
  10419. R.TEXT_OPEN = "Open Controls",
  10420. m.bind(window, "keydown", function(e) {
  10421. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10422. }, !1),
  10423. v.extend(R.prototype, {
  10424. add: function(e, t) {
  10425. return y(this, e, t, {
  10426. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10427. })
  10428. },
  10429. addColor: function(e, t) {
  10430. return y(this, e, t, {
  10431. color: !0
  10432. })
  10433. },
  10434. remove: function(e) {
  10435. this.__ul.removeChild(e.__li),
  10436. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10437. var t = this;
  10438. v.defer(function() {
  10439. t.onResize()
  10440. })
  10441. },
  10442. destroy: function() {
  10443. this.autoPlace && w.removeChild(this.domElement)
  10444. },
  10445. addFolder: function(e) {
  10446. if (void 0 !== this.__folders[e])
  10447. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10448. var t = {
  10449. name: e,
  10450. parent: this
  10451. };
  10452. t.autoPlace = this.autoPlace,
  10453. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10454. t.load = this.load.folders[e]);
  10455. var i = new R(t);
  10456. this.__folders[e] = i;
  10457. var n = A(this, i.domElement);
  10458. return m.addClass(n, "folder"),
  10459. i
  10460. },
  10461. open: function() {
  10462. this.closed = !1
  10463. },
  10464. close: function() {
  10465. this.closed = !0
  10466. },
  10467. onResize: function() {
  10468. var t = this.getRoot();
  10469. if (t.scrollable) {
  10470. var e = m.getOffset(t.__ul).top
  10471. , i = 0;
  10472. v.each(t.__ul.childNodes, function(e) {
  10473. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10474. }),
  10475. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10476. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10477. t.__ul.style.height = "auto")
  10478. }
  10479. t.__resize_handle && v.defer(function() {
  10480. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10481. }),
  10482. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10483. },
  10484. remember: function() {
  10485. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>'),
  10486. this.parent)
  10487. throw new Error("You can only call remember on a top level GUI.");
  10488. var t = this;
  10489. v.each(Array.prototype.slice.call(arguments), function(e) {
  10490. 0 == t.__rememberedObjects.length && function(i) {
  10491. var e = i.__save_row = document.createElement("li");
  10492. m.addClass(i.domElement, "has-save"),
  10493. i.__ul.insertBefore(e, i.__ul.firstChild),
  10494. m.addClass(e, "save-row");
  10495. var t = document.createElement("span");
  10496. t.innerHTML = "&nbsp;",
  10497. m.addClass(t, "button gears");
  10498. var n = document.createElement("span");
  10499. n.innerHTML = "Save",
  10500. m.addClass(n, "button"),
  10501. m.addClass(n, "save");
  10502. var r = document.createElement("span");
  10503. r.innerHTML = "New",
  10504. m.addClass(r, "button"),
  10505. m.addClass(r, "save-as");
  10506. var o = document.createElement("span");
  10507. o.innerHTML = "Revert",
  10508. m.addClass(o, "button"),
  10509. m.addClass(o, "revert");
  10510. var a = i.__preset_select = document.createElement("select");
  10511. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10512. E(i, t, t == i.preset)
  10513. }) : E(i, T, !1),
  10514. m.bind(a, "change", function() {
  10515. for (var e = 0; e < i.__preset_select.length; e++)
  10516. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10517. i.preset = this.value
  10518. }),
  10519. e.appendChild(a),
  10520. e.appendChild(t),
  10521. e.appendChild(n),
  10522. e.appendChild(r),
  10523. e.appendChild(o),
  10524. x) {
  10525. var s = document.getElementById("dg-save-locally")
  10526. , l = document.getElementById("dg-local-explain");
  10527. s.style.display = "block";
  10528. var c = document.getElementById("dg-local-storage");
  10529. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10530. var h = function() {
  10531. l.style.display = i.useLocalStorage ? "block" : "none"
  10532. };
  10533. h(),
  10534. m.bind(c, "change", function() {
  10535. i.useLocalStorage = !i.useLocalStorage,
  10536. h()
  10537. })
  10538. }
  10539. var u = document.getElementById("dg-new-constructor");
  10540. m.bind(u, "keydown", function(e) {
  10541. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10542. }),
  10543. m.bind(t, "click", function() {
  10544. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10545. b.show(),
  10546. u.focus(),
  10547. u.select()
  10548. }),
  10549. m.bind(n, "click", function() {
  10550. i.save()
  10551. }),
  10552. m.bind(r, "click", function() {
  10553. var e = prompt("Enter a new preset name.");
  10554. e && i.saveAs(e)
  10555. }),
  10556. m.bind(o, "click", function() {
  10557. i.revert()
  10558. })
  10559. }(t),
  10560. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10561. }),
  10562. this.autoPlace && l(this, this.width)
  10563. },
  10564. getRoot: function() {
  10565. for (var e = this; e.parent; )
  10566. e = e.parent;
  10567. return e
  10568. },
  10569. getSaveObject: function() {
  10570. var i = this.load;
  10571. return i.closed = this.closed,
  10572. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10573. i.remembered || (i.remembered = {}),
  10574. i.remembered[this.preset] = a(this)),
  10575. i.folders = {},
  10576. v.each(this.__folders, function(e, t) {
  10577. i.folders[t] = e.getSaveObject()
  10578. }),
  10579. i
  10580. },
  10581. save: function() {
  10582. this.load.remembered || (this.load.remembered = {}),
  10583. this.load.remembered[this.preset] = a(this),
  10584. _(this, !1),
  10585. this.saveToLocalStorageIfPossible()
  10586. },
  10587. saveAs: function(e) {
  10588. this.load.remembered || (this.load.remembered = {},
  10589. this.load.remembered[T] = a(this, !0)),
  10590. this.load.remembered[e] = a(this),
  10591. this.preset = e,
  10592. E(this, e, !0),
  10593. this.saveToLocalStorageIfPossible()
  10594. },
  10595. revert: function(t) {
  10596. v.each(this.__controllers, function(e) {
  10597. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10598. }, this),
  10599. v.each(this.__folders, function(e) {
  10600. e.revert(e)
  10601. }),
  10602. t || _(this.getRoot(), !1)
  10603. },
  10604. listen: function(e) {
  10605. var t = 0 == this.__listening.length;
  10606. this.__listening.push(e),
  10607. t && function e(t) {
  10608. 0 != t.length && r(function() {
  10609. e(t)
  10610. }),
  10611. v.each(t, function(e) {
  10612. e.updateDisplay()
  10613. })
  10614. }(this.__listening)
  10615. }
  10616. }),
  10617. R
  10618. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10619. u = ee.controllers.NumberControllerBox,
  10620. d = ee.controllers.NumberControllerSlider,
  10621. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10622. y = ee.dom.dom,
  10623. A = ee.utils.common,
  10624. (C = function(e, t) {
  10625. function i() {
  10626. n.setValue(n.__input.value)
  10627. }
  10628. C.superclass.call(this, e, t);
  10629. var n = this;
  10630. this.__input = document.createElement("input"),
  10631. this.__input.setAttribute("type", "text"),
  10632. y.bind(this.__input, "keyup", i),
  10633. y.bind(this.__input, "change", i),
  10634. y.bind(this.__input, "blur", function() {
  10635. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10636. }),
  10637. y.bind(this.__input, "keydown", function(e) {
  10638. 13 === e.keyCode && this.blur()
  10639. }),
  10640. this.updateDisplay(),
  10641. this.domElement.appendChild(this.__input)
  10642. }
  10643. ).superclass = v,
  10644. A.extend(C.prototype, v.prototype, {
  10645. updateDisplay: function() {
  10646. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10647. C.superclass.prototype.updateDisplay.call(this)
  10648. }
  10649. }),
  10650. C),
  10651. f = ee.controllers.FunctionController,
  10652. g = ee.controllers.BooleanController,
  10653. m = ee.utils.common,
  10654. function(e, t) {
  10655. var i = e[t];
  10656. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10657. min: arguments[2],
  10658. max: arguments[3]
  10659. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10660. }
  10661. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10662. function f(t, i, n, r) {
  10663. t.style.background = "",
  10664. p.each(o, function(e) {
  10665. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10666. })
  10667. }
  10668. var g = function(e, t) {
  10669. function i(e) {
  10670. a(e),
  10671. h.bind(window, "mousemove", a),
  10672. h.bind(window, "mouseup", n)
  10673. }
  10674. function n() {
  10675. h.unbind(window, "mousemove", a),
  10676. h.unbind(window, "mouseup", n)
  10677. }
  10678. function r() {
  10679. var e = d(this.value);
  10680. !1 !== e ? (l.__color.__state = e,
  10681. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10682. }
  10683. function o() {
  10684. h.unbind(window, "mousemove", s),
  10685. h.unbind(window, "mouseup", o)
  10686. }
  10687. function a(e) {
  10688. e.preventDefault();
  10689. var t = h.getWidth(l.__saturation_field)
  10690. , i = h.getOffset(l.__saturation_field)
  10691. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10692. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10693. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10694. 1 < n ? n = 1 : n < 0 && (n = 0),
  10695. l.__color.v = r,
  10696. l.__color.s = n,
  10697. l.setValue(l.__color.toOriginal()),
  10698. !1
  10699. }
  10700. function s(e) {
  10701. e.preventDefault();
  10702. var t = h.getHeight(l.__hue_field)
  10703. , i = h.getOffset(l.__hue_field)
  10704. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10705. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10706. l.__color.h = 360 * n,
  10707. l.setValue(l.__color.toOriginal()),
  10708. !1
  10709. }
  10710. g.superclass.call(this, e, t),
  10711. this.__color = new u(this.getValue()),
  10712. this.__temp = new u(0);
  10713. var l = this;
  10714. this.domElement = document.createElement("div"),
  10715. h.makeSelectable(this.domElement, !1),
  10716. this.__selector = document.createElement("div"),
  10717. this.__selector.className = "selector",
  10718. this.__saturation_field = document.createElement("div"),
  10719. this.__saturation_field.className = "saturation-field",
  10720. this.__field_knob = document.createElement("div"),
  10721. this.__field_knob.className = "field-knob",
  10722. this.__field_knob_border = "2px solid ",
  10723. this.__hue_knob = document.createElement("div"),
  10724. this.__hue_knob.className = "hue-knob",
  10725. this.__hue_field = document.createElement("div"),
  10726. this.__hue_field.className = "hue-field",
  10727. this.__input = document.createElement("input"),
  10728. this.__input.type = "text",
  10729. this.__input_textShadow = "0 1px 1px ",
  10730. h.bind(this.__input, "keydown", function(e) {
  10731. 13 === e.keyCode && r.call(this)
  10732. }),
  10733. h.bind(this.__input, "blur", r),
  10734. h.bind(this.__selector, "mousedown", function(e) {
  10735. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10736. h.removeClass(l.__selector, "drag")
  10737. })
  10738. });
  10739. var c = document.createElement("div");
  10740. p.extend(this.__selector.style, {
  10741. width: "122px",
  10742. height: "102px",
  10743. padding: "3px",
  10744. backgroundColor: "#222",
  10745. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10746. }),
  10747. p.extend(this.__field_knob.style, {
  10748. position: "absolute",
  10749. width: "12px",
  10750. height: "12px",
  10751. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10752. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10753. borderRadius: "12px",
  10754. zIndex: 1
  10755. }),
  10756. p.extend(this.__hue_knob.style, {
  10757. position: "absolute",
  10758. width: "15px",
  10759. height: "2px",
  10760. borderRight: "4px solid #fff",
  10761. zIndex: 1
  10762. }),
  10763. p.extend(this.__saturation_field.style, {
  10764. width: "100px",
  10765. height: "100px",
  10766. border: "1px solid #555",
  10767. marginRight: "3px",
  10768. display: "inline-block",
  10769. cursor: "pointer"
  10770. }),
  10771. p.extend(c.style, {
  10772. width: "100%",
  10773. height: "100%",
  10774. background: "none"
  10775. }),
  10776. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10777. p.extend(this.__hue_field.style, {
  10778. width: "15px",
  10779. height: "100px",
  10780. display: "inline-block",
  10781. border: "1px solid #555",
  10782. cursor: "ns-resize"
  10783. }),
  10784. function(e) {
  10785. e.style.background = "",
  10786. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10787. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10788. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10789. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10790. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10791. }(this.__hue_field),
  10792. p.extend(this.__input.style, {
  10793. outline: "none",
  10794. textAlign: "center",
  10795. color: "#fff",
  10796. border: 0,
  10797. fontWeight: "bold",
  10798. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10799. }),
  10800. h.bind(this.__saturation_field, "mousedown", i),
  10801. h.bind(this.__field_knob, "mousedown", i),
  10802. h.bind(this.__hue_field, "mousedown", function(e) {
  10803. s(e),
  10804. h.bind(window, "mousemove", s),
  10805. h.bind(window, "mouseup", o)
  10806. }),
  10807. this.__saturation_field.appendChild(c),
  10808. this.__selector.appendChild(this.__field_knob),
  10809. this.__selector.appendChild(this.__saturation_field),
  10810. this.__selector.appendChild(this.__hue_field),
  10811. this.__hue_field.appendChild(this.__hue_knob),
  10812. this.domElement.appendChild(this.__input),
  10813. this.domElement.appendChild(this.__selector),
  10814. this.updateDisplay()
  10815. };
  10816. g.superclass = e,
  10817. p.extend(g.prototype, e.prototype, {
  10818. updateDisplay: function() {
  10819. var t = d(this.getValue());
  10820. if (!1 !== t) {
  10821. var i = !1;
  10822. p.each(u.COMPONENTS, function(e) {
  10823. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10824. return i = !0,
  10825. {}
  10826. }, this),
  10827. i && p.extend(this.__color.__state, t)
  10828. }
  10829. p.extend(this.__temp.__state, this.__color.__state),
  10830. this.__temp.a = 1;
  10831. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10832. , n = 255 - e;
  10833. p.extend(this.__field_knob.style, {
  10834. marginLeft: 100 * this.__color.s - 7 + "px",
  10835. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10836. backgroundColor: this.__temp.toString(),
  10837. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10838. }),
  10839. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10840. this.__temp.s = 1,
  10841. this.__temp.v = 1,
  10842. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10843. p.extend(this.__input.style, {
  10844. backgroundColor: this.__input.value = this.__color.toString(),
  10845. color: "rgb(" + e + "," + e + "," + e + ")",
  10846. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10847. })
  10848. }
  10849. });
  10850. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10851. return g
  10852. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10853. a = ee.color.math = {
  10854. hsv_to_rgb: function(e, t, i) {
  10855. var n = Math.floor(e / 60) % 6
  10856. , r = e / 60 - Math.floor(e / 60)
  10857. , o = i * (1 - t)
  10858. , a = i * (1 - r * t)
  10859. , s = i * (1 - (1 - r) * t)
  10860. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10861. return {
  10862. r: 255 * l[0],
  10863. g: 255 * l[1],
  10864. b: 255 * l[2]
  10865. }
  10866. },
  10867. rgb_to_hsv: function(e, t, i) {
  10868. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10869. return 0 == o ? {
  10870. h: NaN,
  10871. s: 0,
  10872. v: 0
  10873. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10874. (n /= 6) < 0 && (n += 1),
  10875. {
  10876. h: 360 * n,
  10877. s: a / o,
  10878. v: o / 255
  10879. })
  10880. },
  10881. rgb_to_hex: function(e, t, i) {
  10882. var n = this.hex_with_component(0, 2, e);
  10883. return n = this.hex_with_component(n, 1, t),
  10884. this.hex_with_component(n, 0, i)
  10885. },
  10886. component_from_hex: function(e, t) {
  10887. return e >> 8 * t & 255
  10888. },
  10889. hex_with_component: function(e, t, i) {
  10890. return i << (c = 8 * t) | e & ~(255 << c)
  10891. }
  10892. },
  10893. s = ee.color.toString,
  10894. l = ee.utils.common,
  10895. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10896. l.extend(ae.prototype, {
  10897. toString: function() {
  10898. return s(this)
  10899. },
  10900. toOriginal: function() {
  10901. return this.__state.conversion.write(this)
  10902. }
  10903. }),
  10904. ie(ae.prototype, "r", 2),
  10905. ie(ae.prototype, "g", 1),
  10906. ie(ae.prototype, "b", 0),
  10907. ne(ae.prototype, "h"),
  10908. ne(ae.prototype, "s"),
  10909. ne(ae.prototype, "v"),
  10910. Object.defineProperty(ae.prototype, "a", {
  10911. get: function() {
  10912. return this.__state.a
  10913. },
  10914. set: function(e) {
  10915. this.__state.a = e
  10916. }
  10917. }),
  10918. Object.defineProperty(ae.prototype, "hex", {
  10919. get: function() {
  10920. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10921. this.__state.hex
  10922. },
  10923. set: function(e) {
  10924. this.__state.space = "HEX",
  10925. this.__state.hex = e
  10926. }
  10927. }),
  10928. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10929. window.setTimeout(e, 1e3 / 60)
  10930. }
  10931. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10932. r = ee.utils.common,
  10933. te.prototype.show = function() {
  10934. var e = this;
  10935. this.backgroundElement.style.display = "block",
  10936. this.domElement.style.display = "block",
  10937. this.domElement.style.opacity = 0,
  10938. this.domElement.style.webkitTransform = "scale(1.1)",
  10939. this.layout(),
  10940. r.defer(function() {
  10941. e.backgroundElement.style.opacity = 1,
  10942. e.domElement.style.opacity = 1,
  10943. e.domElement.style.webkitTransform = "scale(1)"
  10944. })
  10945. }
  10946. ,
  10947. te.prototype.hide = function() {
  10948. var e = this
  10949. , t = function() {
  10950. e.domElement.style.display = "none",
  10951. e.backgroundElement.style.display = "none",
  10952. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10953. n.unbind(e.domElement, "transitionend", t),
  10954. n.unbind(e.domElement, "oTransitionEnd", t)
  10955. };
  10956. n.bind(this.domElement, "webkitTransitionEnd", t),
  10957. n.bind(this.domElement, "transitionend", t),
  10958. n.bind(this.domElement, "oTransitionEnd", t),
  10959. this.backgroundElement.style.opacity = 0,
  10960. this.domElement.style.opacity = 0,
  10961. this.domElement.style.webkitTransform = "scale(1.1)"
  10962. }
  10963. ,
  10964. te.prototype.layout = function() {
  10965. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10966. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10967. }
  10968. ,
  10969. te), ee.dom.dom, ee.utils.common)
  10970. }
  10971. , {}],
  10972. 94: [function(e, t, i) {
  10973. (function(J) {
  10974. "use strict";
  10975. function i(e) {
  10976. function t(e, t) {
  10977. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10978. for (var a = 1; a <= e[o]; a++)
  10979. r[t[n]] = [],
  10980. r[t[n]][0] = i,
  10981. r[t[n]][1] = o,
  10982. n++,
  10983. i++;
  10984. i *= 2
  10985. }
  10986. return r
  10987. }
  10988. function _(e) {
  10989. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  10990. t & 1 << i && (B |= 1 << V),
  10991. i--,
  10992. --V < 0 && (255 == B ? (b(255),
  10993. b(0)) : b(B),
  10994. V = 7,
  10995. B = 0)
  10996. }
  10997. function b(e) {
  10998. F.push(e)
  10999. }
  11000. function w(e) {
  11001. b(e >> 8 & 255),
  11002. b(255 & e)
  11003. }
  11004. function T(e, t, i, n, r) {
  11005. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11006. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11007. for (h = 0; h < 8; ++h) {
  11008. i = e[d],
  11009. n = e[d + 1],
  11010. r = e[d + 2],
  11011. o = e[d + 3],
  11012. a = e[d + 4],
  11013. s = e[d + 5],
  11014. l = e[d + 6];
  11015. var p = i + (c = e[d + 7])
  11016. , f = i - c
  11017. , g = n + l
  11018. , m = n - l
  11019. , v = r + s
  11020. , y = r - s
  11021. , A = o + a
  11022. , C = o - a
  11023. , I = p + A
  11024. , E = p - A
  11025. , _ = g + v
  11026. , b = g - v;
  11027. e[d] = I + _,
  11028. e[d + 4] = I - _;
  11029. var w = .707106781 * (b + E);
  11030. e[d + 2] = E + w,
  11031. e[d + 6] = E - w;
  11032. var T = .382683433 * ((I = C + y) - (b = m + f))
  11033. , x = .5411961 * I + T
  11034. , S = 1.306562965 * b + T
  11035. , M = .707106781 * (_ = y + m)
  11036. , R = f + M
  11037. , P = f - M;
  11038. e[d + 5] = P + x,
  11039. e[d + 3] = P - x,
  11040. e[d + 1] = R + S,
  11041. e[d + 7] = R - S,
  11042. d += 8
  11043. }
  11044. for (h = d = 0; h < 8; ++h) {
  11045. i = e[d],
  11046. n = e[d + 8],
  11047. r = e[d + 16],
  11048. o = e[d + 24],
  11049. a = e[d + 32],
  11050. s = e[d + 40],
  11051. l = e[d + 48];
  11052. var O = i + (c = e[d + 56])
  11053. , L = i - c
  11054. , D = n + l
  11055. , N = n - l
  11056. , F = r + s
  11057. , B = r - s
  11058. , V = o + a
  11059. , k = o - a
  11060. , U = O + V
  11061. , H = O - V
  11062. , z = D + F
  11063. , G = D - F;
  11064. e[d] = U + z,
  11065. e[d + 32] = U - z;
  11066. var W = .707106781 * (G + H);
  11067. e[d + 16] = H + W,
  11068. e[d + 48] = H - W;
  11069. var j = .382683433 * ((U = k + B) - (G = N + L))
  11070. , Y = .5411961 * U + j
  11071. , q = 1.306562965 * G + j
  11072. , X = .707106781 * (z = B + N)
  11073. , Z = L + X
  11074. , K = L - X;
  11075. e[d + 40] = K + Y,
  11076. e[d + 24] = K - Y,
  11077. e[d + 8] = Z + q,
  11078. e[d + 56] = Z - q,
  11079. d++
  11080. }
  11081. for (h = 0; h < 64; ++h)
  11082. u = e[h] * t[h],
  11083. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11084. return Q
  11085. }(e, t), c = 0; c < 64; ++c)
  11086. A[C[c]] = l[c];
  11087. var h = A[0] - i;
  11088. i = A[0],
  11089. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11090. _(v[o]));
  11091. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11092. ;
  11093. if (0 == u)
  11094. return _(a),
  11095. i;
  11096. for (var d, p = 1; p <= u; ) {
  11097. for (var f = p; 0 == A[p] && p <= u; ++p)
  11098. ;
  11099. var g = p - f;
  11100. if (16 <= g) {
  11101. d = g >> 4;
  11102. for (var m = 1; m <= d; ++m)
  11103. _(s);
  11104. g &= 15
  11105. }
  11106. o = 32767 + A[p],
  11107. _(r[(g << 4) + y[o]]),
  11108. _(v[o]),
  11109. p++
  11110. }
  11111. return 63 != u && _(a),
  11112. i
  11113. }
  11114. function x(e) {
  11115. if (e <= 0 && (e = 1),
  11116. 100 < e && (e = 100),
  11117. i != e) {
  11118. (function(e) {
  11119. for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], i = 0; i < 64; i++) {
  11120. var n = u((t[i] * e + 50) / 100);
  11121. n < 1 ? n = 1 : 255 < n && (n = 255),
  11122. O[C[i]] = n
  11123. }
  11124. for (var r = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
  11125. var a = u((r[o] * e + 50) / 100);
  11126. a < 1 ? a = 1 : 255 < a && (a = 255),
  11127. L[C[o]] = a
  11128. }
  11129. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11130. for (var h = 0; h < 8; h++)
  11131. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11132. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11133. l++
  11134. }
  11135. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11136. i = e
  11137. }
  11138. }
  11139. var S, M, R, P, i, u = (Math.round,
  11140. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11141. this.encode = function(e, t) {
  11142. var i = ((new Date).getTime(),
  11143. t.quality);
  11144. i && x(i),
  11145. F = new Array,
  11146. B = 0,
  11147. V = 7,
  11148. w(65496),
  11149. w(65504),
  11150. w(16),
  11151. b(74),
  11152. b(70),
  11153. b(73),
  11154. b(70),
  11155. b(0),
  11156. b(1),
  11157. b(1),
  11158. b(0),
  11159. w(1),
  11160. w(1),
  11161. b(0),
  11162. b(0),
  11163. function() {
  11164. w(65499),
  11165. w(132),
  11166. b(0);
  11167. for (var e = 0; e < 64; e++)
  11168. b(O[e]);
  11169. b(1);
  11170. for (var t = 0; t < 64; t++)
  11171. b(L[t])
  11172. }(),
  11173. function(e, t) {
  11174. w(65472),
  11175. w(17),
  11176. b(8),
  11177. w(t),
  11178. w(e),
  11179. b(3),
  11180. b(1),
  11181. b(17),
  11182. b(0),
  11183. b(2),
  11184. b(17),
  11185. b(1),
  11186. b(3),
  11187. b(17),
  11188. b(1)
  11189. }(e.width, e.height),
  11190. function() {
  11191. w(65476),
  11192. w(418),
  11193. b(0);
  11194. for (var e = 0; e < 16; e++)
  11195. b(G[e + 1]);
  11196. for (var t = 0; t <= 11; t++)
  11197. b(W[t]);
  11198. b(16);
  11199. for (var i = 0; i < 16; i++)
  11200. b(j[i + 1]);
  11201. for (var n = 0; n <= 161; n++)
  11202. b(Y[n]);
  11203. b(1);
  11204. for (var r = 0; r < 16; r++)
  11205. b(q[r + 1]);
  11206. for (var o = 0; o <= 11; o++)
  11207. b(X[o]);
  11208. b(17);
  11209. for (var a = 0; a < 16; a++)
  11210. b(Z[a + 1]);
  11211. for (var s = 0; s <= 161; s++)
  11212. b(K[s])
  11213. }(),
  11214. w(65498),
  11215. w(12),
  11216. b(3),
  11217. b(1),
  11218. b(0),
  11219. b(2),
  11220. b(17),
  11221. b(3),
  11222. b(17),
  11223. b(0),
  11224. b(63),
  11225. b(0);
  11226. var n = 0
  11227. , r = 0
  11228. , o = 0;
  11229. B = 0,
  11230. V = 7,
  11231. this.encode.displayName = "_encode_";
  11232. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11233. for (a = 0; a < A; ) {
  11234. for (u = h = A * C + a,
  11235. d = -1,
  11236. f = p = 0; f < 64; f++)
  11237. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11238. v <= C + p && (u -= A * (C + 1 + p - v)),
  11239. A <= a + d && (u -= a + d - A + 4),
  11240. s = g[u++],
  11241. l = g[u++],
  11242. c = g[u++],
  11243. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11244. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11245. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11246. n = T(k, D, n, S, R),
  11247. r = T(U, N, r, M, P),
  11248. o = T(H, N, o, M, P),
  11249. a += 32
  11250. }
  11251. C += I
  11252. }
  11253. if (0 <= V) {
  11254. var E = [];
  11255. E[1] = V + 1,
  11256. E[0] = (1 << V + 1) - 1,
  11257. _(E)
  11258. }
  11259. return w(65497),
  11260. new J(F)
  11261. }
  11262. ,
  11263. (new Date).getTime(),
  11264. e = e || 50,
  11265. function() {
  11266. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11267. n[t] = e(t)
  11268. }(),
  11269. S = t(G, W),
  11270. M = t(q, X),
  11271. R = t(j, Y),
  11272. P = t(Z, K),
  11273. function() {
  11274. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11275. for (var n = e; n < t; n++)
  11276. y[32767 + n] = i,
  11277. v[32767 + n] = [],
  11278. v[32767 + n][1] = i,
  11279. v[32767 + n][0] = n;
  11280. for (var r = -(t - 1); r <= -e; r++)
  11281. y[32767 + r] = i,
  11282. v[32767 + r] = [],
  11283. v[32767 + r][1] = i,
  11284. v[32767 + r][0] = t - 1 + r;
  11285. e <<= 1,
  11286. t <<= 1
  11287. }
  11288. }(),
  11289. function() {
  11290. for (var e = 0; e < 256; e++)
  11291. z[e] = 19595 * e,
  11292. z[e + 256 >> 0] = 38470 * e,
  11293. z[e + 512 >> 0] = 7471 * e + 32768,
  11294. z[e + 768 >> 0] = -11059 * e,
  11295. z[e + 1024 >> 0] = -21709 * e,
  11296. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11297. z[e + 1536 >> 0] = -27439 * e,
  11298. z[e + 1792 >> 0] = -5329 * e
  11299. }(),
  11300. x(e),
  11301. (new Date).getTime()
  11302. }
  11303. t.exports.encode = function(e, t) {
  11304. return (t = t || {}).quality = t.quality || 50,
  11305. {
  11306. data: new i(t.quality).encode(e, t),
  11307. width: e.width,
  11308. height: e.height
  11309. }
  11310. }
  11311. }
  11312. ).call(this, e("buffer").Buffer)
  11313. }
  11314. , {
  11315. buffer: 198
  11316. }],
  11317. 95: [function(e, t, i) {
  11318. "use strict";
  11319. !function() {
  11320. if ("performance"in window == 0 && (window.performance = {}),
  11321. Date.now = Date.now || function() {
  11322. return (new Date).getTime()
  11323. }
  11324. ,
  11325. "now"in window.performance == 0) {
  11326. var e = Date.now();
  11327. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11328. window.performance.now = function() {
  11329. return Date.now() - e
  11330. }
  11331. }
  11332. }()
  11333. }
  11334. , {}],
  11335. 96: [function(e, t, i) {
  11336. "use strict";
  11337. var a = e("three");
  11338. a.EffectComposer = function(e, t) {
  11339. if (this.renderer = e,
  11340. void 0 === t) {
  11341. var i = {
  11342. minFilter: a.LinearFilter,
  11343. magFilter: a.LinearFilter,
  11344. format: a.RGBAFormat,
  11345. stencilBuffer: !1
  11346. }
  11347. , n = e.getSize();
  11348. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11349. }
  11350. this.renderTarget1 = t,
  11351. this.renderTarget2 = t.clone(),
  11352. this.writeBuffer = this.renderTarget1,
  11353. this.readBuffer = this.renderTarget2,
  11354. this.passes = [],
  11355. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11356. this.copyPass = new a.ShaderPass(a.CopyShader)
  11357. }
  11358. ,
  11359. a.EffectComposer.prototype = {
  11360. swapBuffers: function() {
  11361. var e = this.readBuffer;
  11362. this.readBuffer = this.writeBuffer,
  11363. this.writeBuffer = e
  11364. },
  11365. addPass: function(e) {
  11366. this.passes.push(e)
  11367. },
  11368. insertPass: function(e, t) {
  11369. this.passes.splice(t, 0, e)
  11370. },
  11371. render: function(e) {
  11372. this.writeBuffer = this.renderTarget1,
  11373. this.readBuffer = this.renderTarget2;
  11374. var t, i, n = !1, r = this.passes.length;
  11375. for (i = 0; i < r; i++)
  11376. if ((t = this.passes[i]).enabled) {
  11377. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11378. t.needsSwap) {
  11379. if (n) {
  11380. var o = this.renderer.context;
  11381. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11382. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11383. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11384. }
  11385. this.swapBuffers()
  11386. }
  11387. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11388. }
  11389. },
  11390. reset: function(e) {
  11391. if (void 0 === e) {
  11392. var t = this.renderer.getSize();
  11393. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11394. }
  11395. this.renderTarget1.dispose(),
  11396. this.renderTarget2.dispose(),
  11397. this.renderTarget1 = e,
  11398. this.renderTarget2 = e.clone(),
  11399. this.writeBuffer = this.renderTarget1,
  11400. this.readBuffer = this.renderTarget2
  11401. },
  11402. setSize: function(e, t) {
  11403. this.renderTarget1.setSize(e, t),
  11404. this.renderTarget2.setSize(e, t)
  11405. }
  11406. }
  11407. }
  11408. , {
  11409. three: 217
  11410. }],
  11411. 97: [function(e, t, i) {
  11412. "use strict";
  11413. var n = e("three");
  11414. n.MaskPass = function(e, t) {
  11415. this.scene = e,
  11416. this.camera = t,
  11417. this.enabled = !0,
  11418. this.clear = !0,
  11419. this.needsSwap = !1,
  11420. this.inverse = !1
  11421. }
  11422. ,
  11423. n.MaskPass.prototype = {
  11424. render: function(e, t, i, n) {
  11425. var r, o, a = e.context;
  11426. a.colorMask(!1, !1, !1, !1),
  11427. a.depthMask(!1),
  11428. o = this.inverse ? (r = 0,
  11429. 1) : (r = 1,
  11430. 0),
  11431. a.enable(a.STENCIL_TEST),
  11432. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11433. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11434. a.clearStencil(o),
  11435. e.render(this.scene, this.camera, i, this.clear),
  11436. e.render(this.scene, this.camera, t, this.clear),
  11437. a.colorMask(!0, !0, !0, !0),
  11438. a.depthMask(!0),
  11439. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11440. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11441. }
  11442. },
  11443. n.ClearMaskPass = function() {
  11444. this.enabled = !0
  11445. }
  11446. ,
  11447. n.ClearMaskPass.prototype = {
  11448. render: function(e, t, i, n) {
  11449. var r = e.context;
  11450. r.disable(r.STENCIL_TEST)
  11451. }
  11452. }
  11453. }
  11454. , {
  11455. three: 217
  11456. }],
  11457. 98: [function(e, t, i) {
  11458. "use strict";
  11459. var o = e("three");
  11460. o.RenderPass = function(e, t, i, n, r) {
  11461. this.scene = e,
  11462. this.camera = t,
  11463. this.overrideMaterial = i,
  11464. this.clearColor = n,
  11465. this.clearAlpha = void 0 !== r ? r : 1,
  11466. this.oldClearColor = new o.Color,
  11467. this.oldClearAlpha = 1,
  11468. this.enabled = !0,
  11469. this.clear = !0,
  11470. this.needsSwap = !1
  11471. }
  11472. ,
  11473. o.RenderPass.prototype = {
  11474. render: function(e, t, i, n) {
  11475. this.scene.overrideMaterial = this.overrideMaterial,
  11476. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11477. this.oldClearAlpha = e.getClearAlpha(),
  11478. e.setClearColor(this.clearColor, this.clearAlpha)),
  11479. e.render(this.scene, this.camera, i, this.clear),
  11480. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11481. this.scene.overrideMaterial = null
  11482. }
  11483. }
  11484. }
  11485. , {
  11486. three: 217
  11487. }],
  11488. 99: [function(e, t, i) {
  11489. "use strict";
  11490. var n = e("three");
  11491. n.ShaderPass = function(e, t) {
  11492. this.textureID = void 0 !== t ? t : "tDiffuse",
  11493. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11494. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11495. this.material = new n.ShaderMaterial({
  11496. defines: e.defines || {},
  11497. uniforms: this.uniforms,
  11498. vertexShader: e.vertexShader,
  11499. fragmentShader: e.fragmentShader
  11500. })),
  11501. this.renderToScreen = !1,
  11502. this.enabled = !0,
  11503. this.needsSwap = !0,
  11504. this.clear = !1,
  11505. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11506. this.scene = new n.Scene,
  11507. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11508. this.scene.add(this.quad)
  11509. }
  11510. ,
  11511. n.ShaderPass.prototype = {
  11512. render: function(e, t, i, n) {
  11513. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11514. this.quad.material = this.material,
  11515. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11516. }
  11517. }
  11518. }
  11519. , {
  11520. three: 217
  11521. }],
  11522. 100: [function(e, t, i) {
  11523. "use strict";
  11524. e("three").CopyShader = {
  11525. uniforms: {
  11526. tDiffuse: {
  11527. type: "t",
  11528. value: null
  11529. },
  11530. opacity: {
  11531. type: "f",
  11532. value: 1
  11533. }
  11534. },
  11535. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11536. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11537. }
  11538. }
  11539. , {
  11540. three: 217
  11541. }],
  11542. 101: [function(e, t, i) {
  11543. "use strict";
  11544. e("three").HorizontalBlurShader = {
  11545. uniforms: {
  11546. tDiffuse: {
  11547. type: "t",
  11548. value: null
  11549. },
  11550. h: {
  11551. type: "f",
  11552. value: 1 / 512
  11553. }
  11554. },
  11555. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11556. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11557. }
  11558. }
  11559. , {
  11560. three: 217
  11561. }],
  11562. 102: [function(e, t, i) {
  11563. "use strict";
  11564. e("three").VerticalBlurShader = {
  11565. uniforms: {
  11566. tDiffuse: {
  11567. type: "t",
  11568. value: null
  11569. },
  11570. v: {
  11571. type: "f",
  11572. value: 1 / 512
  11573. }
  11574. },
  11575. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11576. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11577. }
  11578. }
  11579. , {
  11580. three: 217
  11581. }],
  11582. 103: [function(e, t, i) {
  11583. "use strict";
  11584. var z = e("three");
  11585. !function() {
  11586. if ("performance"in window == 0 && (window.performance = {}),
  11587. "now"in window.performance == 0) {
  11588. var e = Date.now();
  11589. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11590. window.performance.now = function() {
  11591. return Date.now() - e
  11592. }
  11593. }
  11594. }(),
  11595. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11596. var t, i = this.extensions, n = this.context;
  11597. if (e === z.RepeatWrapping)
  11598. return n.REPEAT;
  11599. if (e === z.ClampToEdgeWrapping)
  11600. return n.CLAMP_TO_EDGE;
  11601. if (e === z.MirroredRepeatWrapping)
  11602. return n.MIRRORED_REPEAT;
  11603. if (e === z.NearestFilter)
  11604. return n.NEAREST;
  11605. if (e === z.NearestMipMapNearestFilter)
  11606. return n.NEAREST_MIPMAP_NEAREST;
  11607. if (e === z.NearestMipMapLinearFilter)
  11608. return n.NEAREST_MIPMAP_LINEAR;
  11609. if (e === z.LinearFilter)
  11610. return n.LINEAR;
  11611. if (e === z.LinearMipMapNearestFilter)
  11612. return n.LINEAR_MIPMAP_NEAREST;
  11613. if (e === z.LinearMipMapLinearFilter)
  11614. return n.LINEAR_MIPMAP_LINEAR;
  11615. if (e === z.UnsignedByteType)
  11616. return n.UNSIGNED_BYTE;
  11617. if (e === z.UnsignedShort4444Type)
  11618. return n.UNSIGNED_SHORT_4_4_4_4;
  11619. if (e === z.UnsignedShort5551Type)
  11620. return n.UNSIGNED_SHORT_5_5_5_1;
  11621. if (e === z.UnsignedShort565Type)
  11622. return n.UNSIGNED_SHORT_5_6_5;
  11623. if (e === z.ByteType)
  11624. return n.BYTE;
  11625. if (e === z.ShortType)
  11626. return n.SHORT;
  11627. if (e === z.UnsignedShortType)
  11628. return n.UNSIGNED_SHORT;
  11629. if (e === z.IntType)
  11630. return n.INT;
  11631. if (e === z.UnsignedIntType)
  11632. return n.UNSIGNED_INT;
  11633. if (e === z.FloatType)
  11634. return n.FLOAT;
  11635. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11636. return t.HALF_FLOAT_OES;
  11637. if (e === z.AlphaFormat)
  11638. return n.ALPHA;
  11639. if (e === z.RGBFormat)
  11640. return n.RGB;
  11641. if (e === z.RGBAFormat)
  11642. return n.RGBA;
  11643. if (e === z.LuminanceFormat)
  11644. return n.LUMINANCE;
  11645. if (e === z.LuminanceAlphaFormat)
  11646. return n.LUMINANCE_ALPHA;
  11647. if (e === z.AddEquation)
  11648. return n.FUNC_ADD;
  11649. if (e === z.SubtractEquation)
  11650. return n.FUNC_SUBTRACT;
  11651. if (e === z.ReverseSubtractEquation)
  11652. return n.FUNC_REVERSE_SUBTRACT;
  11653. if (e === z.ZeroFactor)
  11654. return n.ZERO;
  11655. if (e === z.OneFactor)
  11656. return n.ONE;
  11657. if (e === z.SrcColorFactor)
  11658. return n.SRC_COLOR;
  11659. if (e === z.OneMinusSrcColorFactor)
  11660. return n.ONE_MINUS_SRC_COLOR;
  11661. if (e === z.SrcAlphaFactor)
  11662. return n.SRC_ALPHA;
  11663. if (e === z.OneMinusSrcAlphaFactor)
  11664. return n.ONE_MINUS_SRC_ALPHA;
  11665. if (e === z.DstAlphaFactor)
  11666. return n.DST_ALPHA;
  11667. if (e === z.OneMinusDstAlphaFactor)
  11668. return n.ONE_MINUS_DST_ALPHA;
  11669. if (e === z.DstColorFactor)
  11670. return n.DST_COLOR;
  11671. if (e === z.OneMinusDstColorFactor)
  11672. return n.ONE_MINUS_DST_COLOR;
  11673. if (e === z.SrcAlphaSaturateFactor)
  11674. return n.SRC_ALPHA_SATURATE;
  11675. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11676. if (e === z.RGB_S3TC_DXT1_Format)
  11677. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11678. if (e === z.RGBA_S3TC_DXT1_Format)
  11679. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11680. if (e === z.RGBA_S3TC_DXT3_Format)
  11681. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11682. if (e === z.RGBA_S3TC_DXT5_Format)
  11683. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11684. }
  11685. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11686. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11687. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11688. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11689. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11690. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11691. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11692. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11693. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11694. }
  11695. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11696. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11697. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11698. if (e === z.MinEquation)
  11699. return t.MIN_EXT;
  11700. if (e === z.MaxEquation)
  11701. return t.MAX_EXT
  11702. }
  11703. return 0
  11704. }
  11705. ,
  11706. z.WebGLState = function(l, i, c) {
  11707. var n = this
  11708. , r = new z.Vector4
  11709. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11710. , o = new Uint8Array(e)
  11711. , a = new Uint8Array(e)
  11712. , s = new Uint8Array(e)
  11713. , t = {}
  11714. , h = null
  11715. , u = null
  11716. , d = null
  11717. , p = null
  11718. , f = null
  11719. , g = null
  11720. , m = null
  11721. , v = null
  11722. , y = !1
  11723. , A = null
  11724. , C = null
  11725. , I = null
  11726. , E = null
  11727. , _ = null
  11728. , b = null
  11729. , w = null
  11730. , T = null
  11731. , x = null
  11732. , S = null
  11733. , M = null
  11734. , R = null
  11735. , P = null
  11736. , O = null
  11737. , L = null
  11738. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11739. , N = void 0
  11740. , F = {}
  11741. , B = new z.Vector4
  11742. , V = null
  11743. , k = null
  11744. , U = new z.Vector4
  11745. , H = new z.Vector4;
  11746. this.init = function() {
  11747. this.clearColor(0, 0, 0, 1),
  11748. this.clearDepth(1),
  11749. this.clearStencil(0),
  11750. this.enable(l.DEPTH_TEST),
  11751. l.depthFunc(l.LEQUAL),
  11752. l.frontFace(l.CCW),
  11753. l.cullFace(l.BACK),
  11754. this.enable(l.CULL_FACE),
  11755. this.enable(l.BLEND),
  11756. l.blendEquation(l.FUNC_ADD),
  11757. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11758. }
  11759. ,
  11760. this.initAttributes = function() {
  11761. for (var e = 0, t = o.length; e < t; e++)
  11762. o[e] = 0
  11763. }
  11764. ,
  11765. this.enableAttribute = function(e) {
  11766. o[e] = 1,
  11767. 0 === a[e] && (l.enableVertexAttribArray(e),
  11768. a[e] = 1),
  11769. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11770. s[e] = 0)
  11771. }
  11772. ,
  11773. this.enableAttributeAndDivisor = function(e, t, i) {
  11774. o[e] = 1,
  11775. 0 === a[e] && (l.enableVertexAttribArray(e),
  11776. a[e] = 1),
  11777. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11778. s[e] = t)
  11779. }
  11780. ,
  11781. this.disableUnusedAttributes = function() {
  11782. for (var e = 0, t = a.length; e < t; e++)
  11783. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11784. a[e] = 0)
  11785. }
  11786. ,
  11787. this.enable = function(e) {
  11788. !0 !== t[e] && (l.enable(e),
  11789. t[e] = !0)
  11790. }
  11791. ,
  11792. this.disable = function(e) {
  11793. !1 !== t[e] && (l.disable(e),
  11794. t[e] = !1)
  11795. }
  11796. ,
  11797. this.getCompressedTextureFormats = function() {
  11798. if (null === h && (h = [],
  11799. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11800. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11801. h.push(e[t]);
  11802. return h
  11803. }
  11804. ,
  11805. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11806. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11807. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11808. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11809. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11810. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11811. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11812. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11813. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11814. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11815. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11816. u = e,
  11817. y = s),
  11818. e === z.CustomBlending ? (r = r || t,
  11819. o = o || i,
  11820. a = a || n,
  11821. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11822. d = t,
  11823. g = r),
  11824. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11825. p = i,
  11826. f = n,
  11827. m = o,
  11828. v = a)) : v = m = g = f = p = d = null
  11829. }
  11830. ,
  11831. this.setDepthFunc = function(e) {
  11832. if (A !== e) {
  11833. if (e)
  11834. switch (e) {
  11835. case z.NeverDepth:
  11836. l.depthFunc(l.NEVER);
  11837. break;
  11838. case z.AlwaysDepth:
  11839. l.depthFunc(l.ALWAYS);
  11840. break;
  11841. case z.LessDepth:
  11842. l.depthFunc(l.LESS);
  11843. break;
  11844. case z.LessEqualDepth:
  11845. l.depthFunc(l.LEQUAL);
  11846. break;
  11847. case z.EqualDepth:
  11848. l.depthFunc(l.EQUAL);
  11849. break;
  11850. case z.GreaterEqualDepth:
  11851. l.depthFunc(l.GEQUAL);
  11852. break;
  11853. case z.GreaterDepth:
  11854. l.depthFunc(l.GREATER);
  11855. break;
  11856. case z.NotEqualDepth:
  11857. l.depthFunc(l.NOTEQUAL);
  11858. break;
  11859. default:
  11860. l.depthFunc(l.LEQUAL)
  11861. }
  11862. else
  11863. l.depthFunc(l.LEQUAL);
  11864. A = e
  11865. }
  11866. }
  11867. ,
  11868. this.setDepthTest = function(e) {
  11869. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11870. }
  11871. ,
  11872. this.setDepthWrite = function(e) {
  11873. C !== e && (l.depthMask(e),
  11874. C = e)
  11875. }
  11876. ,
  11877. this.setColorWrite = function(e) {
  11878. I !== e && (l.colorMask(e, e, e, e),
  11879. I = e)
  11880. }
  11881. ,
  11882. this.setStencilFunc = function(e, t, i) {
  11883. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11884. _ = e,
  11885. b = t,
  11886. w = i)
  11887. }
  11888. ,
  11889. this.setStencilOp = function(e, t, i) {
  11890. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11891. T = e,
  11892. x = t,
  11893. S = i)
  11894. }
  11895. ,
  11896. this.setStencilTest = function(e) {
  11897. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11898. }
  11899. ,
  11900. this.setStencilWrite = function(e) {
  11901. E !== e && (l.stencilMask(e),
  11902. E = e)
  11903. }
  11904. ,
  11905. this.setFlipSided = function(e) {
  11906. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11907. M = e)
  11908. }
  11909. ,
  11910. this.setLineWidth = function(e) {
  11911. e !== R && (l.lineWidth(e),
  11912. R = e)
  11913. }
  11914. ,
  11915. this.setPolygonOffset = function(e, t, i) {
  11916. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11917. !e || P === t && O === i || (l.polygonOffset(t, i),
  11918. P = t,
  11919. O = i)
  11920. }
  11921. ,
  11922. this.getScissorTest = function() {
  11923. return L
  11924. }
  11925. ,
  11926. this.setScissorTest = function(e) {
  11927. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11928. }
  11929. ,
  11930. this.activeTexture = function(e) {
  11931. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11932. N !== e && (l.activeTexture(e),
  11933. N = e)
  11934. }
  11935. ,
  11936. this.bindTexture = function(e, t) {
  11937. void 0 === N && n.activeTexture();
  11938. var i = F[N];
  11939. void 0 === i && (i = {
  11940. type: void 0,
  11941. texture: void 0
  11942. },
  11943. F[N] = i),
  11944. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11945. i.type = e,
  11946. i.texture = t)
  11947. }
  11948. ,
  11949. this.compressedTexImage2D = function() {
  11950. try {
  11951. l.compressedTexImage2D.apply(l, arguments)
  11952. } catch (e) {
  11953. console.error(e)
  11954. }
  11955. }
  11956. ,
  11957. this.texImage2D = function() {
  11958. try {
  11959. l.texImage2D.apply(l, arguments)
  11960. } catch (e) {
  11961. console.error(e)
  11962. }
  11963. }
  11964. ,
  11965. this.clearColor = function(e, t, i, n) {
  11966. r.set(e, t, i, n),
  11967. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11968. B.copy(r))
  11969. }
  11970. ,
  11971. this.clearDepth = function(e) {
  11972. V !== e && (l.clearDepth(e),
  11973. V = e)
  11974. }
  11975. ,
  11976. this.clearStencil = function(e) {
  11977. k !== e && (l.clearStencil(e),
  11978. k = e)
  11979. }
  11980. ,
  11981. this.scissor = function(e) {
  11982. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11983. U.copy(e))
  11984. }
  11985. ,
  11986. this.viewport = function(e) {
  11987. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11988. H.copy(e))
  11989. }
  11990. ,
  11991. this.reset = function() {
  11992. for (var e = 0; e < a.length; e++)
  11993. 1 === a[e] && (l.disableVertexAttribArray(e),
  11994. a[e] = 0);
  11995. t = {},
  11996. N = void 0,
  11997. F = {},
  11998. M = E = C = I = u = h = null
  11999. }
  12000. }
  12001. }
  12002. , {
  12003. three: 217
  12004. }],
  12005. 104: [function(a, h, e) {
  12006. (function(i, e) {
  12007. "use strict";
  12008. function t(e) {
  12009. this.urls = e;
  12010. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12011. this.builder = n.loadProto(t),
  12012. this.decoder = this.builder.build("binary_mesh")
  12013. }
  12014. var s = a("three")
  12015. , n = a("protobufjs")
  12016. , r = a("../util/logger")
  12017. , o = (a("../util/common"),
  12018. a("../util/ajax"))
  12019. , l = a("../objects/Chunk")
  12020. , c = new r(e);
  12021. t.prototype = {
  12022. constructor: t,
  12023. load: function(t, i, n, r) {
  12024. return c.time("download"),
  12025. o.get(t, {
  12026. responseType: "arraybuffer"
  12027. }).done(function(e) {
  12028. c.timeEnd("download"),
  12029. this.parse(e, t, i, n, r)
  12030. }
  12031. .bind(this)).fail(r)
  12032. },
  12033. parse: function(e, t, i, n, r) {
  12034. var o = this.readProtobuf(e);
  12035. if (!o)
  12036. return r();
  12037. try {
  12038. c.time("convert to webgl"),
  12039. this.convertProtobufToSceneObject(o, t, i, n, r),
  12040. c.timeEnd("convert to webgl")
  12041. } catch (e) {
  12042. return c.error("failed parsing .dam"),
  12043. c.error(e.message),
  12044. r()
  12045. }
  12046. },
  12047. readProtobuf: function(e) {
  12048. var t;
  12049. try {
  12050. c.time("parse proto"),
  12051. t = this.decoder.decode(e),
  12052. c.timeEnd("parse proto")
  12053. } catch (e) {
  12054. return c.error("failed parsing proto for .dam"),
  12055. c.error(e.message),
  12056. null
  12057. }
  12058. return t
  12059. },
  12060. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12061. if (0 === e.chunk.length)
  12062. return c.warn("No chunks in damfile..."),
  12063. t([]);
  12064. var o = new s.Matrix4;
  12065. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12066. var a = e.chunk.map(function(e) {
  12067. var t = new s.BufferGeometry;
  12068. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12069. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12070. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12071. t.applyMatrix(o),
  12072. t.computeBoundingBox(),
  12073. new l({
  12074. geometry: t,
  12075. textureName: e.material_name,
  12076. name: e.chunk_name,
  12077. meshUrl: i
  12078. })
  12079. });
  12080. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12081. r())
  12082. }
  12083. },
  12084. h.exports = t
  12085. }
  12086. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12087. }
  12088. , {
  12089. "../objects/Chunk": 144,
  12090. "../util/ajax": 181,
  12091. "../util/common": 185,
  12092. "../util/logger": 189,
  12093. buffer: 198,
  12094. protobufjs: 214,
  12095. three: 217
  12096. }],
  12097. 105: [function(n, r, e) {
  12098. (function(e) {
  12099. "use strict";
  12100. var t = (n("three"),
  12101. n("../settings"),
  12102. n("../util/browser"),
  12103. n("./DamLoader"))
  12104. , i = n("../util/logger")
  12105. , u = (n("../ab"),
  12106. new i(e));
  12107. r.exports = {
  12108. getLoaders: function() {
  12109. return [["_50k", ".dam", t], ["", ".dam", t]]
  12110. },
  12111. load: function(e, t, i, n, r, o) {
  12112. var a = this.getLoaders()[o = o || 0];
  12113. if (a) {
  12114. var s = a[0]
  12115. , l = a[1]
  12116. , c = new a[2](t)
  12117. , h = t.get(e + s + l);
  12118. h ? (u.debug("Trying " + s + l),
  12119. c.load(h, i, n, function() {
  12120. this.load(e, t, i, n, r, ++o)
  12121. }
  12122. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12123. this.load(e, t, i, n, r, ++o))
  12124. } else
  12125. r && r("No suitable model file found...")
  12126. }
  12127. }
  12128. }
  12129. ).call(this, "/js/loaders/ModelLoader.js")
  12130. }
  12131. , {
  12132. "../ab": 3,
  12133. "../settings": 166,
  12134. "../util/browser": 182,
  12135. "../util/logger": 189,
  12136. "./DamLoader": 104,
  12137. three: 217
  12138. }],
  12139. 106: [function(i, n, e) {
  12140. (function(e) {
  12141. "use strict";
  12142. var l = i("../util/common")
  12143. , c = i("../util/texture")
  12144. , h = i("../util/browser")
  12145. , t = i("../util/logger")
  12146. , u = i("../settings")
  12147. , d = new t(e);
  12148. n.exports = {
  12149. load: function(i, n) {
  12150. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12151. return $.when();
  12152. var r = l.countUnique(i.chunks.map(function(e) {
  12153. return e.textureName
  12154. }))
  12155. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12156. , t = "_50k" == e ? "high" : "low";
  12157. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12158. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12159. t = "low"));
  12160. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12161. , a = $.Deferred()
  12162. , s = 0;
  12163. return i.chunks.forEach(function(e) {
  12164. if (!e.material.map && e.textureName) {
  12165. var t = i.urls.get(o + e.textureName);
  12166. e.setTextureMap(c.load(t, function(e, t) {
  12167. e || (n.push(t),
  12168. s++,
  12169. a.notify(s, r),
  12170. s === r && a.resolve())
  12171. }
  12172. .bind(this, c.isLoaded(t))))
  12173. }
  12174. }),
  12175. a.promise()
  12176. }
  12177. }
  12178. }
  12179. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12180. }
  12181. , {
  12182. "../settings": 166,
  12183. "../util/browser": 182,
  12184. "../util/common": 185,
  12185. "../util/logger": 189,
  12186. "../util/texture": 194
  12187. }],
  12188. 107: [function(s, l, e) {
  12189. (function(n, e) {
  12190. "use strict";
  12191. function t(e) {
  12192. this.model = e,
  12193. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12194. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12195. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12196. , i = r.loadProto(t);
  12197. this.decoder = i.build("VisionModeldata")
  12198. }
  12199. var r = s("protobufjs")
  12200. , i = s("../util/ajax")
  12201. , o = (s("../util/common"),
  12202. s("../util/math"))
  12203. , a = new (s("../util/logger"))(e);
  12204. t.prototype.load = function() {
  12205. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12206. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12207. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12208. $.when([]))
  12209. }
  12210. ,
  12211. t.prototype.loadVisionModelData = function() {
  12212. return i.get(this.modelDataPath, {
  12213. responseType: "arraybuffer"
  12214. }).then(function(e) {
  12215. var t;
  12216. try {
  12217. t = this.decoder.decode(e)
  12218. } catch (e) {
  12219. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12220. this.loadSweepLocationsCSV()
  12221. }
  12222. var i = t.sweepLocations.map(function(e) {
  12223. return {
  12224. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12225. position: {
  12226. x: e.pose.translation.x,
  12227. y: e.pose.translation.y,
  12228. z: e.pose.translation.z
  12229. },
  12230. quaternion: {
  12231. x: e.pose.rotation.x,
  12232. y: e.pose.rotation.y,
  12233. z: e.pose.rotation.z,
  12234. w: e.pose.rotation.w
  12235. },
  12236. puck: {
  12237. x: e.puck.x,
  12238. y: e.puck.y,
  12239. z: e.puck.z
  12240. },
  12241. floor: e.group,
  12242. neighbours: e.visibles,
  12243. alignmentType: e.alignment_type
  12244. }
  12245. }).map(function(e) {
  12246. return e.position = o.convertVisionVector(e.position),
  12247. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12248. e.puck = o.convertVisionVector(e.puck),
  12249. e
  12250. });
  12251. return i.forEach(function(e) {
  12252. e.neighbours = e.neighbours.map(function(e) {
  12253. return i[e].uuid
  12254. })
  12255. }),
  12256. i
  12257. }
  12258. .bind(this), function() {
  12259. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12260. this.loadSweepLocationsCSV()
  12261. }
  12262. .bind(this))
  12263. }
  12264. ,
  12265. t.prototype.loadSweepLocationsCSV = function() {
  12266. return i.get(this.sweepLocationsPath).then(function(e) {
  12267. return e.split("\n").map(function(e) {
  12268. return e.split(", ")
  12269. }).filter(function(e) {
  12270. return 1 < e.length
  12271. }).map(function(e) {
  12272. return {
  12273. uuid: e[0],
  12274. position: {
  12275. x: parseFloat(e[1]),
  12276. y: parseFloat(e[2]),
  12277. z: parseFloat(e[3])
  12278. },
  12279. quaternion: {
  12280. x: parseFloat(e[4]),
  12281. y: parseFloat(e[5]),
  12282. z: parseFloat(e[6]),
  12283. w: parseFloat(e[7])
  12284. }
  12285. }
  12286. }).map(function(e) {
  12287. return e.position = o.convertVisionVector(e.position),
  12288. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12289. e
  12290. })
  12291. }).fail(function() {
  12292. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12293. })
  12294. }
  12295. ,
  12296. l.exports = t
  12297. }
  12298. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12299. }
  12300. , {
  12301. "../util/ajax": 181,
  12302. "../util/common": 185,
  12303. "../util/logger": 189,
  12304. "../util/math": 190,
  12305. buffer: 198,
  12306. protobufjs: 214
  12307. }],
  12308. 108: [function(s, l, e) {
  12309. (function(e) {
  12310. "use strict";
  12311. function t() {
  12312. this.locale = null
  12313. }
  12314. var i = s("../settings")
  12315. , n = s("../util/common")
  12316. , r = s("../util/logger")
  12317. , o = s("../enum/Locale")
  12318. , a = new r(e);
  12319. t.prototype.init = function() {
  12320. var e;
  12321. switch (i.languageTag) {
  12322. case null:
  12323. case "en":
  12324. case o.EN_US:
  12325. this.locale = o.EN_US,
  12326. e = s("./strings-en-US");
  12327. break;
  12328. case "es":
  12329. case o.ES_MX:
  12330. this.locale = o.ES_MX,
  12331. e = s("./strings-es-MX");
  12332. break;
  12333. case "fr":
  12334. case o.FR_FR:
  12335. this.locale = o.FR_FR,
  12336. e = s("./strings-fr-FR");
  12337. break;
  12338. case "de":
  12339. case o.DE_DE:
  12340. this.locale = o.DE_DE,
  12341. e = s("./strings-de-DE");
  12342. break;
  12343. case "ru":
  12344. case o.RU_RU:
  12345. this.locale = o.RU_RU,
  12346. e = s("./strings-ru-RU");
  12347. break;
  12348. case "cn":
  12349. case o.CN_CN:
  12350. this.locale = o.CN_CN,
  12351. e = s("./strings-cn-CN");
  12352. break;
  12353. case "jp":
  12354. case o.JP_JP:
  12355. this.locale = o.JP_JP,
  12356. e = s("./strings-jp-JP");
  12357. break;
  12358. default:
  12359. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12360. this.locale = o.EN_US,
  12361. e = s("./strings-en-US")
  12362. }
  12363. a.info("Using locale '" + this.locale + "'"),
  12364. n.extendObject(this, e)
  12365. }
  12366. ,
  12367. t.prototype.localizeGUI = function() {
  12368. var e = document.querySelector("#gui-parent");
  12369. this.localizeTree(e),
  12370. this.localizeLoadingText()
  12371. }
  12372. ,
  12373. t.prototype.localizeLoadingText = function() {
  12374. document.querySelector("#help-dialog").classList.add(this.locale),
  12375. document.querySelector("#interaction-modal").classList.add(this.locale),
  12376. document.querySelector("#gui").classList.add(this.locale)
  12377. }
  12378. ,
  12379. t.prototype.localizeTree = function(e) {
  12380. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12381. if (e.nodeType === Node.TEXT_NODE)
  12382. (t = e.data.match(n)) && (i = t[1],
  12383. e.data = this.localizeText(i) || i);
  12384. else if (e.nodeType === Node.ELEMENT_NODE) {
  12385. var r = e.getAttribute("title");
  12386. r && ((t = r.match(n)) && (i = t[1],
  12387. e.setAttribute("title", this.localizeText(i) || i)))
  12388. }
  12389. for (e = e.firstChild; e; )
  12390. this.localizeTree(e),
  12391. e = e.nextSibling
  12392. }
  12393. ,
  12394. t.prototype.localizeText = function(e) {
  12395. var t = this[e];
  12396. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12397. t = s("./strings-en-US")[e]),
  12398. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12399. t
  12400. }
  12401. ,
  12402. l.exports = new t
  12403. }
  12404. ).call(this, "/js/localization/localize.js")
  12405. }
  12406. , {
  12407. "../enum/Locale": 31,
  12408. "../settings": 166,
  12409. "../util/common": 185,
  12410. "../util/logger": 189,
  12411. "./strings-cn-CN": 109,
  12412. "./strings-de-DE": 110,
  12413. "./strings-en-US": 111,
  12414. "./strings-es-MX": 112,
  12415. "./strings-fr-FR": 113,
  12416. "./strings-jp-JP": 114,
  12417. "./strings-ru-RU": 115
  12418. }],
  12419. 109: [function(e, t, i) {
  12420. "use strict";
  12421. t.exports = {
  12422. PAGE_TITLE: "",
  12423. LOADING: "正在加载",
  12424. PRESENTED_BY_CAPS: "呈现者:",
  12425. POWERED_BY: "技术支持:",
  12426. POWERED_BY_CAPS: "技术支持:",
  12427. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12428. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12429. PRESENTED_BY: "呈现者:",
  12430. MORE: "更多 ",
  12431. LESS: "更少 ",
  12432. TAG_CONTENT: "tag™ 内容",
  12433. SHOW: "显示",
  12434. HIDE: "隐藏",
  12435. DOLLHOUSE: "场景屋",
  12436. FLOOR_PLAN: "楼层平面图",
  12437. OPEN_HIGHLIGHTS: "打开精彩片段",
  12438. CLOSE_HIGHLIGHTS: "关闭",
  12439. PREVIOUS: "上一个",
  12440. PLAY: "播放",
  12441. PAUSE: "暂停",
  12442. NEXT: "下一个",
  12443. EXPLORE_3D_SPACE: "探索 3D 空间",
  12444. VIEW_DOLLHOUSE: "观看场景屋",
  12445. SOCIAL_SHARING: "分享这个空间",
  12446. VIEW_IN_VR: "以 VR 观看",
  12447. VIEW_FULLSCREEN: "全屏观看",
  12448. EXIT_FULLSCREEN: " 退出全屏",
  12449. ZOOM_IN: "放大",
  12450. ZOOM_OUT: "缩小",
  12451. FLOOR_NAME: "楼层",
  12452. FLOOR_ALL: "ALL",
  12453. FLOOR_Lang: ["Floor", ""],
  12454. TERMS: "条款",
  12455. PORT_TERMS: "port 条款",
  12456. TERMS_OF_USE: "使用条款",
  12457. CLOSE_TERMS: "关闭",
  12458. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12459. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12460. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12461. WEBVR_ENTER_WEBVR: "进入 VR",
  12462. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12463. WEBVR_LEARN_MORE: "了解更多",
  12464. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12465. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12466. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12467. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12468. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12469. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12470. VR_LEARN_MORE_CAPS: "了解更多",
  12471. VR_PREVIOUS_CAPS: "上一个’,",
  12472. VR_NEXT_CAPS: "下一个",
  12473. VR_GOT_IT_CAPS: "明白了",
  12474. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12475. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12476. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12477. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12478. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12479. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12480. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12481. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12482. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12483. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12484. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12485. VR_APP: "port VR 应用程序",
  12486. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12487. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12488. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12489. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12490. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12491. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12492. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12493. VR_ANDROID_DVICES: "Android 设备",
  12494. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12495. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12496. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12497. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12498. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12499. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12500. VR_DOWNLOAD_HERE: "在此下载",
  12501. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12502. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12503. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12504. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12505. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12506. SHARE_TO: "分享到",
  12507. SHARE_LINK: "直接链接",
  12508. SHARE_EXPLORE: "探索",
  12509. SHARE_AT: "在",
  12510. SHARE_WITH: "使用",
  12511. SHARE_3D: "以 3D",
  12512. SHARE_COPIED: "已复制!",
  12513. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12514. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12515. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12516. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12517. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12518. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12519. ERROR_GENERIC_ACTIONS_3: " 或",
  12520. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12521. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12522. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12523. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12524. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12525. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12526. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12527. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12528. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12529. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12530. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12531. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12532. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12533. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12534. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12535. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12536. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12537. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12538. LINK_TO_LOCATION: "地点链接",
  12539. MENU_COPY: "复制",
  12540. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12541. ROTATE: "旋转",
  12542. MOVE: "移动",
  12543. INSIDE: "内部",
  12544. ZOOM: "缩放",
  12545. HELP: "小帮手",
  12546. HELP_NAVIGATION_TAB: "导航",
  12547. HELP_MORE_HELP_TAB: "更多帮助",
  12548. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12549. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12550. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12551. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12552. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12553. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12554. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12555. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12556. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12557. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12558. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12559. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12560. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12561. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12562. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12563. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12564. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12565. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12566. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12567. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12568. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12569. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12570. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12571. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12572. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12573. HELP_MORE_HLR_A: "精彩片段集锦",
  12574. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12575. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12576. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12577. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12578. HELP_MORE_FLOORS_A: "楼层选择器",
  12579. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12580. HELP_MORE_TAG_A: "tag™ 贴文",
  12581. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12582. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12583. HELP_MORE_ZOOM_A: "缩放控件",
  12584. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12585. HELP_MORE_TOUR_A: "导览控件",
  12586. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12587. HELP_MORE_INSIDE_A: "内部视图",
  12588. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12589. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12590. HELP_MORE_VR_A: "VR 模式",
  12591. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12592. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12593. HELP_MORE_360_A: "360° 视图",
  12594. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12595. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12596. HELP_MORE_FULLSCREEN_A: "全屏",
  12597. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12598. CLOSE: "关闭"
  12599. }
  12600. }
  12601. , {}],
  12602. 110: [function(e, t, i) {
  12603. "use strict";
  12604. t.exports = {
  12605. PAGE_TITLE: "",
  12606. LOADING: "Lädt",
  12607. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12608. POWERED_BY: "Angetrieben von",
  12609. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12610. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12611. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12612. PRESENTED_BY: "Präsentiert von ",
  12613. MORE: "Mehr ",
  12614. LESS: "Weniger ",
  12615. TAG_CONTENT: "tag™ Inhalt",
  12616. SHOW: "Anzeigen",
  12617. HIDE: "Verbergen",
  12618. DOLLHOUSE: "Puppenhaus",
  12619. FLOOR_PLAN: "Grundriss",
  12620. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12621. CLOSE_HIGHLIGHTS: "Schließen",
  12622. PREVIOUS: "Vorheriges",
  12623. PLAY: "Abspielen",
  12624. PAUSE: "Pausieren",
  12625. NEXT: "Nächstes",
  12626. EXPLORE_3D_SPACE: "Innenraum betreten",
  12627. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12628. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12629. VIEW_IN_VR: "In VR ansehen",
  12630. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12631. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12632. ZOOM_IN: "Vergrößern",
  12633. ZOOM_OUT: "Verkleinern",
  12634. FLOOR_NAME: "Etage ",
  12635. FLOOR_ALL: "Alle",
  12636. TERMS: "Bedingungen",
  12637. PORT_TERMS: "port Bedingungen",
  12638. TERMS_OF_USE: "Nutzungsbedingungen",
  12639. TERMS_TEXT_FILE: "terms-de-DE.html",
  12640. CLOSE_TERMS: "Schließen",
  12641. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12642. HELP: "Hilfe",
  12643. HELP_NAVIGATION_TAB: "Navigation",
  12644. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12645. CLOSE: "Schließen",
  12646. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12647. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12648. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12649. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12650. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12651. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12652. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12653. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12654. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12655. HELP_DESKTOP_DOLLHOUSE_2A: "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  12656. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12657. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12658. HELP_DESKTOP_FLOORPLAN_1A: "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  12659. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12660. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12661. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12662. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12663. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12664. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12665. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12666. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12667. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12668. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12669. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12670. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12671. HELP_MORE_HLR_A: "Liste das Highlight",
  12672. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12673. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12674. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12675. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12676. HELP_MORE_FLOORS_A: "Etage auswählen",
  12677. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12678. HELP_MORE_TAG_A: "tag™ Posts",
  12679. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12680. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12681. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12682. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12683. HELP_MORE_TOUR_A: "Tour Steuerung",
  12684. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12685. HELP_MORE_INSIDE_A: "Innenansicht",
  12686. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12687. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12688. HELP_MORE_VR_A: "VR Modus",
  12689. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12690. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12691. HELP_MORE_360_A: "360° Views Ansicht ",
  12692. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12693. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12694. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12695. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12696. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12697. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12698. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12699. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12700. WEBVR_LEARN_MORE: "Mehr Infos",
  12701. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12702. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12703. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12704. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12705. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12706. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12707. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12708. VR_APP: "port VR App",
  12709. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12710. VR_COMPATIBLE_ANDROID_LONG: "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12711. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12712. VR_APP_FOR_ANDROID: "port VR app für Android",
  12713. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12714. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12715. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12716. VR_PREVIOUS_CAPS: "ZURÜCK",
  12717. VR_NEXT_CAPS: "WEITER",
  12718. VR_GOT_IT_CAPS: "VERSTANDEN",
  12719. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12720. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12721. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12722. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12723. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12724. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12725. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12726. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12727. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12728. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12729. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12730. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12731. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12732. VR_ANDROID_DVICES: "Android Geräte",
  12733. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12734. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12735. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12736. VR_DOWNLOAD_HERE: "Hier runterladen",
  12737. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12738. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12739. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12740. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12741. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12742. SHARE_TO: "Teilen auf",
  12743. SHARE_LINK: "Direkter Link",
  12744. SHARE_EXPLORE: "Umsehen",
  12745. SHARE_AT: "auf",
  12746. SHARE_WITH: "mit",
  12747. SHARE_3D: "in 3D",
  12748. SHARE_COPIED: "Kopiert!",
  12749. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12750. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12751. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12752. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12753. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12754. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12755. ERROR_GENERIC_ACTIONS_3: " oder ",
  12756. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12757. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12758. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12759. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12760. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12761. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12762. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12763. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12764. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12765. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12766. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12767. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12768. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12769. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12770. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12771. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12772. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12773. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12774. LINK_TO_LOCATION: "Link zu",
  12775. MENU_COPY: "Kopieren",
  12776. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12777. ROTATE: "Drehen",
  12778. INSIDE: "Drinnen",
  12779. MOVE: "Bewegen",
  12780. ZOOM: "Vergrößern"
  12781. }
  12782. }
  12783. , {}],
  12784. 111: [function(e, t, i) {
  12785. "use strict";
  12786. t.exports = {
  12787. PAGE_TITLE: "",
  12788. LOADING: "Loading",
  12789. PRESENTED_BY_CAPS: "PRESENTED BY",
  12790. POWERED_BY: "powered by ",
  12791. POWERED_BY_CAPS: "POWERED BY",
  12792. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12793. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12794. PRESENTED_BY: "Presented by ",
  12795. MORE: "More ",
  12796. LESS: "Less ",
  12797. TAG_CONTENT: "tag™ Content",
  12798. SHOW: "Show",
  12799. HIDE: "Hide",
  12800. DOLLHOUSE: "Dollhouse",
  12801. FLOOR_PLAN: "Floor plan",
  12802. OPEN_HIGHLIGHTS: "Open Highlights",
  12803. CLOSE_HIGHLIGHTS: "Close",
  12804. PREVIOUS: "Previous",
  12805. PLAY: "Play",
  12806. PAUSE: "Pause",
  12807. NEXT: "Next",
  12808. EXPLORE_3D_SPACE: "Explore 3D Space",
  12809. VIEW_DOLLHOUSE: "View dollhouse",
  12810. SOCIAL_SHARING: "Share this Space",
  12811. VIEW_IN_VR: "View in VR",
  12812. VIEW_FULLSCREEN: "全屏",
  12813. EXIT_FULLSCREEN: "退出全屏",
  12814. ZOOM_IN: "Zoom in",
  12815. ZOOM_OUT: "Zoom out",
  12816. FLOOR_NAME: "Floor ",
  12817. FLOOR_ALL: "全部",
  12818. TERMS: "Terms",
  12819. PORT_TERMS: "port terms",
  12820. TERMS_OF_USE: "Terms of Use",
  12821. TERMS_TEXT_FILE: "terms-en-US.html",
  12822. CLOSE_TERMS: "Close",
  12823. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12824. HELP: "Help",
  12825. HELP_NAVIGATION_TAB: "Navigation",
  12826. HELP_MORE_HELP_TAB: "More Help",
  12827. CLOSE: "Close",
  12828. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12829. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12830. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12831. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12832. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12833. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12834. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12835. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12836. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12837. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12838. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12839. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12840. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12841. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12842. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12843. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12844. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12845. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12846. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12847. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12848. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12849. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12850. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12851. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12852. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12853. HELP_MORE_HLR_A: "Highlight Reel",
  12854. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12855. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12856. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12857. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12858. HELP_MORE_FLOORS_A: "Floor Selector",
  12859. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12860. HELP_MORE_TAG_A: "tag™ Posts",
  12861. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12862. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12863. HELP_MORE_ZOOM_A: "Zoom Controls",
  12864. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12865. HELP_MORE_TOUR_A: "Tour Controls",
  12866. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12867. HELP_MORE_INSIDE_A: "Inside View",
  12868. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12869. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12870. HELP_MORE_VR_A: "VR Mode",
  12871. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12872. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12873. HELP_MORE_360_A: "360° Views",
  12874. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12875. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12876. HELP_MORE_FULLSCREEN_A: "Full screen",
  12877. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12878. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12879. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12880. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12881. WEBVR_ENTER_WEBVR: "ENTER VR",
  12882. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12883. WEBVR_LEARN_MORE: "Learn more",
  12884. WEBVR_VIEW_SPACE: "View Space in VR",
  12885. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12886. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12887. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12888. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12889. VR_PREVIOUS_CAPS: "PREVIOUS",
  12890. VR_NEXT_CAPS: "NEXT",
  12891. VR_GOT_IT_CAPS: "GOT IT",
  12892. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12893. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12894. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12895. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12896. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12897. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12898. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12899. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12900. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12901. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12902. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12903. VR_APP: "port VR App",
  12904. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12905. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12906. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12907. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12908. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12909. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12910. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12911. VR_ANDROID_DVICES: "Android Devices",
  12912. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12913. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12914. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12915. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12916. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12917. VR_APP_OPEN: "Open with the port VR app instead",
  12918. VR_DOWNLOAD_HERE: "Download here",
  12919. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12920. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12921. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12922. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12923. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12924. SHARE_TO: "Share to",
  12925. SHARE_LINK: "Direct Link",
  12926. SHARE_EXPLORE: "Explore ",
  12927. SHARE_AT: "at",
  12928. SHARE_WITH: "with",
  12929. SHARE_3D: " in 3D",
  12930. SHARE_COPIED: "Copied!",
  12931. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12932. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12933. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12934. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12935. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12936. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12937. ERROR_GENERIC_ACTIONS_3: " or ",
  12938. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12939. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12940. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12941. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12942. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12943. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12944. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12945. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12946. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12947. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12948. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12949. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12950. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12951. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12952. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12953. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12954. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12955. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12956. LINK_TO_LOCATION: "Link to location",
  12957. MENU_COPY: "Copy",
  12958. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12959. ROTATE: "Rotate",
  12960. INSIDE: "Inside",
  12961. MOVE: "Move",
  12962. ZOOM: "Zoom"
  12963. }
  12964. }
  12965. , {}],
  12966. 112: [function(e, t, i) {
  12967. "use strict";
  12968. t.exports = {
  12969. PAGE_TITLE: "",
  12970. LOADING: "Cargando",
  12971. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12972. POWERED_BY: "potenciando por ",
  12973. POWERED_BY_CAPS: "POTENCIADO POR ",
  12974. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12975. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12976. PRESENTED_BY: "Presentado por ",
  12977. MORE: "Más ",
  12978. LESS: "Menos ",
  12979. TAG_CONTENT: "Contenido de tag™",
  12980. SHOW: "Mostrar",
  12981. HIDE: "Ocultar",
  12982. DOLLHOUSE: "Dollhouse",
  12983. FLOOR_PLAN: "Planos",
  12984. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12985. CLOSE_HIGHLIGHTS: "Cerrar",
  12986. PREVIOUS: "Anterior",
  12987. PLAY: "Play",
  12988. PAUSE: "Pausa",
  12989. NEXT: "Siguiente",
  12990. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  12991. VIEW_DOLLHOUSE: "Ver dollhouse",
  12992. SOCIAL_SHARING: "Compartir este espacio",
  12993. VIEW_IN_VR: "Ver en realidad virtual",
  12994. VIEW_FULLSCREEN: "Ver en pantalla completa",
  12995. EXIT_FULLSCREEN: "Salir de pantalla completa",
  12996. ZOOM_IN: "Acercar",
  12997. ZOOM_OUT: "Alejar",
  12998. FLOOR_NAME: "Piso ",
  12999. FLOOR_ALL: "Todas",
  13000. TERMS: "Condiciones",
  13001. PORT_TERMS: "port términos de uso",
  13002. TERMS_OF_USE: "Términos de uso",
  13003. TERMS_TEXT_FILE: "terms-es-MX.html",
  13004. CLOSE_TERMS: "Cerrar",
  13005. TERMS_FAIL: "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  13006. HELP: "Ayuda",
  13007. HELP_NAVIGATION_TAB: "Navegación",
  13008. HELP_MORE_HELP_TAB: "Más Ayuda",
  13009. CLOSE: "Cerrar",
  13010. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13011. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13012. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13013. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13014. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13015. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13016. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13017. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13018. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13019. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13020. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13021. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13022. HELP_DESKTOP_FLOORPLAN_1A: "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  13023. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13024. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13025. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13026. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13027. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13028. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13029. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13030. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13031. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13032. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13033. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13034. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13035. HELP_MORE_HLR_A: "Galería destacada",
  13036. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13037. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13038. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13039. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13040. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13041. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13042. HELP_MORE_TAG_A: "tag™ Posts",
  13043. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13044. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13045. HELP_MORE_ZOOM_A: "Controles de zoom",
  13046. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13047. HELP_MORE_TOUR_A: "Controles de recorrido",
  13048. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13049. HELP_MORE_INSIDE_A: "Vista interior",
  13050. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13051. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13052. HELP_MORE_VR_A: "Modo de realidad virtual",
  13053. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13054. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13055. HELP_MORE_360_A: "360° Views",
  13056. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13057. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13058. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13059. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13060. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13061. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13062. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13063. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13064. WEBVR_LEARN_MORE: "Más información",
  13065. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13066. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13067. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13068. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13069. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13070. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13071. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13072. VR_APP: "port VR App",
  13073. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13074. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13075. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13076. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13077. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13078. VR_PREVIOUS_CAPS: "ANTERIOR",
  13079. VR_NEXT_CAPS: "SIGUIENTE",
  13080. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13081. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13082. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13083. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13084. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13085. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13086. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13087. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13088. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13089. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13090. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13091. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13092. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13093. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13094. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13095. VR_ANDROID_DVICES: "Dispositivos Android",
  13096. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13097. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13098. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13099. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13100. VR_DOWNLOAD_HERE: "Descargar aquí",
  13101. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13102. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13103. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13104. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13105. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13106. SHARE_TO: "Compartir en",
  13107. SHARE_LINK: "Enlace directo",
  13108. SHARE_EXPLORE: "Explorar ",
  13109. SHARE_AT: "en",
  13110. SHARE_WITH: "con",
  13111. SHARE_3D: " en 3D",
  13112. SHARE_COPIED: "¡Copiado!",
  13113. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13114. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13115. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13116. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13117. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13118. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13119. ERROR_GENERIC_ACTIONS_3: " o ",
  13120. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13121. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13122. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13123. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13124. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13125. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13126. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13127. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13128. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13129. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13130. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13131. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13132. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13133. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13134. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13135. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13136. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13137. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13138. LINK_TO_LOCATION: "Enlace a la ubicación",
  13139. MENU_COPY: "Copiar",
  13140. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13141. ROTATE: "Girar",
  13142. INSIDE: "Interior",
  13143. MOVE: "Moverse",
  13144. ZOOM: "Acercar o alejar"
  13145. }
  13146. }
  13147. , {}],
  13148. 113: [function(e, t, i) {
  13149. "use strict";
  13150. t.exports = {
  13151. PAGE_TITLE: "",
  13152. LOADING: "Chargement",
  13153. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13154. POWERED_BY: "alimenté par ",
  13155. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13156. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13157. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13158. PRESENTED_BY: "Présenté par ",
  13159. MORE: "Plus ",
  13160. LESS: "Moins ",
  13161. TAG_CONTENT: "Contenu tag™",
  13162. SHOW: "Montrer",
  13163. HIDE: "Cacher",
  13164. DOLLHOUSE: "Dollhouse",
  13165. FLOOR_PLAN: "Plan de sol",
  13166. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13167. CLOSE_HIGHLIGHTS: "Fermer",
  13168. PREVIOUS: "Précédent",
  13169. PLAY: "Lecture",
  13170. PAUSE: "Pause",
  13171. NEXT: "Suivant",
  13172. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13173. VIEW_DOLLHOUSE: "Voir dollhouse",
  13174. SOCIAL_SHARING: "Partager cet espace",
  13175. VIEW_IN_VR: "Voir en VR",
  13176. VIEW_FULLSCREEN: "Plein écran",
  13177. EXIT_FULLSCREEN: "Fermer plein écran",
  13178. ZOOM_IN: "Zoom avant",
  13179. ZOOM_OUT: "Zoom arrière",
  13180. FLOOR_NAME: "Étage ",
  13181. FLOOR_ALL: "Tous",
  13182. TERMS: "Mentions légales",
  13183. PORT_TERMS: "port mentions légales",
  13184. TERMS_OF_USE: "Conditions d'utilisation",
  13185. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13186. CLOSE_TERMS: "Fermer",
  13187. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13188. HELP: "Aide",
  13189. HELP_NAVIGATION_TAB: "Navigation",
  13190. HELP_MORE_HELP_TAB: "Aide",
  13191. CLOSE: "Fermer",
  13192. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13193. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13194. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13195. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13196. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13197. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13198. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13199. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13200. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13201. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13202. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13203. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13204. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13205. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13206. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13207. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13208. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13209. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13210. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13211. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13212. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13213. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13214. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13215. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13216. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13217. HELP_MORE_HLR_A: "Carrousel",
  13218. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13219. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13220. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13221. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13222. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13223. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13224. HELP_MORE_TAG_A: "tag™ Posts",
  13225. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13226. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13227. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13228. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13229. HELP_MORE_TOUR_A: "Commandes de la visite",
  13230. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13231. HELP_MORE_INSIDE_A: "Vue intérieure",
  13232. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13233. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13234. HELP_MORE_VR_A: "Mode RV",
  13235. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13236. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13237. HELP_MORE_360_A: "Vues 360°",
  13238. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13239. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13240. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13241. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13242. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13243. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13244. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13245. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13246. WEBVR_LEARN_MORE: "En savoir plus",
  13247. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13248. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13249. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13250. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13251. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13252. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13253. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13254. VR_NEXT_CAPS: "SUIVANT",
  13255. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13256. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13257. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13258. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13259. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13260. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13261. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13262. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13263. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13264. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13265. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13266. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13267. VR_APP: "port VR App",
  13268. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13269. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13270. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13271. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13272. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13273. VR_COMPATIBLE_ANDROID_LONG: "Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus",
  13274. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13275. VR_ANDROID_DVICES: "Appareils Android",
  13276. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13277. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13278. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13279. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13280. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13281. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13282. VR_DOWNLOAD_HERE: "Télécharger ici",
  13283. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13284. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13285. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13286. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13287. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13288. SHARE_TO: "Partager sur",
  13289. SHARE_LINK: "Lien direct",
  13290. SHARE_EXPLORE: "Explorer ",
  13291. SHARE_AT: "à",
  13292. SHARE_WITH: "avec",
  13293. SHARE_3D: " en 3D",
  13294. SHARE_COPIED: "Copié!",
  13295. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13296. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13297. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13298. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13299. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13300. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13301. ERROR_GENERIC_ACTIONS_3: " ou ",
  13302. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13303. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13304. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13305. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13306. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13307. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13308. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13309. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13310. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13311. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13312. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13313. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13314. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13315. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13316. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13317. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13318. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13319. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13320. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13321. MENU_COPY: "Copie",
  13322. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13323. ROTATE: "Faire pivoter",
  13324. INSIDE: "Intérieure",
  13325. MOVE: "Se déplacer",
  13326. ZOOM: "Zoom"
  13327. }
  13328. }
  13329. , {}],
  13330. 114: [function(e, t, i) {
  13331. "use strict";
  13332. t.exports = {
  13333. PAGE_TITLE: "",
  13334. LOADING: "読み込み中",
  13335. PRESENTED_BY_CAPS: "PRESENTED BY",
  13336. POWERED_BY: "powered by",
  13337. POWERED_BY_CAPS: "POWERED BY",
  13338. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13339. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13340. PRESENTED_BY: "Presented by ",
  13341. MORE: "全て表示 ",
  13342. LESS: "閉じる ",
  13343. TAG_CONTENT: "tag™コンテンツ ",
  13344. SHOW: "表示",
  13345. HIDE: "非表示",
  13346. DOLLHOUSE: "ドールハウス",
  13347. FLOOR_PLAN: "フロアプラン",
  13348. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13349. CLOSE_HIGHLIGHTS: "閉じる",
  13350. PREVIOUS: "前へ",
  13351. PLAY: "再生",
  13352. PAUSE: "一時停止",
  13353. NEXT: "次へ",
  13354. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13355. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13356. SOCIAL_SHARING: "このSpaceを共有する",
  13357. VIEW_IN_VR: "VRで表示",
  13358. VIEW_FULLSCREEN: "フルスクリーン表示",
  13359. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13360. ZOOM_IN: "ズームイン",
  13361. ZOOM_OUT: "ズームアウト",
  13362. FLOOR_NAME: "フロア ",
  13363. FLOOR_ALL: "すべて",
  13364. TERMS: "規約",
  13365. PORT_TERMS: "port規約",
  13366. TERMS_OF_USE: "利用規約",
  13367. CLOSE_TERMS: "閉じる",
  13368. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13369. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13370. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13371. WEBVR_ENTER_WEBVR: "VRに入る",
  13372. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13373. WEBVR_LEARN_MORE: "もっと詳しく",
  13374. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13375. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13376. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13377. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13378. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13379. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13380. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13381. VR_PREVIOUS_CAPS: "前へ",
  13382. VR_NEXT_CAPS: "次へ",
  13383. VR_GOT_IT_CAPS: "了解",
  13384. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13385. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13386. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13387. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13388. VR_WHAT_YOU_NEED: "必要なもの",
  13389. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13390. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13391. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13392. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13393. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13394. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13395. VR_APP: "port VRアプリ",
  13396. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13397. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13398. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13399. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13400. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13401. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13402. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13403. VR_ANDROID_DVICES: "Androidデバイス",
  13404. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13405. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13406. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13407. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13408. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13409. VR_APP_OPEN: "port VRアプリで開く",
  13410. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13411. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13412. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13413. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13414. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13415. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13416. SHARE_TO: "共有先",
  13417. SHARE_LINK: "ダイレクトリンク",
  13418. SHARE_EXPLORE: "探索",
  13419. SHARE_AT: "場所",
  13420. SHARE_WITH: "使用アプリ",
  13421. SHARE_3D: "3Dで",
  13422. SHARE_COPIED: "コピーされました!",
  13423. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13424. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13425. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13426. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13427. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13428. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13429. ERROR_GENERIC_ACTIONS_3: "または",
  13430. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13431. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13432. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13433. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13434. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13435. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13436. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13437. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13438. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13439. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13440. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13441. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13442. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13443. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13444. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13445. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13446. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13447. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13448. LINK_TO_LOCATION: "ロケーションへのリンク",
  13449. MENU_COPY: "コピー",
  13450. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13451. ROTATE: "回転",
  13452. MOVE: "移動",
  13453. INSIDE: "内側",
  13454. ZOOM: "ズーム",
  13455. HELP: "ヘルプ",
  13456. HELP_NAVIGATION_TAB: "ナビゲーション",
  13457. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13458. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13459. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13460. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13461. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13462. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13463. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13464. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13465. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13466. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13467. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13468. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13469. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13470. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13471. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13472. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13473. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13474. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13475. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13476. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13477. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13478. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13479. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13480. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13481. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13482. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13483. HELP_MORE_HLR_A: "ハイライト",
  13484. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13485. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13486. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13487. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13488. HELP_MORE_FLOORS_A: "フロアセレクター",
  13489. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13490. HELP_MORE_TAG_A: "tag™ Posts",
  13491. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13492. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13493. HELP_MORE_ZOOM_A: "ズームコントロール",
  13494. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13495. HELP_MORE_TOUR_A: "ツアーコントロール",
  13496. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13497. HELP_MORE_INSIDE_A: "内側ビュー",
  13498. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13499. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13500. HELP_MORE_VR_A: "VRモード",
  13501. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13502. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13503. HELP_MORE_360_A: "360° Views",
  13504. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13505. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13506. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13507. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13508. CLOSE: "閉じる"
  13509. }
  13510. }
  13511. , {}],
  13512. 115: [function(e, t, i) {
  13513. "use strict";
  13514. t.exports = {
  13515. PAGE_TITLE: "",
  13516. LOADING: "Загрузка",
  13517. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13518. POWERED_BY: "разработано на платформе ",
  13519. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13520. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13521. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13522. PRESENTED_BY: "Представлено ",
  13523. MORE: "Больше ",
  13524. LESS: "Меньше ",
  13525. TAG_CONTENT: "tag™ Контент",
  13526. SHOW: "Показать",
  13527. HIDE: "Скрыть",
  13528. DOLLHOUSE: "Dollhouse",
  13529. FLOOR_PLAN: "Планировка",
  13530. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13531. CLOSE_HIGHLIGHTS: "Закрыть",
  13532. PREVIOUS: "Предыдущий",
  13533. PLAY: "Воспроизвести",
  13534. PAUSE: "Пауза",
  13535. NEXT: "Следующий",
  13536. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13537. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13538. SOCIAL_SHARING: "Поделиться этой моделью",
  13539. VIEW_IN_VR: "Посмотреть в VR",
  13540. VIEW_FULLSCREEN: "Полный экран",
  13541. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13542. ZOOM_IN: "Увеличить",
  13543. ZOOM_OUT: "Уменьшить",
  13544. FLOOR_NAME: "Этаж ",
  13545. FLOOR_ALL: "Все",
  13546. TERMS: "Условия",
  13547. PORT_TERMS: "Правила пользования",
  13548. TERMS_OF_USE: "Условия использования",
  13549. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13550. CLOSE_TERMS: "Закрыть",
  13551. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13552. HELP: "Помощь",
  13553. HELP_NAVIGATION_TAB: "Навигация",
  13554. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13555. CLOSE: "Закрыть",
  13556. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13557. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13558. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13559. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13560. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13561. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13562. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13563. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13564. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13565. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13566. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13567. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13568. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13569. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13570. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13571. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13572. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13573. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13574. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13575. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13576. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13577. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13578. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13579. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13580. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13581. HELP_MORE_HLR_A: "Фотоколлаж",
  13582. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13583. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13584. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13585. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13586. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13587. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13588. HELP_MORE_TAG_A: "tag™ Posts",
  13589. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13590. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13591. HELP_MORE_ZOOM_A: "Масштаб",
  13592. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13593. HELP_MORE_TOUR_A: "Управление Туром",
  13594. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13595. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13596. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13597. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13598. HELP_MORE_VR_A: "Режим VR",
  13599. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13600. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13601. HELP_MORE_360_A: "360° Views",
  13602. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13603. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13604. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13605. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13606. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13607. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13608. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13609. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13610. WEBVR_LEARN_MORE: "Узнать больше",
  13611. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13612. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13613. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13614. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13615. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13616. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13617. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13618. VR_APP: "port VR App",
  13619. VR_APP_OPEN: "Или открыть через приложение port VR",
  13620. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13621. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13622. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13623. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13624. VR_VIEW_SPACE: "Запустить модель в VR",
  13625. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13626. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13627. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13628. VR_GOT_IT_CAPS: "ЯСНО",
  13629. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13630. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13631. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13632. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13633. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13634. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13635. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13636. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13637. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13638. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13639. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13640. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13641. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13642. VR_ANDROID_DVICES: "Android устройства",
  13643. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13644. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13645. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13646. VR_DOWNLOAD_HERE: "Скачать здесь",
  13647. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13648. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13649. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13650. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13651. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13652. SHARE_TO: "Поделиться",
  13653. SHARE_LINK: "Прямая ссылка",
  13654. SHARE_EXPLORE: "просмотреть",
  13655. SHARE_AT: "на",
  13656. SHARE_WITH: "с",
  13657. SHARE_3D: "в 3D",
  13658. SHARE_COPIED: "Скопировано!",
  13659. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13660. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13661. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13662. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13663. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13664. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13665. ERROR_GENERIC_ACTIONS_3: " или ",
  13666. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13667. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13668. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13669. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13670. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13671. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13672. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13673. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13674. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13675. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13676. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13677. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13678. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13679. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13680. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13681. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13682. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13683. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13684. LINK_TO_LOCATION: "Ссылка на местоположение",
  13685. MENU_COPY: "Копировать",
  13686. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13687. ROTATE: "Вращать",
  13688. MOVE: "Передвигаться",
  13689. INSIDE: "Вид изнутри",
  13690. ZOOM: "Масштаб"
  13691. }
  13692. }
  13693. , {}],
  13694. 116: [function(r, e, t) {
  13695. (function(i) {
  13696. "use strict";
  13697. function re(e) {
  13698. console.log("e1:" + e),
  13699. e = Math.round(.4 * e * 100),
  13700. console.log("e2:" + e);
  13701. var t = $(".progressbar");
  13702. t.find(".bar").css("width", e + "%"),
  13703. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13704. t.find(".perc").text(e + "%")
  13705. }
  13706. $("#gui-loading").fadeIn(200),
  13707. re(.1);
  13708. var e = g_version ? "modeldata.js" : "someData.json";
  13709. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13710. dataType: "json"
  13711. }).done(function(e) {
  13712. var t = matcher(e);
  13713. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13714. t.user = {
  13715. is_authenticated: !1,
  13716. flags: ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  13717. }
  13718. try{//处理一下导览数据,旧的曾有第一个导览数据是错误的,将它删除
  13719. if(t.model.images[0] && !t.model.images[0].thumbnail_signed_src){
  13720. t.model.images = t.model.images.slice(1);
  13721. }
  13722. }catch(e){console.log(e) }
  13723. window.MP_PREFETCHED_MODELDATA = t,
  13724. re(.7),
  13725. function() {
  13726. function y(e) {
  13727. t.update(e)
  13728. }
  13729. function A(e, t) {
  13730. ne.error(t),
  13731. n.error(t),
  13732. N.report(e, "error-" + t)
  13733. }
  13734. function C(e, t, i) {
  13735. try {
  13736. e.start(t)
  13737. } catch (e) {
  13738. throw ne.warn(e.message),
  13739. function(e) {
  13740. var t = O.details();
  13741. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13742. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13743. N.report(e, "error-webgl-generic"))
  13744. }(i.sid),
  13745. e
  13746. }
  13747. }
  13748. function I(e) {
  13749. e.stopPropagation(),
  13750. e.preventDefault()
  13751. }
  13752. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13753. point: "https://super.4dage.com/images/4dagePoint2.png",//window.MP_PREFETCHED_MODELDATA.hoticon.default,
  13754. point2: "https://super.4dage.com/images/4dagePoint.png"//window.MP_PREFETCHED_MODELDATA.hoticon.higt
  13755. });
  13756. window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13757. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13758. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13759. r("./lib/three75-shim"),
  13760. r("./lib/array-polyfill"),
  13761. r("./lib/performance-polyfill"),
  13762. r("./lib/shaders/CopyShader.js"),
  13763. r("./lib/shaders/HorizontalBlurShader.js"),
  13764. r("./lib/shaders/VerticalBlurShader.js"),
  13765. r("./lib/postprocessing/EffectComposer.js"),
  13766. r("./lib/postprocessing/RenderPass.js"),
  13767. r("./lib/postprocessing/MaskPass.js"),
  13768. r("./lib/postprocessing/ShaderPass.js"),
  13769. window.Promise || (window.Promise = r("promise-polyfill"));
  13770. var E = r("three")
  13771. , _ = r("three")
  13772. , b = (r("./util/sentry"),
  13773. r("./player"))
  13774. , w = r("./director")
  13775. , T = r("./controls/CameraControls")
  13776. , x = r("./model/ModelManager")
  13777. , S = r("./DisplayController")
  13778. , M = r("./label/LabelDisplayController")
  13779. , R = r("./enum/Viewmode")
  13780. , e = r("./util/logger")
  13781. , P = r("./showcase")
  13782. , O = r("./util/browser")
  13783. , L = r("./settings")
  13784. , D = r("./gui/gui")
  13785. , n = r("./gui/error")
  13786. , N = r("./analytics")
  13787. , F = r("./util/transitions")
  13788. , B = r("./effects")
  13789. , V = r("./objects/Skybox")
  13790. , k = (r("./util/common"),
  13791. r("./util/PanoramaCollection"),
  13792. r("./util/math"),
  13793. r("./util/showcase"))
  13794. , U = r("./util/camera")
  13795. , H = (r("./objects/Panorama"),
  13796. r("./cameras/PanoramaCamera"),
  13797. r("./preloaders"))
  13798. , z = r("events").EventEmitter
  13799. , G = r("./featureflags")
  13800. , W = (r("./util/lerp"),
  13801. r("./util/ajax"),
  13802. r("./ab"))
  13803. , j = r("./sdk/automation.js")
  13804. , Y = r("./scene/SceneRenderer")
  13805. , q = r("./scene/QuickstartManager")
  13806. , X = r("./tile/QualityManager.js")
  13807. , Z = r("./localization/localize")
  13808. , K = r("./tag/tagManager")
  13809. , Q = r("./tile/TileDownloader")
  13810. , J = r("./tile/PanoRenderer")
  13811. , ee = (r("./enum/PanoSizeClass"),
  13812. r("./enum/PanoramaEvents"),
  13813. r("./enum/SceneRendererEvents"))
  13814. , t = r("./gui/memoryUsage")
  13815. , te = r("./enum/RenderLayers")
  13816. , ie = r("./TimingData")
  13817. , ne = new e(i);
  13818. e.level = L.logLevel,
  13819. e.consoleEnabled = L.console,
  13820. function() {
  13821. var e = k.getModelIDFromQueryString();
  13822. if (!e)
  13823. return A(null, "loading-failed");
  13824. var t = k.parseSidUrl(e)
  13825. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13826. , n = {
  13827. panoElementsToLoad: 6,
  13828. modelElementsToLoad: 0,
  13829. totalElementsLoaded: 0,
  13830. totalElementsToLoad: 0,
  13831. totalPercentageLoaded: 0,
  13832. progressCallback: null
  13833. }
  13834. , r = document.getElementById("player")
  13835. , o = L.quickstart.enabled
  13836. , a = null
  13837. , s = null
  13838. , l = null
  13839. , c = null
  13840. , h = null
  13841. , u = null
  13842. , d = null
  13843. , p = null
  13844. , f = null
  13845. , g = null
  13846. , m = null
  13847. , v = new ie;
  13848. !function(e) {
  13849. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13850. z.defaultMaxListeners = 1e3,
  13851. function(e) {
  13852. e.addEventListener("dragenter", I, !1),
  13853. e.addEventListener("dragover", I, !1)
  13854. }(e),
  13855. O.valueFromHash("title", !0) || $(document).ready(function() {
  13856. $(".model-title").hide()
  13857. })
  13858. }(r),
  13859. function(e) {
  13860. return G.loadFeatureFlags(e).done(function(e) {
  13861. G.updateDependentSettings(e, L)
  13862. })
  13863. }({
  13864. urlBase: t.urlBase
  13865. }).then(function() {
  13866. return Z.init(),
  13867. function(e, t) {
  13868. var i = P.getModel({
  13869. url: t,
  13870. floors: O.valueFromHash("f", !0),
  13871. autoload: !1
  13872. });
  13873. return $.when(i, y).then(null, function(e) {
  13874. return this
  13875. })
  13876. }(0, e)
  13877. }).then(function(e) {
  13878. return re(.9),
  13879. function(e, t, i, n, r) {
  13880. ne.info("Model data loaded"),
  13881. ne.debug("UUID: " + e.data.job.uuid),
  13882. W.init(G.getFlags()),
  13883. i && N.initKeen({
  13884. token: i,
  13885. appId: n
  13886. }),
  13887. N.initSegment({
  13888. model: e.sid,
  13889. version: "2.25.6-0-gd87e5b1",
  13890. startSource: r.startSource,
  13891. token: t,
  13892. autoplay: r.autoplay,
  13893. quickstart: r.quickstart
  13894. })
  13895. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13896. startSource: i,
  13897. autoplay: L.autoplay,
  13898. quickstart: o
  13899. }),
  13900. g.urls.init()
  13901. }).then(function() {
  13902. return g.loadPanos()
  13903. }).then(function() {
  13904. s = U.getStartCameraOptions(g, g.panos),
  13905. d = function(e) {
  13906. var t = new E.PerspectiveCamera;
  13907. t.layers.enable(te.PANOMARKERS),
  13908. t.layers.enable(te.RETICULE),
  13909. t.layers.enable(te.TAG);
  13910. var o = new E.Scene
  13911. , i = new E.AmbientLight(16777215);
  13912. return o.add(i),
  13913. o.skybox = new V,
  13914. o.add(o.skybox),
  13915. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13916. side: E.DoubleSide
  13917. })),
  13918. o.plane.position.y = 0,
  13919. o.plane.rotateX(-Math.PI / 2),
  13920. o.plane.material.visible = !1,
  13921. o.add(o.plane),
  13922. o.updateMatrixWorld(),
  13923. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13924. if (e.metadata && e.metadata.camera_position) {
  13925. var t = e.metadata.camera_position
  13926. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13927. i.position = t.clone(),
  13928. o.add(i);
  13929. var n = e.metadata.camera_quaternion
  13930. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13931. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13932. }
  13933. }),
  13934. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13935. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13936. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13937. new Y(o,t,B)
  13938. }(g),
  13939. m = function(e, t) {
  13940. var i = e ? 1 : 1e3
  13941. , n = W.tilegen || W.imgopt ? 6 : 2;
  13942. n = O.valueFromHash("tileconc", n);
  13943. var r = new X
  13944. , o = new Q({
  13945. concurrentDownloads: n
  13946. })
  13947. , a = new J
  13948. , s = new x
  13949. , l = new w
  13950. , c = new b(t)
  13951. , h = new T
  13952. , u = new S(i)
  13953. , d = new M
  13954. , p = new K;
  13955. return {
  13956. qualityManager: r,
  13957. panoRenderer: a,
  13958. tileDownloader: o,
  13959. player: c,
  13960. director: l,
  13961. modelManager: s,
  13962. tagManager: p,
  13963. displayController: u,
  13964. labelDisplayController: d,
  13965. controls: h
  13966. }
  13967. }(o, s.mode),
  13968. l = m.controls,
  13969. c = m.player,
  13970. h = m.director,
  13971. u = m.tagManager,
  13972. p = m.tileDownloader,
  13973. f = m.qualityManager,
  13974. m.panoRenderer,
  13975. function(e, t, i, n) {
  13976. var r = i.controls
  13977. , o = i.qualityManager
  13978. , a = i.panoRenderer
  13979. , s = i.tileDownloader
  13980. , l = i.modelManager;
  13981. r.init(n, l),
  13982. j.init(i.director, r, i.player, l, t),
  13983. o.init(l),
  13984. s.init(o),
  13985. a.init(t, s, o),
  13986. l.init(s, a, o),
  13987. l.addModel(e),
  13988. t.addComponent(F)
  13989. }(g, d, m, r),
  13990. c.director = h,
  13991. g.supportsTiles && p.start(),
  13992. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  13993. o = !1);
  13994. var e = null;
  13995. if (o) {
  13996. ne.warn("Quickstart engaged. Hold on to your knickers.");
  13997. var t = l.controls[R.PANORAMA];
  13998. a = new q(f,d.scene,d.camera,t,r),
  13999. C(d, r, g),
  14000. e = a.load(s).then(function() {
  14001. d.addComponent(a),
  14002. d.once(ee.AfterRender, function() {
  14003. ne.warn("First render after quickstart load finished.")
  14004. })
  14005. })
  14006. }
  14007. return window.flyToFirst = function() {
  14008. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14009. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14010. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14011. c.flyToPano({
  14012. pano: e,
  14013. lookAtPoint: i
  14014. })
  14015. }
  14016. ,
  14017. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14018. }).then(function() {
  14019. return function(e, t, i, n, r) {
  14020. return r.progressCallback = t,
  14021. N.sessionStart(),
  14022. e.load(n).progress(function(e, t) {
  14023. e.modelElementsToLoad = t[1],
  14024. function(e) {
  14025. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14026. }(e),
  14027. function(e) {
  14028. e.totalElementsLoaded++,
  14029. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14030. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14031. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14032. console.log("pro:" + e.totalPercentageLoaded),
  14033. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14034. }(e)
  14035. }
  14036. .bind(this, r))
  14037. }(g, D.onProgress, 0, !o, n)
  14038. }).then(function() {
  14039. s.quickstart = o,
  14040. function(e, t, i, n) {
  14041. var r = i.qualityManager
  14042. , o = i.panoRenderer
  14043. , a = i.tileDownloader
  14044. , s = i.modelManager
  14045. , l = i.player
  14046. , c = i.director
  14047. , h = i.tagManager
  14048. , u = i.displayController
  14049. , d = i.labelDisplayController
  14050. , p = i.controls;
  14051. t.scene.add(e),
  14052. t.qualityManager = r;
  14053. var f = {
  14054. camera: t.camera,
  14055. director: c,
  14056. modelManager: s,
  14057. tileDownloader: a,
  14058. panoRenderer: o,
  14059. qualityManager: r,
  14060. tagManager: h,
  14061. container: n,
  14062. controls: p
  14063. };
  14064. l.init(f),
  14065. l.setScene(t.scene),
  14066. h.init(s, l),
  14067. c.init(l, s),
  14068. u.init(c, l, s, h, n),
  14069. d.init(l, s, n),
  14070. B.bindEvents(l),
  14071. t.addComponent(h),
  14072. t.addComponent(l),
  14073. t.addComponent(o),
  14074. l.sceneRenderer = t
  14075. }(g, d, m, r),
  14076. d.started || C(d, r, g),
  14077. N.modelLoaded(g, c, l, L.autoplay),
  14078. function(e, t, i, n) {
  14079. return ne.info("Starting player in " + i.mode),
  14080. N.report(t.sid, "started-playing", n, i.quickstart),
  14081. e.start(i)
  14082. }(c, g, s, L.autoplay).done(function() {
  14083. h.autoTour()
  14084. }),
  14085. g.supportsTiles || new H(g,c).start();
  14086. o && (d.removeComponent(a),
  14087. a.destroy(),
  14088. s.pano.enter()),
  14089. D.init(g, h, c, l, d, s, N.getSessionId()),
  14090. D.endLoading(g, h, u),
  14091. d.once(ee.AfterRender, function() {
  14092. v.setAppReadyTime();
  14093. var e = v.calcFullLoadingTime();
  14094. ne.warn("Total load time: " + e / 1e3),
  14095. N.loadComplete(e),
  14096. ne.warn("First render after model load finished.")
  14097. }),
  14098. d.on(ee.MemoryUsageUpdated, y)
  14099. }).fail(A.bind(this, e))
  14100. }()
  14101. }()
  14102. })
  14103. }
  14104. ).call(this, "/js/main.js")
  14105. }
  14106. , {
  14107. "./DisplayController": 1,
  14108. "./TimingData": 2,
  14109. "./ab": 3,
  14110. "./analytics": 4,
  14111. "./cameras/PanoramaCamera": 7,
  14112. "./controls/CameraControls": 9,
  14113. "./director": 15,
  14114. "./effects": 16,
  14115. "./enum/PanoSizeClass": 36,
  14116. "./enum/PanoramaEvents": 37,
  14117. "./enum/RenderLayers": 41,
  14118. "./enum/SceneRendererEvents": 43,
  14119. "./enum/Viewmode": 51,
  14120. "./featureflags": 59,
  14121. "./gui/error": 64,
  14122. "./gui/gui": 65,
  14123. "./gui/memoryUsage": 73,
  14124. "./label/LabelDisplayController": 91,
  14125. "./lib/array-polyfill": 92,
  14126. "./lib/performance-polyfill": 95,
  14127. "./lib/postprocessing/EffectComposer.js": 96,
  14128. "./lib/postprocessing/MaskPass.js": 97,
  14129. "./lib/postprocessing/RenderPass.js": 98,
  14130. "./lib/postprocessing/ShaderPass.js": 99,
  14131. "./lib/shaders/CopyShader.js": 100,
  14132. "./lib/shaders/HorizontalBlurShader.js": 101,
  14133. "./lib/shaders/VerticalBlurShader.js": 102,
  14134. "./lib/three75-shim": 103,
  14135. "./localization/localize": 108,
  14136. "./tag/tagManager": 124,
  14137. "./model/ModelManager": 140,
  14138. "./objects/Panorama": 148,
  14139. "./objects/Skybox": 152,
  14140. "./player": 155,
  14141. "./preloaders": 156,
  14142. "./scene/QuickstartManager": 157,
  14143. "./scene/SceneRenderer": 158,
  14144. "./sdk/automation.js": 164,
  14145. "./settings": 166,
  14146. "./showcase": 168,
  14147. "./tile/PanoRenderer": 169,
  14148. "./tile/QualityManager.js": 170,
  14149. "./tile/TileDownloader": 171,
  14150. "./util/PanoramaCollection": 178,
  14151. "./util/ajax": 181,
  14152. "./util/browser": 182,
  14153. "./util/camera": 183,
  14154. "./util/common": 185,
  14155. "./util/lerp": 188,
  14156. "./util/logger": 189,
  14157. "./util/math": 190,
  14158. "./util/sentry": 192,
  14159. "./util/showcase": 193,
  14160. "./util/transitions": 195,
  14161. events: 202,
  14162. "promise-polyfill": 213,
  14163. three: 217
  14164. }],
  14165. 117: [function(e, t, i) {
  14166. "use strict";
  14167. function n(e) {
  14168. e = e || {},
  14169. r.RawShaderMaterial.call(this, a.extendObject({
  14170. fragmentShader: o.cube.fragmentShader,
  14171. vertexShader: o.cube.vertexShader,
  14172. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14173. name: "CubemapMaterial"
  14174. }, e))
  14175. }
  14176. var r = e("three")
  14177. , o = e("../shaders")
  14178. , a = e("../util/common");
  14179. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14180. t.exports = n
  14181. }
  14182. , {
  14183. "../shaders": 167,
  14184. "../util/common": 185,
  14185. three: 217
  14186. }],
  14187. 118: [function(e, t, i) {
  14188. "use strict";
  14189. function n(e) {
  14190. e = e || {},
  14191. r.RawShaderMaterial.call(this, a.extendObject({
  14192. fragmentShader: o.model.fragmentShader,
  14193. vertexShader: o.model.vertexShader,
  14194. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14195. name: "ModelTextureMaterial"
  14196. }, e))
  14197. }
  14198. var r = e("three")
  14199. , o = e("../shaders")
  14200. , a = e("../util/common");
  14201. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14202. i && (this.uniforms.progress.value = 0),
  14203. e.ensureSkyboxReadyForRender(),
  14204. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14205. this.uniforms.pano0Position.value.copy(e.position),
  14206. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14207. t.ensureSkyboxReadyForRender(),
  14208. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14209. this.uniforms.pano1Position.value.copy(t.position),
  14210. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14211. }
  14212. ,
  14213. t.exports = n
  14214. }
  14215. , {
  14216. "../shaders": 167,
  14217. "../util/common": 185,
  14218. three: 217
  14219. }],
  14220. 119: [function(m, v, e) {
  14221. (function(e) {
  14222. "use strict";
  14223. function t(e, t, i, n) {
  14224. this.div = null,
  14225. this.body = null,
  14226. this.label = e,
  14227. this.description = t,
  14228. this.parsedDescription = [],
  14229. this.media = i || {
  14230. type: null
  14231. },
  14232. this.loadingSpinner = null,
  14233. this.parser = new r({
  14234. supportLinks: !c.valueFromHash("mls"),
  14235. keepLinkLabels: !0
  14236. }),
  14237. this.state = g.CLOSED,
  14238. this.orientation = "",
  14239. this.initialTransform = "",
  14240. this.hovering = !1,
  14241. this.openTransition = null,
  14242. this.closeTransition = null,
  14243. this.openPromise = null,
  14244. this.closePromise = null,
  14245. this.animationTransition = null,
  14246. this.animationScale = 0
  14247. }
  14248. var r = m("../Parser/DescriptionParser")
  14249. , i = m("../Media/Link")
  14250. , n = m("../Media/Image")
  14251. , o = m("../Media/EmbedlyPlayer")
  14252. , a = m("../Media/EmbedlyEmbed")
  14253. , s = m("../../util/transitions")
  14254. , l = m("../../util/lerp")
  14255. , c = m("../../util/browser")
  14256. , b = m("./BillboardEvent")
  14257. , w = m("../Media/MediaEvent")
  14258. , h = m("../Parser/DescriptionChunkType")
  14259. , u = m("events").EventEmitter
  14260. , d = m("./billboardSettings")
  14261. , T = m("./overlaySettings")
  14262. , p = new (m("../../util/logger"))(e)
  14263. , f = document.getElementById("tag-billboards");
  14264. f.addEventListener("touchend", function(e) {
  14265. f.style.pointerEvents = "none"
  14266. }),
  14267. f.addEventListener("touchcancel", function(e) {
  14268. f.style.pointerEvents = "none"
  14269. });
  14270. var g = {
  14271. CLOSED: "closed",
  14272. OPENING: "opening",
  14273. OPEN: "open",
  14274. CLOSING: "closing",
  14275. ACTIVE: "active"
  14276. };
  14277. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14278. this.parsedDescription = this.parser.parse(this.description);
  14279. var t = document.createElement("div");
  14280. t.className = "tag-container has-hotzone",
  14281. this.div = t,
  14282. this.body = document.createElement("div"),
  14283. this.body.className = "tag-body";
  14284. var i = document.createElement("div");
  14285. i.classList.add("tag-content");
  14286. var n = document.createElement("div");
  14287. n.classList.add("tag-text-content");
  14288. var r = document.createElement("div");
  14289. r.className = "tag-label",
  14290. r.textContent = this.label,
  14291. n.appendChild(r);
  14292. var o = document.createElement("div");
  14293. o.className = "tag-desc",
  14294. n.appendChild(o),
  14295. i.appendChild(n),
  14296. this.body.appendChild(i),
  14297. this.appendDescriptionElements(this.parsedDescription, o),
  14298. this.appendMedia(),
  14299. t.appendChild(this.body),
  14300. f.appendChild(t),
  14301. this.bindEvents(t, this.body)
  14302. }
  14303. ,
  14304. t.prototype.bindEvents = function(i, e) {
  14305. function t(n) {
  14306. return function(e) {
  14307. if (!this.div.classList.contains("overlay")) {
  14308. var t, i = document.getElementById("player");
  14309. try {
  14310. t = new MouseEvent(n,e)
  14311. } catch (i) {
  14312. (t = document.createEvent("MouseEvents")).initMouseEvent(n, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  14313. }
  14314. i.dispatchEvent(t)
  14315. }
  14316. }
  14317. }
  14318. e.addEventListener("mousedown", function(e) {
  14319. e.stopPropagation()
  14320. }),
  14321. e.addEventListener("mouseup", function(e) {
  14322. e.stopPropagation()
  14323. }),
  14324. i.addEventListener("touchstart", function(e) {
  14325. f.style.pointerEvents = "auto"
  14326. }),
  14327. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14328. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14329. e.addEventListener("mouseover", function(e) {
  14330. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14331. }
  14332. .bind(this)),
  14333. i.addEventListener("mouseenter", function(e) {
  14334. this.state !== g.CLOSING && (this.hovering = !0,
  14335. this.emit(b.ENTER))
  14336. }
  14337. .bind(this)),
  14338. i.addEventListener("mouseleave", function(e) {
  14339. this.hovering = !1,
  14340. this.emit(b.LEAVE)
  14341. }
  14342. .bind(this)),
  14343. i.addEventListener("gesturestart", function(e) {
  14344. e.preventDefault()
  14345. });
  14346. var n = i.querySelector(".tag-text-content")
  14347. , r = 0;
  14348. n.addEventListener("touchstart", function(e) {
  14349. r = e.changedTouches[0].clientY
  14350. }),
  14351. n.addEventListener("touchmove", function(t) {
  14352. function e(e) {
  14353. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14354. }
  14355. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14356. }),
  14357. i.addEventListener("touchmove", function(e) {
  14358. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14359. })
  14360. }
  14361. ,
  14362. t.prototype.appendDescriptionElements = function(e, i) {
  14363. 0 < e.length && this.div.classList.add("has-text"),
  14364. e.forEach(function(e, t) {
  14365. switch (e.type) {
  14366. case h.TEXT:
  14367. i.appendChild(this.createTextElement(e.text));
  14368. break;
  14369. case h.LINK:
  14370. i.appendChild(this.createLinkElement(e.link))
  14371. }
  14372. }
  14373. .bind(this))
  14374. }
  14375. ,
  14376. t.prototype.appendLoadingSpinner = function() {
  14377. this.loadingSpinner = document.createElement("div"),
  14378. this.loadingSpinner.classList.add("loading-spinner");
  14379. var e = document.createElement("div");
  14380. e.classList.add("gui-spinner-icon"),
  14381. this.loadingSpinner.appendChild(e),
  14382. this.body.appendChild(this.loadingSpinner)
  14383. }
  14384. ,
  14385. t.prototype.onMediaLoadFinished = function() {
  14386. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14387. this.applyOrientation(this.orientation),
  14388. this.loadingSpinner = null)
  14389. }
  14390. ,
  14391. t.prototype.appendMedia = function() {
  14392. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14393. this.appendLoadingSpinner();
  14394. var e = document.createElement("div");
  14395. e.classList.add("tag-media-content");
  14396. var t = document.createElement("i");
  14397. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14398. t.classList.add(e)
  14399. }),
  14400. this.body.appendChild(t),
  14401. this.body.appendChild(e),
  14402. this.media.type) {
  14403. case h.IMAGE:
  14404. e.appendChild(this.createImageElement(this.media, this.body));
  14405. break;
  14406. case h.VIDEO:
  14407. e.appendChild(this.createVideoElement(this.media, this.body));
  14408. break;
  14409. case h.RICH:
  14410. e.appendChild(this.createEmbedElement(this.media, this.body))
  14411. }
  14412. }
  14413. }
  14414. ,
  14415. t.prototype.createTextElement = function(e) {
  14416. var t = document.createElement("span");
  14417. return t.textContent = e,
  14418. t
  14419. }
  14420. ,
  14421. t.prototype.createLinkElement = function(e) {
  14422. var t = new i(e);
  14423. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14424. t.createDomElement()
  14425. }
  14426. ,
  14427. t.prototype.createImageElement = function(t, C) {
  14428. function e() {
  14429. function e() {
  14430. p || (E.classList.remove("view-image"),
  14431. a.classList.add("overlay"),
  14432. t(),
  14433. window.addEventListener("resize", A),
  14434. a.addEventListener("click", i),
  14435. c.addEventListener("click", r),
  14436. o.addEventListener("click", n),
  14437. p = !0,
  14438. _.emit(w.IMAGE_OPENED))
  14439. }
  14440. function t() {
  14441. C.classList.add("show-info"),
  14442. s.classList.remove("collapsible"),
  14443. s.style.height = "";
  14444. var e = parseFloat(getComputedStyle(v).lineHeight)
  14445. , t = g + e
  14446. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14447. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14448. , r = n
  14449. , o = r * I.aspect;
  14450. i < o && (r = (o = i) / I.aspect),
  14451. n < r && (o = (r = n) * I.aspect),
  14452. o += m,
  14453. r += m + t,
  14454. C.style.width = o + "px",
  14455. C.style.height = r + "px",
  14456. l.style.paddingTop = e + m + "px",
  14457. 0 < _.description.length && (s.classList.add("collapsible"),
  14458. s.style.height = s.clientHeight + 12 + "px",
  14459. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14460. }
  14461. function i(e) {
  14462. e.target === a && n()
  14463. }
  14464. function n() {
  14465. p && (p = !1,
  14466. E.classList.add("view-image"),
  14467. a.classList.remove("overlay"),
  14468. s.style.height = "",
  14469. l.style.paddingTop = "",
  14470. C.style.width = "",
  14471. C.style.height = "",
  14472. window.removeEventListener("resize", A),
  14473. a.removeEventListener("click", i),
  14474. c.removeEventListener("click", r),
  14475. o.removeEventListener("click", n),
  14476. _.emit(w.IMAGE_CLOSED),
  14477. _.close(!0))
  14478. }
  14479. function r(e) {
  14480. C.classList.toggle("show-info")
  14481. }
  14482. var a = _.div
  14483. , s = a.getElementsByClassName("tag-content")[0]
  14484. , l = a.getElementsByClassName("tag-media-content")[0]
  14485. , o = C.getElementsByClassName("close")[0]
  14486. , c = s.getElementsByClassName("tag-label")[0];
  14487. a.classList.add("has-image"),
  14488. E.classList.add("view-image"),
  14489. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14490. _.applyOrientation(_.orientation);
  14491. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14492. function() {
  14493. clearInterval(h),
  14494. clearTimeout(u),
  14495. h = setInterval(function() {
  14496. var e = a.clientHeight;
  14497. d !== e && (t(),
  14498. d = e)
  14499. }, 100),
  14500. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14501. }
  14502. );
  14503. I.on(w.IMAGE_OPENING, e),
  14504. _.on(b.ACTIVATE, e),
  14505. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14506. _.on(b.CLOSING, n)
  14507. }
  14508. var I = new n
  14509. , E = I.createDomElement();
  14510. this.once(b.OPENED, function() {
  14511. I.load(t.src).then(e).catch(function(e) {
  14512. p.warn("Failed to load image:", t.src),
  14513. p.warn("with error:", e)
  14514. }).then(this.onMediaLoadFinished.bind(this))
  14515. });
  14516. var _ = this;
  14517. return E
  14518. }
  14519. ,
  14520. t.prototype.createVideoElement = function(t, e) {
  14521. var i = new o({
  14522. autoPlay: !0,
  14523. autoResume: !0,
  14524. startMuted: !1,
  14525. loop: !1
  14526. })
  14527. , n = i.createDomElement();
  14528. return this.once(b.OPENED, function() {
  14529. i.load(t.src).then(function() {
  14530. this.div.classList.add("has-video"),
  14531. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14532. i.play()),
  14533. this.on(b.OPENING, i.show.bind(i)),
  14534. this.on(b.OPENED, i.play.bind(i)),
  14535. this.on(b.CLOSING, i.pause.bind(i)),
  14536. this.on(b.CLOSED, i.hide.bind(i))
  14537. }
  14538. .bind(this)).catch(function(e) {
  14539. p.warn("Failed to embed video:", t.src),
  14540. p.warn("with error:", e)
  14541. }).then(this.onMediaLoadFinished.bind(this))
  14542. }
  14543. .bind(this)),
  14544. n
  14545. }
  14546. ,
  14547. t.prototype.createEmbedElement = function(t, e) {
  14548. var i = new a
  14549. , n = i.createDomElement();
  14550. return this.once(b.OPENED, function() {
  14551. i.load(t.src).then(function() {
  14552. this.div.classList.add("has-embed"),
  14553. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14554. this.applyOrientation(this.orientation),
  14555. this.on(b.OPENING, i.show.bind(i)),
  14556. this.on(b.CLOSED, i.hide.bind(i))
  14557. }
  14558. .bind(this)).catch(function(e) {
  14559. p.warn("Failed to embed:", t.src),
  14560. p.warn("with error:", e)
  14561. }).then(this.onMediaLoadFinished.bind(this))
  14562. }
  14563. .bind(this)),
  14564. n
  14565. }
  14566. ,
  14567. t.prototype.open = function(e) {
  14568. return this.openPromise = $.Deferred(),
  14569. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14570. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14571. this.state !== g.OPEN && (this.emit(b.OPENING),
  14572. e && this.emit(b.ACTIVATING),
  14573. this.state = g.OPENING,
  14574. this.animateOpen(function() {
  14575. e && this.setActiveState(),
  14576. this.openPromise.resolve()
  14577. }
  14578. .bind(this)))
  14579. }
  14580. .bind(this), d.animation.openDelay),
  14581. s.cancel(this.closeTransition),
  14582. this.closePromise && this.closePromise.reject(),
  14583. this.closeTransition = void 0,
  14584. this.openPromise.promise())
  14585. }
  14586. ,
  14587. t.prototype.close = function(e) {
  14588. return this.closePromise = $.Deferred(),
  14589. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14590. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14591. this.state = g.CLOSING,
  14592. this.animateClose())
  14593. }
  14594. .bind(this), d.animation.closeDelay)),
  14595. s.cancel(this.openTransition),
  14596. this.openPromise && this.openPromise.reject(),
  14597. this.openTransition = void 0,
  14598. this.closePromise.resolve(),
  14599. this.closePromise.promise())
  14600. }
  14601. ,
  14602. t.prototype.setActiveState = function() {
  14603. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14604. this.emit(b.ACTIVATE),
  14605. this.div.classList.remove("has-hotzone"))
  14606. }
  14607. ,
  14608. t.prototype.animateOpen = function(e) {
  14609. if (this.state === g.OPENING) {
  14610. if (s.cancel(this.animationTransition),
  14611. c.detectSamsungNative())
  14612. return this.boardOrientation = null,
  14613. this.div.style.visibility = "visible",
  14614. this.emit(b.OPENED),
  14615. this.state = g.OPEN,
  14616. void (e && e());
  14617. this.div.style.webkitTransform = "scale(0)",
  14618. this.div.style.transform = "scale(0)",
  14619. this.div.style.visibility = "visible",
  14620. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14621. this.emit(b.OPENED),
  14622. this.state = g.OPEN,
  14623. e && e()
  14624. }
  14625. .bind(this))
  14626. }
  14627. }
  14628. ,
  14629. t.prototype.animateClose = function(e) {
  14630. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14631. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14632. this.emit(b.CLOSED),
  14633. this.state = g.CLOSED,
  14634. this.div.style.visibility = "hidden",
  14635. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14636. e && e()
  14637. }
  14638. .bind(this)))
  14639. }
  14640. ,
  14641. t.prototype.needsUpdate = function() {
  14642. return this.state !== g.CLOSED
  14643. }
  14644. ,
  14645. t.prototype.update = function(e, t) {
  14646. if (this.needsUpdate()) {
  14647. var i = (this.updateOrientation(e),
  14648. this.calcScale(t))
  14649. , n = {
  14650. x: (e.x + 1) * $("#player").width() / 2,
  14651. y: (e.y + 1) * $("#player").height() / 2
  14652. };
  14653. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14654. this.div.style.webkitTransform = this.div.screenTransform,
  14655. this.div.style.transform = this.div.screenTransform
  14656. }
  14657. }
  14658. ,
  14659. t.prototype.getDimensions = function() {
  14660. return this.div.getBoundingClientRect()
  14661. }
  14662. ,
  14663. t.prototype.calcScale = function(e) {
  14664. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14665. }
  14666. ,
  14667. t.prototype.updateOrientation = function(e) {
  14668. if (this.state !== g.ACTIVE) {
  14669. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14670. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14671. , n = "";
  14672. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14673. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14674. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14675. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14676. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14677. }
  14678. }
  14679. ,
  14680. t.prototype.applyOrientation = function(e) {
  14681. this.div.style.transform = this.div.style.webkitTransform = "",
  14682. this.div.classList.remove("tag-container-" + this.orientation),
  14683. this.div.classList.add("tag-container-" + e);
  14684. var t = window.getComputedStyle(this.div);
  14685. this.initialTransform = t.transform || t.webkitTransform,
  14686. "none" === this.initialTransform && (this.initialTransform = "");
  14687. var i = t.transform.slice(7, -1).split(",")
  14688. , n = -i[4]
  14689. , r = -i[5];
  14690. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14691. this.div.style.transformOrigin = n + "px " + r + "px",
  14692. this.orientation = e
  14693. }
  14694. ,
  14695. v.exports = t
  14696. }
  14697. ).call(this, "/js/tag/Billboard/Billboard.js")
  14698. }
  14699. , {
  14700. "../../util/browser": 182,
  14701. "../../util/lerp": 188,
  14702. "../../util/logger": 189,
  14703. "../../util/transitions": 195,
  14704. "../Media/EmbedlyEmbed": 125,
  14705. "../Media/EmbedlyPlayer": 126,
  14706. "../Media/Image": 128,
  14707. "../Media/Link": 129,
  14708. "../Media/MediaEvent": 131,
  14709. "../Parser/DescriptionChunkType": 133,
  14710. "../Parser/DescriptionParser": 134,
  14711. "./BillboardEvent": 120,
  14712. "./billboardSettings": 121,
  14713. "./overlaySettings": 122,
  14714. events: 202
  14715. }],
  14716. 120: [function(e, t, i) {
  14717. "use strict";
  14718. t.exports = Object.freeze({
  14719. ENTER: "billboard.enter",
  14720. LEAVE: "billboard.leave",
  14721. OPENING: "billboard.opening",
  14722. OPENED: "billboard.open",
  14723. CLOSING: "billboard.closing",
  14724. CLOSED: "billboard.closed",
  14725. ACTIVATING: "billboard.activating",
  14726. ACTIVATE: "billboard.activate"
  14727. })
  14728. }
  14729. , {}],
  14730. 121: [function(e, t, i) {
  14731. "use strict";
  14732. t.exports = Object.freeze({
  14733. animation: Object.freeze({
  14734. hoverOnClosing: !1,
  14735. openDelay: 100,
  14736. closeDelay: 50,
  14737. openDuration: 200,
  14738. closeDuration: 100
  14739. }),
  14740. boardToDiscRatio: 1.2
  14741. })
  14742. }
  14743. , {}],
  14744. 122: [function(e, t, i) {
  14745. "use strict";
  14746. t.exports = Object.freeze({
  14747. boundaryWidth: 30,
  14748. boundaryHeight: 0
  14749. })
  14750. }
  14751. , {}],
  14752. hot: [function(e, t, i) {
  14753. "use strict";
  14754. function n(e, t, i) {
  14755. this.sid = e,
  14756. this.position = this.conversionArray(t.position),
  14757. this.rotation = this.conversionArray(t.rotation),
  14758. this.link = t.link,
  14759. this.model = i,
  14760. this.size = t.size;
  14761. console.log(t.position)
  14762. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14763. this.build()
  14764. this.changeTex()
  14765. }
  14766. var g = e("three")
  14767. , r = e("../shaders")
  14768. , m = e("../settings")
  14769. , v = e("../enum/Viewmode")
  14770. , d = e("../objects/Panorama")
  14771. , o = e("../util/texture")
  14772. , p = new g.Raycaster
  14773. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14774. var defaultTex1 = o.load(g_HotImage.point);
  14775. var defaultTex2 = o.load(g_HotImage.point2)
  14776. n.prototype.changeTex = function(){
  14777. var u = this.mesh.material.uniforms
  14778. if(this.styleTex.length){
  14779. u.texture1.value = o.load(this.styleTex[0].src);
  14780. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14781. }else{
  14782. u.texture1.value = defaultTex1;
  14783. u.texture2.value = defaultTex2;
  14784. }
  14785. }
  14786. n.prototype.initStyleImg = function(t){
  14787. this.styleTex = []
  14788. t.styleImg = t.styleImg || [];
  14789. t.styleImg.forEach((src)=>{
  14790. this.styleTex.push({src:src})
  14791. })
  14792. this.changeTex()
  14793. }
  14794. n.prototype.build = function() {
  14795. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14796. var e = new g.Mesh(a, new g.ShaderMaterial({
  14797. uniforms: t,
  14798. vertexShader: r.hot.vertexShader,
  14799. fragmentShader: r.hot.fragmentShader,
  14800. transparent: !0
  14801. }))
  14802. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14803. e.dynamic = !0,
  14804. e.position.copy((new g.Vector3).fromArray(this.position)),
  14805. e.rotation.copy((new g.Euler).fromArray(this.rotation)),
  14806. t && e.scale.set(t, t, t),
  14807. e.name = this.sid,
  14808. e.type = "hotSprite",
  14809. (e.belongHot = this).link && (e.hotLink = this.link),
  14810. this.mesh = e,
  14811. this.model.add(e),
  14812. g_HotMeshes.push(e);
  14813. }
  14814. ,
  14815. n.prototype.closestPanoTowardTag = function(e, t) {
  14816. var i = []
  14817. , n = []
  14818. , r = this.mesh.position;
  14819. if (e === v.PANORAMA) {
  14820. var o = t.position.clone().sub(r).normalize();
  14821. n.push(d.scoreFunctions.direction(r, o))
  14822. }
  14823. var a = new g.Vector3;
  14824. i.push(function(e) {
  14825. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14826. }, function(e) {
  14827. a.copy(r).sub(e.position);
  14828. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14829. , i = m.tags.navigate.tiltTolerance;
  14830. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14831. },
  14832. (pano)=>{ // add
  14833. player.checkHasNeighbor(pano)
  14834. }
  14835. ),
  14836. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14837. var s = t.model.panos.sortByScore(i, n);
  14838. if (s && m.tags.navigate.lineOfSight) {
  14839. for (var l = 0; l < s.length; l++) {
  14840. var c = s[l].pano
  14841. , h = c.position.distanceTo(r);
  14842. p.set(c.position, r.clone().sub(c.position).normalize());
  14843. var u = p.intersectObjects(t.model.colliders);
  14844. if (0 === u.length || u[0].distance > h)
  14845. return console.log(l),
  14846. c
  14847. }
  14848. return null
  14849. }
  14850. return s && 0 < s.length && s[0].pano
  14851. }
  14852. ,
  14853. n.prototype.examine = function(e, options) {
  14854. var i = document.getElementById("popup");
  14855. options = options || {}
  14856. if (this.link && !options.dontOpen) {
  14857. g_currentHot = this,
  14858. i.style.display = "block",
  14859. i.classList.add("wait");
  14860. var n = document.createElement("iframe");
  14861. if(g_bgAudio && !g_bgAudio.paused){
  14862. manage.switchBgmState(false);
  14863. g_bgAudio.pauseByHot = true
  14864. }
  14865. if(g_tourAudio)g_tourAudio.pause()
  14866. var r = this.link.substring(this.link.indexOf("html") + 4)
  14867. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14868. -1 == r.indexOf("?") ? n.src = this.link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : n.src = this.link + "&time=" + randomTime().getTime() + "&id=" + window.number + o,
  14869. n.id = "id1",
  14870. n.allowTransparency = "true";
  14871. var a = document.getElementById("id1");
  14872. if (void 0 === a || null == a) {
  14873. document.querySelector(".popup-content").appendChild(n);
  14874. var s = !1;
  14875. window.loaddingSuccess = function() {
  14876. s = !0
  14877. }
  14878. ,
  14879. setTimeout(function e() {
  14880. if (s) {
  14881. var t = document.querySelector("#id1").contentWindow.document;
  14882. t.querySelector("video") && (t.querySelector("video").play(),
  14883. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  14884. t.querySelector("audio") && t.querySelector("audio").play()
  14885. } else
  14886. setTimeout(e, 300)
  14887. }, 800)
  14888. }
  14889. }
  14890. var l = e.mode
  14891. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  14892. , h = this.mesh.position;
  14893. e.flyingToTag = !0;
  14894. var u = function() {
  14895. e.flyingToTag = !1;
  14896. options.dontOpen || this.link && i.classList.remove("wait")
  14897. }
  14898. .bind(this);
  14899. if (l === v.PANORAMA) {
  14900. var d = {
  14901. pano: c,
  14902. lookAtPoint: h,
  14903. duration: null,
  14904. maxDistanceOverride: null,
  14905. skipWarpingCheck: !1
  14906. };
  14907. e.flyToPano(d, u)
  14908. } else {
  14909. var p = {
  14910. pano: c
  14911. };
  14912. if (h) {
  14913. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  14914. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  14915. }
  14916. p.callback = u,
  14917. p.duration = 1500,
  14918. p.mode = v.PANORAMA,
  14919. e.flyToNewMode(p)
  14920. }
  14921. }
  14922. ,
  14923. n.prototype.conversionArray = function(e) {
  14924. if ("[object Array]" == Object.prototype.toString.call(e))
  14925. return e;
  14926. var t = [];
  14927. for (var i in e)
  14928. t.push(parseFloat(e[i]));
  14929. return t
  14930. }
  14931. ,
  14932. t.exports = n
  14933. }
  14934. , {
  14935. three: 217,
  14936. "../shaders": 167,
  14937. "../enum/Viewmode": 51,
  14938. "../objects/Panorama": 148,
  14939. "../util/texture": 194,
  14940. "../settings": 166
  14941. }],
  14942. 123: [function(M, R, e) {
  14943. (function(e) {
  14944. "use strict";
  14945. function d(e, t, i) {
  14946. var n = i.version || "0";
  14947. "0" !== n && w.info("tag defined using version " + n),
  14948. this.model = e,
  14949. this.sid = t,
  14950. this.color = (new f.Color).set(i.color || o.tagDefault),
  14951. this.hoverColor = o._darken(this.color, .2),
  14952. this.floor = null,
  14953. this.floorIndex = i.floor,
  14954. this.mode = m.PANORAMA,
  14955. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14956. this.obj3d = null,
  14957. this.disc = null,
  14958. this.materials = {
  14959. disc: null,
  14960. pole: null
  14961. },
  14962. this.position = (new f.Vector3).copy(i.position),
  14963. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  14964. this.discWorldPosition = null,
  14965. this.discScale = .05,
  14966. this.poleEnabled = i.stem.enabled,
  14967. this.billboard = new r(i.label,i.description,i.media,this),
  14968. this.visibleTransition = null,
  14969. this.hoveringDisc = !1
  14970. }
  14971. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  14972. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="), x = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"), S = new f.PlaneBufferGeometry(1,1);
  14973. d.prototype = Object.create(b.prototype),
  14974. d.raycaster = new f.Raycaster,
  14975. d.prototype.bindEvents = function() {
  14976. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  14977. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  14978. }
  14979. ,
  14980. d.prototype.build = function() {
  14981. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  14982. this.floor && (this.billboard.build(this.model.sid),
  14983. this.obj3d = this.buildObject3D(),
  14984. this.floor.add(this.obj3d)),
  14985. this
  14986. }
  14987. ,
  14988. d.prototype.buildObject3D = function() {
  14989. var e = new f.Object3D;
  14990. e.position.copy(this.position);
  14991. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  14992. t.bg.value = x,
  14993. t.mask.value = T,
  14994. t.color.value.copy(this.color),
  14995. this.materials.disc = new f.RawShaderMaterial({
  14996. transparent: !0,
  14997. vertexShader: A.tagDisc.vertexShader,
  14998. fragmentShader: A.tagDisc.fragmentShader,
  14999. uniforms: t
  15000. }),
  15001. this.disc = new f.Mesh(S,this.materials.disc),
  15002. this.disc.layers.set(a.TAG),
  15003. this.disc.position.copy(this.discPosition),
  15004. this.disc.renderOrder = s.tagDisc;
  15005. var i = (this.disc.tag = this).buildPole();
  15006. return i.layers.set(a.TAG),
  15007. i.renderOrder = s.tagStem,
  15008. e.add(i),
  15009. e.layers.set(a.TAG),
  15010. e.add(this.disc)
  15011. }
  15012. ,
  15013. d.prototype.buildPole = function() {
  15014. var e = new f.BufferGeometry
  15015. , t = new Float32Array(6);
  15016. return t[0] = t[1] = t[2] = 0,
  15017. t[3] = this.discPosition.x,
  15018. t[4] = this.discPosition.y,
  15019. t[5] = this.discPosition.z,
  15020. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15021. this.materials.pole = new f.LineBasicMaterial({
  15022. linewidth: g.tags.pole.width,
  15023. color: g.tags.pole.color,
  15024. opacity: 0,
  15025. visible: this.poleEnabled,
  15026. transparent: !0,
  15027. depthWrite: !1
  15028. }),
  15029. new f.Line(e,this.materials.pole)
  15030. }
  15031. ,
  15032. d.prototype.setFreeState = function(e) {
  15033. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15034. this.materials.disc.uniforms.color.value = this.color
  15035. }
  15036. .bind(this))
  15037. }
  15038. ,
  15039. d.prototype.setHoverState = function(e) {
  15040. this.billboard.open(e),
  15041. this.materials.disc.uniforms.color.value = this.hoverColor
  15042. }
  15043. ,
  15044. d.prototype.hide = function(e, t) {
  15045. var i = $.Deferred();
  15046. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15047. return i.resolve().promise();
  15048. e = e || 0,
  15049. t = t || 0,
  15050. C.cancel(this.visibleTransition);
  15051. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15052. return this.visibleTransition = C.start((n = this,
  15053. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15054. o = I.property(n.materials.pole, "opacity", 0),
  15055. function(e) {
  15056. r(e),
  15057. n.materials.pole && o(e)
  15058. }
  15059. ), s * a, function() {
  15060. i.resolve()
  15061. }, l, E[g.warp.blendEasing]),
  15062. i.promise()
  15063. }
  15064. ,
  15065. d.prototype.show = function(e, t) {
  15066. var i = $.Deferred();
  15067. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15068. return i.resolve().promise();
  15069. e = e || 0,
  15070. t = t || 0,
  15071. C.cancel(this.visibleTransition);
  15072. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15073. return this.visibleTransition = C.start((n = this,
  15074. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15075. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15076. function(e) {
  15077. r(e),
  15078. n.materials.pole && o(e)
  15079. }
  15080. ), s * a, function() {
  15081. i.resolve()
  15082. }, l, E[g.warp.blendEasing]),
  15083. i.promise()
  15084. }
  15085. ,
  15086. d.prototype.closestPanoTowardTag = function(e, t) {
  15087. var i = []
  15088. , n = []
  15089. , r = this.disc.getWorldPosition();
  15090. if (e === m.PANORAMA) {
  15091. var o = t.position.clone().sub(r).normalize();
  15092. i.push(y.filters.isPanoAligned()),
  15093. i.push(y.filters.inPanoDirection(r, o, .5)),
  15094. i.push(y.filters.isNeighbourPanoTo(t)),
  15095. n.push(y.scoreFunctions.direction(r, o))
  15096. }
  15097. var a = new f.Vector3;
  15098. i.push(function(e) {
  15099. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15100. }, function(e) {
  15101. a.copy(r).sub(e.position);
  15102. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15103. , i = g.tags.navigate.tiltTolerance;
  15104. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15105. }),
  15106. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15107. var s = this.model.panos.sortByScore(i, n);
  15108. if (g.tags.navigate.lineOfSight) {
  15109. for (var l = 0; l < s.length; l++) {
  15110. var c = s[l].pano
  15111. , h = c.position.distanceTo(r);
  15112. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15113. return null;
  15114. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15115. var u = d.raycaster.intersectObjects(this.model.colliders);
  15116. if (0 === u.length || u[0].distance > h)
  15117. return c
  15118. }
  15119. return null
  15120. }
  15121. return 0 < s.length && s[0].pano
  15122. }
  15123. ,
  15124. d.prototype.examine = function(i) {
  15125. var e = i.mode
  15126. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15127. , t = this.disc.getWorldPosition();
  15128. this.billboard.setActiveState();
  15129. var r = function() {
  15130. var e = this.billboard.getDimensions()
  15131. , t = new f.Vector3;
  15132. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15133. t.unproject(i.camera),
  15134. i.flyToPano({
  15135. pano: n,
  15136. lookAtPoint: t
  15137. })
  15138. }
  15139. .bind(this);
  15140. if (e === m.PANORAMA)
  15141. if (n !== i.currentPano) {
  15142. var o = {
  15143. pano: n,
  15144. lookAtPoint: t,
  15145. duration: null,
  15146. maxDistanceOverride: null,
  15147. skipWarpingCheck: !1
  15148. };
  15149. i.flyToPano(o, r)
  15150. } else
  15151. setTimeout(function() {
  15152. this.billboard.open().then(function() {
  15153. r()
  15154. })
  15155. }
  15156. .bind(this), 0);
  15157. else {
  15158. var a = {
  15159. pano: n
  15160. };
  15161. if (t) {
  15162. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15163. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15164. }
  15165. a.callback = r,
  15166. a.duration = 1500,
  15167. a.mode = m.PANORAMA,
  15168. i.flyToNewMode(a)
  15169. }
  15170. }
  15171. ,
  15172. d.prototype.update = (n = new f.Vector3,
  15173. function(e, t) {
  15174. this.discWorldPosition = this.disc.getWorldPosition(),
  15175. this.updateDisc(e, t),
  15176. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15177. n.z < 1 && (n.y *= -1,
  15178. this.billboard.update(n, this.getDiscRadius(n, t))))
  15179. }
  15180. ),
  15181. d.prototype.updateDisc = (l = new f.Vector3,
  15182. c = new f.Vector3,
  15183. h = new f.Vector3,
  15184. u = new f.Vector3,
  15185. p = new f.Vector3,
  15186. function(e, t) {
  15187. var i = g.tags.visibility
  15188. , n = g.tags.disc.scale
  15189. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15190. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15191. this.obj3d.visible) {
  15192. this.disc.quaternion.copy(t.quaternion);
  15193. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15194. l.copy(this.discWorldPosition).project(t),
  15195. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15196. h.set(o / 2, 0, 0).add(c),
  15197. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15198. p.copy(u).unproject(t);
  15199. var a = p.distanceTo(this.discWorldPosition)
  15200. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15201. this.discScale = a * s,
  15202. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15203. }
  15204. }
  15205. ),
  15206. d.prototype.getDiscRadius = (i = new f.Vector3,
  15207. function(e, t) {
  15208. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15209. Math.abs(e.x - i.x) * $("#player").width()
  15210. }
  15211. ),
  15212. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15213. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15214. }
  15215. ,
  15216. d.prototype.offScreen = function(e, t) {
  15217. var i = e.getWorldPosition().project(t);
  15218. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15219. }
  15220. ,
  15221. d.viewportScale = function() {
  15222. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15223. d.viewportHeight = $("#player").height(),
  15224. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15225. d.currentViewportScale
  15226. }
  15227. ,
  15228. R.exports = d
  15229. }
  15230. ).call(this, "/js/tag/tag.js")
  15231. }
  15232. , {
  15233. "../enum/Colors": 19,
  15234. "../enum/RenderLayers": 41,
  15235. "../enum/RenderOrder": 42,
  15236. "../enum/Viewmode": 51,
  15237. "../objects/Panorama": 148,
  15238. "../settings": 166,
  15239. "../shaders": 167,
  15240. "../util/common": 185,
  15241. "../util/easing": 186,
  15242. "../util/lerp": 188,
  15243. "../util/logger": 189,
  15244. "../util/math": 190,
  15245. "../util/texture": 194,
  15246. "../util/transitions": 195,
  15247. "./Billboard/Billboard": 119,
  15248. "./Billboard/BillboardEvent": 120,
  15249. events: 202,
  15250. three: 217
  15251. }],
  15252. 124: [function(M, R, e) {
  15253. (function(e) {
  15254. "use strict";
  15255. function t() {
  15256. this.tagState = T.IDLE,
  15257. this.intersectTag = null,
  15258. this.hoveredTag = null,
  15259. this.activeTag = null,
  15260. this.tagDiscs = [],
  15261. this.raycaster = new i.Raycaster,
  15262. this.modelManager = null,
  15263. this.player = null,
  15264. this.totaltags = 0,
  15265. this.navigatingViaTag = !1,
  15266. this.enabled = !1
  15267. }
  15268. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15269. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15270. r.extend(t, x),
  15271. t.prototype.init = function(e, t) {
  15272. this.modelManager = e,
  15273. this.player = t,
  15274. this.updateModel(),
  15275. this.bindEvents()
  15276. }
  15277. ,
  15278. t.prototype.update = function(e) {
  15279. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15280. }
  15281. ,
  15282. t.prototype.updateTags = function(e, t, i, n) {
  15283. for (var r in this.model.tags)
  15284. this.model.tags[r].update(e, t, i, n)
  15285. }
  15286. ,
  15287. t.prototype.updateModel = function() {
  15288. this.model = this.modelManager.getActiveModel(),
  15289. this.gettagsFromModel(),
  15290. this.totaltags = Object.keys(this.model.tags).length
  15291. }
  15292. ,
  15293. t.prototype.gettagsFromModel = function() {
  15294. for (var e in this.tagDiscs = [],
  15295. this.model.tags) {
  15296. var t = this.model.tags[e].disc;
  15297. t && this.tagDiscs.push(t)
  15298. }
  15299. }
  15300. ,
  15301. t.prototype.bindEvents = function() {
  15302. function e() {
  15303. Object.keys(this.model.tags).forEach(function(e) {
  15304. var t = this.model.tags[e];
  15305. t.bindEvents(),
  15306. t.billboard.on(y.LINK_CLICK, function(e) {
  15307. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15308. }
  15309. .bind(this)),
  15310. t.billboard.on(y.IMAGE_OPENED, function() {
  15311. this.tagState = T.EXAMINE,
  15312. this.emit(y.IMAGE_OPENED)
  15313. }
  15314. .bind(this)),
  15315. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15316. }
  15317. .bind(this))
  15318. }
  15319. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15320. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15321. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15322. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15323. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15324. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15325. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15326. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15327. e.call(this)
  15328. }
  15329. ,
  15330. t.prototype.navigateViaLink = function(e) {
  15331. var t = a.deserialize(e);
  15332. if (t)
  15333. if (t.mode === C.PANORAMA) {
  15334. try {
  15335. this.player.model.panos.get(t.panoId)
  15336. } catch (e) {
  15337. return void S.warn("Unable to find panorama location", t.panoId)
  15338. }
  15339. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15340. } else {
  15341. var i = {
  15342. cameraMode: t.mode,
  15343. position: t.position,
  15344. quaternion: t.quaternion,
  15345. scanId: t.panoId,
  15346. orthoZoom: t.zoom,
  15347. floorVisibility: t.floorVisibility,
  15348. thumbUrl: null,
  15349. name: null
  15350. };
  15351. this.player.flyToNewMode({
  15352. mode: t.mode,
  15353. duration: m.warp.outsideTime,
  15354. warpDest: new g(i),
  15355. force: !0
  15356. })
  15357. }
  15358. }
  15359. ,
  15360. t.prototype.handleWarpStart = function(e, t, i, n) {
  15361. this.dismissExaminedTag(),
  15362. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15363. e && (i = E.END),
  15364. this.hideShowTagsForBlackoutStyle(i, n))
  15365. }
  15366. ,
  15367. t.prototype.handleWarpInterruption = function(e, t, i) {
  15368. null != i || (i = m.warp.teleportTime),
  15369. this.hideShowTagsForBlackoutStyle(t, i)
  15370. }
  15371. ,
  15372. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15373. var i = 0
  15374. , n = 0
  15375. , r = t / 2;
  15376. switch (null != e || (e = E.MIDDLE),
  15377. e) {
  15378. case E.END:
  15379. this.hideAlltags(r);
  15380. break;
  15381. case E.BEGINNING:
  15382. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15383. break;
  15384. case E.NONE:
  15385. break;
  15386. case E.MIDDLE:
  15387. n = i = r,
  15388. this.hideAlltags(n),
  15389. setTimeout(function() {
  15390. this.showAlltags(i)
  15391. }
  15392. .bind(this), n);
  15393. break;
  15394. case E.FADEIN:
  15395. setTimeout(function() {
  15396. this.showAlltags(r)
  15397. }
  15398. .bind(this), r)
  15399. }
  15400. }
  15401. ,
  15402. t.prototype.onPlayerModeChanging = function(e, t) {
  15403. t !== C.PANORAMA && this.dismissExaminedTag(),
  15404. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15405. var i = t !== C.OUTDOOR;
  15406. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15407. }
  15408. ,
  15409. t.prototype.onPanoChange = function(e, t) {
  15410. var i = this.navigatingViaTag;
  15411. if (this.navigatingViaTag = !1,
  15412. !i) {
  15413. this.dismissExaminedTag();
  15414. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15415. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15416. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15417. }
  15418. }
  15419. ,
  15420. t.prototype.onPlayerReady = function(e, t, i) {
  15421. this.startAlltags(e, t ? i : null)
  15422. }
  15423. ,
  15424. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15425. this.updateClosestTags(e)
  15426. }
  15427. ,
  15428. t.prototype.dismissExaminedTag = function() {
  15429. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15430. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15431. this.hoveredTag = null)
  15432. }
  15433. ,
  15434. t.prototype.startAlltags = function(e, t) {
  15435. this.model.shouldShowtags = m.tags.enabled,
  15436. this.enabled = !0,
  15437. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15438. t && setTimeout(function() {
  15439. this.activateTag(this.model.getTagBySid(t))
  15440. }
  15441. .bind(this), m.tags.startup.fadeInDuration / 2))
  15442. }
  15443. ,
  15444. t.prototype.showAlltags = function(e, t, i) {
  15445. function n() {
  15446. ++o === this.totaltags && (this.model.tagsShown = !0,
  15447. r.resolve())
  15448. }
  15449. var r = $.Deferred();
  15450. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15451. return r.resolve().promise();
  15452. var o = 0;
  15453. for (var a in this.model.tags) {
  15454. this.model.tags[a].show(e, t).done(n.bind(this))
  15455. }
  15456. return r.promise()
  15457. }
  15458. ,
  15459. t.prototype.hideAlltags = function(e, t) {
  15460. function i() {
  15461. ++r === this.totaltags && (this.model.tagsShown = !1,
  15462. n.resolve())
  15463. }
  15464. var n = $.Deferred()
  15465. , r = 0;
  15466. for (var o in this.model.tags) {
  15467. var a = this.model.tags[o];
  15468. a.hide(e, t).done(i.bind(this)),
  15469. a === this.activeTag && this.dismissActiveTag()
  15470. }
  15471. return n.promise()
  15472. }
  15473. ,
  15474. t.prototype.enableHovering = function() {
  15475. this.enabled = !0
  15476. }
  15477. ,
  15478. t.prototype.disableHovering = function() {
  15479. this.enabled = !1
  15480. }
  15481. ,
  15482. t.prototype.activateTag = function(e, t) {
  15483. t = t || T.EXAMINE,
  15484. this.activeTag = e,
  15485. this.activeTag.hoveringDisc = !0,
  15486. this.activeTag.setHoverState(t === T.EXAMINE),
  15487. this.tagState = t,
  15488. this.emit(b.TagActivated, e)
  15489. }
  15490. ,
  15491. t.prototype.dismissActiveTag = function() {
  15492. this.activeTag.hoveringDisc = !1,
  15493. this.activeTag.setFreeState(!0);
  15494. var e = this.activeTag;
  15495. this.activeTag = null,
  15496. this.tagState = T.IDLE,
  15497. this.emit(b.TagDismissed, e)
  15498. }
  15499. ,
  15500. t.prototype.clickedOnTag = function(e) {
  15501. var t = function() {
  15502. this.navigatingViaTag = !0,
  15503. this.activeTag.examine(this.player),
  15504. this.emit(b.TagNavigation, this.activeTag)
  15505. }
  15506. .bind(this);
  15507. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15508. this.activeTag = this.intersectTag,
  15509. t(),
  15510. !0) : (this.dismissActiveTag(),
  15511. !1)
  15512. }
  15513. ,
  15514. t.prototype.intersecttag = (s = new i.Vector3,
  15515. l = new i.Vector3,
  15516. c = new i.Vector3,
  15517. function(e, t, i) {
  15518. if (!this.enabled)
  15519. return null;
  15520. var n = null
  15521. , r = this.tagDiscs.filter(function(e) {
  15522. return e.parent.visible
  15523. });
  15524. if (0 < r.length) {
  15525. var o = this.model.floors.reduce(function(e, t) {
  15526. return t.hidden ? e : e.concat(t.collider.children)
  15527. }, r);
  15528. s.set(e.x, e.y, -1).unproject(i),
  15529. l.set(e.x, e.y, 1).unproject(i),
  15530. c.copy(l).sub(s).normalize(),
  15531. this.raycaster.set(s, c);
  15532. var a = this.raycaster.intersectObjects(o);
  15533. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15534. }
  15535. return this.intersectTag = n,
  15536. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15537. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15538. this.hoveredTag = n
  15539. }
  15540. .bind(this)),
  15541. n.billboard.on(v.LEAVE, function() {
  15542. this.hoveredTag = null
  15543. }
  15544. .bind(this))),
  15545. this.activateTag(n, T.BROWSE))),
  15546. n
  15547. }
  15548. ),
  15549. t.prototype.rankedtagInDirection = (h = [],
  15550. u = [],
  15551. d = new i.Vector3,
  15552. p = new i.Vector3,
  15553. f = new i.Vector3,
  15554. function(e, t, i, n) {
  15555. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15556. var a = this.closesttags[o];
  15557. p.copy(a.position),
  15558. p.add(a.discPosition),
  15559. d.copy(t),
  15560. d.sub(p).negate(),
  15561. d.normalize();
  15562. var s = d.dot(n);
  15563. if (0 <= s && (f.copy(p),
  15564. f.project(i),
  15565. this.intersecttag(f, !1, i))) {
  15566. if (r >= h.length)
  15567. for (var l = 0; l < 64; l++)
  15568. h.push({
  15569. tag: a,
  15570. dot: s
  15571. });
  15572. var c = h[r];
  15573. c.tag = a,
  15574. c.dot = s,
  15575. c.position = math.projectPositionToCanvas(p, i),
  15576. u.push(c),
  15577. r++
  15578. }
  15579. }
  15580. return u.sort(function(e, t) {
  15581. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15582. }),
  15583. e < u.length ? u[e].tag : null
  15584. }
  15585. ),
  15586. t.prototype.updateClosestTags = (o = new i.Vector3,
  15587. function(e) {
  15588. this.closesttags || (this.closesttags = []),
  15589. this.closesttags.length = 0;
  15590. var t = this.model.tags;
  15591. if (t)
  15592. for (var i in t)
  15593. if (t.hasOwnProperty(i)) {
  15594. var n = t[i]
  15595. , r = n.position;
  15596. o.copy(e),
  15597. o.sub(r).negate(),
  15598. o.lengthSq() < 30 && this.closesttags.push(n)
  15599. }
  15600. }
  15601. ),
  15602. R.exports = t
  15603. }
  15604. ).call(this, "/js/tag/tagManager.js")
  15605. }
  15606. , {
  15607. "../controls/serializer": 14,
  15608. "../enum/BlackoutStyle": 18,
  15609. "../enum/tagEvents": 32,
  15610. "../enum/ModelManagerEvents": 33,
  15611. "../enum/PlayerEvents": 40,
  15612. "../enum/TagStates": 44,
  15613. "../enum/Viewmode": 51,
  15614. "../enum/WarpStyle": 52,
  15615. "../objects/Snapshot": 153,
  15616. "../settings": 166,
  15617. "../util/common": 185,
  15618. "../util/lerp": 188,
  15619. "../util/logger": 189,
  15620. "./Billboard/BillboardEvent": 120,
  15621. "./Media/LinkType": 130,
  15622. "./Media/MediaEvent": 131,
  15623. events: 202,
  15624. three: 217
  15625. }],
  15626. 125: [function(r, o, e) {
  15627. (function(e) {
  15628. "use strict";
  15629. function t() {
  15630. this.embedWrapper = null,
  15631. this.embedElement = null
  15632. }
  15633. var i = r("../../util/ajax")
  15634. , a = r("./mediaSettings")
  15635. , n = r("../../settings")
  15636. , s = new (r("../../util/logger"))(e);
  15637. t.prototype.createDomElement = function() {
  15638. return this.embedWrapper = document.createElement("div"),
  15639. this.embedWrapper.classList.add("tag-embed"),
  15640. this.embedWrapper.classList.add("hidden"),
  15641. this.embedWrapper
  15642. }
  15643. ,
  15644. t.prototype.load = function(e) {
  15645. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15646. return new Promise(function(r, o) {
  15647. i.get(t).then(function(e) {
  15648. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15649. this.embedWrapper.innerHTML = e.html;
  15650. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15651. if (this.embedWrapper.style.width = t + "px",
  15652. e.height) {
  15653. var i = e.height / e.width;
  15654. this.embedWrapper.style.height = t * i + "px"
  15655. }
  15656. this.embedElement = this.embedWrapper.firstChild;
  15657. var n = [];
  15658. try {
  15659. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15660. } catch (e) {
  15661. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15662. }
  15663. n.forEach(function(e) {
  15664. e.setAttribute("target", "_blank")
  15665. }),
  15666. this.embedElement.classList.add("hidden"),
  15667. this.embedWrapper.classList.remove("hidden"),
  15668. r()
  15669. } else
  15670. o("Not a valid embed")
  15671. }
  15672. .bind(this), function(e) {
  15673. o(e.response)
  15674. })
  15675. }
  15676. .bind(this))
  15677. }
  15678. ,
  15679. t.prototype.show = function() {
  15680. this.embedElement && this.embedElement.classList.remove("hidden")
  15681. }
  15682. ,
  15683. t.prototype.hide = function() {
  15684. this.embedElement && this.embedElement.classList.add("hidden")
  15685. }
  15686. ,
  15687. o.exports = t
  15688. }
  15689. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15690. }
  15691. , {
  15692. "../../settings": 166,
  15693. "../../util/ajax": 181,
  15694. "../../util/logger": 189,
  15695. "./mediaSettings": 132
  15696. }],
  15697. 126: [function(a, s, e) {
  15698. (function(e) {
  15699. "use strict";
  15700. function t(e) {
  15701. r.call(this),
  15702. this.options = e,
  15703. this.playerControls = null,
  15704. this.state = o.NOT_READY
  15705. }
  15706. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15707. Object.freeze({
  15708. NOT_READY: "player.not.ready",
  15709. CUED: "player.cued",
  15710. PLAYING: "player.playing",
  15711. PAUSED: "player.paused"
  15712. }));
  15713. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15714. return this.embedWrapper = document.createElement("div"),
  15715. this.embedWrapper.classList.add("tag-video"),
  15716. this.embedWrapper.classList.add("hidden"),
  15717. this.embedWrapper
  15718. }
  15719. ,
  15720. t.prototype.load = function(e) {
  15721. var t = function() {
  15722. function e(e) {
  15723. this.playerState = e
  15724. }
  15725. this.playerControls = new playerjs.Player(this.embedElement),
  15726. this.playerControls.on("ready", function(e) {
  15727. this.playerState = o.CUED,
  15728. this.options.startMuted && this.playerControls.mute()
  15729. }
  15730. .bind(this)),
  15731. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15732. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15733. this.playerControls.on("ended", function(e) {
  15734. this.playerControls.setCurrentTime(0),
  15735. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15736. }
  15737. .bind(this))
  15738. }
  15739. .bind(this);
  15740. return r.prototype.load.call(this, e).then(t.bind(this))
  15741. }
  15742. ,
  15743. t.prototype.play = (i = n.isMobile(),
  15744. function() {
  15745. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15746. }
  15747. ),
  15748. t.prototype.pause = function() {
  15749. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15750. }
  15751. ,
  15752. s.exports = t
  15753. }
  15754. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15755. }
  15756. , {
  15757. "../../util/browser": 182,
  15758. "../../util/logger": 189,
  15759. "./EmbedlyEmbed": 125
  15760. }],
  15761. 127: [function(t, i, e) {
  15762. (function(e) {
  15763. "use strict";
  15764. var r = t("../../util/ajax")
  15765. , o = new (t("./mediaSettings"),
  15766. t("../../util/logger"))(e)
  15767. , a = Promise.resolve();
  15768. i.exports.enqueue = function(i) {
  15769. function n() {}
  15770. return a = new Promise(function(e, t) {
  15771. a.catch(n).then(function() {
  15772. (o.debug("requesting file from embedly:", i.href),
  15773. r.get(i.href, {
  15774. responseType: i.responseType
  15775. }).then(function(e) {
  15776. return o.debug("requesting file finished:", i.href),
  15777. e
  15778. })).then(e, t)
  15779. })
  15780. }
  15781. )
  15782. }
  15783. }
  15784. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15785. }
  15786. , {
  15787. "../../util/ajax": 181,
  15788. "../../util/logger": 189,
  15789. "./mediaSettings": 132
  15790. }],
  15791. 128: [function(s, l, e) {
  15792. (function(e) {
  15793. "use strict";
  15794. function t() {
  15795. this.imageWrapper = null,
  15796. this.width = 0,
  15797. this.height = 0,
  15798. this.aspect = 1
  15799. }
  15800. var i = s("./MediaEvent")
  15801. , n = s("./EmbedlyQueue")
  15802. , r = s("events").EventEmitter
  15803. , o = s("../../util/logger")
  15804. , a = s("../../settings");
  15805. new o(e),
  15806. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15807. return this.imageWrapper = document.createElement("div"),
  15808. this.imageWrapper.classList.add("tag-image"),
  15809. this.imageWrapper.classList.add("hidden"),
  15810. this.imageWrapper.addEventListener("click", function(e) {
  15811. e.stopPropagation(),
  15812. this.emit(i.IMAGE_OPENING),
  15813. this.imageWrapper.style.pointerEvents = "none"
  15814. }
  15815. .bind(this)),
  15816. this.imageWrapper
  15817. }
  15818. ,
  15819. t.prototype.onClosed = function() {
  15820. this.imageWrapper.style.pointerEvents = "auto"
  15821. }
  15822. ,
  15823. t.prototype.load = function(e) {
  15824. var t = Math.max(window.screen.height, window.screen.width)
  15825. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15826. return new Promise(function(o, e) {
  15827. n.enqueue({
  15828. href: i,
  15829. responseType: "arraybuffer"
  15830. }).then(function(e) {
  15831. var t = new Uint8Array(e)
  15832. , i = new Blob([t])
  15833. , n = new window.Image;
  15834. n.addEventListener("load", function(e) {
  15835. var t = e.target;
  15836. this.width = t.naturalWidth,
  15837. this.height = t.naturalHeight,
  15838. this.aspect = this.width / this.height;
  15839. var i = e.target.src;
  15840. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15841. this.imageWrapper.style.width = this.width + "px",
  15842. this.imageWrapper.style.height = this.height + "px",
  15843. this.imageWrapper.classList.remove("hidden"),
  15844. o()
  15845. }
  15846. .bind(this));
  15847. var r = URL.createObjectURL(i);
  15848. n.src = r
  15849. }
  15850. .bind(this), e)
  15851. }
  15852. .bind(this))
  15853. }
  15854. ,
  15855. l.exports = t
  15856. }
  15857. ).call(this, "/js/tag/Media/Image.js")
  15858. }
  15859. , {
  15860. "../../settings": 166,
  15861. "../../util/logger": 189,
  15862. "./EmbedlyQueue": 127,
  15863. "./MediaEvent": 131,
  15864. events: 202
  15865. }],
  15866. 129: [function(e, t, i) {
  15867. "use strict";
  15868. function n(e) {
  15869. this.label = e.label,
  15870. this.href = e.url,
  15871. this.type = this.updateLinkForType(),
  15872. this.domElement = null,
  15873. this.id = c++
  15874. }
  15875. var r = e("./LinkType")
  15876. , o = e("./MediaEvent")
  15877. , a = e("../../util/browser")
  15878. , s = e("../../analytics")
  15879. , l = e("events").EventEmitter
  15880. , c = 0;
  15881. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15882. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15883. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  15884. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15885. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15886. r.MODEL) : r.EXT_LINK
  15887. }
  15888. ;
  15889. var h = {};
  15890. n.prototype.createDomElement = function() {
  15891. if (this.domElement = document.createElement("a"),
  15892. this.domElement.classList.add("tag-link"),
  15893. this.domElement.textContent = this.label,
  15894. this.type === r.EXT_LINK) {
  15895. this.domElement.textContent += " ";
  15896. var e = document.createElement("i");
  15897. e.classList.add("icon-ext-link"),
  15898. e.title = "Link to external web site",
  15899. this.domElement.appendChild(e)
  15900. }
  15901. return this.domElement.addEventListener("click", function(e) {
  15902. switch (e.stopPropagation(),
  15903. h[this.id] = !0,
  15904. s.trackAlways("click_tag_link", {
  15905. link_type: this.type,
  15906. link_count: c,
  15907. links_clicked: Object.keys(h).length
  15908. }),
  15909. this.type) {
  15910. case r.MODEL:
  15911. window.location.replace(this.href);
  15912. break;
  15913. case r.EXT_LINK:
  15914. window.open(this.href, "_blank")
  15915. }
  15916. this.emit(o.LINK_CLICK, {
  15917. type: this.type,
  15918. url: this.href
  15919. })
  15920. }
  15921. .bind(this)),
  15922. this.domElement
  15923. }
  15924. ,
  15925. t.exports = n
  15926. }
  15927. , {
  15928. "../../analytics": 4,
  15929. "../../util/browser": 182,
  15930. "./LinkType": 130,
  15931. "./MediaEvent": 131,
  15932. events: 202
  15933. }],
  15934. 130: [function(e, t, i) {
  15935. "use strict";
  15936. t.exports = {
  15937. NAVIGATION: "navigation",
  15938. MODEL: "model",
  15939. EXT_LINK: "ext-link"
  15940. }
  15941. }
  15942. , {}],
  15943. 131: [function(e, t, i) {
  15944. "use strict";
  15945. t.exports = Object.freeze({
  15946. LINK_CLICK: "mtmedia.link",
  15947. IMAGE_LOADED: "mtmedia.image.loaded",
  15948. IMAGE_OPENING: "mtmedia.image.opening",
  15949. IMAGE_OPENED: "mtmedia.image.opened",
  15950. IMAGE_CLOSING: "mtmedia.image.closing",
  15951. IMAGE_CLOSED: "mtmedia.image.closed",
  15952. VIDEO_START: "mtmedia.video.start",
  15953. VIDEO_PAUSE: "mtmedia.video.pause",
  15954. VIDEO_ENDED: "mtmedia.video.end"
  15955. })
  15956. }
  15957. , {}],
  15958. 132: [function(e, t, i) {
  15959. "use strict";
  15960. t.exports = Object.freeze({
  15961. maxEmbedWidth: 350,
  15962. defaultAspectRatio: .75
  15963. })
  15964. }
  15965. , {}],
  15966. 133: [function(e, t, i) {
  15967. "use strict";
  15968. t.exports = Object.freeze({
  15969. TEXT: "text",
  15970. LINK: "link",
  15971. IMAGE: "photo",
  15972. VIDEO: "video",
  15973. RICH: "rich"
  15974. })
  15975. }
  15976. , {}],
  15977. 134: [function(e, t, i) {
  15978. "use strict";
  15979. function n(e) {
  15980. this.capabilities = {
  15981. links: {
  15982. enable: e.supportLinks,
  15983. keepLabels: e.keepLinkLabels
  15984. }
  15985. }
  15986. }
  15987. var r = e("./DescriptionChunkType");
  15988. n.prototype.parse = function(e, i) {
  15989. var n = [];
  15990. return e.split("[").map(function(e, t) {
  15991. return 0 === t ? e : "[" + e
  15992. }).forEach(function(e) {
  15993. var t = this.findMarkdown(e);
  15994. if (t) {
  15995. if (-1 !== t.url.indexOf("javascript:"))
  15996. return;
  15997. this.addLinkChunk(n, t, i),
  15998. this.addTextChunk(n, e.slice(t.markdown.length))
  15999. } else
  16000. this.addTextChunk(n, e)
  16001. }
  16002. .bind(this)),
  16003. n
  16004. }
  16005. ,
  16006. n.prototype.findMarkdown = function(e) {
  16007. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16008. if (t) {
  16009. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16010. 0 !== n); )
  16011. r++;
  16012. var o = i.length - r;
  16013. return {
  16014. markdown: t[0].substring(0, t[0].length - o),
  16015. label: t[1],
  16016. url: t[2].substring(0, r)
  16017. }
  16018. }
  16019. }
  16020. ,
  16021. n.prototype.addTextChunk = function(e, t) {
  16022. 0 !== t.length && e.push({
  16023. type: r.TEXT,
  16024. text: t
  16025. })
  16026. }
  16027. ,
  16028. n.prototype.addLinkChunk = function(e, t) {
  16029. if (this.capabilities.links.enable) {
  16030. var i = {
  16031. label: t.label,
  16032. url: t.url
  16033. };
  16034. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16035. e.push({
  16036. type: r.LINK,
  16037. link: i
  16038. })
  16039. } else
  16040. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16041. }
  16042. ,
  16043. t.exports = n
  16044. }
  16045. , {
  16046. "./DescriptionChunkType": 133
  16047. }],
  16048. 135: [function(t, r, e) {
  16049. (function(e) {
  16050. "use strict";
  16051. var i = new (t("../util/logger"))(e)
  16052. , n = {
  16053. parseIdsFromChunkName: function(e, t) {
  16054. t.floorId = n.parseFloor(e),
  16055. t.roomId = n.parseRoom(e)
  16056. },
  16057. parseFloor: function(e) {
  16058. var t = e.match(/_group([0-9]+)/);
  16059. if (!t)
  16060. return 0;
  16061. try {
  16062. return parseInt(t[1], 10)
  16063. } catch (e) {
  16064. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16065. 0
  16066. }
  16067. },
  16068. parseRoom: function(e) {
  16069. var t = e.match(/_sub([0-9]+)/);
  16070. if (!t)
  16071. return -1;
  16072. try {
  16073. return parseInt(t[1], 10)
  16074. } catch (e) {
  16075. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16076. 0
  16077. }
  16078. }
  16079. };
  16080. r.exports = n
  16081. }
  16082. ).call(this, "/js/model/Chunks.js")
  16083. }
  16084. , {
  16085. "../util/logger": 189
  16086. }],
  16087. 136: [function(a, c, e) {
  16088. (function(e) {
  16089. "use strict";
  16090. function t(e) {
  16091. r.call(this),
  16092. this.model = e,
  16093. this.exploded = !1
  16094. }
  16095. var i = a("../objects/Floor")
  16096. , n = (a("../settings"),
  16097. a("../util/logger"))
  16098. , s = a("../util/transitions")
  16099. , r = a("../util/IndexedCollection")
  16100. , o = a("../util/common")
  16101. , l = a("../util/easing");
  16102. new n(e),
  16103. o.inherit(t, r),
  16104. t.prototype.add = function(e) {
  16105. r.prototype.add.call(this, e),
  16106. this.model.add(e)
  16107. }
  16108. ,
  16109. t.prototype.getIndex = function(e) {
  16110. return e.floorIndex
  16111. }
  16112. ,
  16113. t.prototype.build = function() {
  16114. this.list.forEach(function(e) {
  16115. e.build()
  16116. })
  16117. }
  16118. ,
  16119. t.prototype.size = function() {
  16120. return this.length
  16121. }
  16122. ,
  16123. t.prototype.sort = function() {
  16124. r.prototype.sort.call(this, function(e, t) {
  16125. return e.floorIndex - t.floorIndex
  16126. })
  16127. }
  16128. ,
  16129. t.prototype.nextFloor = function(e, t) {
  16130. return this.index[e.floorIndex + t] || null
  16131. }
  16132. ,
  16133. t.prototype.getFloorAtPoint = function(e) {
  16134. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16135. var r = this.list[n]
  16136. , o = r.distanceToPoint(e);
  16137. (!t || o < i) && (i = o,
  16138. t = r)
  16139. }
  16140. return t
  16141. }
  16142. ,
  16143. t.prototype.getOrMakeFloor = function(e) {
  16144. var t = this.index[e];
  16145. return t || (t = new i(this.model,e),
  16146. this.add(t)),
  16147. t
  16148. }
  16149. ,
  16150. t.prototype.hide = function() {
  16151. this.list.forEach(function(e) {
  16152. e.hide()
  16153. })
  16154. }
  16155. ,
  16156. t.prototype.show = function() {
  16157. this.list.forEach(function(e) {
  16158. e.show()
  16159. })
  16160. }
  16161. ,
  16162. t.prototype.names = function() {
  16163. return this.list.reduce(function(e, t) {
  16164. return e.concat(t.name)
  16165. }, [])
  16166. }
  16167. ,
  16168. t.prototype.toggleExplodeHorizontal = function() {
  16169. function i(e, t) {
  16170. a.copy(e.position),
  16171. e.position.x = r[e.floorIndex] * t,
  16172. e.position.y = 1 * e.floorIndex * t,
  16173. a.sub(e.position).multiplyScalar(-1),
  16174. e.panos.forEach(function(e) {
  16175. e.translate(a)
  16176. })
  16177. }
  16178. var n, r = [], o = 0;
  16179. this.list.forEach(function(e, t, i) {
  16180. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16181. o += n,
  16182. r[t] = o
  16183. }),
  16184. r = r.map(function(e) {
  16185. return e - o / 2
  16186. });
  16187. var a = this.list[0].position.clone();
  16188. this.exploded ? this.list.forEach(function(t) {
  16189. s.start(function(e) {
  16190. i(t, 1 - e)
  16191. }, 1500, null, 0, l.easeOutExpo)
  16192. }) : this.list.forEach(function(t) {
  16193. s.start(function(e) {
  16194. i(t, e)
  16195. }, 1500, null, 0, l.easeOutExpo)
  16196. }),
  16197. this.exploded = !this.exploded
  16198. }
  16199. ,
  16200. t.prototype.toggleExplodeVertical = function() {
  16201. function i(e, t) {
  16202. var i = i.copy(e.position);
  16203. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16204. i.sub(e.position).multiplyScalar(-1),
  16205. e.panos.forEach(function(e) {
  16206. e.translate(i)
  16207. })
  16208. }
  16209. var n = this.model.size;
  16210. this.list[0].position.clone(),
  16211. this.exploded ? this.list.forEach(function(t) {
  16212. s.start(function(e) {
  16213. i(t, 1 - e)
  16214. }, 1500, null, 0, l.easeOutExpo)
  16215. }) : this.list.forEach(function(t) {
  16216. s.start(function(e) {
  16217. i(t, e)
  16218. }, 1500, null, 0, l.easeOutExpo)
  16219. }),
  16220. this.exploded = !this.exploded
  16221. }
  16222. ,
  16223. c.exports = t
  16224. }
  16225. ).call(this, "/js/model/FloorCollection.js")
  16226. }
  16227. , {
  16228. "../objects/Floor": 146,
  16229. "../settings": 166,
  16230. "../util/IndexedCollection": 175,
  16231. "../util/common": 185,
  16232. "../util/easing": 186,
  16233. "../util/logger": 189,
  16234. "../util/transitions": 195
  16235. }],
  16236. 137: [function(r, o, e) {
  16237. (function(e) {
  16238. "use strict";
  16239. function h() {
  16240. n.call(this)
  16241. }
  16242. var u = r("../settings")
  16243. , t = r("../util/logger")
  16244. , d = r("../enum/Viewmode")
  16245. , p = r("../objects/Snapshot")
  16246. , i = (r("../util/math"),
  16247. r("../util/common"))
  16248. , n = r("../util/IndexedCollection")
  16249. , l = new t(e);
  16250. i.inherit(h, n),
  16251. h.prototype.getImage = function(e) {
  16252. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16253. }
  16254. ,
  16255. h.prototype.filterByModesAndReel = function(e, t) {
  16256. for (var i = [], n = 0; n < t.length; n += 1) {
  16257. var r = t[n]
  16258. , o = this.index[r.sid];
  16259. o && i.push(o)
  16260. }
  16261. var a = e[d.DOLLHOUSE]
  16262. , s = e[d.FLOORPLAN];
  16263. (i = i.filter(function(e) {
  16264. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16265. return !0;
  16266. var t;
  16267. try {
  16268. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16269. } catch (e) {
  16270. return l.debug(e.message),
  16271. !1
  16272. }
  16273. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16274. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16275. this.list = i,
  16276. this.reIndex()
  16277. }
  16278. ,
  16279. h.prototype.getHeroLocations = function(e) {
  16280. if (0 === this.list.length)
  16281. return [];
  16282. for (var t = [], i = 0; i < this.list.length; ++i) {
  16283. var n = this.list[i]
  16284. , r = n.thumbnail_signed_src
  16285. , o = n.name || "";
  16286. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16287. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16288. var a = e.get(n.metadata.scan_id);
  16289. if (a && !a.isAligned())
  16290. continue
  16291. }
  16292. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16293. if (s === d.MESH)
  16294. continue;
  16295. var l = {
  16296. cameraMode: s,
  16297. position: n.metadata.camera_position,
  16298. quaternion: n.metadata.camera_quaternion,
  16299. zoom: n.metadata.zoom,
  16300. panoId: n.metadata.scan_id,
  16301. orthoZoom: n.metadata.ortho_zoom,
  16302. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16303. thumbUrl: "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime(),
  16304. name: h.filterImageName(o),
  16305. sid: n.sid
  16306. }
  16307. , c = new p(l);
  16308. t.push(c)
  16309. }
  16310. }
  16311. return t
  16312. }
  16313. ,
  16314. h.prototype.getIndex = function(e) {
  16315. return e.sid
  16316. }
  16317. ,
  16318. h.filterImageName = function(e) {
  16319. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16320. }
  16321. ,
  16322. o.exports = h
  16323. }
  16324. ).call(this, "/js/model/ImageCollection.js")
  16325. }
  16326. , {
  16327. "../enum/Viewmode": 51,
  16328. "../objects/Snapshot": 153,
  16329. "../settings": 166,
  16330. "../util/IndexedCollection": 175,
  16331. "../util/common": 185,
  16332. "../util/logger": 189,
  16333. "../util/math": 190
  16334. }],
  16335. 138: [function(h, u, e) {
  16336. (function(e) {
  16337. "use strict";
  16338. function n() {
  16339. c.call(this)
  16340. }
  16341. var r = h("../label/Label")
  16342. , i = h("../settings")
  16343. , t = h("../util/logger")
  16344. , o = h("../util/math")
  16345. , a = h("../util/ajax")
  16346. , s = h("./RoomCollection")
  16347. , l = h("../util/common")
  16348. , c = h("../util/IndexedCollection");
  16349. new t(e),
  16350. l.inherit(n, c),
  16351. n.prototype.getIndex = function(e) {
  16352. return e.labelId
  16353. }
  16354. ,
  16355. n.prototype.associateWithRooms = function(e) {
  16356. this.forEach(function(t) {
  16357. e.forEach(function(e) {
  16358. e.roomId === t.roomId && (t.room = e)
  16359. })
  16360. })
  16361. }
  16362. ,
  16363. n.prototype.createFromLabelData = function(e) {
  16364. e.forEach(function(e) {
  16365. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16366. t = s.generateRoomId(e.floorId, t);
  16367. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16368. i.position = o.convertWorkshopVector(i.position),
  16369. this.add(i),
  16370. i.build()
  16371. }
  16372. .bind(this))
  16373. }
  16374. ,
  16375. n.prototype.load = function(e, t) {
  16376. return a.get(e, {
  16377. responseType: "json",
  16378. auth: t ? i.authorizationHeader : null
  16379. }).done(function(e) {
  16380. var t = [];
  16381. for (var i in e) {
  16382. var n = e[i];
  16383. t.push(n)
  16384. }
  16385. this.createFromLabelData(t)
  16386. }
  16387. .bind(this))
  16388. }
  16389. ,
  16390. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16391. var t = -1;
  16392. if (e) {
  16393. var i = e.split("_");
  16394. t = parseInt(i[0])
  16395. }
  16396. return t
  16397. }
  16398. ,
  16399. u.exports = n
  16400. }
  16401. ).call(this, "/js/model/LabelCollection.js")
  16402. }
  16403. , {
  16404. "../label/Label": 90,
  16405. "../settings": 166,
  16406. "../util/IndexedCollection": 175,
  16407. "../util/ajax": 181,
  16408. "../util/common": 185,
  16409. "../util/logger": 189,
  16410. "../util/math": 190,
  16411. "./RoomCollection": 141
  16412. }],
  16413. 139: [function(P, O, e) {
  16414. (function(e) {
  16415. "use strict";
  16416. function t(e, t) {
  16417. o.Object3D.call(this),
  16418. this.sid = t.sid,
  16419. this.data = t,
  16420. this.options = e,
  16421. this.urls = new i(e.urlFiles),
  16422. this.isPublic = void 0 !== t.is_public && t.is_public,
  16423. this.images = new E(this),
  16424. this.images.extend(t.images),
  16425. this.heroImage = this.images.getImage(t.icon),
  16426. this.heroLocations = [],
  16427. this.outdoorPanoLocations = [],
  16428. this.floors = new c(this),
  16429. this.floorsEnabled = void 0 === e.floors || e.floors,
  16430. this.changingFloor = !1,
  16431. this.chunks = [],
  16432. this.panos = new g,
  16433. this.colliders = [],
  16434. this.loadPanosPromise = null,
  16435. this.loadMeshTexturesPromise = null,
  16436. this.auxDataPromise = null,
  16437. this.meshTexturesLoaded = !1,
  16438. this.meshTextures = [],
  16439. this.tags = {},
  16440. this.tagsShown = !1,
  16441. this.shouldShowtags = !1,
  16442. this.has360Views = !1,
  16443. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16444. this.supportedModes = {},
  16445. this.supportedModes[s.PANORAMA] = !0,
  16446. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16447. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16448. this.supportedModes[s.TRANSITIONING] = !0,
  16449. this.supportsTiles = this.configureTiling(),
  16450. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || !0,
  16451. this.mode = s.DOLLHOUSE,
  16452. this.size = null,
  16453. this.center = null,
  16454. this.boundingBox = new o.Box3,
  16455. this.currentFloor = null,
  16456. this.allFloorsVisible = !0,
  16457. this.projectedPano0 = null,
  16458. this.projectedPano1 = null,
  16459. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16460. this.addFloor(new r(this,t,e.trim()))
  16461. }
  16462. .bind(this)),
  16463. this.waitQueue = [],
  16464. this.on("load", function(e) {
  16465. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16466. return !e.isLoadedCallback()
  16467. }),
  16468. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16469. }
  16470. .bind(this)),
  16471. this.setupCustomProperties(),
  16472. this.hots = {}
  16473. }
  16474. var o = P("three")
  16475. , a = P("../util/ajax")
  16476. , i = P("../util/ModelUrls")
  16477. , n = P("../objects/BoundingTextureSkybox")
  16478. , s = P("../enum/Viewmode")
  16479. , l = P("../enum/RenderOrder")
  16480. , r = (P("../enum/AlignmentType"),
  16481. P("../objects/Floor"))
  16482. , c = P("./FloorCollection")
  16483. , h = P("../objects/Chunk")
  16484. , u = (P("../objects/Room"),
  16485. P("../objects/Snapshot"),
  16486. P("../label/Label"),
  16487. P("../util/math"),
  16488. P("../settings"))
  16489. , d = P("../shaders")
  16490. , p = P("../util/logger")
  16491. , f = (P("../tag/tag"),
  16492. P("../tag/tagManager"),
  16493. P("../objects/Panorama"))
  16494. , g = P("../util/PanoramaCollection")
  16495. , m = P("../loaders/ModelLoader")
  16496. , v = P("../loaders/ModelTextureLoader")
  16497. , y = P("../loaders/SweepDataLoader")
  16498. , A = P("../util/transitions")
  16499. , C = (P("../util/easing"),
  16500. P("../util/lerp"),
  16501. P("../util/common"))
  16502. , I = (P("../util/texture"),
  16503. P("./../util/browser"))
  16504. , E = P("./ImageCollection")
  16505. , _ = P("./RoomCollection")
  16506. , b = P("./LabelCollection")
  16507. , w = P("./Chunks")
  16508. , T = P("./../util/showcase")
  16509. , x = P("../exception/BasicException")
  16510. , S = (P("../constants"),
  16511. P("events").EventEmitter)
  16512. , M = P("hot")
  16513. , R = new p(e);
  16514. t.prototype = Object.create(o.Object3D.prototype),
  16515. C.extend(t, S),
  16516. t.prototype.setupCustomProperties = function() {
  16517. var t = u.modelAlpha;
  16518. Object.defineProperty(this, "alpha", {
  16519. get: function() {
  16520. return t
  16521. },
  16522. set: function(e) {
  16523. t = e,
  16524. this.chunks.forEach(function(e) {
  16525. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16526. })
  16527. }
  16528. })
  16529. }
  16530. ,
  16531. t.prototype.configureTiling = function() {
  16532. var e = function() {
  16533. try {
  16534. var e = document.createElement("canvas")
  16535. , t = e.getContext("webgl");
  16536. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16537. } catch (e) {
  16538. return 0
  16539. }
  16540. }();
  16541. if (e < 2048)
  16542. return !1;
  16543. R.warn("Max cube texture size: " + e);
  16544. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16545. var i = u.tiling.tilingFlagNames[t];
  16546. if ("1" === I.valueFromHash(i, null))
  16547. return !0;
  16548. if ("0" === I.valueFromHash(i, null))
  16549. return !1
  16550. }
  16551. return !!T.modelDataPromisesTiles(this.data)
  16552. }
  16553. ,
  16554. t.prototype.toggleAlpha = function() {
  16555. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16556. }
  16557. ,
  16558. t.prototype.load = function(e) {
  16559. var t = this.urls.init().then(function() {
  16560. return $.when(this.loadPanos(), this.loadMesh())
  16561. }
  16562. .bind(this));
  16563. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16564. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16565. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16566. }
  16567. ,
  16568. t.prototype.loadMesh = function() {
  16569. var n = $.Deferred()
  16570. , r = this;
  16571. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16572. if (0 === e.length) {
  16573. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16574. r.supportedModes[s.DOLLHOUSE] = !1,
  16575. r.supportedModes[s.FLOORPLAN] = !1;
  16576. var i = new h({
  16577. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16578. });
  16579. i.material.visible = !1,
  16580. i.rotateX(-Math.PI / 2),
  16581. i.geometry.computeBoundingBox(),
  16582. e = [i]
  16583. }
  16584. e.forEach(function(e) {
  16585. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16586. r.addChunk(t, e)
  16587. }),
  16588. r.floors.sort(),
  16589. n.resolve(r)
  16590. }, function(e, t) {
  16591. n.notify(e, t)
  16592. }, function(e) {
  16593. R.error(e),
  16594. n.reject("loading-failed")
  16595. }),
  16596. n.promise()
  16597. }
  16598. ,
  16599. t.prototype.loadMeshTextures = function() {
  16600. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16601. this.meshTexturesLoaded = !0
  16602. }
  16603. .bind(this))),
  16604. this.loadTexturesPromise
  16605. }
  16606. ,
  16607. t.prototype.shineHots = function() {
  16608. A.trigger({
  16609. func: function(e) {
  16610. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16611. for(var i in this.hots){
  16612. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16613. }
  16614. }
  16615. .bind(this),
  16616. cycling: !0,
  16617. duration: 3e3,
  16618. name: "hotShine"
  16619. })
  16620. }
  16621. ,
  16622. t.prototype.createHotItem = function(e, t) {
  16623. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16624. var o = document.createElement("li")
  16625. , a = document.createElement("span");
  16626. a.innerHTML = e[n[r]].title || "热点",
  16627. o.hot = t[n[r]],
  16628. o.appendChild(a),
  16629. i.appendChild(o)
  16630. }
  16631. document.querySelector("#hotListContent ul").appendChild(i),
  16632. console.log(i)
  16633. }
  16634. ,
  16635. t.prototype.loadOverlays = function(overlays){
  16636. var overlays = window.data2.overlays /* ||
  16637. [
  16638. { depth: 0.02,
  16639. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16640. hasBox: 0,
  16641. height: 0.8165,
  16642. media: ["video"],
  16643. pos: [-4.3132, 0.6788, -13.5162],
  16644. qua: [0, 0.9396, 0, 0.3421],
  16645. sid: "1591079418827",
  16646. width: 0.6124
  16647. }] */
  16648. overlays && overlays.forEach((info)=>{
  16649. new Overlay(info)
  16650. })
  16651. }
  16652. ,
  16653. t.prototype.loadhots = function() {
  16654. var r = $.Deferred()
  16655. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16656. return a.get(e, {
  16657. responseType: "json",
  16658. auth: this.isPublic ? null : u.authorizationHeader
  16659. }).done(function(e) {
  16660. window.data2 = e;
  16661. for (var t in g_data2 = hotMatcher(e),
  16662. this.hotsCount = 0,
  16663. e.hots)
  16664. this.hotsCount++,
  16665. this.hots[t] = new M(t,e.hots[t],this);
  16666. g_index = I.valueFromHash("m"),
  16667. e.tourAudio && (g_tourAudio = new Audio,
  16668. g_tourAudio.loop = !1,
  16669. g_tourAudio.addEventListener("ended", function() {
  16670. var e = document.createEvent("MouseEvent");
  16671. e.initEvent("tourAudioEnded", !0, !0),
  16672. window.dispatchEvent(e)
  16673. }));
  16674. var i = $.Deferred()
  16675. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16676. a.get(n, {
  16677. responseType: "json",
  16678. auth: this.isPublic ? null : u.authorizationHeader
  16679. }).done(function(e) {
  16680. window.hotData = e,
  16681. this.createHotItem(e, this.hots);
  16682. for(let i in this.hots){
  16683. e[i] && this.hots[i].initStyleImg(e[i]);
  16684. }
  16685. i.resolve()
  16686. }
  16687. .bind(this)).fail(function() {
  16688. console.log("Data.js is empty"),
  16689. i.resolve()
  16690. }),
  16691. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc),
  16692. window.wx && manage.weixinShare(),
  16693. r.resolve()
  16694. }
  16695. .bind(this)).fail(function() {
  16696. console.log("没有热点"),
  16697. window.wx && manage.weixinShare(),
  16698. r.resolve()
  16699. }),
  16700. r
  16701. }
  16702. ,
  16703. t.prototype.loadPanos = function() {
  16704. if (this.loadPanosPromise)
  16705. return this.loadPanosPromise;
  16706. var e = new y(this);
  16707. return this.loadPanosPromise = e.load().then(function(e) {
  16708. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16709. return this.data.sweeps[e.uuid].enabled
  16710. }
  16711. .bind(this))),
  16712. this.panos.extend(e.map(function(e) {
  16713. return new f(this,e.uuid,e,this.supportsTiles)
  16714. }
  16715. .bind(this))),
  16716. this.panos.forEach(function(i) {
  16717. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16718. var t = this.panos.get(e);
  16719. t && this.panos.setNeighbour(i, t, !0)
  16720. }
  16721. .bind(this)),
  16722. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16723. }
  16724. .bind(this)),
  16725. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16726. this.supportedModes[s.PANORAMA] = !1),
  16727. $.when(this)
  16728. }
  16729. .bind(this)),
  16730. this.loadPanosPromise
  16731. }
  16732. ,
  16733. t.prototype.loadHighlightReel = function() {
  16734. var t = $.Deferred()
  16735. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16736. return a.get(e, {
  16737. responseType: "json",
  16738. auth: this.isPublic ? null : u.authorizationHeader
  16739. }).done(function(e) {
  16740. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16741. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16742. t.resolve()
  16743. }
  16744. .bind(this)).fail(function() {
  16745. R.warn("Getting highlight reel failed, no highlights available"),
  16746. t.resolve()
  16747. }),
  16748. t
  16749. }
  16750. ,
  16751. t.prototype.waitForLoad = function(e, t) {
  16752. t() || (this.waitQueue.push({
  16753. object: e,
  16754. isLoadedCallback: t
  16755. }),
  16756. 1 === this.waitQueue.length && this.emit("waiting"))
  16757. }
  16758. ,
  16759. t.prototype.hide = function() {
  16760. this.floors.hide()
  16761. }
  16762. ,
  16763. t.prototype.show = function() {
  16764. this.floors.show()
  16765. }
  16766. ,
  16767. t.prototype.floorNames = function() {
  16768. return this.floors.names()
  16769. }
  16770. ,
  16771. t.prototype.warpDestFloors = function(e, t) {
  16772. if (e && this.floors.length === e.length) {
  16773. var i = e.findIndex(function(e) {
  16774. return e
  16775. }
  16776. .bind(this));
  16777. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16778. } else
  16779. this.toggleAllFloors(!0)
  16780. }
  16781. ,
  16782. t.prototype.setFloor = function(e, t, i) {
  16783. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16784. this.allFloorsVisible = !1,
  16785. this._setFloor(e, t, i)
  16786. }
  16787. ,
  16788. t.prototype.toggleAllFloors = function(e) {
  16789. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16790. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16791. this._setFloor(this.currentFloor)
  16792. }
  16793. ,
  16794. t.prototype._setFloor = function(e, t, i) {
  16795. var n;
  16796. if (t = t || this.mode,
  16797. this.emit("floor.changed", e, t, this.currentFloor),
  16798. this.currentFloor = e,
  16799. t === s.PANORAMA) {
  16800. if (this.show(),
  16801. this.shouldShowtags && this.tagsShown)
  16802. for (n in this.tags)
  16803. this.tags[n].show(u.showFloorDuration)
  16804. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16805. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16806. }
  16807. .bind(this)),
  16808. this.shouldShowtags && this.tagsShown))
  16809. for (n in this.tags) {
  16810. var r = this.tags[n];
  16811. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16812. }
  16813. var o = this
  16814. , a = e;
  16815. A.start(function() {}, u.showFloorDelay, function() {
  16816. o.floors.forEach(function(t) {
  16817. t.chunks.forEach(function(e) {
  16818. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16819. })
  16820. })
  16821. }
  16822. .bind(this))
  16823. }
  16824. ,
  16825. t.prototype.toggleExplode = function() {
  16826. this.floors.toggleExplodeHorizontal()
  16827. }
  16828. ,
  16829. t.prototype.toggleExplodeUp = function() {
  16830. this.floors.toggleExplodeVertical()
  16831. }
  16832. ,
  16833. t.prototype.nextFloor = function(e) {
  16834. return this.floors.nextFloor(this.currentFloor, e)
  16835. }
  16836. ,
  16837. t.prototype.addFloor = function(e) {
  16838. this.floors.add(e)
  16839. }
  16840. ,
  16841. t.prototype.getFloorAtPoint = function(e) {
  16842. return this.floors.getFloorAtPoint(e)
  16843. }
  16844. ,
  16845. t.prototype.getTagBySid = function(e) {
  16846. return this.tags[e]
  16847. }
  16848. ,
  16849. t.prototype.addChunk = function(e, t) {
  16850. this.floors.getOrMakeFloor(e).addChunk(t),
  16851. this.chunks.push(t)
  16852. }
  16853. ,
  16854. t.prototype.setMode = function(t) {
  16855. if (!this.supportedModes[t])
  16856. throw new x("Mode not supported for this model: " + t);
  16857. this.mode = t,
  16858. this.chunks.forEach(function(e) {
  16859. e.setMode(t)
  16860. })
  16861. }
  16862. ,
  16863. t.prototype.build = function() {
  16864. this.heroLocations = this.images.getHeroLocations(this.panos);
  16865. var e = function() {
  16866. return !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  16867. }
  16868. .bind(this)();
  16869. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16870. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16871. }
  16872. .bind(this)) || e,
  16873. null === this.heroImage && R.warn("No hero image defined."),
  16874. this.currentFloor = this.floors.last(),
  16875. this.floors.build(),
  16876. this.colliders = this.floors.reduce(function(e, t) {
  16877. return e.concat(t.collider.children)
  16878. }, []),
  16879. this.panos.forEach(function(e) {
  16880. e.build1(),
  16881. e.on("enter", function() {
  16882. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16883. }
  16884. .bind(this))
  16885. }
  16886. .bind(this)),
  16887. this.panos.forEach(function(e) {
  16888. e.build2()
  16889. }),
  16890. this.floors.forEach(function(e) {
  16891. this.boundingBox.union(e.boundingBox)
  16892. }
  16893. .bind(this)),
  16894. this.size = this.boundingBox.size(),
  16895. this.center = this.boundingBox.center(),
  16896. this.floors.forEach(function(e) {
  16897. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16898. }
  16899. .bind(this)),
  16900. this.panos.populate_path_graph(),
  16901. this.skybox = new n(this.boundingBox),
  16902. this.skybox.matrixWorldNeedsUpdate = !0,
  16903. this.add(this.skybox),
  16904. setTimeout(function() {
  16905. this.hotsCount && this.shineHots()
  16906. }
  16907. .bind(this), 1300),
  16908. this.tags)
  16909. this.tags[t].build();
  16910. return R.debug("Done building model"),
  16911. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16912. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16913. this.buildRooms(),
  16914. this.labels.associateWithRooms(this.rooms),
  16915. $.when(this)
  16916. }
  16917. ,
  16918. t.prototype.loadLabels = function() {
  16919. this.labels = new b(this);
  16920. var e = $.Deferred();
  16921. if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  16922. !this.showingLabels)
  16923. return e.resolve();
  16924. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16925. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16926. R.warn("Getting labels failed, not displaying labels."),
  16927. e.resolve()
  16928. }),
  16929. e
  16930. }
  16931. ,
  16932. t.prototype.buildRooms = function() {
  16933. this.rooms = new _(this),
  16934. this.rooms.createFromChunks(this.chunks),
  16935. this.rooms.calcRoomBoundaries()
  16936. }
  16937. ,
  16938. t.prototype.updateProjectedPanos = function() {
  16939. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16940. }
  16941. ,
  16942. t.prototype.setProjectedPanos = function(t, i, n) {
  16943. null != n || (n = !0),
  16944. n = !!n,
  16945. this.projectedPano0 = t,
  16946. this.projectedPano1 = i,
  16947. this.skybox.material.setProjectedPanos(t, i, n),
  16948. this.chunks.forEach(function(e) {
  16949. e.materialInside.setProjectedPanos(t, i, n)
  16950. })
  16951. }
  16952. ,
  16953. t.prototype.setSide = function(t) {
  16954. this.floors.forEach(function(e) {
  16955. e.collider.material.side = t
  16956. })
  16957. }
  16958. ,
  16959. t.prototype.heroCount = function() {
  16960. return this.heroLocations ? this.heroLocations.length : 0
  16961. }
  16962. ,
  16963. t.prototype.getHeroDescriptorByIndex = function(e) {
  16964. if (e < 0)
  16965. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  16966. null;
  16967. if (this.heroCount() < 1)
  16968. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  16969. null;
  16970. var t = this.heroLocations[e];
  16971. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  16972. null) : t
  16973. }
  16974. ,
  16975. t.prototype.findPanoramicHero = function() {
  16976. for (var e in this.heroLocations)
  16977. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  16978. return this.heroLocations[e];
  16979. return null
  16980. }
  16981. ,
  16982. t.prototype.listImagePanos = function() {
  16983. var i = []
  16984. , n = this;
  16985. return this.images.forEach(function(e) {
  16986. if (e.metadata && e.metadata.scan_id) {
  16987. var t = n.panos.get(e.metadata.scan_id);
  16988. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  16989. }
  16990. }),
  16991. i
  16992. }
  16993. ,
  16994. t.prototype.fadePanoMarkers = function(e, t) {
  16995. this.panos.fadeMarkerOpacity(e, t)
  16996. }
  16997. ,
  16998. t.prototype.setSweepVisibility = function(t) {
  16999. this.panos.forEach(function(e) {
  17000. e.marker && (e.marker.visible = t)
  17001. })
  17002. }
  17003. ,
  17004. t.prototype.outsideAllowed = function() {
  17005. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17006. }
  17007. ,
  17008. O.exports = t
  17009. }
  17010. ).call(this, "/js/model/Model.js")
  17011. }
  17012. , {
  17013. "../constants": 8,
  17014. "../enum/AlignmentType": 17,
  17015. "../enum/RenderOrder": 42,
  17016. "../enum/Viewmode": 51,
  17017. "../exception/BasicException": 55,
  17018. "../label/Label": 90,
  17019. "../loaders/ModelLoader": 105,
  17020. "../loaders/ModelTextureLoader": 106,
  17021. "../loaders/SweepDataLoader": 107,
  17022. "../tag/tag": 123,
  17023. "../tag/tagManager": 124,
  17024. "../objects/BoundingTextureSkybox": 143,
  17025. "../objects/Chunk": 144,
  17026. "../objects/Floor": 146,
  17027. "../objects/Panorama": 148,
  17028. "../objects/Room": 150,
  17029. "../objects/Snapshot": 153,
  17030. "../settings": 166,
  17031. "../shaders": 167,
  17032. "../util/ModelUrls": 177,
  17033. "../util/PanoramaCollection": 178,
  17034. "../util/ajax": 181,
  17035. "../util/common": 185,
  17036. "../util/easing": 186,
  17037. "../util/lerp": 188,
  17038. "../util/logger": 189,
  17039. "../util/math": 190,
  17040. "../util/texture": 194,
  17041. "../util/transitions": 195,
  17042. "./../util/browser": 182,
  17043. "./../util/showcase": 193,
  17044. "./Chunks": 135,
  17045. "./FloorCollection": 136,
  17046. "./ImageCollection": 137,
  17047. "./LabelCollection": 138,
  17048. "./RoomCollection": 141,
  17049. events: 202,
  17050. three: 217,
  17051. hot: "hot"
  17052. }],
  17053. 140: [function(e, t, i) {
  17054. "use strict";
  17055. function n() {
  17056. this.modelMap = {},
  17057. this.activeModel = null,
  17058. this.modelCount = 0,
  17059. this.tileDownloader = null,
  17060. this.panoRenderer = null
  17061. }
  17062. var r = (e("three"),
  17063. e("../util/common"))
  17064. , o = e("../exception/BasicException")
  17065. , a = e("../enum/ModelManagerEvents")
  17066. , s = e("../enum/PanoRendererEvents")
  17067. , l = e("events").EventEmitter;
  17068. n.prototype.init = function(e, t, i) {
  17069. this.tileDownloader = e,
  17070. this.panoRenderer = t,
  17071. this.qualityManager = i,
  17072. this.bindEvents()
  17073. }
  17074. ,
  17075. n.prototype.bindEvents = function() {
  17076. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17077. }
  17078. ,
  17079. n.prototype.onTileRendered = function(e, t, i, n) {}
  17080. ,
  17081. n.prototype.addModel = function(e) {
  17082. this.modelMap[e.sid] = e,
  17083. 0 === this.modelCount && this.activateModel(e.sid),
  17084. this.modelCount++,
  17085. this.emit(a.ModelAdded)
  17086. }
  17087. ,
  17088. n.prototype.getModel = function(e) {
  17089. return this.modelMap[e]
  17090. }
  17091. ,
  17092. n.prototype.activateModel = function(e) {
  17093. var t = this.modelMap[e];
  17094. if (!t)
  17095. throw new o("Tried to activate invalid model!");
  17096. var i = this.activeModel;
  17097. this.activeModel = t,
  17098. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17099. this.tileDownloader.setUrls(t.urls),
  17100. t.panos.forEach(function(e) {
  17101. e.attachToPanoRenderer(this.panoRenderer),
  17102. e.tileDownloader = this.tileDownloader,
  17103. e.qualityManager = this.qualityManager
  17104. }
  17105. .bind(this)),
  17106. this.emit(a.ActiveModelChanged, {
  17107. oldModel: i,
  17108. model: t
  17109. })
  17110. }
  17111. ,
  17112. n.prototype.getActiveModel = function() {
  17113. return this.activeModel
  17114. }
  17115. ,
  17116. r.extend(n, l),
  17117. t.exports = n
  17118. }
  17119. , {
  17120. "../enum/ModelManagerEvents": 33,
  17121. "../enum/PanoRendererEvents": 35,
  17122. "../exception/BasicException": 55,
  17123. "../util/common": 185,
  17124. events: 202,
  17125. three: 217
  17126. }],
  17127. 141: [function(r, l, e) {
  17128. (function(e) {
  17129. "use strict";
  17130. function o() {
  17131. n.call(this)
  17132. }
  17133. var a = r("../objects/Room")
  17134. , t = (r("../settings"),
  17135. r("../util/logger"))
  17136. , i = (r("../util/transitions"),
  17137. r("../util/easing"),
  17138. r("../util/common"))
  17139. , n = r("../util/IndexedCollection")
  17140. , s = r("./Chunks");
  17141. new t(e),
  17142. i.inherit(o, n),
  17143. o.prototype.getIndex = function(e) {
  17144. return e.roomId
  17145. }
  17146. ,
  17147. o.prototype.calcRoomBoundaries = function() {
  17148. this.forEach(function(e) {
  17149. e.calcBoundaries()
  17150. })
  17151. }
  17152. ,
  17153. o.prototype.createFromChunks = function(e) {
  17154. var n = {
  17155. floorId: -1,
  17156. roomId: -1
  17157. }
  17158. , r = {};
  17159. e.forEach(function(e) {
  17160. s.parseIdsFromChunkName(e.name, n);
  17161. var t = r[n.roomId];
  17162. if (!t) {
  17163. var i = o.generateRoomId(n.floorId, n.roomId);
  17164. t = new a(n.floorId,i),
  17165. this.add(t),
  17166. r[n.roomId] = t
  17167. }
  17168. t.addChunk(e)
  17169. }
  17170. .bind(this)),
  17171. this.calcRoomBoundaries()
  17172. }
  17173. ,
  17174. o.generateRoomId = function(e, t) {
  17175. return e + "_" + t
  17176. }
  17177. ,
  17178. l.exports = o
  17179. }
  17180. ).call(this, "/js/model/RoomCollection.js")
  17181. }
  17182. , {
  17183. "../objects/Room": 150,
  17184. "../settings": 166,
  17185. "../util/IndexedCollection": 175,
  17186. "../util/common": 185,
  17187. "../util/easing": 186,
  17188. "../util/logger": 189,
  17189. "../util/transitions": 195,
  17190. "./Chunks": 135
  17191. }],
  17192. 142: [function(e, t, i) {
  17193. "use strict";
  17194. function n(e, t, i) {
  17195. var n = (e = e.clone()).size()
  17196. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17197. r.boundingBox = e,
  17198. o.Mesh.call(this, r, t),
  17199. this.position.copy(e.center()),
  17200. this.frustumCulled = !1,
  17201. i && this.add(new o.WireframeHelper(this))
  17202. }
  17203. var o = e("three");
  17204. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17205. t.exports = n
  17206. }
  17207. , {
  17208. three: 217
  17209. }],
  17210. 143: [function(l, c, e) {
  17211. (function(e) {
  17212. "use strict";
  17213. function t(e) {
  17214. s.time("Computing a nice bounding cubemap");
  17215. var t = new r({
  17216. side: i.BackSide,
  17217. transparent: !0
  17218. });
  17219. t.uniforms.modelAlpha.value = 0,
  17220. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17221. this.renderOrder = a.boundingSkybox,
  17222. n.call(this, e, t),
  17223. s.timeEnd("Computing a nice bounding cubemap")
  17224. }
  17225. var i = l("three")
  17226. , n = (l("../enum/Viewmode"),
  17227. l("../shaders"),
  17228. l("./BoundingMesh"))
  17229. , r = l("../materials/ModelTextureMaterial")
  17230. , o = l("../settings")
  17231. , a = l("../enum/RenderOrder")
  17232. , s = new (l("../util/logger"))(e);
  17233. (t.prototype = Object.create(n.prototype)).constructor = t,
  17234. c.exports = t
  17235. }
  17236. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17237. }
  17238. , {
  17239. "../enum/RenderOrder": 42,
  17240. "../enum/Viewmode": 51,
  17241. "../materials/ModelTextureMaterial": 118,
  17242. "../settings": 166,
  17243. "../shaders": 167,
  17244. "../util/logger": 189,
  17245. "./BoundingMesh": 142,
  17246. three: 217
  17247. }],
  17248. 144: [function(e, t, i) {
  17249. "use strict";
  17250. function n(e) {
  17251. this.materialInside = new s({
  17252. side: r.DoubleSide
  17253. });
  17254. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17255. this.materialOutside = new r.RawShaderMaterial({
  17256. fragmentShader: o.modelOutside.fragmentShader,
  17257. vertexShader: o.modelOutside.vertexShader,
  17258. uniforms: t,
  17259. side: r.FrontSide,
  17260. name: "chunkOut"
  17261. }),
  17262. r.Mesh.call(this, e.geometry, this.materialInside),
  17263. this.name = e.name || "",
  17264. this.textureName = e.textureName,
  17265. this.meshUrl = e.meshUrl
  17266. }
  17267. var r = e("three")
  17268. , o = e("../shaders")
  17269. , a = e("../enum/Viewmode")
  17270. , s = e("../materials/ModelTextureMaterial");
  17271. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17272. this.materialInside.uniforms.map.value = e,
  17273. this.materialOutside.uniforms.map.value = e
  17274. }
  17275. ,
  17276. n.prototype.setMode = function(e) {
  17277. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17278. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17279. t.transparent = this.material.transparent,
  17280. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17281. this.material = t
  17282. }
  17283. ,
  17284. t.exports = n
  17285. }
  17286. , {
  17287. "../enum/Viewmode": 51,
  17288. "../materials/ModelTextureMaterial": 118,
  17289. "../shaders": 167,
  17290. three: 217
  17291. }],
  17292. 145: [function(e, t, i) {
  17293. "use strict";
  17294. function n(e) {
  17295. this.chunksize = e || 10,
  17296. this.chunks = {},
  17297. this.boundingBoxes = {},
  17298. this.children = [],
  17299. this.offset = new m.Vector3(0,.5,0),
  17300. this.material = new m.MeshBasicMaterial({
  17301. color: 16777215 * Math.random(),
  17302. side: m.DoubleSide
  17303. })
  17304. }
  17305. var m = e("three");
  17306. e("../enum/Viewmode"),
  17307. n.prototype.add = function(e) {
  17308. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17309. u ? (t = u.position.array,
  17310. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17311. e.faces);
  17312. var d = new m.Vector3;
  17313. if (i)
  17314. for (n = 0,
  17315. r = i.length; n < r; n += 3) {
  17316. var p = 3 * i[n]
  17317. , f = 3 * i[n + 1]
  17318. , g = 3 * i[n + 2];
  17319. o = (t[p] + t[f] + t[g]) / 3,
  17320. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17321. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17322. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17323. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17324. this.boundingBoxes[l] = new m.Box3),
  17325. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17326. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17327. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17328. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17329. }
  17330. else
  17331. for (n = 0,
  17332. r = t.length; n < r; n += 9)
  17333. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17334. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17335. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17336. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17337. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17338. this.boundingBoxes[l] = new m.Box3),
  17339. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17340. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17341. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17342. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17343. }
  17344. ,
  17345. n.prototype.build = function() {
  17346. var e = new m.Object3D;
  17347. for (var t in e.material = this.material,
  17348. this.chunks) {
  17349. var i = this.chunks[t]
  17350. , n = new m.BufferGeometry;
  17351. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17352. n.boundingBox = this.boundingBoxes[t];
  17353. var r = new m.Mesh(n,this.material);
  17354. r.material.visible = !1,
  17355. e.add(r),
  17356. this.chunks[t] = []
  17357. }
  17358. return e
  17359. }
  17360. ,
  17361. t.exports = n
  17362. }
  17363. , {
  17364. "../enum/Viewmode": 51,
  17365. three: 217
  17366. }],
  17367. 146: [function(e, t, i) {
  17368. "use strict";
  17369. var n = e("three")
  17370. , r = e("../settings")
  17371. , o = e("../util/common")
  17372. , a = e("../util/lerp")
  17373. , s = e("./ChunkedCollider")
  17374. , l = e("../util/transitions")
  17375. , c = e("../util/easing")
  17376. , h = (e("../objects/Panorama"),
  17377. e("../enum/RenderOrder"));
  17378. e("../localization/localize");
  17379. function u(e, t, i) {
  17380. n.Object3D.call(this),
  17381. this.model = e,
  17382. this.floorIndex = t,
  17383. this.lang = r.languageTag,
  17384. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17385. this.panos = [],
  17386. this.chunks = [],
  17387. this.colliderBuilder = new s(3),
  17388. this.collider = null,
  17389. this.center = null,
  17390. this.boundingBox = new n.Box3,
  17391. this.size = null,
  17392. this.hidden = !1,
  17393. this.conservativeBoundingBox = new n.Box3,
  17394. this.debugColor = 16777215 * Math.random(),
  17395. this.transition = null
  17396. }
  17397. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17398. this.model.setFloor(this, e)
  17399. }
  17400. ,
  17401. u.prototype.hide = function(e) {
  17402. if (!this.hidden || this.transition) {
  17403. this.chunks.forEach(function(e) {
  17404. e.material.transparent = !0
  17405. }),
  17406. l.cancel(this.transition);
  17407. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17408. , i = e ? 0 : r.hideFloorDelay / t;
  17409. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17410. this.hidden = !0
  17411. }
  17412. .bind(this), i, c.easeInOutQuad)
  17413. }
  17414. }
  17415. ,
  17416. u.prototype.show = function(e) {
  17417. if (this.hidden || this.transition) {
  17418. this.hidden = !1,
  17419. l.cancel(this.transition);
  17420. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17421. , i = e ? 0 : r.showFloorDelay / t;
  17422. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17423. this.hidden || this.chunks.forEach(function(e) {
  17424. e.material.transparent = !1
  17425. })
  17426. }
  17427. .bind(this), i, c.easeInOutQuad)
  17428. }
  17429. }
  17430. ,
  17431. u.prototype.toggle = function(e, t) {
  17432. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17433. }
  17434. ,
  17435. u.prototype.containsPoint = function(t) {
  17436. return this.collider.children.some(function(e) {
  17437. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17438. e.geometry.boundingBox.containsPoint(t)
  17439. })
  17440. }
  17441. ,
  17442. u.prototype.distanceToPoint = function(i) {
  17443. var n = null
  17444. , r = 1 / 0;
  17445. return this.collider.children.forEach(function(e) {
  17446. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17447. var t = e.geometry.boundingBox.distanceToPoint(i);
  17448. (!n || t < r) && (r = t,
  17449. n = e)
  17450. }),
  17451. r
  17452. }
  17453. ,
  17454. u.prototype.addChunk = function(e) {
  17455. e.renderOrder = h.ghostFloor,
  17456. this.add(e),
  17457. this.chunks.push(e),
  17458. this.boundingBox.union(e.geometry.boundingBox),
  17459. this.size = this.boundingBox.size(),
  17460. this.colliderBuilder.add(e.geometry)
  17461. }
  17462. ,
  17463. u.prototype.addPano = function(e) {
  17464. this.panos.push(e),
  17465. this.add(e.skyboxMesh),
  17466. e.marker && this.add(e.marker);
  17467. var t = new n.Vector3(1,1,1)
  17468. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17469. this.boundingBox.union(i)
  17470. }
  17471. ,
  17472. u.prototype.build = function() {
  17473. this.collider = this.colliderBuilder.build(!0),
  17474. this.add(this.collider),
  17475. this.center = this.boundingBox.center(),
  17476. this.conservativeBoundingBox.copy(this.boundingBox),
  17477. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17478. return e.geometry.boundingBox.min.y
  17479. }), 5),
  17480. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17481. return e.geometry.boundingBox.max.y
  17482. }), 5),
  17483. this.colliderBuilder = null
  17484. }
  17485. ,
  17486. u.prototype.toShortString = function() {
  17487. return o.nth(this.floorIndex + 1)
  17488. }
  17489. ,
  17490. u.prototype.toString = function() {
  17491. return this.name
  17492. }
  17493. ,
  17494. t.exports = u
  17495. }
  17496. , {
  17497. "../enum/RenderOrder": 42,
  17498. "../localization/localize": 108,
  17499. "./strings-cn-CN": 109,
  17500. "../objects/Panorama": 148,
  17501. "../settings": 166,
  17502. "../util/common": 185,
  17503. "../util/easing": 186,
  17504. "../util/lerp": 188,
  17505. "../util/transitions": 195,
  17506. "./ChunkedCollider": 145,
  17507. three: 217
  17508. }],
  17509. 147: [function(e, t, i) {
  17510. "use strict";
  17511. function n(e) {
  17512. this.player = e,
  17513. this.obj3d = null,
  17514. this.UP = new u.Vector3(0,1,0)
  17515. }
  17516. var u = e("three")
  17517. , d = e("../settings");
  17518. n.prototype.prefs = {
  17519. linewidth: 3,
  17520. height: .07,
  17521. opacity: .45,
  17522. endScale: .05
  17523. },
  17524. n.prototype.discard = function() {
  17525. if (this.obj3d) {
  17526. var e = this.obj3d.parent;
  17527. e && e.remove(this.obj3d)
  17528. }
  17529. this.obj3d = null
  17530. }
  17531. ,
  17532. n.prototype.draw = function() {
  17533. if (this.discard(),
  17534. d.showNeighbors) {
  17535. var e = this.player.currentPano.floor;
  17536. this.obj3d = new u.Object3D;
  17537. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17538. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17539. i.y += this.prefs.height;
  17540. var n = .1525
  17541. , r = new u.Matrix4;
  17542. for (var o in t)
  17543. if (t[o]) {
  17544. var a = this.player.model.panos.get(o)
  17545. , s = (a.position.clone().sub(this.player.model.position),
  17546. a.position.clone().sub(a.floorPosition))
  17547. , l = a.floorPosition.clone().sub(this.player.model.position);
  17548. l.y += this.prefs.height;
  17549. var c = new u.Geometry;
  17550. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  17551. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  17552. r.identity().setPosition(s),
  17553. c.applyMatrix(r),
  17554. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17555. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17556. r.lookAt(l, i, this.UP).setPosition(l),
  17557. c.applyMatrix(r),
  17558. c.vertices.push(l, i);
  17559. var h = new u.Line(c,new u.LineBasicMaterial({
  17560. color: a.debugColor.getHex(),
  17561. transparent: !0,
  17562. opacity: this.prefs.opacity,
  17563. depthWrite: !1,
  17564. name: "sLine" + o,
  17565. linewidth: this.prefs.linewidth
  17566. }));
  17567. this.obj3d.add(h)
  17568. }
  17569. e.add(this.obj3d)
  17570. }
  17571. }
  17572. ,
  17573. n.prototype.update = function() {
  17574. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17575. }
  17576. ,
  17577. t.exports = n
  17578. }
  17579. , {
  17580. "../settings": 166,
  17581. three: 217
  17582. }],
  17583. 148: [function(S, M, e) {
  17584. (function(e) {
  17585. "use strict";
  17586. function r(e, t, i, n) {
  17587. this.model = e,
  17588. this.id = t,
  17589. this.alignmentType = i.alignmentType || c.ALIGNED,
  17590. this.neighbourUUIDs = i.neighbours || null,
  17591. this.neighbourPanos = null,
  17592. this.floor = null,
  17593. this.floorIndex = i.floor,
  17594. this.failedLoadingAt = 0,
  17595. this.maxLoadRetries = 4,
  17596. this.origin = i.position.clone(),
  17597. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17598. this.quaternion = i.quaternion.clone(),
  17599. this.skyboxMesh = new s.Mesh(E),
  17600. this.skyboxMesh.position.copy(this.position),
  17601. this.skyboxMesh.quaternion.copy(this.quaternion),
  17602. this.skyboxMesh.name = "skybox",
  17603. this.skyboxMesh.visible = !1,
  17604. this.skyboxMesh.updateMatrix(),
  17605. this.skyboxMesh.updateMatrixWorld(),
  17606. this.marker = null,
  17607. this.showFloorMarker = this.showFloorMarker = void 0 === window.MP_PREFETCHED_MODELDATA.hideFloorMarker || "false" === window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17608. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17609. map: b,
  17610. side: s.DoubleSide,
  17611. opacity: 0,
  17612. transparent: !0,
  17613. depthWrite: !1,
  17614. visible: this.showFloorMarker
  17615. })),
  17616. this.marker.renderOrder = l.panoMarker,
  17617. this.marker.name = "marker",
  17618. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17619. this.marker.updateMatrixWorld(),
  17620. a.colorMarkerOnLoad && this.on("load", function() {
  17621. this.marker.material.color.set(65280)
  17622. })),
  17623. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17624. this.floorPosition = i.puck ? i.puck.clone() : null,
  17625. this.tiled = n,
  17626. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17627. this.solidSkybox.flipY = !1,
  17628. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17629. this.solidSkybox.magFilter = s.LinearFilter,
  17630. this.solidSkybox.generateMipmaps = !1)),
  17631. this.zoomed = !1,
  17632. this.panoRenderer = null,
  17633. this.qualityManager = null,
  17634. this.tileDownloader = null,
  17635. this.tiledPanoRenderTarget = null,
  17636. this.minimumTiledPanoLoaded = !1,
  17637. this.highestPartialTileRenderOpCompleted = 0,
  17638. this.highestFullTileRenderOpCompleted = 0,
  17639. this.shouldRedrawOnBaseLoaded = !1,
  17640. this.lockUntilRenderingComplete = !1,
  17641. a.colorMarkerOnLoad && this.on("load", function() {
  17642. this.marker.material.color.set(65280)
  17643. }),
  17644. (e = new s.TextureLoader).setCrossOrigin(!0);
  17645. var r = e.load("images/texture.jpg");
  17646. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17647. color: 16777215,
  17648. transparent: !0,
  17649. opacity: .75,
  17650. map: r
  17651. })),
  17652. this.vrMarker.boluoType = "vr",
  17653. this.vrMarker.position.z = 1,
  17654. this.vrMarker.enabled = !0,
  17655. this.vrMarker.visible = !1,
  17656. window.vrMarkers = window.vrMarkers || [],
  17657. window.vrMarkers.push(this.vrMarker),
  17658. this.marker && this.marker.add(this.vrMarker),
  17659. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17660. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17661. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17662. this.adjustAngleEnable) {
  17663. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17664. this.skyboxMesh.quaternion.multiply(i);
  17665. var o = new s.Quaternion;
  17666. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17667. this.skyboxMesh.quaternion.multiply(o),
  17668. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17669. this.skyboxMesh.quaternion.multiply(n),
  17670. this.skyboxMesh.updateMatrix(),
  17671. this.skyboxMesh.updateMatrixWorld(),
  17672. this.model.updateProjectedPanos()
  17673. }
  17674. }
  17675. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17676. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17677. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17678. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17679. S("../enum/GLCubeFaces"),
  17680. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  17681. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17682. function() {
  17683. this.setZoomed(!1),
  17684. this.emit("enter", {
  17685. oldPano: t,
  17686. newPano: this
  17687. }),
  17688. t = this
  17689. }
  17690. ),
  17691. r.prototype.exit = function() {
  17692. this.tiled ? (this.clearWaitDeferreds(),
  17693. this.minimumTiledPanoLoaded = !1,
  17694. this.tiledPanoRenderTarget = null,
  17695. this.setZoomed(!1),
  17696. this.panoRenderer.deactivateTiledPano(this),
  17697. this.highestPartialTileRenderOpCompleted = 0,
  17698. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17699. this.solidSkybox.loaded = !1,
  17700. this.solidSkybox.version = 0),
  17701. this.emit("exit")
  17702. }
  17703. ,
  17704. r.prototype.hoverOn = function(e) {
  17705. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17706. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17707. }
  17708. ,
  17709. r.prototype.hoverOff = function(e) {
  17710. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17711. }
  17712. ,
  17713. r.prototype.build1 = function() {
  17714. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17715. this.floor.addPano(this),
  17716. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17717. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17718. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17719. }
  17720. ,
  17721. r.prototype.build2 = function() {
  17722. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17723. this.height = this.position.distanceTo(this.floorPosition),
  17724. this.placeMarker()
  17725. }
  17726. ,
  17727. r.prototype.interpolateFloorPosition = function() {
  17728. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17729. return !!e.floorPosition
  17730. }).sort(function(e, t) {
  17731. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17732. }
  17733. .bind(this))
  17734. , t = this.position.clone();
  17735. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17736. t
  17737. }
  17738. ,
  17739. r.prototype.raycastFloorPosition = function() {
  17740. I.warn("Performance warning: Raycasting to find floor position");
  17741. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17742. return e.length ? e[0].point : null
  17743. }
  17744. ,
  17745. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  17746. function() {
  17747. I.warn("Performance warning: Raycasting to find floor index");
  17748. for (var e = 0; e < i.length; e++) {
  17749. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17750. if (t.length)
  17751. return t[0].object.parent.parent
  17752. }
  17753. return null
  17754. }
  17755. ),
  17756. r.prototype.placeMarker = function() {
  17757. this.marker && (this.marker.position.copy(this.floorPosition),
  17758. this.marker.position.y += .05,
  17759. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17760. }
  17761. ,
  17762. r.prototype.translate = function(e) {
  17763. this.position.add(e),
  17764. this.floorPosition.add(e)
  17765. }
  17766. ,
  17767. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17768. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17769. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17770. }
  17771. ,
  17772. r.prototype.attachToPanoRenderer = function(e) {
  17773. this.panoRenderer = e,
  17774. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17775. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17776. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17777. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17778. }
  17779. ;
  17780. var w, T, x = {};
  17781. r.prototype.getWaitDeferred = function(e) {
  17782. var t = x[this.id];
  17783. t || (t = {},
  17784. x[this.id] = t);
  17785. var i = t[e];
  17786. return i || (i = {
  17787. deferred: $.Deferred(),
  17788. active: !1
  17789. },
  17790. t[e] = i),
  17791. i
  17792. }
  17793. ,
  17794. r.prototype.resetWaitDeferred = function(e) {
  17795. var t = this.getWaitDeferred(e);
  17796. t.active = !1,
  17797. t.deferred = $.Deferred()
  17798. }
  17799. ,
  17800. r.prototype.clearWaitDeferreds = function() {
  17801. var e = x[this.id];
  17802. for (var t in e || (e = {},
  17803. x[this.id] = e),
  17804. e)
  17805. if (e.hasOwnProperty(t)) {
  17806. var i = e[t];
  17807. i.active = !1,
  17808. i.deferred = $.Deferred()
  17809. }
  17810. }
  17811. ,
  17812. r.prototype.loadTiledPano = (new s.Vector3,
  17813. w = [],
  17814. T = [],
  17815. function(e, t, i, n, r, o) {
  17816. null != n || (n = !0),
  17817. null != r || (r = !0);
  17818. var a = this.getWaitDeferred(e)
  17819. , s = a.deferred
  17820. , l = null
  17821. , c = null;
  17822. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17823. c = i.vFov)),
  17824. !this.isLoaded(e)) {
  17825. if (!a.active) {
  17826. if (a.active = !0,
  17827. i) {
  17828. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17829. w[this.id + ":" + e] = {
  17830. tileCount: 0,
  17831. targetTileCount: h
  17832. },
  17833. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17834. }
  17835. T[this.id] || (T[this.id] = !0,
  17836. this.on(f.LoadComplete, function(e, t) {
  17837. var i = this.getWaitDeferred(e).deferred;
  17838. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17839. this.resetWaitDeferred(e))
  17840. }
  17841. .bind(this)),
  17842. this.on(f.LoadFailed, function(e) {
  17843. var t = this.getWaitDeferred(e).deferred;
  17844. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17845. this.resetWaitDeferred(e))
  17846. }
  17847. .bind(this)),
  17848. this.on(f.TileLoaded, function(e, t, i) {
  17849. var n = this.getWaitDeferred(e).deferred;
  17850. if (n && "pending" === n.state()) {
  17851. n.notify(e, t, i);
  17852. var r = w[this.id + ":" + e];
  17853. r && (r.tileCount++,
  17854. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17855. n.resolve(e, i),
  17856. this.resetWaitDeferred(e)))
  17857. }
  17858. }
  17859. .bind(this)))
  17860. }
  17861. this.tileDownloader.clearForceQueue(),
  17862. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17863. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17864. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17865. }
  17866. return s.promise()
  17867. }
  17868. ),
  17869. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17870. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17871. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17872. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17873. }
  17874. ,
  17875. r.prototype.onTileRendered = function(e, t, i, n) {
  17876. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17877. }
  17878. ,
  17879. r.prototype.onPanoRendered = function(e, t, i, n) {
  17880. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17881. this.updateSkyboxForZoomLevel(),
  17882. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17883. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17884. this.emit("load", t),
  17885. this.model.emit("load", this),
  17886. this.emit(f.LoadComplete, t, i))
  17887. }
  17888. ,
  17889. r.prototype.setZoomed = function(e) {
  17890. this.zoomed = e,
  17891. this.updateSkyboxForZoomLevel()
  17892. }
  17893. ,
  17894. r.prototype.ensureSkyboxReadyForRender = function() {
  17895. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17896. this.solidSkybox.loaded = !0)
  17897. }
  17898. ,
  17899. r.prototype.updateSkyboxForZoomLevel = function() {
  17900. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  17901. }
  17902. ,
  17903. r.prototype.getSkyboxTexture = function() {
  17904. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  17905. }
  17906. ,
  17907. r.prototype.onTileRenderFail = function(e, t, i) {
  17908. e === this.id && this.emit(f.LoadFailed, t)
  17909. }
  17910. ,
  17911. r.prototype.isLoaded = function(e) {
  17912. if (this.tiled) {
  17913. if (e && "string" == typeof e)
  17914. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  17915. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  17916. }
  17917. if (e && "number" == typeof e)
  17918. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  17919. return !!this.solidSkybox.high || e in this.solidSkybox
  17920. }
  17921. ,
  17922. r.prototype.loadCube = function(a) {
  17923. if (this.isLoaded(a))
  17924. return I.info("Skipping load of pano, already loaded"),
  17925. $.when();
  17926. this.emit("loading", a),
  17927. this.model.emit("loading", this);
  17928. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  17929. , e = n.filter(function(e) {
  17930. return !e
  17931. });
  17932. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  17933. a = "high",
  17934. n = p.getCubemapUrls(this.model.urls, this.id, a));
  17935. var t = 0
  17936. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  17937. return u.getImage(n[t])
  17938. }
  17939. .bind(this));
  17940. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  17941. return this.solidSkybox[a] = [e, t, i, n, r, o],
  17942. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  17943. this.solidSkybox.low = null),
  17944. this.solidSkybox.needsUpdate = !0,
  17945. this.emit("load", a),
  17946. this.model.emit("load", this),
  17947. this
  17948. }
  17949. .bind(this), function() {
  17950. I.error("Downloading cubemap for pano", this.id, "failed"),
  17951. this.failedLoadingAt = Date.now()
  17952. }
  17953. .bind(this), function() {
  17954. return $.when(++t, 6)
  17955. })
  17956. }
  17957. ,
  17958. r.raycastsSkipped = 0,
  17959. r.raycastsDone = 0,
  17960. r.prototype.findNeighourPanos = function() {
  17961. return this.model.panos.setNeighbour(this.id, this.id, !1),
  17962. this.model.panos.forEach(function(e) {
  17963. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  17964. var t = this.position.distanceTo(e.position);
  17965. if (t > a.panoramaNeighbourMaxDistance)
  17966. return this.model.panos.setNeighbour(this, e, !1),
  17967. void r.raycastsSkipped++;
  17968. var i = e.position.clone().sub(this.position).normalize()
  17969. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  17970. r.raycastsDone++,
  17971. this.model.panos.setNeighbour(this, e, 0 === n.length),
  17972. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  17973. }
  17974. }
  17975. .bind(this)),
  17976. this.model.panos.neighbourMap[this.id]
  17977. }
  17978. ,
  17979. r.prototype.worldPosition = function() {
  17980. return this.position
  17981. }
  17982. ,
  17983. r.prototype.addTextSprite = function(e, t) {
  17984. this.removeTextSprite();
  17985. var i = document.createElement("canvas")
  17986. , n = i.getContext("2d");
  17987. i.width = 256,
  17988. i.height = 256;
  17989. n.font = "bold 60px Arial",
  17990. n.fillStyle = "white";
  17991. var r = n.measureText(e).width;
  17992. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  17993. var o = new s.Texture(i);
  17994. o.needsUpdate = !0;
  17995. var a = new s.SpriteMaterial({
  17996. map: o,
  17997. color: t || 16428055
  17998. });
  17999. this.text3d = new s.Sprite(a),
  18000. this.text3d.position.copy(this.skyboxMesh.position),
  18001. this.floor.add(this.text3d)
  18002. }
  18003. ,
  18004. r.prototype.removeTextSprite = function() {
  18005. this.text3d && (this.floor.remove(this.text3d),
  18006. this.text3d = null)
  18007. }
  18008. ,
  18009. r.prototype.isAligned = function() {
  18010. return this.alignmentType === c.ALIGNED
  18011. }
  18012. ,
  18013. r.filters = {
  18014. inDirection: function(t, i, n) {
  18015. return function(e) {
  18016. return e.position.clone().sub(t).normalize().dot(i) > n
  18017. }
  18018. },
  18019. inFloorDirection: function(t, i, n) {
  18020. return function(e) {
  18021. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18022. }
  18023. },
  18024. inPanoDirection: function(n, r, o) {
  18025. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18026. function(e) {
  18027. var t = e.floorPosition.clone().sub(n).normalize()
  18028. , i = e.position.clone().sub(n).normalize();
  18029. return t.dot(r) > o || i.dot(r) > o
  18030. }
  18031. },
  18032. atFloor: function(t) {
  18033. return function(e) {
  18034. return !t || e.floor === t
  18035. }
  18036. },
  18037. not: function(t) {
  18038. return function(e) {
  18039. return e !== t
  18040. }
  18041. },
  18042. notIn: function(t) {
  18043. return function(e) {
  18044. return -1 === t.indexOf(e)
  18045. }
  18046. },
  18047. isLoaded: function() {
  18048. return function(e) {
  18049. return e.isLoaded()
  18050. }
  18051. },
  18052. isNotLoaded: function() {
  18053. return function(e) {
  18054. return !e.isLoaded()
  18055. }
  18056. },
  18057. isCloseEnoughTo: function(t, i) {
  18058. return function(e) {
  18059. return t.distanceTo(e.floorPosition) < i
  18060. }
  18061. },
  18062. hasMinimumHeightDifferenceTo: function(t, i) {
  18063. return function(e) {
  18064. return Math.abs(e.position.y - t.y) > i
  18065. }
  18066. },
  18067. isNotBehindNormal: function(t, i) {
  18068. var n = new s.Vector3;
  18069. return i = i.clone(),
  18070. function(e) {
  18071. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18072. }
  18073. },
  18074. isNeighbourPanoTo: function(t) {
  18075. return function(e) {
  18076. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18077. }
  18078. },
  18079. isNeighbourOfNeighbourTo: function(n) {
  18080. return function(i) {
  18081. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18082. var t = n.model.panos.get(e);
  18083. return !!t && t.neighbourPanos[i.id]
  18084. })
  18085. }
  18086. },
  18087. isNotRecentlyFailed: function(t) {
  18088. return function(e) {
  18089. return Date.now() - e.failedLoadingAt > t
  18090. }
  18091. },
  18092. isOnVisibleFloor: function() {
  18093. return function(e) {
  18094. return !e.floor.hidden
  18095. }
  18096. },
  18097. isPanoAligned: function() {
  18098. return function(e) {
  18099. return e.isAligned()
  18100. }
  18101. }
  18102. },
  18103. r.sortFunctions = {
  18104. distanceToPoint: function(i) {
  18105. return function(e, t) {
  18106. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18107. }
  18108. },
  18109. floorDistanceToPoint: function(i) {
  18110. return function(e, t) {
  18111. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18112. }
  18113. },
  18114. choose: function(i) {
  18115. return function(e, t) {
  18116. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18117. }
  18118. }
  18119. },
  18120. r.scoreFunctions = {
  18121. distance: function(t, i) {
  18122. return i = i || a.navigation.distanceFactor,
  18123. function(e) {
  18124. return t ? t.position.distanceTo(e.position) * i : 0
  18125. }
  18126. },
  18127. distanceSquared: function(t, i) {
  18128. return i = i || a.navigation.distanceFactor,
  18129. function(e) {
  18130. return t ? t.position.distanceToSquared(e.position) * i : 0
  18131. }
  18132. },
  18133. direction: function(t, i) {
  18134. return function(e) {
  18135. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18136. }
  18137. },
  18138. angle: function(t, i) {
  18139. return function(e) {
  18140. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18141. }
  18142. },
  18143. inFieldOfView: function(t, i) {
  18144. return function(e) {
  18145. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18146. }
  18147. },
  18148. optionality: function(t) {
  18149. return function(e) {
  18150. return e.neighbourUUIDs.filter(function(e) {
  18151. return !(e in t.neighbourUUIDs) && e !== t.id
  18152. }).length * a.navigation.optionalityFactor
  18153. }
  18154. },
  18155. penalizeHeightDifferenceUnder: function(t, i) {
  18156. return function(e) {
  18157. return t.y - e.position.y < i ? -20 : 0
  18158. }
  18159. }
  18160. },
  18161. M.exports = r
  18162. }
  18163. ).call(this, "/js/objects/Panorama.js")
  18164. }
  18165. , {
  18166. "../enum/AlignmentType": 17,
  18167. "../enum/GLCubeFaces": 25,
  18168. "../enum/PanoRendererEvents": 35,
  18169. "../enum/PanoSizeClass": 36,
  18170. "../enum/PanoramaEvents": 37,
  18171. "../enum/RenderLayers": 41,
  18172. "../enum/RenderOrder": 42,
  18173. "../enum/TileDownloaderEvents": 45,
  18174. "../enum/Viewmode": 51,
  18175. "../exception/BasicException": 55,
  18176. "../scene/SceneRenderer": 158,
  18177. "../settings": 166,
  18178. "../tile/TileUtils": 174,
  18179. "../util/ajax": 181,
  18180. "../util/common": 185,
  18181. "../util/lerp": 188,
  18182. "../util/logger": 189,
  18183. "../util/panorama": 191,
  18184. "../util/texture": 194,
  18185. "../util/transitions": 195,
  18186. events: 202,
  18187. three: 217
  18188. }],
  18189. 149: [function(e, t, i) {
  18190. "use strict";
  18191. function n(e) {
  18192. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18193. t.map.value = d,
  18194. t.opacity.value = 0,
  18195. t.color.value.set(o.reticuleColor),
  18196. t.showMouseMarker = void 0 === window.MP_PREFETCHED_MODELDATA.hideMouseMarker || "false" === window.MP_PREFETCHED_MODELDATA.hideMouseMarker,
  18197. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18198. side: r.DoubleSide,
  18199. depthWrite: !1,
  18200. depthTest: !1,
  18201. transparent: !0,
  18202. vertexShader: c.waypoint.vertexShader,
  18203. fragmentShader: c.waypoint.fragmentShader,
  18204. uniforms: t,
  18205. name: "waypoint",
  18206. opacity: 0,
  18207. visible: t.showMouseMarker
  18208. })),
  18209. this.layers.set(h.RETICULE),
  18210. this.renderOrder = u.reticule,
  18211. this.player = e,
  18212. this.direction = new r.Vector3,
  18213. this.hidden = !0,
  18214. this.mouseLastMoveTime = Date.now()
  18215. }
  18216. var r = e("three")
  18217. , o = e("../settings")
  18218. , a = e("../util/transitions")
  18219. , s = e("../util/texture")
  18220. , l = e("../util/lerp")
  18221. , c = e("../shaders")
  18222. , h = e("../enum/RenderLayers")
  18223. , u = e("../enum/RenderOrder")
  18224. , d = s.load("images/reticule-256x256.png");
  18225. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18226. this.hidden = i,
  18227. this.mouseLastMoveTime = Date.now()
  18228. }
  18229. ,
  18230. n.prototype.hide = function() {
  18231. this.hidden || (this.hidden = !0,
  18232. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18233. }
  18234. ,
  18235. n.prototype.show = function() {
  18236. this.hidden = !1,
  18237. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18238. }
  18239. ,
  18240. n.prototype.update = function() {
  18241. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18242. }
  18243. ,
  18244. n.prototype.updatePosition = function(e, t) {
  18245. if (!this.hidden) {
  18246. if (!t)
  18247. return this.hide();
  18248. var i = t.point
  18249. , n = e.distanceTo(i)
  18250. , r = 1 + .01 * n;
  18251. n < 1 && (r -= 1 - n),
  18252. this.show(),
  18253. this.scale.set(r, r, r),
  18254. this.direction = this.direction.multiplyScalar(.8),
  18255. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18256. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18257. this.lookAt(this.position.clone().add(this.direction))
  18258. }
  18259. }
  18260. ,
  18261. n.prototype.writeAstag = function() {
  18262. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18263. , t = new Date;
  18264. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18265. var i = {
  18266. enabled: !0,
  18267. version: "0",
  18268. created: t.toISOString(),
  18269. created_by: "APITest",
  18270. position: this.position.clone(),
  18271. stem: {
  18272. enabled: o.tags.pole.enabled,
  18273. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18274. },
  18275. label: "tag " + this.tagCount,
  18276. description: "Description " + e,
  18277. floor: function(e) {
  18278. if (e.currentFloor) {
  18279. var t = e.floors.indexOf(e.currentFloor);
  18280. return -1 < t ? t : void 0
  18281. }
  18282. }(this.player.model),
  18283. type: "info",
  18284. metadata: {
  18285. preferred_camera: {
  18286. mode: this.player.mode
  18287. }
  18288. }
  18289. };
  18290. console.log("--------------------------"),
  18291. console.log(JSON.stringify(i));
  18292. var n = this.player.model.addtag(e, i).build();
  18293. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18294. n.visible || n.show(o.tags.startup.fadeInDuration))
  18295. }
  18296. ,
  18297. t.exports = n
  18298. }
  18299. , {
  18300. "../enum/RenderLayers": 41,
  18301. "../enum/RenderOrder": 42,
  18302. "../settings": 166,
  18303. "../shaders": 167,
  18304. "../util/lerp": 188,
  18305. "../util/texture": 194,
  18306. "../util/transitions": 195,
  18307. three: 217
  18308. }],
  18309. 150: [function(e, t, i) {
  18310. "use strict";
  18311. function n(e, t) {
  18312. this.chunks = [],
  18313. this.floorId = e,
  18314. this.roomId = t,
  18315. this.position = new l.Vector3
  18316. }
  18317. var l = e("three");
  18318. n.prototype.addChunk = function(e) {
  18319. this.chunks.push(e)
  18320. }
  18321. ,
  18322. n.prototype.calcBoundaries = function() {
  18323. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18324. var a = this.chunks[o].geometry.attributes.position;
  18325. if (a)
  18326. for (var s = 0; s < a.array.length; s += 3)
  18327. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18328. t.add(e),
  18329. 0 === s ? (i.copy(e),
  18330. n.copy(e)) : (i.max(e),
  18331. n.min(e)),
  18332. r++
  18333. }
  18334. 0 < r ? (t.multiplyScalar(1 / r),
  18335. this.average = t) : this.average = null,
  18336. this.boundsMax = i,
  18337. this.boundsMin = n,
  18338. this.center = new l.Vector3,
  18339. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18340. }
  18341. ,
  18342. t.exports = n
  18343. }
  18344. , {
  18345. three: 217
  18346. }],
  18347. 151: [function(o, v, e) {
  18348. (function(e) {
  18349. "use strict";
  18350. function t(e, t, i) {
  18351. this.obj3d = null,
  18352. this.nodes = [],
  18353. this.colorHull = [],
  18354. this.shortPaths = {},
  18355. this.floorHull = null,
  18356. this.cameraHull = null,
  18357. this.floorPathDistance = 0,
  18358. this.floorCurvePoints = null,
  18359. this.floorCurveColors = null,
  18360. this.camCurvePoints = null,
  18361. this.warpDestHeroLoc = null,
  18362. this.warpDestPano = null,
  18363. this.warpPathPoints = null,
  18364. this.warpPathLengths = [0],
  18365. this.warpLength = 0,
  18366. this.closeWarpDistance = 4,
  18367. this.UP = U.UP.clone(),
  18368. this.longestStep = 0,
  18369. this.upcomingTransType = null,
  18370. this.burnsDir = 1,
  18371. this.prevNextDist = 0,
  18372. this.nextI = 0,
  18373. this.activeTransType = null,
  18374. this.lastTransType = null,
  18375. this.bunnyObj = null,
  18376. this.director = e,
  18377. this.player = t,
  18378. this.playerControls = i,
  18379. this.modelManager = t.modelManager,
  18380. this.updateModel(),
  18381. this.updateDefaultsFromModelData(),
  18382. this.bindEvents(),
  18383. this.warping = !1,
  18384. this.waitingToWarp = !1,
  18385. this.warpInterrupted = !1,
  18386. this.warpInterruptionBlackoutStyle = null,
  18387. this.warpInterruptionTravelTime = null
  18388. }
  18389. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18390. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18391. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18392. path: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18393. pathEnd: n.load("images/End.png"),
  18394. pathStart: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18395. };
  18396. t.prototype.setScene = function(e) {
  18397. this.createCpm(e),
  18398. this.createBunnyObj(e)
  18399. }
  18400. ,
  18401. t.prototype.updateModel = function() {
  18402. this.model = this.modelManager.getActiveModel()
  18403. }
  18404. ,
  18405. t.prototype.bindEvents = function() {
  18406. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18407. }
  18408. ,
  18409. t.prototype.updateDefaultsFromModelData = function() {
  18410. this.model.data
  18411. }
  18412. ,
  18413. t.prototype.pointPathDistance = function(e) {
  18414. for (var t = 0, i = 1; i < e.length; i += 1)
  18415. t += e[i - 1].distanceTo(e[i]);
  18416. return t
  18417. }
  18418. ,
  18419. t.prototype.pointPathLengths = function(e) {
  18420. for (var t = [0], i = 1; i < e.length; i += 1)
  18421. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18422. return t
  18423. }
  18424. ,
  18425. t.prototype.interpAlongPath = function(e, t, i) {
  18426. var n, r = new P.Vector3, o = t[t.length - 1];
  18427. if (i < 1) {
  18428. n = i * o;
  18429. for (var a = 1; a < t.length; a += 1)
  18430. if (t[a] > n) {
  18431. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18432. return r.copy(e[a]),
  18433. r.sub(e[a - 1]),
  18434. r.multiplyScalar(s),
  18435. r.add(e[a - 1]),
  18436. r
  18437. }
  18438. } else
  18439. r.copy(e[e.length - 1]);
  18440. return r
  18441. }
  18442. ,
  18443. t.prototype.pathHeight = function() {
  18444. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18445. }
  18446. ,
  18447. t.prototype.createBunnyObj = function(e) {
  18448. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18449. this.bunnyObj.visible = D.warp.showBunny),
  18450. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18451. e.add(this.bunnyObj)
  18452. }
  18453. ,
  18454. t.prototype.createCpm = function(e) {
  18455. if (!this.currentPanoMarker) {
  18456. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18457. t.material.uniforms.opacity.value = 0,
  18458. this.currentPanoMarker = {
  18459. mesh: t,
  18460. placed: !1
  18461. }
  18462. }
  18463. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18464. this.placeCpm(),
  18465. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18466. }
  18467. ,
  18468. t.prototype.placeCpm = function() {
  18469. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18470. var e = this.player.currentPano.floor;
  18471. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18472. e.add(this.currentPanoMarker.mesh)),
  18473. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18474. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18475. this.currentPanoMarker.placed = !0
  18476. } else
  18477. this.popOutCpm()
  18478. }
  18479. ,
  18480. t.prototype.fadeInCpm = function(e) {
  18481. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18482. }
  18483. ,
  18484. t.prototype.fadeOutCpm = function(e) {
  18485. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18486. }
  18487. ,
  18488. t.prototype.popInCpm = function() {
  18489. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18490. }
  18491. ,
  18492. t.prototype.popOutCpm = function() {
  18493. this.fadeOutCpm(2)
  18494. }
  18495. ,
  18496. t.prototype.brushPrefs = {
  18497. linewidth: 7,
  18498. strokeWidth: 15,
  18499. cvSegments: 48,
  18500. paveStep: .1,
  18501. paveWidth: .2,
  18502. lookBlendDist: 3,
  18503. maxTurn: P.Math.degToRad(2)
  18504. },
  18505. t.prototype.panoPathDistance = function(e) {
  18506. var t = this.model.panos;
  18507. if (!e || e.length < 2)
  18508. return 0;
  18509. for (var i = [], n = 0; n < e.length; n += 1)
  18510. i.push(t.get(e[n]).floorPosition);
  18511. return this.pointPathDistance(i)
  18512. }
  18513. ,
  18514. t.prototype.loadTileTexture = function(t) {
  18515. var e = n.load(t, function(e) {
  18516. e.wrapS = P.RepeatWrapping,
  18517. e.wrapT = P.RepeatWrapping,
  18518. e.needsUpdate = !0,
  18519. H.debug('path texture "' + t + '" is ready')
  18520. }, function() {
  18521. H.error('path texture "' + t + '" failed')
  18522. });
  18523. return e.mapping = P.UVMapping,
  18524. e
  18525. }
  18526. ,
  18527. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18528. return new l({
  18529. cameraMode: n,
  18530. position: e,
  18531. quaternion: t,
  18532. panoId: i,
  18533. orthoZoom: o,
  18534. floorVisibility: r,
  18535. thumbUrl: null,
  18536. name: null
  18537. })
  18538. }
  18539. ,
  18540. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18541. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18542. }
  18543. ,
  18544. t.prototype.setWarpDestination = function(e) {
  18545. this.warpDestHeroLoc = e
  18546. }
  18547. ,
  18548. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18549. var t = this.getHeroDescriptorByHeroIndex(e);
  18550. return null !== t && (this.setWarpDestination(t),
  18551. !0)
  18552. }
  18553. ,
  18554. t.prototype.setWarpDestinationByPano = function(e, t) {
  18555. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18556. }
  18557. ,
  18558. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18559. var i = this.model.panos.get(e);
  18560. if (i) {
  18561. t = t || new P.Quaternion;
  18562. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18563. return this.setWarpDestination(n),
  18564. !0
  18565. }
  18566. return !1
  18567. }
  18568. ,
  18569. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18570. var t = this.model.heroCount();
  18571. if (null !== this.warpDestHeroLoc && t < 2)
  18572. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18573. this.model.getHeroDescriptorByIndex(0);
  18574. var i = this.model.getHeroDescriptorByIndex(e);
  18575. if (i) {
  18576. var n = i.isPano() ? i.panoId : i.cameraMode;
  18577. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18578. }
  18579. return i
  18580. }
  18581. ,
  18582. t.prototype.getHeroDescriptorByPano = function(e) {
  18583. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18584. }
  18585. ,
  18586. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18587. var t = this.getHeroIndexFromPanoId(e);
  18588. return this.getHeroDescriptorByHeroIndex(t)
  18589. }
  18590. ,
  18591. t.prototype.getHeroIndexFromPanoId = function(e) {
  18592. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18593. var i = this.model.heroLocations[t]
  18594. , n = this.getHeroId(i);
  18595. if (n && n === e)
  18596. return t
  18597. }
  18598. return -1
  18599. }
  18600. ,
  18601. t.prototype.getHeroPano = function(e) {
  18602. if (null === e)
  18603. return H.warn("getHeroPano(): no destination"),
  18604. null;
  18605. var t = this.getHeroId(e)
  18606. , i = this.model.panos.get(t);
  18607. return void 0 === i && (i = null,
  18608. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18609. i
  18610. }
  18611. ,
  18612. t.prototype.getHeroId = function(e) {
  18613. return e.panoId
  18614. }
  18615. ,
  18616. t.prototype.setWarpDestPano = function() {
  18617. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18618. this.warpDestPano
  18619. }
  18620. ,
  18621. t.prototype.brushToWarpPano = function(e, t) {
  18622. if (this.discardPathObject(),
  18623. !this.setWarpDestPano())
  18624. return !1;
  18625. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18626. !this.warpDestPano)
  18627. return H.info("No brush"),
  18628. !1;
  18629. if (!this.player.currentPano)
  18630. return H.debug("No current pano, visibility undefined"),
  18631. !1;
  18632. if (!this.warpDestPano)
  18633. return H.info("No wPano, visibility undefined"),
  18634. !1;
  18635. if (!this.warpDestPano.isAligned())
  18636. return H.debug("Cannot brush to unaligned pano"),
  18637. !1;
  18638. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18639. , n = !0;
  18640. if (this.player.currentPano.id === this.warpDestPano.id)
  18641. H.debug("Already at destination pano");
  18642. else {
  18643. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18644. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18645. this.obj3d = new P.Object3D,
  18646. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18647. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18648. e = t) : (this.setPathHulls(this.nodes),
  18649. this.setFloorCurves(),
  18650. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  18651. this.player.currentPano.floor.add(this.obj3d);
  18652. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18653. , o = e === L.STD;
  18654. if (!n && (i || o)) {
  18655. if (r) {
  18656. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18657. this.obj3d.add(a)
  18658. }
  18659. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18660. this.obj3d.add(s)
  18661. }
  18662. this.appearSlow()
  18663. }
  18664. return this.upcomingTransType = e,
  18665. !n
  18666. }
  18667. ,
  18668. t.prototype.findShortestPath = function(e, t) {
  18669. if (!e || !t)
  18670. return null;
  18671. var i = D.warp.walkExtraPanosDistance
  18672. , n = e.id + ":" + t.id + ":" + i;
  18673. if (this.shortPaths.hasOwnProperty(n))
  18674. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18675. var r = t.id + ":" + e.id + ":" + i;
  18676. if (this.shortPaths.hasOwnProperty(r))
  18677. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18678. var o = this.model.panos.aStarSearch(e, t);
  18679. return this.model.panos.includeNodesNearPath(o, i),
  18680. this.shortPaths[n] = o ? o.slice() : null,
  18681. o
  18682. }
  18683. ,
  18684. t.prototype.makePathHulls = function(e) {
  18685. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18686. r = (t = h.get(e[0])).floor.floorIndex;
  18687. for (var u = 0; u < e.length; u += 1)
  18688. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18689. s.push(i),
  18690. l.push(t.position.clone()),
  18691. n = t.floor.floorIndex,
  18692. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18693. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18694. return a > this.longestStep && (this.longestStep = a,
  18695. H.debug("path contains " + a + " meter segment")),
  18696. {
  18697. floor: s,
  18698. camera: l,
  18699. color: c
  18700. }
  18701. }
  18702. ,
  18703. t.prototype.makeFloorCurves = function(e, t, i) {
  18704. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18705. , r = this.pointPathDistance(e) - 2 * n
  18706. , o = e.slice(0)
  18707. , a = o[1].clone().sub(o[0]);
  18708. a.y = 0,
  18709. a.normalize().multiplyScalar(n),
  18710. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18711. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18712. a.normalize().multiplyScalar(n),
  18713. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18714. var s = new P.CatmullRomCurve3(o)
  18715. , l = Math.floor(r / i);
  18716. l = 4 * Math.floor(l / 4),
  18717. l = Math.max(4, l);
  18718. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18719. h = 0,
  18720. c = u[f].distanceTo(e[0]);
  18721. for (var g = 1; g < e.length; g += 1)
  18722. p.copy(u[f]).sub(e[g]),
  18723. p.y *= 4,
  18724. p.length() < c && (h = g);
  18725. d.push(t[h])
  18726. }
  18727. return {
  18728. distance: r,
  18729. points: u,
  18730. colors: d
  18731. }
  18732. }
  18733. ,
  18734. t.prototype.makeCameraCurvePoints = function(e, t) {
  18735. var i = this.pointPathDistance(e);
  18736. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18737. }
  18738. ,
  18739. t.prototype.makeCameraCurveTangents = function(e, t) {
  18740. var i = this.pointPathDistance(e)
  18741. , n = new P.CatmullRomCurve3(e)
  18742. , r = Math.max(2, Math.floor(i / t));
  18743. r = r || 5;
  18744. for (var o = [], a = 0; a <= r; a++)
  18745. o.push(n.getTangentAt(a / r));
  18746. return o
  18747. }
  18748. ,
  18749. t.prototype.setPathHulls = function(e) {
  18750. var t = this.makePathHulls(e);
  18751. this.floorHull = t.floor,
  18752. this.cameraHull = t.camera,
  18753. this.colorHull = t.color
  18754. }
  18755. ,
  18756. t.prototype.setFloorCurves = function() {
  18757. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18758. this.floorPathDistance = e.distance,
  18759. this.floorCurvePoints = e.points,
  18760. this.floorCurveColors = e.colors
  18761. }
  18762. ,
  18763. t.prototype.setCameraCurvePoints = function() {
  18764. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18765. }
  18766. ,
  18767. t.prototype.chooseWarpPath = function(e) {
  18768. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18769. if (this.player.currentPano === this.warpDestPano || !e)
  18770. return this.warpPathPoints = null,
  18771. this.warpLength = 0,
  18772. !1;
  18773. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18774. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18775. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18776. t.multiplyScalar(.15).add(r.position),
  18777. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18778. t.y = r.position.y,
  18779. i.y = this.warpDestPano.position.y,
  18780. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18781. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18782. this.setCameraCurvePoints(),
  18783. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18784. this.warpLength = 0,
  18785. this.warpPathLengths = [0];
  18786. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  18787. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18788. var h = o.length();
  18789. o.y *= D.warp.climbEffort;
  18790. var u = o.length() / h;
  18791. if (1 < c) {
  18792. o.setY(0).normalize(),
  18793. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18794. var d = Math.min(1, o.dot(a))
  18795. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18796. u = Math.max(p, u)
  18797. }
  18798. this.warpLength += h * u,
  18799. this.warpPathLengths[c] = this.warpLength
  18800. }
  18801. return !0
  18802. }
  18803. ,
  18804. t.prototype.drawPathRibbon = function(e, t) {
  18805. this.bunnyObj.visible = D.warp.showBunny;
  18806. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  18807. a.copy(e[s]),
  18808. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18809. a.normalize(),
  18810. n.crossVectors(a, U.UP),
  18811. n.multiplyScalar(i);
  18812. var l = (new P.Vector3).copy(e[s]).add(r);
  18813. l.sub(n),
  18814. o.vertices.push(l),
  18815. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18816. o.vertices.push(l)
  18817. }
  18818. var c, h, u, d = 0;
  18819. for (s = 0; s < e.length - 1; s += 1) {
  18820. var p = 2 * s
  18821. , f = d
  18822. , g = d += e[s + 1].distanceTo(e[s])
  18823. , m = t[s]
  18824. , v = t[s + 1];
  18825. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18826. o.faces.push(c),
  18827. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18828. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18829. o.faces.push(c),
  18830. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18831. }
  18832. o.computeFaceNormals(),
  18833. o.computeVertexNormals(),
  18834. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18835. u.opacity.value = 0,
  18836. u.color.value.set(D.path.color),
  18837. new P.RawShaderMaterial({
  18838. side: P.DoubleSide,
  18839. depthWrite: !1,
  18840. transparent: !0,
  18841. vertexShader: C.ribbon.vertexShader,
  18842. fragmentShader: C.ribbon.fragmentShader,
  18843. uniforms: u,
  18844. name: "ribbonT",
  18845. opacity: 0
  18846. })) : new P.MeshBasicMaterial({
  18847. color: 16777215,
  18848. side: P.DoubleSide,
  18849. name: "ribbonOut",
  18850. vertexColors: P.VertexColors
  18851. });
  18852. var y = new P.Mesh(o,h);
  18853. return y.name = "ribbon",
  18854. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18855. y
  18856. }
  18857. ,
  18858. t.prototype.drawPathPavement = function(e) {
  18859. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18860. r.copy(e[o]),
  18861. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18862. r.normalize(),
  18863. i.crossVectors(r, U.UP),
  18864. i.multiplyScalar(this.brushPrefs.paveWidth),
  18865. (t = (new P.Vector3).copy(e[o])).sub(i),
  18866. n.vertices.push(t),
  18867. n.vertices.push((new P.Vector3).copy(e[o])),
  18868. (t = (new P.Vector3).copy(e[o])).add(i),
  18869. n.vertices.push(t);
  18870. var a, s, l;
  18871. for (o = 0; o < e.length - 1; o += 1)
  18872. a = 3 * o + 1,
  18873. l = .25 + (s = .25 * o),
  18874. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18875. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18876. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18877. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18878. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18879. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18880. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18881. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18882. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18883. color: D.path.color,
  18884. side: P.DoubleSide,
  18885. transparent: !0,
  18886. depthWrite: !1,
  18887. opacity: 0,
  18888. name: "paveT",
  18889. map: I.path
  18890. }) : new P.MeshBasicMaterial({
  18891. color: D.path.color,
  18892. side: P.DoubleSide,
  18893. transparent: !0,
  18894. depthWrite: !1,
  18895. opacity: 1,
  18896. name: "paveO",
  18897. map: I.path
  18898. });
  18899. return new P.Mesh(n,c)
  18900. }
  18901. ,
  18902. t.prototype.hintPrefs = {
  18903. rad: .18,
  18904. width: .0125,
  18905. depth: .0625,
  18906. setBack: -.04,
  18907. markRad: .25,
  18908. markInnerRad: .16
  18909. },
  18910. t.prototype.makeWaypointObj = function(e, t) {
  18911. var i = new P.Geometry
  18912. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18913. , r = this.pathHeight();
  18914. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  18915. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  18916. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  18917. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  18918. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  18919. o.map.value = e,
  18920. o.opacity.value = 0,
  18921. o.color.value.set(D.path.color);
  18922. var a = {
  18923. side: P.DoubleSide,
  18924. depthWrite: !1,
  18925. transparent: !0,
  18926. vertexShader: C.waypoint.vertexShader,
  18927. fragmentShader: C.waypoint.fragmentShader,
  18928. uniforms: o,
  18929. name: "waypoint",
  18930. opacity: 0
  18931. };
  18932. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  18933. a.name = "wayPtOut");
  18934. var s = new P.RawShaderMaterial(a)
  18935. , l = new P.Mesh(i,s);
  18936. return l.name = t,
  18937. l
  18938. }
  18939. ,
  18940. t.prototype.makeStartMarker = function(e, t) {
  18941. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  18942. i.y = 0,
  18943. i.normalize();
  18944. var n = Math.acos(i.x)
  18945. , r = this.makeWaypointObj(I.pathStart, "Start");
  18946. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  18947. r.position.copy(e),
  18948. r
  18949. }
  18950. ,
  18951. t.prototype.makeEndMarker = function(e) {
  18952. var t = this.makeWaypointObj(I.pathEnd, "End")
  18953. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  18954. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  18955. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  18956. t.position.copy(e),
  18957. t
  18958. }
  18959. ,
  18960. t.prototype.pathClean = function(e) {
  18961. if (e) {
  18962. for (var t in e.children)
  18963. this.pathClean(e.children[t]);
  18964. e.geometry && e.geometry.dispose(),
  18965. e.material && e.material.dispose()
  18966. }
  18967. }
  18968. ,
  18969. t.prototype.discardPathObject = function() {
  18970. if (this.obj3d) {
  18971. var e = this.obj3d.parent;
  18972. e && e.remove(this.obj3d),
  18973. this.pathClean(this.obj3d)
  18974. }
  18975. this.obj3d = null,
  18976. this.popInCpm()
  18977. }
  18978. ,
  18979. t.prototype.discardSlow = function() {
  18980. if (this.obj3d) {
  18981. if (this.player.mode !== O.PANORAMA)
  18982. return void this.discardPathObject();
  18983. for (var e, t = 0, i = function() {
  18984. this.discardPathObject()
  18985. }
  18986. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  18987. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  18988. t += 1,
  18989. i = null);
  18990. 0 === t && this.discardPathObject(),
  18991. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  18992. }
  18993. }
  18994. ,
  18995. t.prototype.appearSlow = function() {
  18996. var e;
  18997. this.fadeOutCpm(D.path.fadeInTime);
  18998. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  18999. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19000. }
  19001. ,
  19002. t.prototype.update = function() {
  19003. this.obj3d && this.obj3d.updateMatrixWorld()
  19004. }
  19005. ,
  19006. t.prototype.calcBurnsAmount = function(e) {
  19007. var n = P.Math.degToRad(D.warp.burnsAngle);
  19008. if (this.player.mode !== O.PANORAMA)
  19009. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19010. var t = this.burnsDir * n;
  19011. if (this.upcomingTransType === L.BLACK)
  19012. return t;
  19013. var i = e;
  19014. if (null === i)
  19015. return H.warn("Transition request for non-highlight"),
  19016. t;
  19017. var r = this.getHeroDescriptorByHeroIndex(i);
  19018. if (null === r)
  19019. return t;
  19020. if (!r.isPano())
  19021. return t;
  19022. function o(e) {
  19023. var t = Math.acos(Math.min(1, e.dot(l)))
  19024. , i = (new P.Vector3).crossVectors(l, e);
  19025. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19026. }
  19027. var a = this.getHeroPano(r)
  19028. , s = this.playerControls.cameras[O.PANORAMA]
  19029. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19030. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19031. if (a === this.player.currentPano)
  19032. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19033. var h = this.findShortestPath(this.player.currentPano, a);
  19034. if (null == h || h.length < 1)
  19035. return H.debug("Empty path ahead..."),
  19036. t;
  19037. var u = this.makePathHulls(h)
  19038. , d = new P.CatmullRomCurve3(u.camera)
  19039. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19040. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19041. }
  19042. ,
  19043. t.prototype.waitNextStep = function(e, t, i) {
  19044. var o = null == i ? D.warp.tourStepDelay : i;
  19045. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19046. var a = new P.Euler
  19047. , s = new P.Vector3;
  19048. H.debug("Starting wait: " + (void 0 !== t));
  19049. var l = this.calcBurnsAmount(e)
  19050. , c = function() {
  19051. this.endWarpState(),
  19052. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19053. t && t()
  19054. }
  19055. .bind(this)
  19056. , n = function(e, t) {
  19057. if (this.warpInterrupted)
  19058. return c(),
  19059. !0;
  19060. var i = t || 1e3 / 60;
  19061. if (D.warp.doBurns)
  19062. if (this.player.mode === O.PANORAMA) {
  19063. var n = this.playerControls.cameras[O.PANORAMA];
  19064. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19065. var r = i * l / o;
  19066. a.y += r,
  19067. s.set(0, 0, -1),
  19068. s.applyEuler(a),
  19069. s.add(n.position),
  19070. n.controls.lookAt(s),
  19071. n.controls.lookVector.copy(s),
  19072. n.lookAt(s)
  19073. } else
  19074. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19075. }
  19076. .bind(this);
  19077. this.startWarpState(),
  19078. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19079. /* var r = player.model.heroLocations[app.director.currentItem];
  19080. this.player.zoomEnabled = !0;
  19081. var h = function(e, t) {
  19082. //console.log(e),
  19083. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19084. }
  19085. .bind(this);
  19086. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19087. }
  19088. ,
  19089. t.prototype.warpToNonPano = function(e) {
  19090. if (this.discardPathObject(),
  19091. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19092. var t = function() {
  19093. e && e()
  19094. }
  19095. .bind(this);
  19096. this.player.flyToNewMode({
  19097. mode: this.warpDestHeroLoc.cameraMode,
  19098. duration: D.warp.outsideTime,
  19099. warpDest: this.warpDestHeroLoc,
  19100. callback: t,
  19101. force: !0
  19102. })
  19103. } else
  19104. H.warn("no warp destination!!!"),
  19105. e && e()
  19106. }
  19107. ,
  19108. t.prototype._resetWarpShaderParams = function(e) {
  19109. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19110. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19111. }
  19112. ,
  19113. t.prototype._clearWarpShading = function() {
  19114. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19115. this._resetWarpShaderParams(e[t]),
  19116. e[t].visible = !0;
  19117. this._resetWarpShaderParams(this.model.skybox)
  19118. }
  19119. ,
  19120. t.prototype._warpStopFlying = function() {
  19121. this.activeTransType = null,
  19122. this.placeCpm()
  19123. }
  19124. ,
  19125. t.prototype._wrapupTravelOnlyBits = function() {
  19126. this._warpStopFlying(),
  19127. this.warpPathPoints && (this.player.currentPano.exit(),
  19128. this.warpDestPano.enter(),
  19129. this.player.currentPano = this.warpDestPano),
  19130. this.player.spider.draw(),
  19131. this.placeCpm()
  19132. }
  19133. ,
  19134. t.prototype._wrapupTravel = function(e) {
  19135. this._wrapupTravelOnlyBits(),
  19136. this.warpCameraAim(e)
  19137. }
  19138. ,
  19139. t.prototype._wrapupWarpShading = function(e) {
  19140. this._clearWarpShading(),
  19141. this._wrapupTravel(e)
  19142. }
  19143. ,
  19144. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19145. t !== z.END && this._clearWarpShading(),
  19146. this._wrapupTravelOnlyBits(),
  19147. this.upcomingTransType = null,
  19148. e && e()
  19149. }
  19150. ,
  19151. t.prototype._warpCameraAim = function(e, t) {
  19152. var i = this.warpDestHeroLoc.quaternion
  19153. , n = this.playerControls.cameras[O.PANORAMA]
  19154. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19155. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19156. , a = P.Math.radToDeg(Math.acos(o))
  19157. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19158. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19159. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19160. c.y = N.constrainedTurn(c.y),
  19161. this.burnsDir = Math.sign(c.y);
  19162. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19163. , u = new P.Vector3
  19164. , d = function(e, t) {
  19165. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19166. h.y = l.y + e * c.y,
  19167. h.z = l.z + e * c.z,
  19168. u.set(0, 0, -1),
  19169. u.applyEuler(h),
  19170. u.add(n.position),
  19171. n.controls.lookAt(u),
  19172. n.controls.lookVector.copy(u),
  19173. void n.lookAt(u))
  19174. }
  19175. .bind(this);
  19176. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19177. void (t && t()))
  19178. }
  19179. ,
  19180. t.prototype._warpBendAim = function(e, t, i, n) {
  19181. var r = n || 0
  19182. , o = this.playerControls.cameras[O.PANORAMA]
  19183. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19184. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19185. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19186. l.y = N.constrainedTurn(l.y);
  19187. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19188. l.x = c * Math.sign(l.x),
  19189. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19190. this.burnsDir = Math.sign(l.y),
  19191. c *= Math.sign(l.y),
  19192. l.y = c;
  19193. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19194. , u = new P.Vector3
  19195. , d = function(e, t) {
  19196. if (e < .5)
  19197. h.x = s.x + e * l.x,
  19198. h.y = s.y + e * l.y,
  19199. h.z = s.z + e * l.z;
  19200. else {
  19201. var i = (1 - e) * D.warp.softBendEnd;
  19202. h.x = a.x - i * l.x,
  19203. h.y = a.y - i * l.y,
  19204. h.z = a.z - i * l.z
  19205. }
  19206. u.set(0, 0, -1),
  19207. u.applyEuler(h),
  19208. u.add(o.position),
  19209. o.controls.lookAt(u),
  19210. o.controls.lookVector.copy(u),
  19211. o.lookAt(u)
  19212. }
  19213. .bind(this);
  19214. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19215. }
  19216. ,
  19217. t.prototype._warpStepCameraAim = function(e, t, i) {
  19218. var n = this.playerControls.cameras[O.PANORAMA]
  19219. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19220. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19221. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19222. a.y = N.constrainedTurn(a.y),
  19223. this.burnsDir = Math.sign(a.y);
  19224. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19225. , l = new P.Vector3
  19226. , c = function(e, t) {
  19227. e < .5 ? s.copy(o) : s.copy(r),
  19228. l.set(0, 0, -1),
  19229. l.applyEuler(s),
  19230. l.add(n.position),
  19231. n.controls.lookAt(l),
  19232. n.controls.lookVector.copy(l),
  19233. n.lookAt(l)
  19234. }
  19235. .bind(this);
  19236. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19237. }
  19238. ,
  19239. t.prototype.setBurnsDir = function() {
  19240. var e = this.playerControls.cameras[O.PANORAMA]
  19241. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19242. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19243. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19244. n.y = N.constrainedTurn(n.y),
  19245. this.burnsDir = Math.sign(n.y)
  19246. }
  19247. ,
  19248. t.prototype.stepWarpPath = function(e, t) {
  19249. var i = this.playerControls.cameras[O.PANORAMA];
  19250. if (!this.warpPathPoints)
  19251. return i.position.copy(this.warpDestPano.position),
  19252. !0;
  19253. var n = this.warpPathPoints[0]
  19254. , r = this.warpDestPano.position;
  19255. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19256. var o = new P.Vector3;
  19257. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19258. i.position.copy(o)
  19259. } else
  19260. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19261. }
  19262. ,
  19263. t.prototype.interruptAndFastForward = function(e, t) {
  19264. this.warping && (this.warpInterrupted = !0,
  19265. this.warpInterruptionBlackoutStyle = e,
  19266. this.warpInterruptionTravelTime = t,
  19267. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19268. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19269. }
  19270. ,
  19271. t.prototype.warpCameraAim = function(e) {
  19272. var t = D.warp.minWarpTime;
  19273. if (this.upcomingTransType === L.BLACK)
  19274. t = D.warp.teleportTime;
  19275. else {
  19276. var i = this.playerControls.cameras[O.PANORAMA]
  19277. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19278. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19279. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19280. o.y = N.constrainedTurn(o.y);
  19281. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19282. t = Math.max(t, a)
  19283. }
  19284. var s = function() {
  19285. this._warpStopFlying(),
  19286. this.discardSlow(),
  19287. e && e()
  19288. }
  19289. .bind(this);
  19290. this._warpCameraAim(t, s)
  19291. }
  19292. ,
  19293. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19294. this.model.skybox.material.uniforms.blackout.value = n;
  19295. var r = F.uniform(this.model.skybox, "progress", 1)
  19296. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19297. , a = !1
  19298. , s = function() {
  19299. if (this.warpInterrupted)
  19300. return a = !0
  19301. }
  19302. .bind(this)
  19303. , l = function(e, t) {
  19304. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19305. }
  19306. .bind(this)
  19307. , c = function(e, t) {
  19308. return i && a ? (o(0),
  19309. !0) : void o(e, t)
  19310. }
  19311. .bind(this);
  19312. V.start(s, e, null, t, null, "safeHaltWatch"),
  19313. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19314. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19315. }
  19316. ,
  19317. t.prototype.warpTravel_STD = function(e) {
  19318. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19319. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19320. t += this.warpLength * D.warp.timePerMeter,
  19321. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19322. function n(e) {
  19323. var t = i;
  19324. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19325. }
  19326. var y = !1
  19327. , r = this.warpDestHeroLoc.quaternion
  19328. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19329. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19330. , a = A.dot(o)
  19331. , C = P.Math.radToDeg(Math.acos(a))
  19332. , s = function() {
  19333. return m.lookAt(g, l, U.UP),
  19334. u.setFromRotationMatrix(m, D.warp.eOrder),
  19335. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19336. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19337. N.constrainedTurn(v.y)
  19338. }
  19339. .bind(this)
  19340. , I = function(e, t) {
  19341. if (this.warpInterrupted)
  19342. return y = !0
  19343. }
  19344. .bind(this)
  19345. , E = function(e, t) {
  19346. return y || !this.warpPathPoints ? (k.blur(0),
  19347. !0) : void k.blur(e)
  19348. }
  19349. .bind(this)
  19350. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19351. , b = function(e, t) {
  19352. return y || !this.warpPathPoints ? (_(0),
  19353. !0) : void _(e, t)
  19354. }
  19355. .bind(this)
  19356. , w = function(e, t) {
  19357. if (!this.warpPathPoints)
  19358. return h.position.copy(this.warpDestPano.position),
  19359. !0;
  19360. if (y)
  19361. return !0;
  19362. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19363. h.position.copy(i),
  19364. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19365. }
  19366. .bind(this)
  19367. , T = function(e, t) {
  19368. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19369. !0)
  19370. }
  19371. .bind(this)
  19372. , x = function(e, t) {
  19373. if (y)
  19374. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19375. !0;
  19376. if (!this.warpPathPoints)
  19377. return !0;
  19378. var i = this.warpLength * e
  19379. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19380. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19381. D.warp.matchCam && (n *= 1 - r),
  19382. m.lookAt(g, l, U.UP),
  19383. u.setFromRotationMatrix(m, D.warp.eOrder),
  19384. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19385. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19386. v.y = N.constrainedTurn(v.y),
  19387. u.x = p.x + n * v.x,
  19388. u.y = p.y + n * v.y,
  19389. u.z = p.z + n * v.z,
  19390. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19391. v.y = N.constrainedTurn(v.y);
  19392. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19393. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19394. f.x = f.x + v.x * D.warp.turnFriction,
  19395. f.y = f.y + v.y * D.warp.turnFriction,
  19396. f.z = f.z + v.z * D.warp.turnFriction,
  19397. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19398. var a = l.clone().sub(g).normalize();
  19399. if (C < D.warp.maxAimRotation && 0 < r) {
  19400. var s = 1 - r;
  19401. a.x = a.x * s + r * A.x,
  19402. a.y = a.y * s + r * A.y,
  19403. a.z = a.z * s + r * A.z,
  19404. a.normalize()
  19405. }
  19406. this.bunnyObj.position.copy(h.position).add(a),
  19407. d.set(0, 0, -1).applyEuler(f).normalize(),
  19408. d.multiplyScalar(8),
  19409. d.add(h.position),
  19410. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19411. h.controls.lookVector.copy(d),
  19412. h.lookAt(d))
  19413. }
  19414. .bind(this)
  19415. , S = function() {
  19416. y ? (this.discardSlow(),
  19417. this.upcomingTransType = L.BLACK,
  19418. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19419. }
  19420. .bind(this);
  19421. T(0);
  19422. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19423. , R = M / (t += M);
  19424. this.warpCommonParameters(t, R, !0, z.NONE),
  19425. V.start(I, t, null, 0, null, "_haltWatcher"),
  19426. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19427. V.start(E, t, null, R, n, "blurring")),
  19428. V.start(b, t, null, R, n, "modelAlpha"),
  19429. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19430. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19431. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19432. }
  19433. ,
  19434. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19435. var r = e || 0;
  19436. null != t || (t = D.warp.teleportTime),
  19437. this.warpCommonParameters(t, r, !1, i),
  19438. this.model.chunks.forEach(function(e) {
  19439. e.material.uniforms.blackout.value = i
  19440. }),
  19441. this._warpBendAim(null, t, null, r);
  19442. var o = function() {
  19443. this.wrapupWarpShadingOnly(n, i)
  19444. }
  19445. .bind(this);
  19446. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19447. }
  19448. ,
  19449. t.prototype.flightStepWalk = (a = new P.Vector3,
  19450. s = new P.Vector3,
  19451. function(e, t, i) {
  19452. if (this.warpInterrupted)
  19453. i && i();
  19454. else if (this.activeTransType !== L.WALK)
  19455. this._clearWarpShading(),
  19456. this._warpStopFlying(),
  19457. this.player.spider.draw(),
  19458. this.placeCpm(),
  19459. i && i();
  19460. else if (this.player.currentPano !== e) {
  19461. var n = {
  19462. pano: e,
  19463. lookAtPoint: t,
  19464. duration: null,
  19465. maxDistanceOverride: D.warp.walkMaxDist,
  19466. skipWarpingCheck: !1,
  19467. constantMoveSpeed: !0
  19468. };
  19469. n.duration = function(e, t) {
  19470. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19471. s.copy(U.FORWARD),
  19472. this.player.getDirection(s),
  19473. a.copy(t).sub(e.position).normalize();
  19474. var n = a.dot(s)
  19475. , r = Math.acos(n)
  19476. , o = r / i;
  19477. return .001 < o && (i *= o / .001,
  19478. r < 1 && (i *= 1.2)),
  19479. i
  19480. }
  19481. .call(this, e, t),
  19482. this.player.nonInterruptingFlyToPano(n, i)
  19483. } else
  19484. i && i()
  19485. }
  19486. ),
  19487. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19488. return this.flightStepWalk.bind(this, e, t, i)
  19489. }
  19490. ,
  19491. t.prototype.warpTravel_WALK = (f = [],
  19492. function(e) {
  19493. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19494. var o = this.nodes[r]
  19495. , a = t.get(o);
  19496. this.nodes.length,
  19497. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19498. i && n || (f.push(o),
  19499. i = a)
  19500. }
  19501. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19502. var s = f.length
  19503. , l = t.get(f[s - 1])
  19504. , c = new Array(s + 1);
  19505. c[c.length - 1] = function() {
  19506. e && e()
  19507. }
  19508. .bind(this);
  19509. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19510. var d = f[h];
  19511. l = t.get(d);
  19512. var p = new P.Vector3;
  19513. this.getLookAtForWalkingTourNode(f, h, p),
  19514. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19515. h--
  19516. }
  19517. c[0]()
  19518. }
  19519. ),
  19520. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19521. h = new P.Vector3,
  19522. u = new P.Vector3,
  19523. d = new P.Vector3,
  19524. p = new P.Vector3,
  19525. function(e, t, i) {
  19526. var n = e.length;
  19527. if (n <= t)
  19528. return !1;
  19529. var r = 1
  19530. , o = 1;
  19531. h.set(0, 0, 0),
  19532. p.set(0, 0, 0);
  19533. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19534. if (a = this.player.model.panos.get(e[s]),
  19535. this.getOrientationForWalkingTourNode(e, s, u),
  19536. s === t && c.copy(u),
  19537. d.copy(u),
  19538. t < s) {
  19539. var l = d.dot(c) < .65;
  19540. r *= l ? .2 : .75,
  19541. o *= l ? .2 : .4
  19542. }
  19543. u.multiplyScalar(r),
  19544. h.add(u),
  19545. p.lerp(a.position, o)
  19546. }
  19547. return h.normalize(),
  19548. i.copy(p),
  19549. i.add(h),
  19550. !0
  19551. }
  19552. ),
  19553. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19554. var n = e.length;
  19555. if (n <= t)
  19556. return !1;
  19557. if (t === n - 1)
  19558. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19559. else {
  19560. var r = this.player.model.panos.get(e[t])
  19561. , o = this.player.model.panos.get(e[t + 1]);
  19562. i.copy(o.position).sub(r.position)
  19563. }
  19564. return i.normalize(),
  19565. !0
  19566. }
  19567. ,
  19568. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19569. if (this.activeTransType = this.upcomingTransType,
  19570. this.lastTransType = this.activeTransType,
  19571. this.upcomingTransType = null,
  19572. e)
  19573. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19574. this._clearWarpShading(),
  19575. this._warpStopFlying(),
  19576. this.player.spider.draw(),
  19577. this.placeCpm(),
  19578. n && n()
  19579. }
  19580. .bind(this)) : this.warpTravel_STD(n);
  19581. else {
  19582. var r = function() {
  19583. this._wrapupTravel(n)
  19584. }
  19585. .bind(this)
  19586. , o = {
  19587. pano: this.warpDestPano,
  19588. lookAtPoint: null,
  19589. duration: null,
  19590. maxDistanceOverride: null,
  19591. skipWarpingCheck: !1
  19592. };
  19593. this.player.flyToPano(o, r)
  19594. }
  19595. }
  19596. ,
  19597. t.prototype.startWarpState = function() {
  19598. this.warping = !0,
  19599. this.warpInterrupted = !1,
  19600. this.warpInterruptionBlackoutStyle = null,
  19601. this.warpInterruptionTravelTime = null
  19602. }
  19603. ,
  19604. t.prototype.endWarpState = function() {
  19605. this.warping = !1
  19606. }
  19607. ,
  19608. t.prototype.warpToPano = function(e, t, i, n) {
  19609. if (this.warping)
  19610. H.warn("Cannot warp when already warping");
  19611. else {
  19612. if (this.upcomingTransType = e,
  19613. this.activeTransType = null,
  19614. !this.setWarpDestPano())
  19615. return this.upcomingTransType = null,
  19616. void this.warpToNonPano(n);
  19617. if (this.player.mode !== O.PANORAMA)
  19618. return this.upcomingTransType = null,
  19619. this.discardSlow(),
  19620. void this.player.flyToNewMode({
  19621. mode: O.PANORAMA,
  19622. pano: this.warpDestPano,
  19623. duration: D.warp.outsideTime,
  19624. warpDest: this.warpDestHeroLoc,
  19625. callback: n,
  19626. force: !0
  19627. });
  19628. if (!this.warpDestPano)
  19629. return H.warn("no warp destination, callback dropped"),
  19630. void (this.upcomingTransType = null);
  19631. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  19632. , o = this.chooseWarpPath(r);
  19633. if (o && this.upcomingTransType !== L.WALK) {
  19634. var a = function() {
  19635. this.waitingToWarp = !1,
  19636. this.warpToPano(e, t, i, n)
  19637. }
  19638. .bind(this);
  19639. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19640. return void (this.waitingToWarp = !0)
  19641. }
  19642. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19643. this.player.currentPano = this.warpDestPano,
  19644. this.placeCpm(),
  19645. this.fadeOutCpm(D.path.fadeOutTime),
  19646. this.player.spider.draw()),
  19647. H.debug("Warping to pano ", this.warpDestPano.position),
  19648. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19649. this.startWarpState();
  19650. var s = function() {
  19651. this.endWarpState(),
  19652. n && n()
  19653. }
  19654. .bind(this);
  19655. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19656. }
  19657. }
  19658. ,
  19659. v.exports = t
  19660. }
  19661. ).call(this, "/js/objects/ShowPath.js")
  19662. }
  19663. , {
  19664. "../constants": 8,
  19665. "../effects": 16,
  19666. "../enum/BlackoutStyle": 18,
  19667. "../enum/ModelManagerEvents": 33,
  19668. "../enum/PlayerEvents": 40,
  19669. "../enum/RenderOrder": 42,
  19670. "../enum/Vectors": 50,
  19671. "../enum/Viewmode": 51,
  19672. "../enum/WarpStyle": 52,
  19673. "../gui/gui": 65,
  19674. "../model/ModelManager": 140,
  19675. "../objects/Snapshot": 153,
  19676. "../settings": 166,
  19677. "../shaders": 167,
  19678. "../util/easing": 186,
  19679. "../util/lerp": 188,
  19680. "../util/logger": 189,
  19681. "../util/math": 190,
  19682. "../util/texture": 194,
  19683. "../util/transitions": 195,
  19684. three: 217
  19685. }],
  19686. 152: [function(e, t, i) {
  19687. "use strict";
  19688. function n() {
  19689. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19690. , t = new r.RawShaderMaterial({
  19691. fragmentShader: o.skysphere.fragmentShader,
  19692. vertexShader: o.skysphere.vertexShader,
  19693. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19694. side: r.BackSide,
  19695. name: "skysphere"
  19696. });
  19697. t.uniforms.radius.value = e.parameters.radius,
  19698. r.Mesh.call(this, e, t)
  19699. }
  19700. var r = e("three")
  19701. , o = e("../shaders")
  19702. , a = e("../settings");
  19703. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19704. t.exports = n
  19705. }
  19706. , {
  19707. "../settings": 166,
  19708. "../shaders": 167,
  19709. three: 217
  19710. }],
  19711. 153: [function(r, o, e) {
  19712. (function(e) {
  19713. "use strict";
  19714. function t(e) {
  19715. n.call(this, e),
  19716. this.sid = e.sid,
  19717. this.panoId = e.panoId,
  19718. this.orthoZoom = e.orthoZoom,
  19719. this.floorVisibility = e.floorVisibility,
  19720. this.thumbUrl = e.thumbUrl,
  19721. this.name = e.name,
  19722. this.zoom = e.zoom
  19723. }
  19724. var i = (r("three"),
  19725. r("../util/logger"))
  19726. , n = (r("../settings"),
  19727. r("../enum/Viewmode"),
  19728. r("../util/common"),
  19729. r("../util/transitions"),
  19730. r("../util/lerp"),
  19731. r("../util/ajax"),
  19732. r("../util/texture"),
  19733. r("./View"));
  19734. r("events").EventEmitter,
  19735. new i(e),
  19736. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19737. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19738. }
  19739. ,
  19740. o.exports = t
  19741. }
  19742. ).call(this, "/js/objects/Snapshot.js")
  19743. }
  19744. , {
  19745. "../enum/Viewmode": 51,
  19746. "../settings": 166,
  19747. "../util/ajax": 181,
  19748. "../util/common": 185,
  19749. "../util/lerp": 188,
  19750. "../util/logger": 189,
  19751. "../util/texture": 194,
  19752. "../util/transitions": 195,
  19753. "./View": 154,
  19754. events: 202,
  19755. three: 217
  19756. }],
  19757. 154: [function(o, a, e) {
  19758. (function(e) {
  19759. "use strict";
  19760. function t(e) {
  19761. e = e || {},
  19762. this.position = new i.Vector3,
  19763. this.quaternion = new i.Quaternion,
  19764. this.update(e)
  19765. }
  19766. var i = o("three")
  19767. , n = o("../util/logger")
  19768. , r = (o("../settings"),
  19769. o("../enum/Viewmode"),
  19770. o("../util/common"),
  19771. o("../util/transitions"),
  19772. o("../util/lerp"),
  19773. o("../util/ajax"),
  19774. o("../util/texture"),
  19775. o("events").EventEmitter);
  19776. new n(e),
  19777. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19778. return !!this.cameraMode
  19779. }
  19780. ,
  19781. t.prototype.update = function(e) {
  19782. return this.cameraMode = e.cameraMode || this.cameraMode,
  19783. this.pano = e.pano || this.pano,
  19784. e.position && this.position.copy(e.position),
  19785. e.quaternion && this.quaternion.copy(e.quaternion),
  19786. this
  19787. }
  19788. ,
  19789. a.exports = t
  19790. }
  19791. ).call(this, "/js/objects/View.js")
  19792. }
  19793. , {
  19794. "../enum/Viewmode": 51,
  19795. "../settings": 166,
  19796. "../util/ajax": 181,
  19797. "../util/common": 185,
  19798. "../util/lerp": 188,
  19799. "../util/logger": 189,
  19800. "../util/texture": 194,
  19801. "../util/transitions": 195,
  19802. events: 202,
  19803. three: 217
  19804. }],
  19805. 155: [function(J, ee, e) {
  19806. (function(e) {
  19807. "use strict";
  19808. function t(e) {
  19809. this.currentPano = null,
  19810. this.nextPano = null,
  19811. this.camera = null,
  19812. this.paused = !1,
  19813. this.flying = !1,
  19814. this.sceneIntersectionPlane = null,
  19815. this.target = new B.Vector3,
  19816. this.mouse = new B.Vector3(1.1,1.1,.5),
  19817. this.mouseAtMouseDown = new B.Vector2,
  19818. this.mouseCouldBeClickToMove = !1,
  19819. this.mouseLastMoveTime = Date.now(),
  19820. this.mouseDown = !1,
  19821. this.mouseDownTimer = null,
  19822. this.couldBeLongTap = !1,
  19823. this.containsMouse = !0,
  19824. this.isTouchEvent = !1,
  19825. this.isPanoHover = !1,
  19826. this.reticule = new n(this),
  19827. this.panoMarkers = [],
  19828. this.spider = new s(this),
  19829. this.quaternion = new B.Quaternion,
  19830. this.position = new B.Vector3(15,10,15),
  19831. this.previousState = null,
  19832. this.lastInsideView = new o,
  19833. this.last360View = new o,
  19834. this.raycaster = new B.Raycaster,
  19835. this.intersect = null,
  19836. this.lastChangeTime = Date.now(),
  19837. this.history = new h,
  19838. this.cameraControls = null,
  19839. this.path = null,
  19840. this.model = null,
  19841. this.domElement = null,
  19842. this.cachedPanoCandidates = null,
  19843. this.basePanoSize = 0,
  19844. this.standardPanoSize = 0,
  19845. this.highPanoSize = 0,
  19846. this.ultraHighPanoSize = 0,
  19847. this.zoomLevel = 1,
  19848. this.zooming = 0,
  19849. this.zoomSpeed = .5,
  19850. this.scrollZoomSpeed = .06,
  19851. this.zoomSpeedAdjust = .05,
  19852. this.defaultZoomIncrement = .2,
  19853. this.baseFov = k.insideFOV,
  19854. this.zoomFov = this.baseFov,
  19855. this.zoomEnabled = !0,
  19856. this.preRenderingEnabled = !1,
  19857. this.setupCustomProperties(e),
  19858. this.zoomStats = new v,
  19859. this.modeTran = ''
  19860. this.currentCursor = '';
  19861. }
  19862. var B = J("three")
  19863. , i = J("./util/logger")
  19864. , n = J("./objects/Reticule")
  19865. , a = J("./objects/Panorama")
  19866. , r = J("./objects/ShowPath")
  19867. , o = J("./objects/View")
  19868. , s = (J("./objects/Snapshot"),
  19869. J("./objects/NSpider"))
  19870. , V = J("./enum/Viewmode")
  19871. , T = (J("./enum/TagStates"),
  19872. J("./enum/Vectors"))
  19873. , l = J("./enum/Keys")
  19874. , k = (J("./enum/AlignmentType"),
  19875. J("./settings"))
  19876. , x = J("./util/common")
  19877. , U = (J("./util/browser"),
  19878. J("./util/math"))
  19879. , H = J("./util/lerp")
  19880. , z = J("./util/easing")
  19881. , G = J("./util/transitions")
  19882. , c = J("events").EventEmitter
  19883. , h = (J("./shaders"),
  19884. J("./util/history"))
  19885. , S = (J("./util/camera"),
  19886. J("./model/ModelManager"),
  19887. J("./enum/PathDiscardMode"))
  19888. , M = J("./enum/PathDisplayMode")
  19889. , W = J("./enum/PlayerEvents")
  19890. , u = J("./enum/ControlEvents")
  19891. , d = J("./enum/ModelManagerEvents")
  19892. , R = J("./enum/WarpStyle")
  19893. , P = J("./enum/BlackoutStyle")
  19894. , p = J("./exception/BasicException")
  19895. , f = J("./enum/PanoSizeClass")
  19896. , g = (J("./tile/TileDownloader"),
  19897. J("./tile/TilePrioritizer"))
  19898. , m = (J("./enum/PanoramaEvents"),
  19899. J("./enum/ZoomEvents"))
  19900. , v = J("./util/ZoomStats")
  19901. , y = J("./constants")
  19902. , j = J("./util/common")
  19903. , A = J("./util/cameraLight")
  19904. , C = J("hot")
  19905. , Y = new i(e)
  19906. , q = Object.freeze({
  19907. FlyToPano: G.getUniqueId(),
  19908. FlyToNewMode: G.getUniqueId(),
  19909. FlyToSameMode: G.getUniqueId(),
  19910. FlyToViewFloor: G.getUniqueId(),
  19911. LookTransition: G.getUniqueId(),
  19912. ZoomTransition: G.getUniqueId()
  19913. });
  19914. function I(e) {
  19915. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  19916. o[r] = n.charCodeAt(r);
  19917. return new Blob([o],{
  19918. type: i
  19919. })
  19920. }
  19921. (t.prototype = Object.create(c.prototype)).init = function(e) {
  19922. (window.player = this).modelManager = e.modelManager,
  19923. this.tileDownloader = e.tileDownloader,
  19924. this.panoRenderer = e.panoRenderer,
  19925. this.qualityManager = e.qualityManager,
  19926. this.domElement = e.container,
  19927. this.camera = e.camera,
  19928. this.tagManager = e.tagManager,
  19929. this.cameraControls = e.controls,
  19930. this.path = new r(e.director,this,e.controls),
  19931. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  19932. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  19933. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  19934. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  19935. this.tileDownloader.processPriorityQueue = !1,
  19936. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  19937. this.bindEvents(e.container),
  19938. this.updateModel()
  19939. }
  19940. ,
  19941. t.prototype.screenShot = function(i) {
  19942. if (!this.flying && !this.flyingToTag) {
  19943. var n = this.sceneRenderer;
  19944. for (var e in n.updateScreenSize(i),
  19945. this.model.panos.index)
  19946. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  19947. this.model.panos.index[e].marker.visible = !1);
  19948. for (var e in this.model.hots)
  19949. this.model.hots[e].mesh.visible = !1;
  19950. this.reticule.visible = !1,
  19951. this.reticule.forceUnvisible = !0,
  19952. this.path.currentPanoMarker.mesh.visible = !1,
  19953. setTimeout(function() {
  19954. n.renderer.clear(!0, !0, !0),
  19955. n.renderer.render(n.scene, n.camera);
  19956. var e = n.renderer.domElement.toDataURL(i.type, .9);
  19957. for (var t in i.f && i.f(e),
  19958. n.updateScreenSize({
  19959. resize: !0
  19960. }),
  19961. this.reticule.visible = !0,
  19962. this.model.hots)
  19963. this.model.hots[t].mesh.visible = !0;
  19964. for (var t in this.model.panos.index)
  19965. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  19966. this.path.currentPanoMarker.mesh.visible = !0,
  19967. n.renderer.render(n.scene, n.camera)
  19968. }
  19969. .bind(this), 30)
  19970. }
  19971. }
  19972. ;
  19973. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  19974. t.prototype.getWrapShot = function() {
  19975. var i = this.getSnapAngleInfo()
  19976. , n = ",{\r\t" + i
  19977. , r = arguments[0];
  19978. this.screenShot({
  19979. width: 4 * g_snapShotWidth,
  19980. height: 4 * g_snapShotHeight,
  19981. type: "image/jpeg",
  19982. f: function(e) {
  19983. if (r && r.__callback)
  19984. return r.__callback(e, i);
  19985. var t = new Image;
  19986. t.src = e,
  19987. t.onload = function() {
  19988. var e = function(r, i) {
  19989. function n(e, t) {
  19990. var i = o || r
  19991. , n = document.createElement("canvas");
  19992. n.width = i.width,
  19993. n.height = i.height,
  19994. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  19995. o = Q(e, n, t)
  19996. }
  19997. function e() {
  19998. var e = o || r
  19999. , t = I(e.src);
  20000. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20001. t = I(e.src)),
  20002. (o = o || new Image).base64Src = e.src,
  20003. o.src = window.URL.createObjectURL(t)
  20004. }
  20005. var o, t = Math.max(r.width, r.height);
  20006. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20007. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20008. e())),
  20009. o || r
  20010. }(this, {
  20011. maxSize: g_snapShotWidth,
  20012. oldType: "jpeg"
  20013. });
  20014. e.src.replace(function(e) {
  20015. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20016. }("image/jpeg"), "image/octet-stream");
  20017. var t = "snap" + (new Date).getTime();
  20018. !function(e, t) {
  20019. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20020. i.href = e,
  20021. i.download = t;
  20022. var n = document.createEvent("MouseEvents");
  20023. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20024. i.dispatchEvent(n)
  20025. }(e.src, t + ".jpg"),
  20026. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20027. n += '\r\t"sid":"' + t + '",',
  20028. n += '\r\t"name":"' + t + '"\r}',
  20029. logData(n)
  20030. }
  20031. }
  20032. })
  20033. }
  20034. /* ,
  20035. t.prototype.getSnapAngleInfo = function() {
  20036. var e = {}
  20037. , t = '"metadata":{'
  20038. , i = this.camera.quaternion.clone();
  20039. switch (this.mode) {
  20040. case "panorama":
  20041. e.scan_id = this.currentPano.id,
  20042. t += '"scan_id":"' + this.currentPano.id + '",';
  20043. break;
  20044. case "floorplan":
  20045. e.camera_mode = 1,
  20046. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20047. t += '"camera_mode":1,',
  20048. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20049. break;
  20050. case "dollhouse":
  20051. e.camera_mode = 2,
  20052. t += '"camera_mode":2,'
  20053. }
  20054. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20055. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20056. n.x *= -1,
  20057. n.w *= -1,
  20058. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20059. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20060. e.zoom = this.zoomLevel,
  20061. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20062. }
  20063. , */
  20064. t.prototype.getSnapAngleInfo = function(){
  20065. var info = {};
  20066. var str = '"metadata":{';
  20067. var q = this.camera.quaternion.clone();
  20068. switch (this.mode) {
  20069. case "panorama":
  20070. info.scan_id = this.currentPano.id;
  20071. str += ('"scan_id":"'+this.currentPano.id+'",');
  20072. break;
  20073. case "floorplan":
  20074. info.camera_mode = 1;
  20075. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20076. q.multiply(this.camera.quaternion);
  20077. str += ('"camera_mode":1,');
  20078. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20079. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20080. break;
  20081. case "dollhouse":
  20082. info.camera_mode = 2;
  20083. str += ('"camera_mode":2,');
  20084. break;
  20085. }
  20086. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20087. //console.log(info.camera_position)
  20088. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20089. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20090. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20091. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20092. out.x *= -1;
  20093. out.w *= -1;
  20094. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20095. }else{
  20096. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20097. } */
  20098. info.zoom = this.zoomLevel;
  20099. //console.log(info.camera_quaternion)
  20100. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20101. // fyz 扩展编辑页面, 加上导览点缩放值
  20102. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20103. console.log(str)
  20104. return str;
  20105. }
  20106. //------end
  20107. t.prototype.closePopup = function() {
  20108. if (g_currentHot) {
  20109. g_currentHot = null,
  20110. document.getElementById("popup").style.display = "none",
  20111. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20112. $("#popup iframe:last").remove();
  20113. document.getElementById("bgaudio");
  20114. if(g_bgAudio && g_bgAudio.pauseByHot){
  20115. manage.switchBgmState(true)
  20116. }
  20117. return false
  20118. }
  20119. }
  20120. ,
  20121. t.prototype.setupCustomProperties = function(e) {
  20122. var i = e || V.PANORAMA;
  20123. Object.defineProperty(this, "mode", {
  20124. get: function() {
  20125. return i
  20126. },
  20127. set: function(e) {
  20128. var t = i;
  20129. i = e,
  20130. this.onModeUpdated(t, i)
  20131. }
  20132. })
  20133. }
  20134. ,
  20135. t.prototype.isInMode = function() {
  20136. for (var e = 0; e < arguments.length; e++)
  20137. if (this.mode === arguments[e])
  20138. return !0;
  20139. return !1
  20140. }
  20141. ,
  20142. t.prototype.isOutsideMode = function(e) {
  20143. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20144. }
  20145. ,
  20146. t.prototype.is360View = function(e, t) {
  20147. return e === V.PANORAMA && t && !t.isAligned()
  20148. }
  20149. ,
  20150. t.prototype.setScene = function(e) {
  20151. this.sceneIntersectionPlane = e.plane,
  20152. this.path.setScene(e),
  20153. this.moveReticuleToScene(e)
  20154. }
  20155. ,
  20156. t.prototype.moveReticuleToScene = function(e) {
  20157. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20158. e.add(this.reticule)
  20159. }
  20160. ,
  20161. t.prototype.updateModel = function() {
  20162. function n(e) {
  20163. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20164. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20165. , n = t.position.y + (e - i.target.y)
  20166. , r = k.showFloorDuration + k.showFloorDelay;
  20167. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20168. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20169. }
  20170. this.model = this.modelManager.getActiveModel(),
  20171. this.model.on("floor.changed", function(e, t, i) {
  20172. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20173. }
  20174. .bind(this)),
  20175. this.model.on("allfloors.toggled", function(e, t) {
  20176. if (this.mode === V.DOLLHOUSE) {
  20177. var i = e ? this.model.center.y : i = t.center.y;
  20178. n.call(this, i)
  20179. }
  20180. }
  20181. .bind(this)),
  20182. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20183. var t = this;
  20184. this.model.panos.list.forEach(function(e) {
  20185. e.vrMarker.addEventListener("click", function() {
  20186. t.flyToPano({
  20187. pano: e
  20188. })
  20189. })
  20190. })
  20191. }
  20192. ,
  20193. t.prototype.updateModelDependentData = function() {
  20194. this.cameraControls.setModelForControls(this.model),
  20195. this.getPanoMarkersFromModel(this.model)
  20196. }
  20197. ,
  20198. t.prototype.onModelChanged = function() {
  20199. this.updateModel(),
  20200. this.updateModelDependentData()
  20201. }
  20202. ,
  20203. t.prototype.getPanoMarkersFromModel = function(e) {
  20204. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20205. return t.marker ? e.concat(t.marker) : e
  20206. }, [])
  20207. }
  20208. ,
  20209. t.prototype.handleControlMove = function(e) {
  20210. this.emit(W.Move, e)
  20211. }
  20212. ,
  20213. t.prototype.handleControlInputStart = function(e) {
  20214. this.emit(W.InputStart, e)
  20215. }
  20216. ,
  20217. t.prototype.onModeUpdated = function(e, t) {
  20218. this.cameraControls.activateControls(t),
  20219. this.emit(W.ModeChanged, e, t)
  20220. }
  20221. ,
  20222. t.prototype.isWarping = function() {
  20223. return this.path.warping
  20224. }
  20225. ,
  20226. t.prototype.isWaitingToWarp = function() {
  20227. return this.path.waitingToWarp
  20228. }
  20229. ,
  20230. t.prototype.getLabelScaleFactor = function() {
  20231. if (this.isOutsideMode()) {
  20232. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20233. }
  20234. return .5
  20235. }
  20236. ,
  20237. t.prototype.changeMusic = function() {
  20238. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20239. }
  20240. ,
  20241. t.prototype.bindEvents = function(e) {
  20242. e !== document && e.setAttribute("tabindex", -1),
  20243. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20244. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20245. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20246. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20247. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20248. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20249. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20250. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20251. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20252. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20253. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20254. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20255. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20256. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20257. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20258. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20259. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20260. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20261. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20262. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20263. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20264. window.getSeft && getSeft(this),
  20265. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20266. }
  20267. ,
  20268. t.prototype.onMouseDown = function(e) {
  20269. e.currentTarget !== document && e.currentTarget.focus(),
  20270. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20271. this.updateIntersect())
  20272. }
  20273. ,
  20274. t.prototype.onMouseMove = function(e) {
  20275. this.isTouchEvent = !1,
  20276. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20277. }
  20278. ,
  20279. t.prototype.onMouseOver = function(e) {
  20280. this.containsMouse = !0,
  20281. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20282. }
  20283. ,
  20284. t.prototype.onMouseOut = function(e) {
  20285. this.containsMouse = !1
  20286. }
  20287. ,
  20288. t.prototype.onMouseUp = function(e) {
  20289. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20290. }
  20291. ,
  20292. t.prototype.onTouchStart = function(e) {
  20293. if (e.currentTarget !== document && e.currentTarget.focus(),
  20294. !this.mouseDown) {
  20295. this.couldBeLongTap = !0;
  20296. var t = x.average(e.changedTouches, "clientX")
  20297. , i = x.average(e.changedTouches, "clientY");
  20298. this.handleInputStart.call(this, t, i, !0),
  20299. this.mouseDownTimer = setTimeout(function() {
  20300. this.updateIntersect(),
  20301. this.handleInputEnd.call(this, t, i, !0)
  20302. }
  20303. .bind(this), k.input.longTapThreshold)
  20304. }
  20305. }
  20306. ,
  20307. t.prototype.onTouchMove = function(e) {
  20308. var t = x.average(e.changedTouches, "clientX")
  20309. , i = x.average(e.changedTouches, "clientY");
  20310. this.handleInputMove.call(this, t, i, !0)
  20311. }
  20312. ,
  20313. t.prototype.onTouchEnd = function(e) {
  20314. if (clearTimeout(this.mouseDownTimer),
  20315. this.mouseDown) {
  20316. this.couldBeLongTap = !1,
  20317. this.updateIntersect();
  20318. var t = x.average(e.changedTouches, "clientX")
  20319. , i = x.average(e.changedTouches, "clientY");
  20320. this.handleInputEnd.call(this, t, i, !0)
  20321. }
  20322. }
  20323. ,
  20324. t.prototype.onPointerDown = function(e) {
  20325. return e.currentTarget !== document && e.currentTarget.focus(),
  20326. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20327. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20328. void (this.mouseDownTimer = setTimeout(function() {
  20329. this.updateIntersect(),
  20330. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20331. }
  20332. .bind(this), k.input.longTapThreshold)))
  20333. }
  20334. ,
  20335. t.prototype.onPointerMove = function(e) {
  20336. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20337. }
  20338. ,
  20339. t.prototype.onPointerUp = function(e) {
  20340. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20341. this.couldBeLongTap = !1,
  20342. this.updateIntersect(),
  20343. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20344. }
  20345. ,
  20346. t.prototype.onPointerOut = function(e) {
  20347. this.mouseDown = !1
  20348. }
  20349. ,
  20350. t.prototype.onPointerCancel = function(e) {
  20351. this.mouseDown = !1
  20352. }
  20353. ,
  20354. t.prototype.onKeyDown = function(e) {
  20355. var t = function() {
  20356. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20357. }
  20358. .bind(this)
  20359. , i = e.which;
  20360. switch (i) {
  20361. case l.F:
  20362. t(),
  20363. this.changeFloor(-1);
  20364. break;
  20365. case l.R:
  20366. t(),
  20367. this.changeFloor(1)
  20368. }
  20369. if (this.mode === V.PANORAMA)
  20370. switch (i) {
  20371. case l.UPARROW:
  20372. case l.W:
  20373. this.flyLocalDirection(T.FORWARD.clone());
  20374. break;
  20375. case l.DOWNARROW:
  20376. case l.S:
  20377. this.flyLocalDirection(T.BACK.clone());
  20378. break;
  20379. case l.A:
  20380. this.flyLocalDirection(T.LEFT.clone());
  20381. break;
  20382. case l.D:
  20383. this.flyLocalDirection(T.RIGHT.clone())
  20384. }
  20385. }
  20386. ,
  20387. t.prototype.handleScrollPinchZoom = function(e) {
  20388. var t = e
  20389. , i = this.zoomLevel;
  20390. this.zoomBy(t),
  20391. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20392. }
  20393. ,
  20394. t.prototype.handleControlPinch = function(e) {
  20395. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20396. }
  20397. ,
  20398. t.prototype.handleControlScroll = function(e) {
  20399. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20400. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20401. }
  20402. ,
  20403. t.prototype.handleInputStart = function(e, t, i) {
  20404. var n = this.handelPadding(e, t);
  20405. e = n.x,
  20406. t = n.y,
  20407. this.isTouchEvent = i,
  20408. U.convertScreenPositionToNDC(e, t, this.mouse),
  20409. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20410. this.mouseCouldBeClickToMove = !0,
  20411. this.mouseDown = !0,
  20412. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20413. window.transformControls && transformControls.onPointerDown()
  20414. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20415. try{
  20416. this.overlayGroup.children.forEach((overlay)=>{overlay.plane.material.map.image.play()})
  20417. }catch(e){}
  20418. this.overlayInitedPlay = true
  20419. }
  20420. }
  20421. ,
  20422. t.prototype.handelPadding = function(e, t) {
  20423. return this.pad || (this.pad = {
  20424. x: dom.getOffset("left", $("#player")[0]),
  20425. y: dom.getOffset("top", $("#player")[0])
  20426. }),
  20427. {
  20428. x: e - this.pad.x,
  20429. y: t - this.pad.y
  20430. }
  20431. }
  20432. ,
  20433. t.prototype.handleInputMove = function(e, t, i) {
  20434. var n = this.handelPadding(e, t);
  20435. e = n.x,
  20436. t = n.y,
  20437. this.isTouchEvent = i,
  20438. U.convertScreenPositionToNDC(e, t, this.mouse);
  20439. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20440. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20441. this.couldBeLongTap = !1,
  20442. clearTimeout(this.mouseDownTimer)),
  20443. this.mouseLastMoveTime = Date.now(),
  20444. this.reticule.move(e, t, i)
  20445. window.transformControls && transformControls.onPointerMove()
  20446. }
  20447. ,
  20448. t.prototype.handleInputEnd = function(e, t, i) {
  20449. if (this.isTouchEvent = i,
  20450. this.mouseDown = !1,
  20451. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20452. !i && this.couldBeLongTap)
  20453. return !0;
  20454. if (this.handleLongTap())
  20455. return !0;
  20456. window.transformControls && transformControls.onPointerUp()
  20457. if (this.mouseCouldBeClickToMove) {
  20458. if (this.flying)
  20459. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20460. !0;
  20461. //add----
  20462. if (window.panoVisiSet && panoVisiSet.setPanoVisible) {//正在设置漫游可行
  20463. this.intersect && this.intersect.object.visible && panoVisiSet.dealPanoVisible(this.intersect.object.name);
  20464. return;
  20465. }
  20466. if(this.hoveringPlane){
  20467. this.clickOverlay(this.hoveringPlane)
  20468. return;
  20469. }
  20470. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20471. return EditOverlay.addPlane({intersect:this.intersect});
  20472. }
  20473. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20474. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20475. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20476. } */
  20477. //----------
  20478. if (this.checkHotClick())
  20479. return !0;
  20480. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20481. this.history.invalidate(),
  20482. this.intersect)
  20483. return this.flyToPanoClosestToMouse();
  20484. if (this.mode === V.PANORAMA) {
  20485. var n = this.closestPanoInDirection(this.getMouseDirection());
  20486. return n ? this.flyToPano({
  20487. pano: n
  20488. }) : this.bump(this.getMouseDirection())
  20489. }
  20490. }
  20491. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20492. }
  20493. ,
  20494. t.prototype.handleLongTap = function() {
  20495. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20496. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20497. !0
  20498. }
  20499. ,
  20500. t.prototype.checktagClick = function() {
  20501. if (this.tagManager.intersectTag) {
  20502. var e = this.isTouchEvent
  20503. , t = this.tagManager.clickedOnTag(e, this);
  20504. return e || t || G.cancelById(q.LookTransition),
  20505. !0
  20506. }
  20507. if (this.tagManager.activeTag)
  20508. return this.tagManager.dismissActiveTag(),
  20509. !1
  20510. }
  20511. ,
  20512. t.prototype.rankedtagInDirection = function(e, t) {
  20513. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20514. }
  20515. ,
  20516. t.prototype.start = function(e) {
  20517. $(".toolLeft").removeClass("unable");
  20518. $(".toolTop").removeClass("unable");
  20519. //-------------------
  20520. window.initTransformCtl(B)
  20521. window.initOverlay(B)
  20522. this.model.loadOverlays()
  20523. window.EditOverlay && window.EditOverlay.init(B);
  20524. window.panoVisiSet && panoVisiSet.init()
  20525. //-------------------
  20526. var t = e.mode
  20527. , i = e.pano
  20528. , n = e.position
  20529. , r = e.quaternion
  20530. , o = e.tag
  20531. , a = e.quickstart
  20532. , s = $.Deferred();
  20533. this.updateModelDependentData(),
  20534. this.updateFromControls(),
  20535. this.findDefaultViews();
  20536. var l = this.is360View(t, i);
  20537. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20538. s.done(function(e) {
  20539. this.emit(W.Ready, l, e, o)
  20540. }
  20541. .bind(this)),
  20542. s.promise()
  20543. }
  20544. ,
  20545. t.prototype.startOutside = function(e, t) {
  20546. var i = e.mode
  20547. , n = e.pano
  20548. , r = e.position
  20549. , o = e.quaternion
  20550. , a = e.zoom
  20551. , s = e.floorVisibility
  20552. , l = e.tag;
  20553. this.emit(W.StartOutside, k[i].transitionTime),
  20554. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20555. G.cancelById(q.FlyToViewFloor),
  20556. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20557. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20558. }
  20559. ,
  20560. t.prototype.startInside = function(e, t, i, n, r) {
  20561. r = r || $.Deferred();
  20562. var o = (this.currentPano = e) && !e.isAligned();
  20563. if (t = o ? e.position : t || e.position,
  20564. i = i || e.quaternion,
  20565. e) {
  20566. var a = this.startInside.bind(this, e, t, i, n, r);
  20567. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20568. return
  20569. }
  20570. return this.mode = V.PANORAMA,
  20571. e.floor.enter(this.mode),
  20572. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20573. this.switchCameraMode(this.mode, i),
  20574. this.emit(W.StartInside, o),
  20575. r.resolve(!0),
  20576. r
  20577. }
  20578. ,
  20579. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20580. if (r = r || $.Deferred(),
  20581. this.dollhouseMode(),
  20582. !i)
  20583. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20584. r.resolve(!1),
  20585. r;
  20586. e = e || i.position;
  20587. var o = n || this.cameraControls.activeControl.camera.quaternion
  20588. , a = i.position;
  20589. return this.fitDollhouse(a, e, o),
  20590. setTimeout(function(e) {
  20591. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20592. var t = {
  20593. mode: V.PANORAMA,
  20594. pano: i,
  20595. quaternion: n,
  20596. callback: function() {
  20597. this.emit(W.FlyinFinished),
  20598. r.resolve(!0)
  20599. }
  20600. .bind(this)
  20601. };
  20602. this.flyToNewMode(t)
  20603. }
  20604. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20605. r
  20606. }
  20607. ,
  20608. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20609. K = {},
  20610. function(t, e, i, n, r, o, a, s, l, c) {
  20611. if (function() {
  20612. for (var e in Z)
  20613. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20614. return !0;
  20615. return !1
  20616. }())
  20617. return !0;
  20618. var h = function(e, t, i) {
  20619. j.delayOneFrame(function() {
  20620. Z[e] = !1,
  20621. r && r(t, i)
  20622. }
  20623. .bind(this))
  20624. }
  20625. .bind(this, t.id)
  20626. , u = function(e, t) {
  20627. j.delayOneFrame(function() {
  20628. Z[e] = !1,
  20629. o && o(t)
  20630. }
  20631. .bind(this))
  20632. }
  20633. .bind(this, t.id);
  20634. try {
  20635. return null != s || (s = !0),
  20636. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  20637. Z[t.id] && (K[t.id] = performance.now()),
  20638. Z[t.id]
  20639. } catch (e) {
  20640. throw Z[t.id] = !1,
  20641. K[t.id] = performance.now() - 5e3,
  20642. e
  20643. }
  20644. }
  20645. ),
  20646. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20647. if (!e)
  20648. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20649. return r && this.model.waitForLoad(e, function() {
  20650. return e.isLoaded(i)
  20651. }),
  20652. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20653. !0)
  20654. }
  20655. ,
  20656. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20657. function(e, t, i, n, r, o, a, s) {
  20658. if (!e)
  20659. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20660. return X.copy(T.FORWARD),
  20661. this.getDirection(X),
  20662. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20663. return e.isLoaded(t)
  20664. }),
  20665. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20666. i && i(e, t)
  20667. }
  20668. .bind(this)).fail(function(e) {
  20669. n && n(e)
  20670. }
  20671. .bind(this)).progress(function(e, t, i) {
  20672. r && r(e, t, i)
  20673. }
  20674. .bind(this)),
  20675. !0)
  20676. }
  20677. ),
  20678. t.prototype.switchCameraMode = function(e, t) {
  20679. var i = this.cameraControls.controls[e]
  20680. , n = i.camera;
  20681. switch (e) {
  20682. case V.PANORAMA:
  20683. n.position.copy(this.currentPano.position);
  20684. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20685. i.lookAt(r.add(n.position));
  20686. break;
  20687. case V.DOLLHOUSE:
  20688. var o = this.position.clone();
  20689. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  20690. n.position.copy(o),
  20691. i.target.copy(this.target.clone().setY(this.model.center.y));
  20692. break;
  20693. case V.FLOORPLAN:
  20694. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20695. i.target.copy(this.model.center).setY(0),
  20696. i.zoomToContain(this.model.size),
  20697. i.rotateToView(this.model.size, this.getDirection())
  20698. }
  20699. i.update(0)
  20700. }
  20701. ,
  20702. t.prototype.update = (new B.Vector3,
  20703. N = {},
  20704. F = [],
  20705. function(e) {
  20706. this.updatePersistentZooming(e),
  20707. this.updateFromControls(e),
  20708. this.getCurrentNodePanos(F)
  20709. if(this.hasChanged(N)){
  20710. this.lastChangeTime = Date.now(),
  20711. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20712. this.emit(W.ViewChanged)
  20713. //add:
  20714. if (window.panoVisiSet && panoVisiSet.setPanoVisible) panoVisiSet.updateFootIconSize();
  20715. }
  20716. this.model.supportsTiles && (this.updateTileDownloader(F),
  20717. this.updatePanoRenderer(F)),
  20718. this.updatePreRendering(F),
  20719. this.reticule.update(),
  20720. this.path.update(),
  20721. this.spider.update(),
  20722. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20723. this.updateControlLocks(),
  20724. this.model.supportsTiles && this.updateZoomPano()
  20725. }
  20726. ),
  20727. t.prototype.updatePersistentZooming = function(e) {
  20728. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20729. }
  20730. ,
  20731. t.prototype.updateControlLocks = function() {
  20732. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20733. }
  20734. ,
  20735. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20736. function(e) {
  20737. var t = this.nextPano || this.currentPano;
  20738. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20739. this.getDirection(D),
  20740. this.panoRenderer.updateDirection(D))
  20741. }
  20742. ),
  20743. t.prototype.cleanupInactivePanos = (O = [],
  20744. L = [],
  20745. function() {
  20746. O.length = 0,
  20747. O.push(this.currentPano),
  20748. this.nextPano && O.push(this.nextPano);
  20749. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20750. L.push(this.panoRenderer.activePanos[e]);
  20751. for (var t = 0; t < L.length; t++) {
  20752. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20753. i.id === O[r].id && (n = !1);
  20754. n && i.exit()
  20755. }
  20756. }
  20757. ),
  20758. t.prototype.updatePreRendering = (w = {},
  20759. function(e) {
  20760. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20761. var t = this.nextPano || this.currentPano;
  20762. if (t && e && 1 < e.length) {
  20763. var i = e.findIndex(function(e) {
  20764. if (e.id === t.id)
  20765. return !0
  20766. });
  20767. if (0 <= i && i + 1 < e.length) {
  20768. var n = e[i + 1];
  20769. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20770. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20771. window.setTimeout(function(e) {
  20772. w[e.id] = !1
  20773. }
  20774. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20775. }
  20776. .bind(this, n), k.tiling.panoPreRenderDelay),
  20777. w[n.id] = !0)
  20778. }
  20779. }
  20780. }
  20781. }
  20782. ),
  20783. t.prototype.enablePreRendering = function() {
  20784. this.preRenderingEnabled = !0
  20785. }
  20786. ,
  20787. t.prototype.disablePreRendering = function() {
  20788. this.preRenderingEnabled = !1,
  20789. this.cleanupInactivePanos()
  20790. }
  20791. ,
  20792. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20793. function(e) {
  20794. var t = this.nextPano || this.currentPano;
  20795. t && (b.copy(T.FORWARD),
  20796. this.getDirection(b),
  20797. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20798. this.tileDownloader.processPriorityQueue = !0)
  20799. }
  20800. ),
  20801. t.prototype.updateFromControls = function(e) {
  20802. null != e || (e = 0),
  20803. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20804. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20805. this.position.copy(this.cameraControls.activeControl.camera.position),
  20806. this.target.copy(this.cameraControls.activeControl.target),
  20807. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20808. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20809. this.camera.position.copy(this.position),
  20810. this.camera.quaternion.copy(this.quaternion),
  20811. this.camera.updateMatrix(),
  20812. this.camera.updateMatrixWorld()
  20813. }
  20814. ,
  20815. t.prototype.hasChanged = function(e) {
  20816. if (!this.previousState)
  20817. return this.previousState = {
  20818. allFloorsVisible: this.model.allFloorsVisible,
  20819. position: this.position.clone(),
  20820. quaternion: this.quaternion.clone(),
  20821. mouse: this.mouse.clone(),
  20822. labelScaleFactor: this.getLabelScaleFactor(),
  20823. currentFloor: this.model.currentFloor,
  20824. projectionMatrix: this.camera.projectionMatrix.clone(),
  20825. worldMatrix: this.camera.matrixWorld.clone(),
  20826. mode: this.mode,
  20827. modelPosition: this.model.position.clone(),
  20828. modelCenter: this.model.center.clone(),
  20829. zoomLevel: this.zoomLevel
  20830. },
  20831. !0;
  20832. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  20833. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  20834. e.moved = !this.position.equals(this.previousState.position),
  20835. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  20836. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  20837. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  20838. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  20839. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  20840. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  20841. e.modeChanged = this.mode !== this.previousState.mode,
  20842. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  20843. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  20844. e.nextPanoActive = null !== this.nextPano,
  20845. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  20846. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  20847. this.previousState.position.copy(this.position),
  20848. this.previousState.quaternion.copy(this.quaternion),
  20849. this.previousState.mouse.copy(this.mouse),
  20850. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  20851. this.previousState.currentFloor = this.model.currentFloor,
  20852. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  20853. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  20854. this.previousState.mode = this.mode,
  20855. this.previousState.modelPosition.copy(this.model.position),
  20856. this.previousState.modelCenter.copy(this.model.center),
  20857. this.previousState.zoomLevel = this.zoomLevel,
  20858. !t
  20859. }
  20860. ,
  20861. t.prototype.updateIntersect = function() {
  20862. var e = this.flying || this.isWarping()
  20863. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  20864. , i = G.getById(q.LookTransition);
  20865. e || t || this.isTouchEvent || i.length && i[0].running;
  20866. if (window.panoVisiSet && panoVisiSet.setPanoVisible) {
  20867. this.intersect = this.getMouseIntersect(null, panoVisiSet.footIcons);
  20868. if (this.intersect && this.intersect.object.visible )
  20869. $("#player").css("cursor", "pointer");
  20870. else
  20871. $("#player").css("cursor", "")
  20872. return;
  20873. }
  20874. this.intersect = this.getMouseIntersect(),
  20875. this.intersect && this.updateClosestPano(this.intersect),
  20876. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  20877. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  20878. }
  20879. ,
  20880. t.prototype.checkHotClick = function() {
  20881. if (this.intersectHot)
  20882. return this.intersectHot.examine(this),
  20883. !0
  20884. }
  20885. ,
  20886. t.prototype.getMouseDirection = function(e) {
  20887. e = e || this.mouse;
  20888. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20889. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  20890. }
  20891. ,
  20892. t.prototype.hoverOverlay = function(mesh){
  20893. if(!mesh){
  20894. this.hoveringPlane = null;
  20895. $("#player").css("cursor",this.currentCursor || "" );
  20896. }else{
  20897. var overlay = mesh.parent;
  20898. $("#player").css("cursor","pointer");
  20899. this.hoveringPlane = overlay;
  20900. return true;
  20901. }
  20902. },
  20903. t.prototype.clickOverlay = function(overlay){
  20904. if(this.openOverlay && !overlay)return;
  20905. var plane = overlay.plane;
  20906. if(overlay.overlayType == "video"){
  20907. if(plane.material.map.image.paused)plane.material.map.image.play()
  20908. else plane.material.map.image.pause();
  20909. }
  20910. if(window.EditOverlay &&EditOverlay.editing){
  20911. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  20912. $('#overlayProp').removeClass('atRight').removeClass('hide')
  20913. EditOverlay.endAddPlane();
  20914. EditOverlay.updateOverlayPanel(overlay)
  20915. transformControls.attach(overlay)
  20916. return;
  20917. }
  20918. },
  20919. t.prototype.getMouseIntersect = function(e, t) {
  20920. e = e || this.mouse.clone(),
  20921. t = t || this.model.floors.reduce(function(e, t) {
  20922. return t.hidden ? e : e.concat(t.collider.children)
  20923. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  20924. t = t.slice(0)
  20925. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  20926. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  20927. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20928. this.raycaster.set(i, this.getMouseDirection(e));
  20929. var n = this.raycaster.intersectObjects(t, true);//add true
  20930. if ("add" == g_HotStatus) {
  20931. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  20932. //console.log(r[0]),
  20933. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  20934. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  20935. window.hotIntersect = !1)
  20936. return;
  20937. }
  20938. if (0 === n.length)
  20939. return this.intersectHot = null,
  20940. "add" != g_HotStatus && $("#player").css("cursor", ""),
  20941. null;
  20942. var o = n[0];
  20943. if ("hotSprite" == o.object.type){
  20944. return this.intersectHot = o.object.belongHot, $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active"),
  20945. void $("#player").css("cursor", "pointer");
  20946. }
  20947. $(".toolRight .spotList ul li").removeClass("active")
  20948. this.intersectHot = null;
  20949. /* if(window.EditOverlay && n && n.length){
  20950. if(n[0].object.parent.parent == this.overlayGroup){
  20951. this.hoverOverlay(n[0].object);
  20952. }else()
  20953. } */
  20954. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  20955. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  20956. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  20957. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  20958. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  20959. o.horizontal = .8 < o.normal.y);
  20960. return o
  20961. }
  20962. ,
  20963. t.prototype.updateClosestPano = function(e) {
  20964. var t = [a.filters.isPanoAligned()];
  20965. if (this.mode === V.PANORAMA) {
  20966. if (!this.currentPano)
  20967. return;
  20968. t.push(a.filters.not(this.currentPano)),
  20969. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  20970. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  20971. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  20972. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  20973. } else{
  20974. t.push((pano)=>{ // add
  20975. return this.checkHasNeighbor(pano)
  20976. })
  20977. t.push(a.filters.isOnVisibleFloor()),
  20978. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  20979. }
  20980. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  20981. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  20982. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  20983. this.closestPano = i) : this.isPanoHover = !1
  20984. }
  20985. ,
  20986. t.prototype.dollhouseMode = function(e, t) {
  20987. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  20988. this.mode = V.DOLLHOUSE,
  20989. this.cameraControls.controls[V.DOLLHOUSE].reset();
  20990. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  20991. , n = new B.Vector3(15,10,15);
  20992. if (e && t) {
  20993. var r = T.FORWARD.clone().applyQuaternion(t)
  20994. , o = this.model.center.clone().sub(e).dot(r);
  20995. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  20996. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  20997. }
  20998. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  20999. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21000. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21001. this.updateFromControls(),
  21002. this.model.alpha = 1,
  21003. this.model.skybox.material.uniforms.opacity.value = 0
  21004. }
  21005. ,
  21006. t.prototype.insideMode = function(e, t) {
  21007. var i = $.Deferred()
  21008. , n = t || null;
  21009. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21010. var r = [a.filters.isPanoAligned()];
  21011. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21012. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21013. this.flyToNewMode({
  21014. mode: V.PANORAMA,
  21015. pano: e,
  21016. callback: n
  21017. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21018. } else {
  21019. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21020. i.reject(o)
  21021. }
  21022. return i.promise()
  21023. }
  21024. ,
  21025. t.prototype.fitDollhouse = function(e, t, i) {
  21026. var n = T.FORWARD.clone().applyQuaternion(i);
  21027. i = n.clone().add(e);
  21028. this.cameraControls.activeControl.target.copy(i),
  21029. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  21030. }
  21031. ,
  21032. t.prototype.floorplanMode = function(e, t, i) {
  21033. this.mode = V.FLOORPLAN;
  21034. var n = this.cameraControls.controls[V.FLOORPLAN];
  21035. n.reset();
  21036. var r = e || this.model.center;
  21037. if (n.target.copy(r).setY(0),
  21038. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21039. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21040. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21041. t) {
  21042. var o = T.LEFT.clone().applyQuaternion(t);
  21043. n.rotateLeft(-Math.atan2(o.x, o.z))
  21044. } else
  21045. n.rotateToView(this.model.size, this.getDirection());
  21046. n.update(0)
  21047. }
  21048. ,
  21049. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21050. return e.skipWarpingCheck = !0,
  21051. this.flyToPano(e, t)
  21052. }
  21053. ,
  21054. t.prototype.updateMarkerVisi = function() {//加
  21055. if(this.mode != "panorama")return;
  21056. this.model.panos.list.forEach((pano)=>{
  21057. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21058. })
  21059. }
  21060. ,
  21061. t.prototype.flyToPano = function(e, t) {
  21062. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  21063. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21064. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21065. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21066. t && t(),
  21067. !1;
  21068. if (this.updateLastView(),
  21069. this.mode !== V.PANORAMA)
  21070. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21071. void this.flyToNewMode({
  21072. mode: V.PANORAMA,
  21073. pano: n,
  21074. duration: o,
  21075. quaternion: i,
  21076. callback: t
  21077. });
  21078. if (!n || (h = x.deepExtend(e),
  21079. u = function() {
  21080. j.delayOneFrame(function() {
  21081. this.flyToPano(h, t)
  21082. }
  21083. .bind(this))
  21084. }
  21085. .bind(this),
  21086. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21087. var d = function(e) {
  21088. t && t(e)
  21089. }
  21090. .bind(this);
  21091. this.currentPano || (this.currentPano = n,
  21092. this.path.placeCpm(),
  21093. this.path.fadeOutCpm(k.path.fadeOutTime),
  21094. this.spider.draw());
  21095. var p = o;
  21096. if ("number" != typeof o) {
  21097. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21098. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21099. }
  21100. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21101. 1 !== this.zoomLevel)
  21102. switch (k.zoom.transitionStyle) {
  21103. case 1:
  21104. this.smoothZoomToDefault(p / 2);
  21105. break;
  21106. case 2:
  21107. return h = x.deepExtend(e),
  21108. u = this.flyToPano.bind(this, h, t),
  21109. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21110. }
  21111. if (r) {
  21112. G.cancelById(q.LookTransition),
  21113. p *= k.transition.aimSlowFactor;
  21114. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21115. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21116. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21117. , y = g.clone()
  21118. , A = new B.Vector3;
  21119. if (n === this.currentPano) {
  21120. var C = T.FORWARD.clone().applyQuaternion(g)
  21121. , I = T.FORWARD.clone().applyQuaternion(v)
  21122. , E = C.angleTo(I);
  21123. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21124. void G.start(function(e) {
  21125. y.copy(g),
  21126. H.quaternion(y, v)(e),
  21127. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21128. this.cameraControls.activeControl.lookAt(A)
  21129. }
  21130. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21131. }
  21132. }
  21133. if (n === this.currentPano || this.flying)
  21134. return void d();
  21135. this.flying = !0;
  21136. var _ = this.position.clone()
  21137. , b = this.currentPano;
  21138. Y.debug("Flying to pano ", n.position),
  21139. this.emit(W.PanoChosen, this.currentPano, n),
  21140. this.emit(W.FlyingStarted, n.position, _, n, b),
  21141. r && G.start(function(e) {
  21142. y.copy(g),
  21143. H.quaternion(y, v)(e),
  21144. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21145. this.cameraControls.activeControl.lookAt(A)
  21146. }
  21147. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21148. var w = c ? null : z[k.transition.movementEasing];
  21149. this.nextPano = n,
  21150. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21151. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21152. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21153. this.flying = !1,
  21154. this.currentPano !== n && this.currentPano.exit(),
  21155. n.enter(),
  21156. this.currentPano = n,
  21157. this.nextPano = null,
  21158. this.path.placeCpm(),
  21159. this.path.fadeOutCpm(k.path.fadeOutTime),
  21160. this.spider.draw(),
  21161. this.emit(W.FlyingEnded, n.position, _, n, b),
  21162. this.updateMarkerVisi();//add
  21163. d(e)
  21164. }
  21165. .bind(this), 0, w, "camFly", q.FlyToPano)
  21166. }
  21167. }
  21168. ,
  21169. t.prototype.fastForwardActivePanoFlight = function(e) {
  21170. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21171. G.adjustSpeed(q.FlyToPano, e),
  21172. G.adjustSpeed(q.LookTransition, e)
  21173. }
  21174. ,
  21175. t.prototype.flyToPanoClosestToMouse = function() {
  21176. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21177. this.intersect && this.updateClosestPano(this.intersect)),
  21178. this.closestPano)
  21179. return this.flyToPano({
  21180. pano: this.closestPano
  21181. });
  21182. var e = this.getMouseDirection();
  21183. this.flyDirection(e) || this.flyToPano({
  21184. pano: this.currentPano
  21185. })
  21186. }
  21187. ,
  21188. t.prototype.flyLocalDirection = function(e) {
  21189. var t = this.getDirection(e)
  21190. , i = 1 === e.z ? .4 : .75
  21191. , n = 1 === Math.abs(e.x);
  21192. return this.flyDirection(t, i, n)
  21193. }
  21194. ,
  21195. t.prototype.flyDirection = function(e, t, i) {
  21196. this.closePopup();
  21197. var n = $.Deferred();
  21198. this.history.invalidate();
  21199. var r = this.closestPanoInDirection(e, t, i);
  21200. return r ? this.flyToPano({
  21201. pano: r
  21202. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21203. n.resolve(!1)),
  21204. n.promise()
  21205. }
  21206. ,
  21207. t.prototype.closestPanoInDirection = function(e, t, i) {
  21208. return this.rankedPanoInDirection(0, e, t, i)
  21209. }
  21210. ,
  21211. t.prototype.rankedPanoInDirection = (_ = {
  21212. pano: null,
  21213. candidates: []
  21214. },
  21215. function(e, t, i, n) {
  21216. e = e || 0,
  21217. i = void 0 !== i ? i : .75;
  21218. var r = n ? "angle" : "direction";
  21219. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21220. this.cachedPanoCandidates = _.candidates,
  21221. _.pano
  21222. }
  21223. ),
  21224. t.prototype.bump = function(e) {
  21225. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21226. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21227. if (.5 < Math.abs(a))
  21228. t = function() {
  21229. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21230. }
  21231. .bind(this),
  21232. i = function() {
  21233. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21234. }
  21235. .bind(this);
  21236. else {
  21237. var s = this.camera.position.clone()
  21238. , l = e.clone();
  21239. this.raycaster.set(s, l);
  21240. var c = this.model.floors.reduce(function(e, t) {
  21241. return e.concat(t.collider.children)
  21242. }, [])
  21243. , h = this.raycaster.intersectObjects(c)
  21244. , u = 0 < h.length ? h[0].distance / 25 : .04
  21245. , d = s.clone().add(l.multiplyScalar(u));
  21246. t = function() {
  21247. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21248. }
  21249. .bind(this),
  21250. i = function() {
  21251. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21252. }
  21253. .bind(this)
  21254. }
  21255. n = function() {
  21256. this.flying = !1
  21257. }
  21258. .bind(this),
  21259. this.flying = !0,
  21260. t()
  21261. }
  21262. }
  21263. ,
  21264. t.prototype.changeFloor = function(e) {
  21265. if (!this.is360View(this.mode, this.currentPano))
  21266. if (this.mode === V.PANORAMA) {
  21267. var t = this.history.reversePano(e);
  21268. t && t.isAligned() ? this.flyToPano({
  21269. pano: t
  21270. }) : this.changeFloorByScore(e)
  21271. } else
  21272. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21273. }
  21274. ,
  21275. t.prototype.changeFloorByScore = (E = {
  21276. pano: null,
  21277. candidates: []
  21278. },
  21279. function(e) {
  21280. var t = this.model.nextFloor(e);
  21281. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  21282. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21283. this.history.push(e, this.currentPano),
  21284. this.flyToPano({
  21285. pano: E.pano
  21286. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21287. }
  21288. ),
  21289. t.prototype.gotoFloor = function(e) {
  21290. var t = e - this.model.currentFloor.floorIndex;
  21291. this.changeFloor(t)
  21292. }
  21293. ,
  21294. t.prototype.getDirection = function(e) {
  21295. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21296. }
  21297. ,
  21298. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21299. if (r = r || $.Deferred(),
  21300. this.mode === V.TRANSITIONING)
  21301. return Y.warn("should not be transitioning here"),
  21302. n && n(!1),
  21303. r.reject().promise();
  21304. var o = i || !1
  21305. , a = i ? i.position : this.position
  21306. , s = this.position.clone()
  21307. , l = this.currentPano;
  21308. if (Y.debug("New pose in mode " + this.mode),
  21309. !e || (retryCallback = function() {
  21310. j.delayOneFrame(function() {
  21311. this.flyToSameMode(e, t, i, n, r)
  21312. }
  21313. .bind(this))
  21314. }
  21315. .bind(this),
  21316. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21317. var c = function() {
  21318. this.emit(W.FlyingEnded, a, s, e, l),
  21319. n && n(!0)
  21320. }
  21321. .bind(this)
  21322. , h = k[this.mode]
  21323. , u = void 0 !== t ? t : h.transitionTime
  21324. , d = new B.Vector3
  21325. , p = new B.Vector3;
  21326. if (this.emit(W.FlyingStarted, a, s, e, l),
  21327. this.mode === V.PANORAMA)
  21328. Y.warn("we should not be here for panorama views");
  21329. else if (this.mode === V.DOLLHOUSE)
  21330. if (o) {
  21331. var f = new B.Vector3(0,1,0);
  21332. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21333. this.model.warpDestFloors(i.floorVisibility),
  21334. p.copy(i.position);
  21335. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21336. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21337. , v = 3;
  21338. m.length ? (d.copy(m[0].point),
  21339. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21340. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21341. var y = (new B.Matrix4).lookAt(p, d, f)
  21342. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21343. , C = d.distanceTo(p)
  21344. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21345. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21346. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21347. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21348. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21349. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21350. this.path.burnsDir = Math.sign(b.y);
  21351. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21352. , T = new B.Vector3;
  21353. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21354. G.start(function(e, t) {
  21355. w.x = E.x + e * b.x,
  21356. w.y = E.y + e * b.y,
  21357. w.z = E.z + e * b.z;
  21358. var i = _ + e * (C - _);
  21359. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21360. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21361. }
  21362. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21363. G.start(function(e, t) {
  21364. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21365. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21366. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21367. }
  21368. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21369. } else
  21370. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21371. else if (this.path.placeCpm(),
  21372. this.path.fadeInCpm(k.path.fadeInTime),
  21373. i) {
  21374. this.model.warpDestFloors(i.floorVisibility);
  21375. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21376. , S = this.cameraControls.controls[V.FLOORPLAN]
  21377. , M = S.target.clone()
  21378. , R = i.position.clone().sub(M)
  21379. , P = x.position.clone().sub(S.target).length()
  21380. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21381. , L = Math.atan2(S.offset.x, S.offset.z)
  21382. , D = Math.atan2(O.x, O.z)
  21383. , N = S.absoluteScale
  21384. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21385. G.start(function(e, t) {
  21386. S.target.copy(R).multiplyScalar(e).add(M);
  21387. var i = L + (D - L) * e;
  21388. S.offset.x = P * Math.sin(i),
  21389. S.offset.z = P * Math.cos(i),
  21390. x.position.copy(S.target).add(S.offset),
  21391. S.absoluteScale = N + e * (F - N),
  21392. S.update(),
  21393. this.quaternion.copy(x.quaternion),
  21394. this.position.copy(x.position),
  21395. this.target.copy(S.target),
  21396. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21397. }
  21398. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21399. } else
  21400. Y.info("flyToSameMode() funny floorplan view? skipping");
  21401. return G.setTimeout(function(e) {
  21402. this.mode = e,
  21403. c(),
  21404. r.resolve(!0)
  21405. }
  21406. .bind(this, this.mode), u, q.FlyToSameMode),
  21407. this.mode = V.TRANSITIONING,
  21408. r.promise()
  21409. }
  21410. }
  21411. ,
  21412. t.prototype.flyToNewMode = function(e, t) {
  21413. var i = (e = e || {}).mode
  21414. , n = e.pano
  21415. , r = e.duration
  21416. , o = e.warpDest
  21417. , a = e.callback
  21418. , s = e.force
  21419. , l = e.quaternion;
  21420. if (t = t || $.Deferred(),
  21421. this.isWarping())
  21422. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21423. a && a(!1),
  21424. t.reject("Cannot change mode during tour transition").promise();
  21425. if (this.mode === V.TRANSITIONING)
  21426. return a && a(!1),
  21427. t.reject("Cannot change mode during mode transition").promise();
  21428. if (i === this.mode)
  21429. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21430. t.promise()) : (a && a(!1),
  21431. t.reject("Already in " + i + " mode").promise());
  21432. var c = o || !1;
  21433. Y.debug("Switching mode to " + i);
  21434. var h = function() {
  21435. j.delayOneFrame(function() {
  21436. this.flyToNewMode(e, t)
  21437. }
  21438. .bind(this))
  21439. }
  21440. .bind(this);
  21441. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21442. return t.promise();
  21443. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21444. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21445. this.model.waitForLoad(this.model, function() {
  21446. return this.model.meshTexturesLoaded
  21447. }
  21448. .bind(this)),
  21449. this.model.loadMeshTextures().done(h),
  21450. t.promise();
  21451. this.history.invalidate(),
  21452. this.updateLastView();
  21453. var u = this.mode
  21454. , d = this.cameraControls.cameras[i];
  21455. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21456. var p = void 0 !== r ? r : e.transitionTime;
  21457. this.emit(W.ModeChanging, u, i, n),
  21458. n && (this.currentPano = n),
  21459. this.switchCameraMode(i, l),
  21460. G.cancelById(q.LookTransition);
  21461. var f = (new B.Vector3).copy(this.position);
  21462. this.modeTran = this.mode + "-" + i;
  21463. if(this.mode == "floorplan" && window.panoVisiSet && panoVisiSet.setPanoVisible){
  21464. panoVisiSet.finishSetPanoVisible()
  21465. }
  21466. if(editTool.atPanel == "screen"){
  21467. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21468. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21469. }
  21470. if (i === V.PANORAMA)
  21471. this.emit(W.PanoChosen, n, n),
  21472. setTimeout(function() {
  21473. n.floor.enter(i)
  21474. }
  21475. .bind(this), p / 2),
  21476. this.path.fadeOutCpm(k.path.fadeOutTime);
  21477. else if (i === V.DOLLHOUSE) {
  21478. if (c && (this.model.stayPut = !0),
  21479. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21480. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21481. this.path.placeCpm(),
  21482. this.path.fadeInCpm(k.path.fadeInTime),
  21483. c) {
  21484. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21485. f.set(15, 10, 15);
  21486. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21487. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21488. v.length ? (g.copy(v[0].point),
  21489. f.copy(o.position),
  21490. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  21491. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21492. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21493. f.add(this.model.position),
  21494. d.position.copy(f),
  21495. this.cameraControls.controls[V.DOLLHOUSE].update()
  21496. }
  21497. } else if (this.path.placeCpm(),
  21498. this.path.fadeInCpm(k.path.fadeInTime),
  21499. o) {
  21500. this.model.warpDestFloors(o.floorVisibility);
  21501. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21502. , A = this.cameraControls.controls[V.FLOORPLAN]
  21503. , C = y.position.clone().sub(A.target)
  21504. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21505. , E = Math.atan2(I.x, I.z);
  21506. A.target.copy(o.position);
  21507. var _ = C.length();
  21508. A.offset.x = _ * Math.sin(E),
  21509. A.offset.y = 0,
  21510. A.offset.z = _ * Math.cos(E),
  21511. y.position.copy(A.target).add(A.offset),
  21512. A.target.clone().sub(d.position),
  21513. d.quaternion.copy(o.quaternion),
  21514. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21515. A.absoluteScale = A.currentScale,
  21516. A.update()
  21517. } else
  21518. this.model.currentFloor.enter(i);
  21519. var b = this.currentPano
  21520. , w = this.position.clone();
  21521. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21522. this.flying = !0,
  21523. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21524. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21525. d.controls.update()),
  21526. e.blackoutStyle = P.FADEIN,
  21527. p = k.show360Views.transitionTime,
  21528. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21529. this.mode = i,
  21530. this.path && this.path.popOutCpm(),
  21531. e.blackoutStyle = P.END,
  21532. p = k.show360Views.transitionTime,
  21533. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21534. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21535. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21536. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21537. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21538. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21539. G.setTimeout(function() {
  21540. this.flying = !1,
  21541. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21542. this.currentPano.enter(),
  21543. this.path.placeCpm(),
  21544. this.path.fadeOutCpm(k.path.fadeOutTime),
  21545. this.spider.draw()),
  21546. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21547. this.mode = i,
  21548. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21549. if (this.afterCModeFuc) {
  21550. //手动加的函数
  21551. var cf = this.afterCModeFuc;
  21552. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21553. cf();
  21554. }
  21555. this.updateMarkerVisi();//add
  21556. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21557. t.resolve())
  21558. }
  21559. .bind(this), p, q.FlyToNewMode),
  21560. this.mode = V.TRANSITIONING,
  21561. t.promise()
  21562. }
  21563. ,
  21564. t.prototype.fade360View = function(e, t, i) {
  21565. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21566. $(this.domElement).fadeOut(.5 * e, function() {
  21567. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21568. this.model.alpha = i.modelAlpha,
  21569. this.position.copy(t.position),
  21570. this.quaternion.copy(t.quaternion),
  21571. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21572. $(this.domElement).fadeIn(.5 * e)
  21573. }
  21574. .bind(this))
  21575. }
  21576. ,
  21577. t.prototype.findDefaultViews = function() {
  21578. this.findDefaultView(this.lastInsideView, !0),
  21579. this.findDefaultView(this.last360View, !1)
  21580. }
  21581. ,
  21582. t.prototype.findDefaultView = function(e, i) {
  21583. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21584. if (e.cameraMode !== V.PANORAMA)
  21585. return !1;
  21586. var t = r.get(e.panoId);
  21587. return t && t.isAligned() === i
  21588. });
  21589. 0 <= o ? (t = r.get(n[o].panoId),
  21590. e.update({
  21591. cameraMode: V.PANORAMA,
  21592. pano: t,
  21593. position: n[o].position,
  21594. quaternion: n[o].quaternion
  21595. })) : 0 <= (o = r.list.findIndex(function(e) {
  21596. return e.isAligned() === i
  21597. })) ? (t = r.list[o],
  21598. e.update({
  21599. cameraMode: V.PANORAMA,
  21600. pano: t,
  21601. position: t.position
  21602. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21603. }
  21604. ,
  21605. t.prototype.updateLastView = function() {
  21606. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21607. pano: this.currentPano,
  21608. position: this.position,
  21609. quaternion: this.quaternion
  21610. })
  21611. }
  21612. ,
  21613. t.prototype.goToLastView = function(e, t) {
  21614. var i = $.Deferred()
  21615. , n = i.resolve.bind(i)
  21616. , r = i.reject.bind(i)
  21617. , o = e ? this.lastInsideView : this.last360View;
  21618. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21619. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21620. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21621. mode: o.cameraMode,
  21622. pano: o.pano,
  21623. quaternion: o.quaternion,
  21624. callback: t
  21625. }).done(n).fail(r),
  21626. i.promise()
  21627. }
  21628. ,
  21629. t.prototype.fadeToView = function(e, t, i, n) {
  21630. var r = $.Deferred()
  21631. , o = r.resolve.bind(r)
  21632. , a = r.reject.bind(r);
  21633. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21634. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21635. a("Cannot go to illegal view"),
  21636. r.promise();
  21637. var s = (k[t.cameraMode],
  21638. function() {
  21639. $(this.domElement).fadeIn(.5 * i),
  21640. n && n(),
  21641. o()
  21642. }
  21643. .bind(this))
  21644. , l = e ? P.FADEIN : P.END;
  21645. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21646. $(this.domElement).fadeOut(.5 * i, function() {
  21647. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21648. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21649. pano: t.pano,
  21650. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21651. duration: 0
  21652. }, s) : this.flyToNewMode({
  21653. mode: t.cameraMode,
  21654. quaternion: t.quaternion,
  21655. duration: 0,
  21656. callback: s
  21657. })
  21658. }
  21659. .bind(this)),
  21660. r.promise()
  21661. }
  21662. ,
  21663. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21664. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21665. this.flying)
  21666. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21667. o && o(),
  21668. !1;
  21669. null != e || (e = M.Show),
  21670. this.history.invalidate(),
  21671. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21672. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21673. return this.emit(W.WarpStarted, a, i, n, r),
  21674. n = n || P.MIDDLE,
  21675. this.path.warpToPano(i, n, r, function() {
  21676. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21677. this.emit(W.WarpEnded, i),
  21678. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21679. o && o()
  21680. }
  21681. .bind(this)),
  21682. e === M.Hide && this.path.discardPathObject(),
  21683. !0
  21684. }
  21685. ,
  21686. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21687. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21688. s && s(),
  21689. !1)
  21690. }
  21691. ,
  21692. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21693. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21694. a && a(),
  21695. !1)
  21696. }
  21697. ,
  21698. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21699. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21700. }
  21701. ,
  21702. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21703. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21704. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21705. t && t(),
  21706. !1)
  21707. }
  21708. ,
  21709. t.prototype.aimTourCamera = function(e, t, i, n) {
  21710. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21711. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21712. }
  21713. ,
  21714. t.prototype.showPathToHeroLocation = function(e) {
  21715. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  21716. }
  21717. ,
  21718. t.prototype.tourInterlude = function(e, t) {
  21719. this.history.invalidate(),
  21720. this.path.discardSlow();
  21721. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  21722. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  21723. , r = i && i.music ? i.time - n : 2e3;
  21724. this.path.waitNextStep(e, function() {
  21725. t && t()
  21726. }
  21727. .bind(this), r)
  21728. }
  21729. ,
  21730. t.prototype.stopInterlude = function() {
  21731. this.interruptAndFastForward(null, 0)
  21732. }
  21733. ,
  21734. t.prototype.interruptAndFastForward = function(e, t) {
  21735. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  21736. this.flying && this.emit(W.FlyingInterrupted),
  21737. this.path.interruptAndFastForward(e, t)
  21738. }
  21739. ,
  21740. t.prototype.setSize = function(e, t) {
  21741. var i = e / t;
  21742. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  21743. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  21744. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  21745. this.cameraControls.cameras) {
  21746. var o = this.cameraControls.cameras[r];
  21747. o.fov = this.baseFov * (1 / this.zoomLevel),
  21748. o.updateAspect(i)
  21749. }
  21750. }
  21751. ,
  21752. t.prototype.toJSON = function() {
  21753. var e = {};
  21754. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  21755. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  21756. return e.hidden ? 0 : 1
  21757. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  21758. e
  21759. }
  21760. ,
  21761. t.prototype.getCurrentNodePanos = function(e) {
  21762. if (this.model.panos.map,
  21763. e.length = 0,
  21764. this.path.nodes)
  21765. for (var t = 0; t < this.path.nodes.length; t++) {
  21766. var i = this.path.nodes[t];
  21767. e.push(this.model.panos.get(i))
  21768. }
  21769. }
  21770. ,
  21771. t.prototype.zoomIncrementally = function(e) {
  21772. var t = this.zoomLevel;
  21773. this.zoomTo(this.zoomLevel + e),
  21774. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  21775. }
  21776. ,
  21777. t.prototype.zoomInIncrementally = function(e) {
  21778. e = e || this.defaultZoomIncrement,
  21779. this.zoomIncrementally(e)
  21780. }
  21781. ,
  21782. t.prototype.zoomOutIncrementally = function(e) {
  21783. e = e || -this.defaultZoomIncrement,
  21784. this.zoomIncrementally(e)
  21785. }
  21786. ,
  21787. t.prototype.zoomBy = function(e) {
  21788. this.zoomTo(this.zoomLevel * e)
  21789. }
  21790. ,
  21791. t.prototype.zoomIn = function() {
  21792. this.zoomBy(1 + this.zoomSpeed)
  21793. }
  21794. ,
  21795. t.prototype.zoomOut = function() {
  21796. this.zoomBy(1 - this.zoomSpeed)
  21797. }
  21798. ,
  21799. t.prototype.zoomTo = function(e, t) {
  21800. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  21801. e > k.zoom.max && (e = k.zoom.max),
  21802. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  21803. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  21804. e === k.zoom.min && this.emit(m.ZoomMin)),
  21805. this.cameraControls.activeControl)) {
  21806. var i = this.cameraControls.activeControl.camera;
  21807. this.zoomLevel = e,
  21808. i.fov = this.baseFov * (1 / this.zoomLevel),
  21809. i.updateProjectionMatrix(),
  21810. this.zoomFov = i.fov
  21811. }
  21812. }
  21813. ,
  21814. t.prototype.increaseZoomSpeed = function() {
  21815. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  21816. }
  21817. ,
  21818. t.prototype.decreaseZoomSpeed = function() {
  21819. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  21820. }
  21821. ,
  21822. t.prototype.clampZoomSpeed = function(e) {
  21823. return e < 0 ? 0 : e
  21824. }
  21825. ,
  21826. t.prototype.activatePersistentZooming = function(e) {
  21827. this.zooming = e ? 1 : -1
  21828. }
  21829. ,
  21830. t.prototype.deactivatePersistentZooming = function() {
  21831. this.zooming = 0
  21832. }
  21833. ,
  21834. t.prototype.zoomDefault = function() {
  21835. this.zoomTo(1, !0)
  21836. }
  21837. ,
  21838. t.prototype.smoothZoomToDefault = function(e, t) {
  21839. var i, n = this.zoomLevel, r = function(e) {
  21840. 1 < e && (e = 1),
  21841. i = n * (1 - e) + e,
  21842. this.zoomTo(i, !0)
  21843. }
  21844. .bind(this), o = function() {
  21845. this.zoomDefault(),
  21846. t && window.setTimeout(t, 50)
  21847. }
  21848. .bind(this);
  21849. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  21850. }
  21851. ,
  21852. t.prototype.updateZoomPano = function() {
  21853. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  21854. var e = this.currentPano;
  21855. if (e) {
  21856. var t = this.zoomLevel > k.zoom.activationThreshold
  21857. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  21858. t);
  21859. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  21860. this.panoRenderer.setZoomingActive(i, e, !0);
  21861. var n = function(e, t) {
  21862. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  21863. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  21864. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  21865. e.setZoomed(t)
  21866. }
  21867. .bind(this);
  21868. i && !e.zoomed ? (n(e, !0),
  21869. this.panoRenderer.enableUltraHighQualityMode(function() {
  21870. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  21871. i && n(e, !0)
  21872. }
  21873. .bind(this))) : !t && e.zoomed && n(e, !1)
  21874. }
  21875. }
  21876. },
  21877. //--------
  21878. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  21879. var f2;
  21880. if (this.mode == mode) {
  21881. f1 && f1()
  21882. } else {
  21883. f2 = f1;
  21884. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  21885. this.afterCModeFuc = function() {
  21886. this.afterCModeFuc = f2
  21887. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  21888. }.bind(this)
  21889. } else {
  21890. this.afterCModeFuc = f2;//飞入后执行
  21891. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  21892. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  21893. }catch(e){}
  21894. }
  21895. }
  21896. }
  21897. ,
  21898. t.prototype.checkHasNeighbor = function(pano){//add
  21899. for(var i in pano.neighbourPanos ){
  21900. if(i == pano.id)continue;
  21901. if(pano.neighbourPanos[i]){
  21902. return true;
  21903. }
  21904. }
  21905. }
  21906. ,
  21907. ee.exports = t
  21908. }
  21909. ).call(this, "/js/player.js")
  21910. }
  21911. , {
  21912. "./constants": 8,
  21913. "./enum/AlignmentType": 17,
  21914. "./enum/BlackoutStyle": 18,
  21915. "./enum/ControlEvents": 21,
  21916. "./enum/Keys": 30,
  21917. "./enum/ModelManagerEvents": 33,
  21918. "./enum/PanoSizeClass": 36,
  21919. "./enum/PanoramaEvents": 37,
  21920. "./enum/PathDiscardMode": 38,
  21921. "./enum/PathDisplayMode": 39,
  21922. "./enum/PlayerEvents": 40,
  21923. "./enum/TagStates": 44,
  21924. "./enum/Vectors": 50,
  21925. "./enum/Viewmode": 51,
  21926. "./enum/WarpStyle": 52,
  21927. "./enum/ZoomEvents": 53,
  21928. "./exception/BasicException": 55,
  21929. "./model/ModelManager": 140,
  21930. "./objects/NSpider": 147,
  21931. "./objects/Panorama": 148,
  21932. "./objects/Reticule": 149,
  21933. "./objects/ShowPath": 151,
  21934. "./objects/Snapshot": 153,
  21935. "./objects/View": 154,
  21936. "./settings": 166,
  21937. "./shaders": 167,
  21938. "./tile/TileDownloader": 171,
  21939. "./tile/TilePrioritizer": 172,
  21940. "./util/ZoomStats": 179,
  21941. "./util/browser": 182,
  21942. "./util/camera": 183,
  21943. "./util/cameraLight": 184,
  21944. "./util/common": 185,
  21945. "./util/easing": 186,
  21946. "./util/history": 187,
  21947. "./util/lerp": 188,
  21948. "./util/logger": 189,
  21949. "./util/math": 190,
  21950. "./util/transitions": 195,
  21951. hot: "hot",
  21952. scaleImg: "scaleImg",
  21953. events: 202,
  21954. three: 217
  21955. }],
  21956. scaleImg: [function(e, t) {
  21957. var i = t;
  21958. (function() {
  21959. function e(e, t, i, n) {
  21960. function r() {
  21961. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  21962. U.height = p,
  21963. H = U.getContext("2d")
  21964. }
  21965. function o(e) {
  21966. if (e) {
  21967. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  21968. for (t = 0; t < ie; t += 4)
  21969. n[t] = e[t] * ne | 0,
  21970. n[t + 1] = e[t + 1] * ne | 0,
  21971. n[t + 2] = e[t + 2] * ne | 0,
  21972. n[t + 3] = e[t + 3] * ne | 0;
  21973. return delete e,
  21974. i
  21975. }
  21976. return H.getImageData(0, 0, d, p)
  21977. }
  21978. function a(e, t, i, n, r) {
  21979. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  21980. }
  21981. var s, l;
  21982. if (t || (t = e.input,
  21983. i = e.output,
  21984. n = e.inputRemovable,
  21985. e.scale && (e = e.scale)),
  21986. t.src)
  21987. if (s = document.createElement("canvas"),
  21988. null != t.naturalWidth)
  21989. s.width = t.naturalWidth,
  21990. s.height = t.naturalHeight;
  21991. else if (null != t.runtimeStyle) {
  21992. var c = t.runtimeStyle
  21993. , h = c.width
  21994. , u = c.height;
  21995. c.width = "auto",
  21996. c.height = "auto",
  21997. s.width = t.width,
  21998. s.height = t.height,
  21999. c.width = h,
  22000. c.height = u
  22001. } else {
  22002. h = t.width,
  22003. u = t.height;
  22004. t.removeAttribute && (t.removeAttribute("width"),
  22005. t.removeAttribute("height")),
  22006. s.width = t.width,
  22007. s.height = t.height,
  22008. t.width = h,
  22009. t.height = u
  22010. }
  22011. else
  22012. s = t;
  22013. l = s.getContext("2d"),
  22014. t.src && l.drawImage(t, 0, 0);
  22015. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22016. if (!f || !g)
  22017. return !1;
  22018. (t.src || n) && s.clearRect(0, 0, f, g),
  22019. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22020. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22021. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22022. e * g + .5 | 0);
  22023. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22024. if (1 < re || 1 < oe)
  22025. for (r(),
  22026. G = (z = o()).data,
  22027. C = 0; C < p; C++)
  22028. for (V = (y = C / oe) - (w = 0 | y),
  22029. j = w * $,
  22030. W = w < 1 ? j : j - $,
  22031. w < g - 2 ? (Y = j + $,
  22032. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22033. A = 0; A < d; A++,
  22034. te += 4)
  22035. Z = (b = 0 | (v = A / re)) << 2,
  22036. b < f - 2 ? (K = Z + 4,
  22037. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22038. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22039. ++Z,
  22040. ++K,
  22041. ++Q,
  22042. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22043. ++Z,
  22044. ++K,
  22045. ++Q,
  22046. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22047. ++Z,
  22048. ++K,
  22049. ++Q,
  22050. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22051. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22052. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22053. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22054. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22055. else {
  22056. if (le.Float32Array)
  22057. L = new Float32Array(ie);
  22058. else
  22059. for (L = [],
  22060. te = 0; te < ie; ++te)
  22061. L[te] = 0;
  22062. for (y = 0; y < g; y++)
  22063. for (I = (_ = 0 | (C = y * oe)) * J,
  22064. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22065. R = C + oe - _ - 1),
  22066. v = 0; v < f; v++,
  22067. ee += 4)
  22068. switch (A = v * re,
  22069. E = 0 | A,
  22070. te = I + (E << 2),
  22071. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22072. P && (x = 1 + E - A,
  22073. S = A + re - E - 1),
  22074. D = m[ee],
  22075. F = m[ee + 1],
  22076. B = m[ee + 2],
  22077. N = m[ee + 3],
  22078. P + O) {
  22079. case 0:
  22080. L[te] += D * ae,
  22081. L[te + 1] += F * ae,
  22082. L[te + 2] += B * ae,
  22083. L[te + 3] += N * ae;
  22084. break;
  22085. case 1:
  22086. T = x * oe,
  22087. L[te] += D * T,
  22088. L[te + 1] += F * T,
  22089. L[te + 2] += B * T,
  22090. L[te + 3] += N * T,
  22091. T = S * oe,
  22092. L[te + 4] += D * T,
  22093. L[te + 5] += F * T,
  22094. L[te + 6] += B * T,
  22095. L[te + 7] += N * T;
  22096. break;
  22097. case 2:
  22098. T = re * M,
  22099. L[te] += D * T,
  22100. L[te + 1] += F * T,
  22101. L[te + 2] += B * T,
  22102. L[te + 3] += N * T,
  22103. T = re * R,
  22104. L[te += J] += D * T,
  22105. L[te + 1] += F * T,
  22106. L[te + 2] += B * T,
  22107. L[te + 3] += N * T;
  22108. break;
  22109. default:
  22110. T = x * M,
  22111. L[te] += D * T,
  22112. L[te + 1] += F * T,
  22113. L[te + 2] += B * T,
  22114. L[te + 3] += N * T,
  22115. T = S * M,
  22116. L[te + 4] += D * T,
  22117. L[te + 5] += F * T,
  22118. L[te + 6] += B * T,
  22119. L[te + 7] += N * T,
  22120. T = x * R,
  22121. L[te += J] += D * T,
  22122. L[te + 1] += F * T,
  22123. L[te + 2] += B * T,
  22124. L[te + 3] += N * T,
  22125. T = S * R,
  22126. L[te + 4] += D * T,
  22127. L[te + 5] += F * T,
  22128. L[te + 6] += B * T,
  22129. L[te + 7] += N * T
  22130. }
  22131. delete m,
  22132. r(),
  22133. z = o(L)
  22134. }
  22135. if (H.putImageData(z, 0, 0),
  22136. "string" == typeof i) {
  22137. var se;
  22138. if ("png" === i || "jpeg" === i)
  22139. return (se = n && t.src ? t : new Image).width = d,
  22140. se.height = p,
  22141. se.src = U.toDataURL("image/" + i, .85),
  22142. se;
  22143. if ("png-src" === i || "jpeg-src" === i)
  22144. return U.toDataURL("image/" + i.split("-")[0], .85)
  22145. }
  22146. return U
  22147. }
  22148. var le = this;
  22149. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22150. exports.scale = e) : c = e
  22151. }
  22152. ).call(this),
  22153. i.exports = c
  22154. }
  22155. , {}],
  22156. 156: [function(i, n, e) {
  22157. (function(e) {
  22158. "use strict";
  22159. function t(e, t) {
  22160. this.model = e,
  22161. this.panos = e.panos,
  22162. this.player = t,
  22163. this.imagePanos = this.listImagePanos(),
  22164. this.retryMinimumTime = 1e4
  22165. }
  22166. var r = (i("three"),
  22167. i("./enum/Viewmode"))
  22168. , o = (i("./settings"),
  22169. i("./objects/Panorama"))
  22170. , a = new (i("./util/logger"))(e);
  22171. t.prototype.start = function() {
  22172. this.loadNextPano(function(e) {
  22173. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22174. setTimeout(function() {
  22175. this.start()
  22176. }
  22177. .bind(this), 1e3))
  22178. }
  22179. .bind(this))
  22180. }
  22181. ,
  22182. t.prototype.validLoadTarget = function(e) {
  22183. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22184. }
  22185. ,
  22186. t.prototype.listImagePanos = function() {
  22187. var i = []
  22188. , n = this;
  22189. return this.model.images.forEach(function(e) {
  22190. if (e.metadata && e.metadata.scan_id) {
  22191. var t = n.model.panos.get(e.metadata.scan_id);
  22192. t && !t.isLoaded("high") && i.push(t)
  22193. }
  22194. }),
  22195. i
  22196. }
  22197. ,
  22198. t.prototype.nextNotLoadedImage = function() {
  22199. for (; 0 < this.imagePanos.length; ) {
  22200. var e = this.imagePanos[0];
  22201. if (!e.isLoaded("high"))
  22202. return e;
  22203. this.imagePanos.shift()
  22204. }
  22205. return null
  22206. }
  22207. ,
  22208. t.prototype.loadNextPano = function(e) {
  22209. var t, i, n = this.model.waitQueue.filter(function(e) {
  22210. return e.object instanceof o
  22211. });
  22212. 0 < n.length ? (t = n[0].object,
  22213. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22214. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22215. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22216. t = this.imagePanos[0],
  22217. a.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode !== r.PANORAMA || (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + t.id),
  22218. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22219. a.debug("Preloading " + i + "-res pano " + t.id),
  22220. t.loadCube(i).done(e).fail(function() {
  22221. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22222. e()
  22223. })) : e && e(null)
  22224. }
  22225. ,
  22226. n.exports = t
  22227. }
  22228. ).call(this, "/js/preloaders.js")
  22229. }
  22230. , {
  22231. "./enum/Viewmode": 51,
  22232. "./objects/Panorama": 148,
  22233. "./settings": 166,
  22234. "./util/logger": 189,
  22235. three: 217
  22236. }],
  22237. 157: [function(a, s, e) {
  22238. (function(e) {
  22239. "use strict";
  22240. function t(e, t, i, n, r) {
  22241. this.qualityManager = e,
  22242. this.scene = t,
  22243. this.camera = i,
  22244. this.container = r,
  22245. this.controls = n,
  22246. this.controls.enabled = !0,
  22247. this.controls.locked = !0,
  22248. this.quickstartCamera = n.camera,
  22249. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22250. this.skybox = null
  22251. }
  22252. var i = a("three")
  22253. , n = a("../util/logger")
  22254. , o = a("../constants")
  22255. , h = (a("../util/transitions"),
  22256. a("../util/lerp"),
  22257. a("../util/easing"),
  22258. a("../enum/Vectors"))
  22259. , u = a("../enum/PanoSizeClass")
  22260. , r = (a("../materials/ModelTextureMaterial"),
  22261. a("../materials/CubemapMaterial"))
  22262. , d = (a("../cameras/PanoramaCamera"),
  22263. a("../controls/PanoramaControls"),
  22264. a("../tile/TileUtils"),
  22265. a("../util/camera"),
  22266. a("../util/cameraLight"))
  22267. , p = (a("../util/browser"),
  22268. a("../settings"),
  22269. a("../gui/helpManager"),
  22270. new n(e));
  22271. t.prototype.load = function(e) {
  22272. e.pano.shouldRedrawOnBaseLoaded = !0;
  22273. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22274. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22275. var a = this.qualityManager.getPanoSize(u.BASE)
  22276. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22277. if (e.pano.tiled) {
  22278. p.warn("Loading startPano, TILED", e.pano.id);
  22279. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22280. , c = this.quickstartCamera.fov;
  22281. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22282. t = e.pano.loadTiledPano(s, r, {
  22283. hFov: l,
  22284. vFov: c
  22285. }, !1, !1, !0),
  22286. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22287. } else
  22288. p.warn("Loading startPano", e.pano.id),
  22289. t = e.pano.loadCube("high");
  22290. return $.when(t).then(function() {
  22291. n.init(e.pano, e.quaternion),
  22292. e.pano.tiled ? i.done(function() {
  22293. e.pano.lockUntilRenderingComplete = !1,
  22294. this.controls.locked = !1
  22295. }
  22296. .bind(this)) : this.controls.locked = !1
  22297. }
  22298. .bind(this))
  22299. }
  22300. ,
  22301. t.prototype.init = function(e, t) {
  22302. p.info("Quickstart done loading, adding scene objects"),
  22303. e.lockUntilRenderingComplete = !0,
  22304. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22305. side: i.BackSide
  22306. })),
  22307. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22308. this.skybox.quaternion.copy(e.quaternion),
  22309. this.scene.add(this.skybox),
  22310. $(this.container).show()
  22311. }
  22312. ,
  22313. t.prototype.update = function(e) {
  22314. this.controls.update(e),
  22315. this.camera.copy(this.quickstartCamera)
  22316. }
  22317. ,
  22318. t.prototype.setSize = function(e, t) {
  22319. this.quickstartCamera.updateAspect(e / t)
  22320. }
  22321. ,
  22322. t.prototype.destroy = function() {
  22323. this.scene.remove(this.skybox)
  22324. }
  22325. ,
  22326. s.exports = t
  22327. }
  22328. ).call(this, "/js/scene/QuickstartManager.js")
  22329. }
  22330. , {
  22331. "../cameras/PanoramaCamera": 7,
  22332. "../constants": 8,
  22333. "../controls/PanoramaControls": 13,
  22334. "../enum/PanoSizeClass": 36,
  22335. "../enum/Vectors": 50,
  22336. "../gui/helpManager": 68,
  22337. "../materials/CubemapMaterial": 117,
  22338. "../materials/ModelTextureMaterial": 118,
  22339. "../settings": 166,
  22340. "../tile/TileUtils": 174,
  22341. "../util/browser": 182,
  22342. "../util/camera": 183,
  22343. "../util/cameraLight": 184,
  22344. "../util/easing": 186,
  22345. "../util/lerp": 188,
  22346. "../util/logger": 189,
  22347. "../util/transitions": 195,
  22348. three: 217
  22349. }],
  22350. 158: [function(e, t, i) {
  22351. "use strict";
  22352. function h(e, t, i) {
  22353. this.scene = e,
  22354. this.camera = t,
  22355. this.renderer = null,
  22356. this.effects = i,
  22357. this.animateCallback = null,
  22358. this.composer = null,
  22359. this.qualityManager = null,
  22360. e.renderWidth = 0,
  22361. e.renderHeight = 0,
  22362. this.updateClock = new M.Clock,
  22363. this.components = [],
  22364. this.updateListeners = [],
  22365. this.resizeListeners = [],
  22366. this.forceUpdateSize = !1,
  22367. this.started = !1,
  22368. this.textures = {},
  22369. this.suspendedObjects = []
  22370. }
  22371. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  22372. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22373. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22374. this.components.push(e),
  22375. e.update && this.updateListeners.push(e),
  22376. e.setSize && (this.resizeListeners.push(e),
  22377. this.forceUpdateSize = !0)
  22378. }
  22379. ,
  22380. h.prototype.removeComponent = function(t) {
  22381. function e(e) {
  22382. return e !== t
  22383. }
  22384. this.components = this.components.filter(e),
  22385. this.updateListeners = this.updateListeners.filter(e),
  22386. this.resizeListeners = this.resizeListeners.filter(e)
  22387. }
  22388. ,
  22389. h.prototype.start = function(e) {
  22390. if (this.started)
  22391. throw new l("Can't start SceneRenderer, already started");
  22392. this.createContext(e),
  22393. this.boluoVrInit(),
  22394. this.initComposer(),
  22395. this.started = !0,
  22396. (b = b.bind(this))()
  22397. }
  22398. ,
  22399. h.prototype.createContext = function(e) {
  22400. try {
  22401. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22402. this.renderer.autoClear = !0,
  22403. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22404. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22405. this.emit(r.ContextCreated)
  22406. } catch (e) {
  22407. throw new c("Unable to create a WebGL rendering context")
  22408. }
  22409. d.profiling.enabled && this.overrideTextures(),
  22410. e.appendChild(this.renderer.domElement)
  22411. }
  22412. ,
  22413. h.prototype.overrideTextures = function() {
  22414. var d = this.renderer.context
  22415. , t = 0
  22416. , i = d.createTexture;
  22417. d.createTexture = function() {
  22418. var e = i.call(d);
  22419. return e.id = t++,
  22420. this.textures[e.id] = e
  22421. }
  22422. .bind(this);
  22423. var p = d.texImage2D;
  22424. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22425. var c, h = this.getTextureTypeFromTarget(d, e);
  22426. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22427. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22428. s = r,
  22429. n = (l = o).naturalWidth,
  22430. r = l.naturalHeight,
  22431. p.call(d, e, t, i, a, s, l));
  22432. var u = this.textures[c.id];
  22433. u.width = h === f.TextureCube ? 6 * n : n,
  22434. u.height = r
  22435. }
  22436. .bind(this);
  22437. var n = d.deleteTexture;
  22438. d.deleteTexture = function(e) {
  22439. delete this.textures[e.id],
  22440. n.call(d, e)
  22441. }
  22442. .bind(this)
  22443. }
  22444. ,
  22445. h.prototype.updateTextureMemory = (n = null,
  22446. function() {
  22447. var e = 0;
  22448. for (var t in this.textures) {
  22449. var i = this.textures[t];
  22450. i.width && i.height && (e += i.width * i.height * 4)
  22451. }
  22452. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22453. n = e
  22454. }
  22455. ),
  22456. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22457. switch (t) {
  22458. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22459. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22460. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22461. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22462. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22463. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22464. return f.TextureCube;
  22465. case e.TEXTURE_2D:
  22466. return f.Texture2D;
  22467. default:
  22468. return null
  22469. }
  22470. }
  22471. ,
  22472. h.prototype.initComposer = function() {
  22473. this.composer = new M.EffectComposer(this.renderer),
  22474. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22475. this.composer.addPass(this.effects.hblurPass),
  22476. this.composer.addPass(this.effects.vblurPass)
  22477. }
  22478. ,
  22479. h.prototype.setSize = function(e, t, i) {
  22480. this.renderWidth = e,
  22481. this.renderHeight = t,
  22482. this.effects.aspect = e / t,
  22483. this.renderer.setSize(e, t, !1, i),
  22484. this.composer.setSize(e, t);
  22485. for (var n = 0; n < this.resizeListeners.length; n++)
  22486. this.resizeListeners[n].setSize(e, t)
  22487. }
  22488. ,
  22489. h.prototype.render = function() {
  22490. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22491. }
  22492. ,
  22493. h.prototype.boluoVrInit = function() {
  22494. console.log("boluoVrInit"),
  22495. this.isHuawei5X = u.detectHUAWEI5X(),
  22496. this.oldRenderer = this.renderer,
  22497. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22498. window.panoCamera = this.camera;
  22499. var i = this;
  22500. window._vrEnabled = !1,
  22501. Object.defineProperty(window, "vrEnabled", {
  22502. get: function() {
  22503. return window._vrEnabled
  22504. },
  22505. set: function(e) {
  22506. (e = !!e) ? (i.renderer = i.newRenderer,
  22507. window.vrMarkers.forEach(function(e) {
  22508. e.visible = !0
  22509. })) : (i.renderer = i.oldRenderer,
  22510. window.vrMarkers.forEach(function(e) {
  22511. e.visible = !1
  22512. })),
  22513. i.cursor.visible = e,
  22514. i.setSize(window.innerWidth, window.innerHeight),
  22515. window._vrEnabled = e,
  22516. setTimeout(function() {
  22517. console.log(player.cameraControls.activeControl.camera.fov)
  22518. }, 500)
  22519. }
  22520. }),
  22521. this.createCursor(.5, !1, 1, 16777215, 0);
  22522. var e = {
  22523. setSize: function(e, t) {
  22524. i.camera.aspect = e / t
  22525. }
  22526. };
  22527. this.resizeListeners.push(e),
  22528. this.vrLoadingInit()
  22529. }
  22530. ,
  22531. h.prototype.vrLoadingInit = function() {
  22532. var e = new (e = function() {
  22533. var t = this
  22534. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22535. , i = new M.MeshBasicMaterial({
  22536. color: 4967932,
  22537. side: M.DoubleSide
  22538. })
  22539. , n = new M.Mesh(e,i);
  22540. (this.mesh = n).position.z = -2,
  22541. n.scale.set(.08, .08, .08),
  22542. n.visible = !1,
  22543. window.player.camera.add(n),
  22544. t.enabled = !1,
  22545. this.update = function(e) {
  22546. 1 == t.enabled && (n.rotation.z += 15 * e)
  22547. }
  22548. }
  22549. )(this.camera);
  22550. window.Loading = e,
  22551. this.updateListeners.push(e)
  22552. }
  22553. ,
  22554. h.prototype.createCursor = function(e, t, i, n, r) {
  22555. var o, a = new M.SpriteMaterial({
  22556. opacity: i,
  22557. color: n,
  22558. transparent: t,
  22559. map: this.boluoGetTexture("images/cursor.png"),
  22560. needsUpdate: !0,
  22561. side: M.DoubleSide
  22562. });
  22563. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22564. a.map.repeat = new M.Vector2(1 / 17,1),
  22565. a.depthTest = !1,
  22566. a.blending = M.AdditiveBlending,
  22567. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22568. o.position.z = -2,
  22569. o.visible = !1,
  22570. o.name = "cursor",
  22571. this.camera.add(o),
  22572. this.scene.add(this.camera),
  22573. this.cursor = o;
  22574. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22575. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22576. this.updateListeners.push(s)
  22577. }
  22578. ,
  22579. h.prototype.CursorAnimation = function(e, t, o) {
  22580. this.cursor = t,
  22581. this.raycaster = new M.Raycaster,
  22582. this.targetEventObj = {},
  22583. this.type = 1,
  22584. this.tweenFlag = !0;
  22585. var s = this;
  22586. this.target = o,
  22587. console.log(o.uuid),
  22588. this.euler = new M.Euler,
  22589. this.q0 = new M.Quaternion,
  22590. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22591. this.zee = new M.Vector3(0,0,1),
  22592. this.alpha = -1e3,
  22593. this.beta = -1e3,
  22594. this.gamma = -1e3,
  22595. this.orient = M.Math.degToRad(window.orientation || 0),
  22596. window.addEventListener("orientationchange", function() {
  22597. s.orient = M.Math.degToRad(window.orientation || 0)
  22598. }),
  22599. window.addEventListener("deviceorientation", function(e) {
  22600. var t = M.Math.degToRad(e.alpha)
  22601. , i = M.Math.degToRad(e.beta)
  22602. , n = M.Math.degToRad(e.gamma);
  22603. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22604. -1e3 === s.beta && (s.beta = i),
  22605. -1e3 === s.gamma && (s.gamma = n),
  22606. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22607. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22608. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22609. s.beta = i,
  22610. s.gamma = n),
  22611. h.vrDebug) {
  22612. $("#info-device-orientation").css("display", "block");
  22613. var r = "";
  22614. r += "alpha=(" + s.alpha + ")<BR/>",
  22615. r += "beta=(" + s.beta + ")<BR/>",
  22616. r += "gamma=" + s.gamma + "<BR/>",
  22617. document.getElementById("info-device-orientation").innerHTML = r
  22618. }
  22619. }),
  22620. this.setObjectQuaternion = function(e, t, i, n, r) {
  22621. s.euler.set(i, t, -n, "YXZ"),
  22622. e.setFromEuler(s.euler),
  22623. e.multiply(s.q1),
  22624. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22625. o.updateMatrixWorld()
  22626. }
  22627. ,
  22628. parent !== window && window.addEventListener("message", function(e) {
  22629. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22630. o && o.alpha && o.beta && o.gamma && (t = a,
  22631. i = M.Math.degToRad(o.alpha),
  22632. n = M.Math.degToRad(o.beta),
  22633. r = M.Math.degToRad(o.gamma),
  22634. t ? (-1e3 === s.alpha && (s.alpha = i),
  22635. -1e3 === s.beta && (s.beta = n),
  22636. -1e3 === s.gamma && (s.gamma = r),
  22637. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22638. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22639. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22640. s.beta = n,
  22641. s.gamma = r))
  22642. }),
  22643. this.update = function(e) {
  22644. TWEEN.update(),
  22645. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22646. this.triggerTargetEvent())
  22647. }
  22648. ,
  22649. this.triggerTargetEvent = function() {
  22650. var e = this.choseObj()
  22651. , t = e ? e.object : void 0;
  22652. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22653. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22654. t && t.enabled && this.startAnimate(function() {
  22655. this.clickCallback(t)
  22656. }
  22657. .bind(this))) : this.type,
  22658. this.targetEventObj.lastObj = t)
  22659. }
  22660. ,
  22661. this.choseObj = function() {
  22662. this.raycaster.setFromCamera({
  22663. x: 0,
  22664. y: 0
  22665. }, o);
  22666. var e = (this.raycaster.ray,
  22667. window.vrMarkers)
  22668. , t = this.raycaster.intersectObjects(e);
  22669. if (0 < t.length)
  22670. return t[0]
  22671. }
  22672. ,
  22673. this.clickCallback = function(e) {
  22674. this.runTHREEAction(e, "onclick")
  22675. }
  22676. ,
  22677. this.runTHREEAction = function(e, t) {
  22678. switch (t) {
  22679. case "onclick":
  22680. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22681. e()
  22682. });
  22683. break;
  22684. case "onhover":
  22685. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22686. e()
  22687. });
  22688. break;
  22689. case "onout":
  22690. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22691. e()
  22692. })
  22693. }
  22694. }
  22695. ,
  22696. this.startAnimate = function(e) {
  22697. this.tweenFlag && this.initAnimation(e)
  22698. }
  22699. ,
  22700. this.initAnimation = function(e) {
  22701. var t = this
  22702. , i = this.cursor.material.map.offset;
  22703. t.tweenFlag = !1,
  22704. this.cursorAnimate = new TWEEN.Tween(i).to({
  22705. x: 1
  22706. }, 1e3).onStart(function() {
  22707. t.tweenFlag = !1
  22708. }).onStop(function() {
  22709. t.tweenFlag = !0,
  22710. this.x = 0,
  22711. i.x = 0
  22712. }).onUpdate(function() {}).onComplete(function() {
  22713. e(),
  22714. i.x = 0,
  22715. setTimeout(function() {
  22716. t.tweenFlag = !0
  22717. }, 1500)
  22718. }),
  22719. this.cursorAnimate.easing(function(e) {
  22720. return Math.floor(17 * e) / 17
  22721. }),
  22722. this.cursorAnimate.start()
  22723. }
  22724. ,
  22725. this.autoCursorPosition = function(e) {
  22726. this.cursor.scale.set(.3, .3, .3)
  22727. }
  22728. }
  22729. ,
  22730. h.prototype.vrRenderer = function(a, i, e) {
  22731. var s = new i.vrCamera(e);
  22732. s.bananaAspect = .8,
  22733. this.width,
  22734. this.height;
  22735. i = this;
  22736. this.setSize = function(e, t) {
  22737. a.setSize.call(this, e, t),
  22738. i.width = e,
  22739. i.height = t
  22740. }
  22741. ,
  22742. this.render = function(e, t, i, n) {
  22743. var r, o;
  22744. if (window.cameraQua = t.quaternion.clone(),
  22745. t.__RESS__SKIP__STEREO__)
  22746. return a.render(e, t, i, n);
  22747. if ("PerspectiveCamera" === t.type)
  22748. r = s.cameraL,
  22749. o = s.cameraR,
  22750. e.updateMatrixWorld(),
  22751. null === t.parent && t.updateMatrixWorld(),
  22752. s.vrCameraUpdate(t);
  22753. else {
  22754. if ("OrthographicCamera" !== t.type)
  22755. return DEBUG && console.error("Unsupported renderer: ", t.type);
  22756. r = o = t
  22757. }
  22758. a.setScissorTest(!0),
  22759. a.setScissor(0, 0, this.width / 2, this.height),
  22760. a.setViewport(0, 0, this.width / 2, this.height),
  22761. a.render.call(this, e, r, i, n),
  22762. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  22763. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  22764. a.render.call(this, e, o, i, n),
  22765. a.setScissorTest(!1)
  22766. }
  22767. ,
  22768. this.__proto__ = {
  22769. __proto__: a
  22770. }
  22771. }
  22772. ,
  22773. h.prototype.vrCamera = function(e) {
  22774. this.type = "StereoCamera",
  22775. this._aspect = 1,
  22776. this._overlap = .064,
  22777. this.cameraL = new M.PerspectiveCamera,
  22778. this.cameraL.layers.enable(1),
  22779. this.cameraL.matrixAutoUpdate = !1,
  22780. this.cameraR = new M.PerspectiveCamera,
  22781. this.cameraR.layers.enable(2),
  22782. this.cameraR.matrixAutoUpdate = !1,
  22783. this.eyeRight = new M.Matrix4,
  22784. this.eyeLeft = new M.Matrix4,
  22785. this.vrCameraNeedsUpdate = !0,
  22786. window.vrCameraL = this.cameraL,
  22787. Object.defineProperty(this, "bananaAspect", {
  22788. get: function() {
  22789. return this._aspect
  22790. },
  22791. set: function(e) {
  22792. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  22793. this._aspect = e
  22794. }
  22795. }),
  22796. Object.defineProperty(this, "overlap", {
  22797. get: function() {
  22798. return this._overlap
  22799. },
  22800. set: function(e) {
  22801. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  22802. this._overlap = e
  22803. }
  22804. }),
  22805. this.vrCameraUpdate = function(e) {
  22806. if (this.vrCameraNeedsUpdate = !0,
  22807. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  22808. this.vrCameraNeedsUpdate) {
  22809. this.vrCameraNeedsUpdate = !1,
  22810. console.debug("vrCameraUpdate"),
  22811. this.bananaFocus = e.focus,
  22812. this.bananaFov = e.fov,
  22813. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  22814. this.bananaNear = e.near,
  22815. this.bananaFar = e.far,
  22816. console.debug(e.aspect),
  22817. this.bananaFocus = 10;
  22818. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  22819. this.eyeLeft.elements[12] = -r,
  22820. this.eyeRight.elements[12] = r,
  22821. t = -a * this.bananaReal_aspect + o,
  22822. i = a * this.bananaReal_aspect + o,
  22823. n.elements[0] = 2 * this.bananaNear / (i - t),
  22824. n.elements[8] = (i + t) / (i - t),
  22825. this.cameraL.projectionMatrix.copy(n),
  22826. t = -a * this.bananaReal_aspect - o,
  22827. i = a * this.bananaReal_aspect - o,
  22828. n.elements[0] = 2 * this.bananaNear / (i - t),
  22829. n.elements[8] = (i + t) / (i - t),
  22830. this.cameraR.projectionMatrix.copy(n)
  22831. }
  22832. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  22833. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  22834. }
  22835. }
  22836. ,
  22837. h.prototype.boluoGetTexture = function(e) {
  22838. var t = new M.TextureLoader;
  22839. return t.crossOrigin = "anonymous",
  22840. t.load(e)
  22841. }
  22842. ,
  22843. h.prototype.updateScreenSize = function(e) {
  22844. var t, i, n, r = !1;
  22845. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  22846. n = e.height,
  22847. r = !0,
  22848. t = 1) : (i = $("#player").width(),
  22849. n = $("#player").height(),
  22850. e && e.resize && (o = this.renderWidth,
  22851. a = this.renderHeight),
  22852. i === o && n === a && !this.forceUpdateSize || (o = i,
  22853. a = n,
  22854. r = !0,
  22855. t = window.devicePixelRatio)),
  22856. r && (this.setSize(i, n, t),
  22857. this.forceUpdateSize = !1)
  22858. }
  22859. ,
  22860. h.prototype.updateComponents = function() {
  22861. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22862. this.updateListeners[t].update(e)
  22863. }
  22864. ,
  22865. h.prototype.suspend = function() {
  22866. this.started = !1,
  22867. this.suspendedObjects = this.scene.children.map(function(e) {
  22868. return this.scene.remove(e),
  22869. e
  22870. }
  22871. .bind(this)),
  22872. this.render()
  22873. }
  22874. ,
  22875. h.prototype.resume = function() {
  22876. this.suspendedObjects.forEach(function(e) {
  22877. this.scene.add(e)
  22878. }
  22879. .bind(this)),
  22880. this.suspendedObjects = [],
  22881. this.started = !0,
  22882. b()
  22883. }
  22884. ;
  22885. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  22886. this.started && (window.requestAnimationFrame(b),
  22887. this.updateScreenSize(),
  22888. this.updateComponents(),
  22889. this.updateTextureMemory(),
  22890. this.render(),
  22891. this.emit(r.AfterRender))
  22892. };
  22893. h.prototype.getImageData = (E = document.createElement("canvas"),
  22894. _ = E.getContext("2d"),
  22895. function(e, t, i) {
  22896. return E.width === t && E.height === i || (E.width = t,
  22897. E.height = i),
  22898. _.drawImage(e, 0, 0, t, i),
  22899. _.getImageData(0, 0, t, i)
  22900. }
  22901. ),
  22902. h.prototype.initSizedTexture2D = function(e, t, i) {
  22903. var n = this.renderer
  22904. , r = n.context
  22905. , o = n.state
  22906. , a = new M.Texture(null);
  22907. !(a.flipY = !1) !== i && (i = !1),
  22908. a.generateMipmaps = i;
  22909. var s = n.paramThreeToGL(a.format)
  22910. , l = n.paramThreeToGL(a.type)
  22911. , c = n.properties.get(a)
  22912. , h = r.createTexture();
  22913. o.bindTexture(r.TEXTURE_2D, h),
  22914. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  22915. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  22916. a.wrapS = t,
  22917. a.wrapT = t;
  22918. var u = n.paramThreeToGL(t);
  22919. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  22920. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  22921. i ? (a.magFilter = M.LinearFilter,
  22922. a.minFilter = M.LinearMipMapLinearFilter,
  22923. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  22924. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  22925. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  22926. a.minFilter = M.LinearFilter,
  22927. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  22928. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  22929. o.bindTexture(r.TEXTURE_2D, null),
  22930. c.__webglTexture = h,
  22931. a
  22932. }
  22933. ,
  22934. h.prototype.initSizedCubeMap = function(e, t) {
  22935. var i = this.renderer
  22936. , n = i.context
  22937. , r = i.state
  22938. , o = new M.CubeTexture([null, null, null, null, null, null]);
  22939. o.flipY = !1,
  22940. o.generateMipmaps = t;
  22941. var a = i.paramThreeToGL(o.format)
  22942. , s = i.paramThreeToGL(o.type)
  22943. , l = i.properties.get(o)
  22944. , c = n.createTexture();
  22945. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  22946. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  22947. for (var h = 0; h < 6; h++)
  22948. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  22949. return t ? (o.magFilter = M.LinearFilter,
  22950. o.minFilter = M.LinearMipMapLinearFilter,
  22951. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22952. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22953. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22954. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  22955. o.minFilter = M.LinearFilter,
  22956. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22957. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22958. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22959. l.__image__webglTextureCube = c,
  22960. o
  22961. }
  22962. ,
  22963. h.prototype.deallocateCubeTexture = function(e) {
  22964. var t = this.renderer
  22965. , i = t.context
  22966. , n = t.properties.get(e);
  22967. i.deleteTexture(n.__image__webglTextureCube)
  22968. }
  22969. ,
  22970. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22971. var a = this.renderer
  22972. , s = a.context
  22973. , l = a.state
  22974. , c = a.properties.get(t);
  22975. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22976. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22977. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22978. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22979. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22980. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22981. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22982. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22983. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22984. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22985. l.bindTexture(s.TEXTURE_2D, null)
  22986. }
  22987. ,
  22988. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22989. var s = this.renderer
  22990. , l = s.context
  22991. , c = s.state
  22992. , h = s.properties.get(t);
  22993. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22994. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22995. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22996. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22997. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22998. }
  22999. ,
  23000. h.prototype.rebuildMipMaps2D = function(e) {
  23001. var t = this.renderer
  23002. , i = t.context
  23003. , n = t.state;
  23004. t.properties.get(e),
  23005. i.generateMipmap(i.TEXTURE_2D),
  23006. n.bindTexture(i.TEXTURE_2D, null)
  23007. }
  23008. ,
  23009. h.prototype.rebuildMipMaps3D = function(e) {
  23010. var t = this.renderer
  23011. , i = t.context
  23012. , n = t.state
  23013. , r = t.properties.get(e);
  23014. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23015. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23016. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23017. }
  23018. ,
  23019. h.prototype.renderToCubeMap = (P = !1,
  23020. F = N = D = L = O = null,
  23021. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23022. this.renderer.context,
  23023. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23024. (O = new M.Scene).add(L),
  23025. D = new M.ShaderMaterial({
  23026. uniforms: {
  23027. tDiffuse: {
  23028. type: "t",
  23029. value: null
  23030. },
  23031. alpha: {
  23032. type: "f",
  23033. value: 1
  23034. }
  23035. },
  23036. vertexShader: R.basicTextured.vertexShader,
  23037. fragmentShader: R.basicTextured.fragmentShader,
  23038. depthWrite: !1,
  23039. depthTest: !1,
  23040. side: M.DoubleSide
  23041. }),
  23042. N = new M.PlaneBufferGeometry(1,1),
  23043. (F = new M.Mesh(N,D)).position.z = 0,
  23044. O.add(F),
  23045. P = !0);
  23046. var m = N.getAttribute("uv");
  23047. m.setDynamic(!0),
  23048. m.needsUpdate = !0;
  23049. var v = m.array
  23050. , y = r / i
  23051. , A = o / n
  23052. , C = a / i
  23053. , I = s / n;
  23054. v[0] = y,
  23055. v[1] = A + I,
  23056. v[2] = y + C,
  23057. v[3] = A + I,
  23058. v[4] = y,
  23059. v[5] = A,
  23060. v[6] = y + C,
  23061. v[7] = A;
  23062. var E = N.getAttribute("position");
  23063. E.setDynamic(!0),
  23064. E.needsUpdate = !0;
  23065. var _ = E.array
  23066. , b = l / t.width - .5
  23067. , w = c / t.height - .5
  23068. , T = h / t.width
  23069. , x = u / t.height;
  23070. _[0] = b,
  23071. _[1] = w + x,
  23072. _[3] = b + T,
  23073. _[4] = w + x,
  23074. _[6] = b,
  23075. _[7] = w,
  23076. _[9] = b + T,
  23077. _[10] = w,
  23078. this.renderer.properties.get(e),
  23079. D.uniforms.tDiffuse.value = e,
  23080. D.blending = p || M.NoBlending,
  23081. D.transparent = !!f,
  23082. null != g || (g = 1),
  23083. D.uniforms.alpha.value = g,
  23084. D.needUpdate = !0,
  23085. t.activeCubeFace = d,
  23086. t.viewport.set(0, 0, t.width, t.height);
  23087. var S = this.renderer.autoClear;
  23088. this.renderer.autoClear = !1,
  23089. this.renderer.render(O, L, t, !1),
  23090. this.renderer.autoClear = S
  23091. }
  23092. ),
  23093. h.prototype.copyCubeMap = (g = !1,
  23094. C = A = y = v = m = null,
  23095. I = new M.Euler,
  23096. new M.Vector3,
  23097. function(e, t, i, n, r, o, a, s, l) {
  23098. this.renderer,
  23099. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23100. (m = new M.Scene).add(v),
  23101. y = new M.ShaderMaterial({
  23102. uniforms: {
  23103. tDiffuse: {
  23104. type: "t",
  23105. value: null
  23106. },
  23107. alpha: {
  23108. type: "f",
  23109. value: 1
  23110. }
  23111. },
  23112. vertexShader: R.copyCubeMap.vertexShader,
  23113. fragmentShader: R.copyCubeMap.fragmentShader,
  23114. depthWrite: !1,
  23115. depthTest: !1,
  23116. side: M.DoubleSide
  23117. }),
  23118. A = new M.BoxGeometry(2,2,2),
  23119. C = new M.Mesh(A,y),
  23120. m.add(C),
  23121. g = !0);
  23122. for (var c = 0; c < 6; c++)
  23123. h.getCubeOrientationForCubeFace(c, I),
  23124. C.rotation.copy(I),
  23125. C.matrixWorldNeedsUpdate = !0,
  23126. C.updateMatrixWorld(),
  23127. y.uniforms.tDiffuse.value = e,
  23128. y.blending = a || M.NoBlending,
  23129. y.transparent = !!s,
  23130. null != l || (l = 1),
  23131. y.uniforms.alpha.value = l,
  23132. y.needUpdate = !0,
  23133. t.activeCubeFace = c,
  23134. t.viewport.set(0, 0, r, o),
  23135. this.renderer.render(m, v, t, !1)
  23136. }
  23137. ),
  23138. h.getLookAtForCubeFace = function(e, t) {
  23139. switch (e) {
  23140. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23141. t.set(1, 0, 0);
  23142. break;
  23143. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23144. t.set(-1, 0, 0);
  23145. break;
  23146. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23147. t.set(0, 1, 0);
  23148. break;
  23149. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23150. t.set(0, -1, 0);
  23151. break;
  23152. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23153. t.set(0, 0, 1);
  23154. break;
  23155. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23156. t.set(0, 0, -1)
  23157. }
  23158. }
  23159. ,
  23160. h.getCubeOrientationForCubeFace = function(e, t) {
  23161. switch (e) {
  23162. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23163. t.set(0, -Math.PI / 2, 0);
  23164. break;
  23165. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23166. t.set(0, Math.PI / 2, 0);
  23167. break;
  23168. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23169. t.set(Math.PI / 2, Math.PI, 0);
  23170. break;
  23171. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23172. t.set(-Math.PI / 2, Math.PI, 0);
  23173. break;
  23174. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23175. t.set(0, -Math.PI, 0);
  23176. break;
  23177. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23178. t.set(0, 0, 0)
  23179. }
  23180. }
  23181. ,
  23182. t.exports = h
  23183. }
  23184. , {
  23185. "../enum/GLCubeFaces": 25,
  23186. "../enum/GLTextureType": 26,
  23187. "../enum/SceneRendererEvents": 43,
  23188. "../exception/BasicException": 55,
  23189. "../exception/RendererCreationException": 57,
  23190. "../settings": 166,
  23191. "../shaders": 167,
  23192. "../util/browser": 182,
  23193. events: 202,
  23194. three: 217
  23195. }],
  23196. 159: [function(e, t, i) {
  23197. "use strict";
  23198. function n(e) {
  23199. this.messenger = new a(e),
  23200. this.clientKey = null
  23201. }
  23202. var o = e("../util/ajax")
  23203. , r = e("./PostMessageType")
  23204. , a = e("./postmessage")
  23205. , s = e("./VersionInfo")
  23206. , l = e("events").EventEmitter
  23207. , c = window.location.origin + "/api/v1/user/";
  23208. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23209. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23210. }
  23211. ,
  23212. n.prototype.waitForConnection = function() {
  23213. return new Promise(function(t, i) {
  23214. this.messenger.on(r.CONNECT, function(e) {
  23215. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23216. }
  23217. .bind(this))
  23218. }
  23219. .bind(this))
  23220. }
  23221. ,
  23222. n.prototype.onConnectionReceived = function(i) {
  23223. return this.messenger.setTarget(i.source, i.origin),
  23224. this.verifyConnection(i).then(function(e, t) {
  23225. this.messenger.send({
  23226. type: r.ACCEPT,
  23227. toId: i.fromId,
  23228. warning: t
  23229. }),
  23230. this.clientKey = e,
  23231. this.messenger.removeAllListeners(r.CONNECT),
  23232. this.bindEvents()
  23233. }
  23234. .bind(this), function(e) {
  23235. this.messenger.send({
  23236. type: r.REJECT,
  23237. toId: i.fromId,
  23238. reason: e
  23239. }),
  23240. this.messenger.setTarget()
  23241. }
  23242. .bind(this))
  23243. }
  23244. ,
  23245. n.prototype.verifyConnection = function(r) {
  23246. return new Promise(function(e, t) {
  23247. var i;
  23248. if (s.isDeprecated(r.sdkVersion))
  23249. i = "这个版本正在被弃用";
  23250. else if (!s.isSupported(r.sdkVersion))
  23251. return t("不支持此版本的SDK");
  23252. var n = {
  23253. cache: !1,
  23254. headers: {
  23255. "X-port-Application-Key": r.applicationKey,
  23256. "X-port-Referrer": r.origin
  23257. }
  23258. };
  23259. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23260. }
  23261. )
  23262. }
  23263. ,
  23264. n.prototype.onMessageReceived = function(t) {
  23265. if (this.validateClientApplicationKey(t.applicationKey)) {
  23266. var i = this;
  23267. t.onDone = function(e) {
  23268. e.toId = t.fromId,
  23269. e.uid = t.uid,
  23270. e.type = r.RESPONSE,
  23271. i.messenger.send(e)
  23272. }
  23273. ,
  23274. this.emit(r.ACTION, t)
  23275. }
  23276. }
  23277. ,
  23278. n.prototype.validateClientApplicationKey = function(e) {
  23279. return this.clientKey === e
  23280. }
  23281. ,
  23282. n.prototype.sendEvent = function(e, t) {
  23283. this.messenger.send({
  23284. type: r.EVENT,
  23285. eventType: e,
  23286. eventData: t
  23287. })
  23288. }
  23289. ,
  23290. t.exports = n
  23291. }
  23292. , {
  23293. "../util/ajax": 181,
  23294. "./PostMessageType": 160,
  23295. "./VersionInfo": 163,
  23296. "./postmessage": 165,
  23297. events: 202
  23298. }],
  23299. 160: [function(e, t, i) {
  23300. "use strict";
  23301. t.exports = Object.freeze({
  23302. CONNECT: "postmessage.connect",
  23303. ACCEPT: "postmessage.accept",
  23304. REJECT: "postmessage.reject",
  23305. ACTION: "postmessage.action",
  23306. RESPONSE: "postmessage.response",
  23307. EVENT: "postmessage.event"
  23308. })
  23309. }
  23310. , {}],
  23311. 161: [function(e, t, i) {
  23312. "use strict";
  23313. t.exports = Object.freeze({
  23314. MOVE: "sdk.move",
  23315. ENTER_PANO: "sdk.enterpano",
  23316. MODEL_LOADED: "sdk.modelloaded"
  23317. })
  23318. }
  23319. , {}],
  23320. 162: [function(e, t, i) {
  23321. "use strict";
  23322. t.exports = Object.freeze({
  23323. FLY: "transition.fly",
  23324. FADEOUT: "transition.fade",
  23325. INSTANT: "transition.instant"
  23326. })
  23327. }
  23328. , {}],
  23329. 163: [function(e, t, i) {
  23330. "use strict";
  23331. t.exports = {
  23332. current: "1.0",
  23333. supported: ["1.0"],
  23334. deprecated: [],
  23335. isSupported: function(e) {
  23336. return -1 !== this.supported.indexOf(e)
  23337. },
  23338. isDeprecated: function(e) {
  23339. return -1 !== this.deprecated.indexOf(e)
  23340. },
  23341. isValid: function(e) {
  23342. return this.isSupported(e) || this.isDeprecated(e)
  23343. }
  23344. }
  23345. }
  23346. , {}],
  23347. 164: [function(q, X, e) {
  23348. (function(e) {
  23349. "use strict";
  23350. function r(e, t, i) {
  23351. e = e && e.toLowerCase().trim();
  23352. var n = new C.UP.clone
  23353. , r = Math.PI / 3
  23354. , o = Math.PI / 2;
  23355. switch (e) {
  23356. case "left":
  23357. i.copy(t),
  23358. i.applyAxisAngle(n, o);
  23359. break;
  23360. case "right":
  23361. i.copy(t),
  23362. i.applyAxisAngle(n, -o);
  23363. break;
  23364. case "forwardleft":
  23365. i.copy(t),
  23366. i.applyAxisAngle(n, r);
  23367. break;
  23368. case "forwardright":
  23369. i.copy(t),
  23370. i.applyAxisAngle(n, -r);
  23371. break;
  23372. case "forward":
  23373. default:
  23374. i.copy(t)
  23375. }
  23376. return i
  23377. }
  23378. function o(e, t) {
  23379. if (e) {
  23380. var i = {
  23381. pano: e,
  23382. lookAtPoint: null,
  23383. duration: null,
  23384. maxDistanceOverride: null,
  23385. skipWarpingCheck: !1
  23386. };
  23387. this.player.flyToPano(i, function() {
  23388. t && t({
  23389. success: !0,
  23390. message: "Transition complete."
  23391. })
  23392. })
  23393. } else
  23394. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23395. t && t({
  23396. success: !1,
  23397. error: "Unable to find pano."
  23398. })
  23399. }
  23400. function a(e, t) {
  23401. t.copy(C.FORWARD),
  23402. e.getDirection(t)
  23403. }
  23404. function c(i) {
  23405. return {
  23406. panos: i.panos.list.map(function(e) {
  23407. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23408. return {
  23409. uuid: e.id,
  23410. aligned: e.alignmentType === g.ALIGNED,
  23411. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23412. position: function(e) {
  23413. return e.alignmentType !== g.ALIGNED ? null : {
  23414. x: e.position.x,
  23415. y: e.position.y,
  23416. z: e.position.z
  23417. }
  23418. }(e),
  23419. rotation: function(e) {
  23420. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23421. return {
  23422. x: h.Math.radToDeg(t._x),
  23423. y: h.Math.radToDeg(t._y),
  23424. z: h.Math.radToDeg(t._z)
  23425. }
  23426. }(e),
  23427. thumbnail: t
  23428. }
  23429. })
  23430. }
  23431. }
  23432. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  23433. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23434. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23435. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23436. N.angle = 0,
  23437. N.angleTravelled = 0,
  23438. N.playerDirection = new h.Vector3,
  23439. N.lastFacingDirection = new h.Vector3,
  23440. N.onDone = null,
  23441. N.player = null,
  23442. N.start = function(e, t, i, n) {
  23443. N.active = !0,
  23444. e && t && (t = 0),
  23445. N.angle = e || t,
  23446. N.xAngle = e,
  23447. N.yAngle = t,
  23448. N.angleTravelled = 0,
  23449. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23450. i.getDirection(N.playerDirection),
  23451. N.lastFacingDirection.copy(N.playerDirection),
  23452. N.projectVectors(),
  23453. N.onDone = n,
  23454. N.player = i,
  23455. N()
  23456. }
  23457. ,
  23458. N.projectVectors = function() {
  23459. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23460. N.lastFacingDirection.projectOnPlane(C.UP))
  23461. }
  23462. ,
  23463. N), P = (i = new h.Vector3,
  23464. function(e) {
  23465. e ? (i.copy(e.position),
  23466. i.add(e.discPosition),
  23467. s.projectPositionToCanvas(i, this.player.camera, i),
  23468. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23469. }
  23470. ), O = (l = new h.Vector3,
  23471. function(e) {
  23472. var t = this.player.getDirection();
  23473. l.copy(t);
  23474. var i = l.y;
  23475. l.y = 0,
  23476. l.normalize();
  23477. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23478. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23479. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23480. 0;
  23481. this.player.mode === I.DOLLHOUSE && (n = -n);
  23482. var r = function() {
  23483. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23484. }
  23485. .call(this) - .1
  23486. , o = function() {
  23487. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23488. }
  23489. .call(this) + .1
  23490. , a = n + e;
  23491. r < a ? a = r : a < o && (a = o);
  23492. var s = a - n;
  23493. return 0 < e && s < .01 && (s = 0),
  23494. e < 0 && -.01 < s && (s = 0),
  23495. s
  23496. }
  23497. ), L = (t = new h.Euler,
  23498. function(e) {
  23499. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23500. {
  23501. position: {
  23502. x: e.position.x,
  23503. y: e.position.y,
  23504. z: e.position.z
  23505. },
  23506. rotation: {
  23507. x: h.Math.radToDeg(t.x),
  23508. y: h.Math.radToDeg(t.y),
  23509. z: 0
  23510. },
  23511. pano: e.currentPano ? e.currentPano.id : null,
  23512. mode: e.mode
  23513. }
  23514. }
  23515. ), D = null;
  23516. function N() {
  23517. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23518. N.player.getDirection(N.playerDirection),
  23519. N.projectVectors();
  23520. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23521. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23522. N.onDone && (0,
  23523. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23524. window.setTimeout(N, 4))
  23525. }
  23526. X.exports = {
  23527. init: function(e, t, i, n, r) {
  23528. Y.init(e, t, i, r),
  23529. D = new Promise(function(e, t) {
  23530. i.on(_.Ready, function() {
  23531. e()
  23532. })
  23533. }
  23534. .bind(this));
  23535. var o = new u(window)
  23536. , a = o.waitForConnection();
  23537. a.then(function(e) {
  23538. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23539. });
  23540. var s, l = (s = Date.now(),
  23541. function() {
  23542. if (!(Date.now() - s < 100)) {
  23543. var e = L(i);
  23544. o.sendEvent(b.MOVE, {
  23545. state: e
  23546. }),
  23547. s = Date.now()
  23548. }
  23549. }
  23550. );
  23551. i.on(_.Move, l),
  23552. i.on(_.ViewChanged, l),
  23553. n.on(p.ActiveModelChanged, function(e) {
  23554. function t(e) {
  23555. var t, i = e.newPano.id;
  23556. e.oldPano && (t = e.oldPano.id),
  23557. i !== t && o.sendEvent(b.ENTER_PANO, {
  23558. oldPano: t,
  23559. newPano: i
  23560. })
  23561. }
  23562. var i = e.model
  23563. , n = e.oldModel;
  23564. Y.model = i,
  23565. a.then(function() {
  23566. o.sendEvent(b.MODEL_LOADED, {
  23567. metadata: c(i)
  23568. })
  23569. }),
  23570. n && n.panos.forEach(function(e) {
  23571. e.removeEventListener("enter", t)
  23572. }),
  23573. i.panos.forEach(function(e) {
  23574. e.on("enter", t)
  23575. })
  23576. })
  23577. }
  23578. };
  23579. var F, B, V, k, U, H, z, G, W, j, Y = {
  23580. director: null,
  23581. player: null,
  23582. controls: null,
  23583. sceneRenderer: null,
  23584. model: null,
  23585. init: function(e, t, i, n) {
  23586. this.director = e,
  23587. this.player = i,
  23588. this.controls = t,
  23589. this.sceneRenderer = n
  23590. },
  23591. handleToObject: {},
  23592. objectToHandle: {},
  23593. handleCount: 0,
  23594. onMessageReceive: function(e) {
  23595. if (e) {
  23596. var t = e.targetFunction
  23597. , i = e.params
  23598. , n = e.onDone;
  23599. t && this[t] && this[t](i, n)
  23600. }
  23601. },
  23602. waitForInit: function(e, t) {
  23603. D.then(t.bind({
  23604. success: !0,
  23605. message: "Init complete."
  23606. }))
  23607. },
  23608. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23609. j = new h.Quaternion,
  23610. function(e, t) {
  23611. var i = e.pano
  23612. , n = e.rotation
  23613. , r = e.transition;
  23614. if (!this.model)
  23615. return t({
  23616. success: !1,
  23617. error: "The model has not been loaded yet"
  23618. });
  23619. var o = this.model.panos.get(i);
  23620. if (!o)
  23621. return t({
  23622. success: !1,
  23623. error: i + " does not exist in this model"
  23624. });
  23625. if (!n)
  23626. return t({
  23627. sucess: !1,
  23628. erorr: n + " is not a valid rotation"
  23629. });
  23630. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23631. console.log(n.z);
  23632. var a = {
  23633. success: !0,
  23634. message: i
  23635. };
  23636. if (r === v.FADEOUT)
  23637. j.setFromEuler(W),
  23638. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23639. else {
  23640. var s, l;
  23641. r === v.INSTANT && (l = s = 0);
  23642. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23643. this.player.flyToPano({
  23644. pano: o,
  23645. lookAtPoint: c,
  23646. duration: s,
  23647. aimDuration: l
  23648. }, t.bind(this, a))
  23649. }
  23650. }
  23651. ),
  23652. moveInDirection: function(e, t) {
  23653. var i = e.direction;
  23654. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23655. void (t && t({
  23656. success: !1,
  23657. error: "Invalid direction."
  23658. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23659. t(e ? {
  23660. success: !0,
  23661. message: "moved " + i
  23662. } : {
  23663. success: !1,
  23664. error: "Cannot move in direction: " + i
  23665. })
  23666. })
  23667. },
  23668. getPose: function(e, t) {
  23669. return this.player.camera.position,
  23670. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23671. t({
  23672. success: !0,
  23673. message: L(this.player)
  23674. })
  23675. },
  23676. takeScreenShot: (z = new h.PerspectiveCamera,
  23677. G = new h.WebGLRenderTarget,
  23678. function(e, t) {
  23679. if (!e.resolution)
  23680. return t({
  23681. success: !1,
  23682. error: "An invalid resolution was specified"
  23683. });
  23684. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23685. var i = this.sceneRenderer.renderer.getSize();
  23686. e.resolution.width = i.width,
  23687. e.resolution.height = i.height
  23688. }
  23689. z.layers.set(T.DEFAULT),
  23690. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23691. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23692. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23693. var n = e.resolution.width
  23694. , r = e.resolution.height
  23695. , o = n / r;
  23696. z.position.copy(this.sceneRenderer.camera.position),
  23697. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23698. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23699. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  23700. G.setSize(n, r),
  23701. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  23702. var a = new Uint8Array(n * r * 4);
  23703. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  23704. var s = S.encode({
  23705. data: a,
  23706. width: n,
  23707. height: r,
  23708. heading: 180,
  23709. pitch: 0
  23710. }, {
  23711. quality: 75,
  23712. flipY: !0
  23713. });
  23714. t({
  23715. success: !0,
  23716. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  23717. })
  23718. }
  23719. ),
  23720. findRankedPano: (U = new h.Vector3,
  23721. H = new h.Vector3,
  23722. function(e, t) {
  23723. a(this.player, H),
  23724. r(t, H, U);
  23725. var i = this.player.rankedPanoInDirection(e, U);
  23726. if (i) {
  23727. var n = this.objectToHandle[i.id];
  23728. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  23729. this.handleToObject[n] = i),
  23730. n
  23731. }
  23732. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23733. -1
  23734. }
  23735. ),
  23736. findRankedtag: (V = new h.Vector3,
  23737. k = new h.Vector3,
  23738. function(e, t) {
  23739. a(this.player, k),
  23740. r(t, k, V);
  23741. var i = this.player.rankedtagInDirection(e, V);
  23742. if (i) {
  23743. var n = this.objectToHandle[i.sid];
  23744. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  23745. this.handleToObject[n] = i),
  23746. n
  23747. }
  23748. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23749. -1
  23750. }
  23751. ),
  23752. clickNearesttag: function(e) {
  23753. this.clickRankedtag(0, e)
  23754. },
  23755. clickRankedtag: function(e, t) {
  23756. var i = function(e, t) {
  23757. var i = this.findRankedtag(e, t);
  23758. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23759. null)
  23760. }
  23761. .call(this, e, t);
  23762. i && P.call(this, i)
  23763. },
  23764. clickNearestPano: function(e, t) {
  23765. this.clickRankedPano(0, e, t)
  23766. },
  23767. clickRankedPano: function(e, t, i) {
  23768. var n = function(e, t) {
  23769. var i = this.findRankedPano(e, t);
  23770. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23771. null)
  23772. }
  23773. .call(this, e, t);
  23774. n ? o.call(this, n, i) : i(null)
  23775. },
  23776. clickPano: function(e, t) {
  23777. var i = this.handleTable[e];
  23778. i ? o.call(this, i, t) : t(null)
  23779. },
  23780. rotateDirection: function(e, t) {
  23781. var i = e.direction
  23782. , n = e.angle;
  23783. if (!R.active) {
  23784. var r = 0
  23785. , o = 0
  23786. , a = 0
  23787. , s = 0;
  23788. if (!n || isNaN(n))
  23789. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23790. void (t && t({
  23791. success: !1,
  23792. error: "Invalid rotation angle."
  23793. }));
  23794. if (this.player.mode === I.TRANSITIONING)
  23795. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23796. void (t && t({
  23797. success: !1,
  23798. error: "Cannot rotate while transitioning"
  23799. }));
  23800. if (i === m.RIGHT || i === m.LEFT)
  23801. i === m.RIGHT && (n = -n),
  23802. r = 0 < n ? -1 : 1,
  23803. a = n;
  23804. else {
  23805. if (i !== m.UP && i !== m.DOWN)
  23806. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23807. void (t && t({
  23808. success: !1,
  23809. error: "Invalid direction for rotation."
  23810. }));
  23811. if (this.player.mode === I.FLOORPLAN)
  23812. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23813. void (t && t({
  23814. success: !1,
  23815. error: "Cannot rotate " + i + " in floorplan mode"
  23816. }));
  23817. if (i === m.DOWN && (n = -n),
  23818. 0 === (n = O.call(this, n)))
  23819. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23820. void (t && t({
  23821. success: !1,
  23822. error: "Already at maximum rotation in direction: " + i
  23823. }));
  23824. o = 0 < n ? 1 : -1,
  23825. s = n
  23826. }
  23827. var l = n;
  23828. n = h.Math.degToRad(n),
  23829. a = h.Math.degToRad(a),
  23830. s = h.Math.degToRad(s);
  23831. var c = this.controls.activeControl;
  23832. c.startRotating(r, o),
  23833. R.start(a, s, this.player, function() {
  23834. c.stopRotating(!0),
  23835. t && t({
  23836. success: !0,
  23837. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23838. })
  23839. })
  23840. }
  23841. },
  23842. rotate: (F = new h.Vector3,
  23843. B = new h.Vector3,
  23844. function(e, t) {
  23845. var i = e.xAngle
  23846. , n = e.yAngle;
  23847. if (!R.active) {
  23848. if (i = i || 0,
  23849. n = n || 0,
  23850. isNaN(i) || isNaN(n))
  23851. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  23852. void (t && t({
  23853. success: !1,
  23854. error: "Invalid rotation angle."
  23855. }));
  23856. if (this.player.mode === I.TRANSITIONING)
  23857. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23858. void (t && t({
  23859. success: !1,
  23860. error: "Cannot rotate while transitioning"
  23861. }));
  23862. Math.abs(i) < .01 && (i = 0),
  23863. Math.abs(n) < .01 && (n = 0);
  23864. var r = n;
  23865. n = O.call(this, n);
  23866. var o = 0 < r ? "UP" : "DOWN";
  23867. if (!(i = -i) && r && !n)
  23868. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  23869. void (t && t({
  23870. success: !1,
  23871. error: "Already at maximum rotation in direction: " + o
  23872. }));
  23873. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  23874. var a = n;
  23875. n = h.Math.degToRad(n),
  23876. i = h.Math.degToRad(i),
  23877. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23878. this.player.getDirection(F),
  23879. B.copy(F).applyAxisAngle(C.UP, i),
  23880. B.applyAxisAngle(C.RIGHT, n);
  23881. var s = (F.angleTo(B),
  23882. 0 < i ? -1 : i < 0 ? 1 : 0)
  23883. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  23884. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  23885. var c = this.controls.activeControl;
  23886. c.startRotating(s, l),
  23887. R.start(i, n, this.player, function() {
  23888. c.stopRotating(!0),
  23889. t && t({
  23890. success: !0,
  23891. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  23892. })
  23893. })
  23894. }
  23895. }
  23896. ),
  23897. panCamera: function(e, i) {
  23898. function t(e) {
  23899. switch (r.removeAllListeners(w.AutoPanComplete),
  23900. r.removeAllListeners(w.AutoPanInterrupt),
  23901. r.removeAllListeners(w.AutoPanClamped),
  23902. e) {
  23903. case w.AutoPanInterrupt:
  23904. i({
  23905. success: !0,
  23906. message: "Camera panning interrupted."
  23907. });
  23908. break;
  23909. case w.AutoPanClamped:
  23910. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23911. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23912. return void i({
  23913. success: !1,
  23914. error: "Already at edge of current model bounds."
  23915. });
  23916. var t = "The view point is outside the bounds for the current model. ";
  23917. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  23918. console.warn(t)
  23919. }
  23920. case w.AutoPanComplete:
  23921. i({
  23922. success: !0,
  23923. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23924. })
  23925. }
  23926. }
  23927. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  23928. return i({
  23929. success: !1,
  23930. error: "Camera panning is not available in the current mode: " + this.player.mode
  23931. });
  23932. var n = e.position
  23933. , r = this.player.control;
  23934. r.setAutoPanPosition(n.x, n.z),
  23935. r.autoPan = !0;
  23936. var o = function(e, t) {
  23937. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23938. };
  23939. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  23940. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  23941. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  23942. },
  23943. click: function(e, t) {
  23944. var i = e.x
  23945. , n = e.y;
  23946. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  23947. n = n / 100 * $("#player").height()),
  23948. this.player.handleInputStart(i, n),
  23949. this.player.updateIntersect(),
  23950. this.player.handleInputEnd(i, n)
  23951. },
  23952. mouseOver: function(e, t) {
  23953. var i = e.x
  23954. , n = e.y;
  23955. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  23956. n = n / 100 * $("#player").height()),
  23957. this.player.handleInputMove(i, n),
  23958. this.player.updateIntersect()
  23959. },
  23960. moveToMode: function(e, t) {
  23961. function i(e) {
  23962. t(e ? {
  23963. success: !1,
  23964. error: "Failed to load new mode: " + e
  23965. } : {
  23966. success: !0,
  23967. message: "Moved to new mode: " + n
  23968. })
  23969. }
  23970. var n = e.mode;
  23971. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23972. i()
  23973. }, function(e) {
  23974. i(e)
  23975. }) : t({
  23976. success: !1,
  23977. error: "Invalid mode selection"
  23978. })
  23979. }
  23980. }
  23981. }
  23982. ).call(this, "/js/sdk/automation.js")
  23983. }
  23984. , {
  23985. "../constants": 8,
  23986. "../enum/AlignmentType": 17,
  23987. "../enum/ControlEvents": 21,
  23988. "../enum/Direction": 22,
  23989. "../enum/GLCubeFaces": 25,
  23990. "../enum/Keys": 30,
  23991. "../enum/ModelManagerEvents": 33,
  23992. "../enum/PlayerEvents": 40,
  23993. "../enum/RenderLayers": 41,
  23994. "../enum/Vectors": 50,
  23995. "../enum/Viewmode": 51,
  23996. "../enum/WarpStyle": 52,
  23997. "../lib/jpeg_encoder": 94,
  23998. "../sdk/SdkEvents": 161,
  23999. "../settings": 166,
  24000. "../util/common": 185,
  24001. "../util/logger": 189,
  24002. "../util/math": 190,
  24003. "../util/panorama": 191,
  24004. "./ApiHost": 159,
  24005. "./PostMessageType": 160,
  24006. "./TransitionStyles": 162,
  24007. three: 217
  24008. }],
  24009. 165: [function(e, t, i) {
  24010. "use strict";
  24011. function n(e) {
  24012. this.sourceWindow = e,
  24013. this.targetWindow = null,
  24014. this.targetOrigin = null,
  24015. this.id = Math.floor(1e5 * Math.random()),
  24016. this.bindEvents()
  24017. }
  24018. var r = e("./PostMessageType")
  24019. , o = e("events").EventEmitter;
  24020. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24021. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24022. }
  24023. ,
  24024. n.prototype.setTarget = function(e, t) {
  24025. this.targetWindow = e,
  24026. this.targetOrigin = t
  24027. }
  24028. ,
  24029. n.prototype.onPostmessageReceived = function(e) {
  24030. var t = e.origin || e.originalEvent.origin
  24031. , i = e.source;
  24032. switch (e.data.type) {
  24033. case r.CONNECT:
  24034. break;
  24035. case r.RESPONSE:
  24036. if (this.id !== e.data.toId)
  24037. return;
  24038. default:
  24039. if (!this.validateMessageOrigin(t))
  24040. return
  24041. }
  24042. var n = e.data;
  24043. n.source = i,
  24044. n.origin = t,
  24045. n.timestamp = Date.now(),
  24046. this.emit(e.data.type, n)
  24047. }
  24048. ,
  24049. n.prototype.validateMessageOrigin = function(e) {
  24050. return "*" === this.targetOrigin || e === this.targetOrigin
  24051. }
  24052. ,
  24053. n.prototype.send = function(e) {
  24054. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24055. this.targetWindow.postMessage(e, this.targetOrigin))
  24056. }
  24057. ,
  24058. t.exports = n
  24059. }
  24060. , {
  24061. "./PostMessageType": 160,
  24062. events: 202
  24063. }],
  24064. 166: [function(e, t, i) {
  24065. "use strict";
  24066. var n = e("three")
  24067. , r = e("./util/browser")
  24068. , o = e("./enum/Viewmode")
  24069. , a = e("./enum/VROption")
  24070. , s = e("./enum/Colors")
  24071. , l = e("./enum/WarpStyle")
  24072. , c = e("./util/easing")
  24073. , h = e("./util/common")
  24074. , u = e("./util/showcase")
  24075. , d = e("./constants")
  24076. , p = {
  24077. debug: !1,
  24078. version: "2.25.6-0-gd87e5b1",
  24079. languageTag: r.valueFromHash("lang", null),
  24080. pageTitle: "四维虚拟漫游",
  24081. authorizationHeader: u.getAuthorizationHeader(),
  24082. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24083. logLevel: r.valueFromHash("log", 2),
  24084. skyboxRadius: 2500,
  24085. modelBoundsPadding: 5,
  24086. showNeighbors: !1,
  24087. brand: r.valueFromHash("brand", !0),
  24088. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24089. startHighlights: r.valueFromHash("hl", -1),
  24090. specialEdition: r.valueFromHash("bn", 0),
  24091. useWheel: r.valueFromHash("wh", !0),
  24092. crossOrigin: "anonymous",
  24093. fancierTransition: !1,
  24094. wireframe: !1,
  24095. skyboxWireframe: !1,
  24096. modelAlpha: 1,
  24097. highlightPanoSelection: !1,
  24098. showSweeps: !0,
  24099. showSkyboxes: !1,
  24100. showMesh: !0,
  24101. showFloors: !1,
  24102. showFloorDuration: 300,
  24103. showFloorDelay: 300,
  24104. hideFloorDuration: 300,
  24105. hideFloorDelay: 0,
  24106. reticuleOpacityTransitionTime: 250,
  24107. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24108. markerOpacityTransitionTime: 500,
  24109. guiAnimationSpeed: 250,
  24110. highlightAnimationDuration: 500,
  24111. modelComponentLoadSpinnerDelay: 150,
  24112. captureErrors: !1,
  24113. maxMobileTextures: 6,
  24114. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24115. startupFlyinDelay: 3e3,
  24116. dollhouseDefault: {
  24117. minDistance: 1,//15, //编辑页面给近一些
  24118. maxDistance: 50,
  24119. minPolarAngle: n.Math.degToRad(10),
  24120. maxPolarAngle: n.Math.degToRad(90)
  24121. },
  24122. hideReticuleTimeout: 1e3,
  24123. analytics: {
  24124. inactivityThreshold: 30,
  24125. sessionTrackingRate: .15,
  24126. maxTrackedErrors: 20,
  24127. sessionDurationPingFrequency: 10,
  24128. sessionDurationTimeout: 15
  24129. },
  24130. flydown: {
  24131. movementEasing: "easeInOutQuad",
  24132. movementDelay: .001,
  24133. rotationEasing: "easeInOutQuad",
  24134. rotationDelay: .5,
  24135. modelTextureDelay: .75,
  24136. skyboxDelay: .75
  24137. },
  24138. transition: {
  24139. flySpeed: .001,
  24140. flyTime: 750,
  24141. flytimeMaxDistanceThreshold: 5,
  24142. flytimeDistanceMultiplier: 150,
  24143. aimTime: 1500,
  24144. aimSlowFactor: 1.5,
  24145. blur: .8,
  24146. movementEasing: "easeInOutQuad",
  24147. blendEasing: "easeInOutQuad",
  24148. fastForwardFactor: 3
  24149. },
  24150. show360Views: {
  24151. enabled: !0,
  24152. transitionTime: 1e3
  24153. },
  24154. quickstart: {
  24155. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24156. animation: 1400,
  24157. showTextDelay: 500,
  24158. fadeOutDelay: 3e3,
  24159. fovChange: 10
  24160. },
  24161. appConfig: {
  24162. webvr_version: null,
  24163. segment_key: null,
  24164. embedly_key: null,
  24165. branch_key: null,
  24166. keen_write_key: null,
  24167. keen_project_id: null
  24168. },
  24169. vr: {
  24170. enabled: !0,
  24171. allowWebVR: !1,
  24172. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24173. },
  24174. share: {
  24175. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24176. },
  24177. input: {
  24178. longTapThreshold: 200,
  24179. moveToleranceNDC: .08,
  24180. touchMoveThreshold: 25
  24181. },
  24182. help: {
  24183. modalStayDuration: 600
  24184. },
  24185. immersive: {
  24186. timeToShowAgain: 1250,
  24187. uiStayDuration: 600
  24188. },
  24189. tourInteraction: {
  24190. disabled: "0" === r.valueFromHash("tourcta", null),
  24191. showPauseButton: 1e3,
  24192. showModal: 1500,
  24193. allowNextClick: 200,
  24194. largeModal: "1" === r.valueFromHash("tourcta", null),
  24195. smallModal: "2" === r.valueFromHash("tourcta", null)
  24196. },
  24197. labels: {
  24198. enabled: !1,
  24199. hideUntilStart: !0,
  24200. fadeInDuration: 250,
  24201. fadeInDelay: 250,
  24202. fadeOutDuration: 250,
  24203. fadeOutDelay: 0,
  24204. zoomHideThreshhold: {
  24205. mobile: r.isSmallScreen() ? .45 : .6,
  24206. desktop: 2
  24207. },
  24208. zoomTruncateThreshhold: {
  24209. mobile: r.isSmallScreen() ? .35 : .45,
  24210. desktop: .85
  24211. },
  24212. minLengthForTruncate: 16,
  24213. truncateLength: 12,
  24214. truncateSuffix: "..."
  24215. },
  24216. tags: {
  24217. enabled: r.valueFromHash("mt", 1),
  24218. startup: {
  24219. hideUntilStart: !0,
  24220. fadeInDuration: 500,
  24221. fadeInDelay: 100
  24222. },
  24223. visibility: {
  24224. anyDistance: !0,
  24225. visibleDistance: 8,
  24226. cameraClearance: .1,
  24227. alphaTestLevel: .05,
  24228. hideViaFloor: !0,
  24229. hideOffScreenDisc: !1,
  24230. hideOffScreenObject: !1
  24231. },
  24232. disc: {
  24233. opacity: 1,
  24234. disabledOpacity: .5,
  24235. scale: {
  24236. nearBound: 1.5,
  24237. farBound: 4.8,
  24238. linkFarBound: !1,
  24239. linkPercent: 40,
  24240. maxSize: 80,
  24241. minSize: 40,
  24242. baseViewportSize: 800,
  24243. responsiveness: 100
  24244. }
  24245. },
  24246. pole: {
  24247. enabled: !0,
  24248. height: .5,
  24249. width: 2,
  24250. opacity: .5,
  24251. color: "white"
  24252. },
  24253. navigate: {
  24254. nearestPano: !0,
  24255. lineOfSight: !0,
  24256. reactivate: !0,
  24257. aimAt: "disc",
  24258. tiltTolerance: 25,
  24259. rotateSpeedFactor: .6
  24260. }
  24261. },
  24262. path: {
  24263. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24264. colorUp: s._desat(s.newBlue, .5),
  24265. colorDown: s._darken(s.newBlue, .35),
  24266. opacity: .5,
  24267. style: "ribbon",
  24268. height: .025,
  24269. ribbonWidth: .24,
  24270. outsideHeight: .5,
  24271. waypointRadius: .5,
  24272. waypointIndoorRadius: .24,
  24273. waypointPulse: 1e3,
  24274. typ: l.BLACK,
  24275. meshFree: r.valueFromHash("mf", 1),
  24276. mapGuides: r.valueFromHash("guides", !0),
  24277. fadeInTime: 400,
  24278. fadeOutTime: 300
  24279. },
  24280. warp: {
  24281. nearPanoDist: .1,
  24282. matchCam: !1,
  24283. blur: .33,
  24284. fastTime: 1500,
  24285. teleportTime: 1500,
  24286. outsideTime: 2e3,
  24287. lookAheadMax: .3,
  24288. lookAheadDist: 2.5,
  24289. softPushDist: .37,
  24290. softPushEnd: .3,
  24291. softBendAngle: 8,
  24292. softBendTilt: 4,
  24293. softBendEnd: .3,
  24294. doBurns: !0,
  24295. burnsAngle: 8,
  24296. minBurnsAngle: 35,
  24297. minDownAngle: -35,
  24298. maxTurnPerSec: 280,
  24299. maxAimPerSec: 35,
  24300. minRotation: 12,
  24301. maxAimRotation: 33.2,
  24302. turnFriction: .2,
  24303. flySpeed: .01,
  24304. minWarpTime: 1200,
  24305. warpInterruptionRedirectTime: 500,
  24306. tourStepDelay: r.valueFromHash("st", 0),
  24307. walkDelay: 0,
  24308. walkMaxDist: 50,
  24309. walkMinDist: .8,
  24310. walkSlideShowThreshhold: 3e3,
  24311. walkExtraPanosDistance: .4,
  24312. timePerMeter: 1200,
  24313. motionLeadTime: 5e3,
  24314. movementEasing: "easeInOutQuad",
  24315. blendEasing: "easeInOutQuad",
  24316. showBunny: !1,
  24317. loop: r.valueFromHash("lp", !1),
  24318. auto: r.valueFromHash("ts", -1),
  24319. eOrder: "YXZ",
  24320. stepFactor: .25,
  24321. brakeStrength: 2,
  24322. minBrakeAngle: .1,
  24323. maxBrakeAngle: 1.8,
  24324. climbEffort: 4
  24325. },
  24326. rotationFriction: .05,
  24327. rotationAccelerationInside: 4.5,
  24328. rotationAccelerationOutside: .15,
  24329. rotationAfterMoveMultiplier: 40,
  24330. rotationAfterMoveHistoryCount: 5,
  24331. panFriction: .09,
  24332. panAccelerationOutside: 60,
  24333. onload: r.valueFromHash("onload", o.PANORAMA),
  24334. zoomNearLimit: .1,
  24335. zoomFarLimit: 10,
  24336. navigation: {
  24337. panoScores: !1,
  24338. mouseDirection: !0,
  24339. filterStrictness: .75,
  24340. angleFactor: -30,
  24341. directionFactor: 10,
  24342. distanceFactor: -1,
  24343. optionalityFactor: 3
  24344. },
  24345. sdkInit: !1,
  24346. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24347. console: r.valueFromHash("console", !1),
  24348. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24349. panoramaNeighbourMaxDistance: 5,
  24350. panoFloorClickRadius: .35,
  24351. showScreenshotLocations: !1,
  24352. showAxis: !1,
  24353. showNeighbourRaycasts: !1,
  24354. colorMarkerOnLoad: !1,
  24355. colorMarkerByFloor: !1,
  24356. tiling: {
  24357. panoPreRenderRepeatDelay: 2500,
  24358. panoPreRenderDelay: 500,
  24359. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24360. tilingFlagNames: ["usetiles", "tiles"],
  24361. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24362. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24363. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24364. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24365. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24366. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24367. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24368. customCompression: r.valueFromHash("tilecustcomp", 0),
  24369. mobileHighQualityOverride: 1,
  24370. allowUltraHighResolution: !0
  24371. },
  24372. zoom: {
  24373. enabled: !0,
  24374. forceOff: r.valueFromHash("nozoom", 0),
  24375. overridemax: r.valueFromHash("maxzoom", null),
  24376. overridemin: r.valueFromHash("minzoom", null),
  24377. max: d.highQualityMaxZoom,
  24378. min: 1,
  24379. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24380. activationThreshold: 1.1,
  24381. restoreTime: 500
  24382. },
  24383. profiling: {
  24384. enabled: r.valueFromHash("mem", !1)
  24385. }
  24386. };
  24387. (p = h.deepExtend(p, d, {
  24388. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24389. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24390. panorama: {
  24391. transitionTime: 1e3,
  24392. modelAlpha: 0,
  24393. modelAlphaDelay: p.flydown.modelTextureDelay,
  24394. modelAlphaLength: 1,
  24395. skyboxOpacity: 1,
  24396. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24397. skyboxOpacityLength: .9,
  24398. fovLength: 1,
  24399. fovDelay: 0,
  24400. cameraMatrixDuration: .8,
  24401. cameraMatrixDelay: 0,
  24402. cameraMatrixEase: c.easeInCubic,
  24403. reticuleOpacity: 1,
  24404. markerOpacity: .3,
  24405. markerOpacityOnHover: 1
  24406. },
  24407. dollhouse: {
  24408. transitionTime: 1e3,
  24409. modelAlpha: 1,
  24410. modelAlphaDelay: 0,
  24411. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24412. skyboxOpacity: 0,
  24413. skyboxOpacityDelay: 0,
  24414. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24415. fovLength: 1,
  24416. fovDelay: 0,
  24417. cameraMatrixDuration: .8,
  24418. cameraMatrixDelay: .3,
  24419. cameraMatrixEase: c.easeInCubic,
  24420. reticuleOpacity: 1,
  24421. markerOpacity: 0,
  24422. markerOpacityOnHover: 0
  24423. },
  24424. floorplan: {
  24425. transitionTime: 1e3,
  24426. modelAlpha: 1,
  24427. modelAlphaDelay: 0,
  24428. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24429. skyboxOpacity: 0,
  24430. skyboxOpacityDelay: 0,
  24431. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24432. fovLength: 1,
  24433. fovDelay: 0,
  24434. cameraMatrixDuration: .5,
  24435. cameraMatrixDelay: 0,
  24436. cameraMatrixEase: c.easeOutCubic,
  24437. reticuleOpacity: 1,
  24438. markerOpacity: 0,
  24439. markerOpacityOnHover: 0,
  24440. cameraHeight: 50
  24441. },
  24442. transitioning: {
  24443. reticuleOpacity: 0,
  24444. markerOpacity: .3,
  24445. markerOpacityOnHover: 1
  24446. },
  24447. "floorplan-dollhouse": {
  24448. rotationDelay: 0,
  24449. rotationDuration: 1
  24450. },
  24451. "floorplan-panorama": {
  24452. rotationDelay: .5,
  24453. rotationDuration: 1
  24454. },
  24455. "dollhouse-panorama": {
  24456. rotationDelay: .5,
  24457. rotationDuration: 1
  24458. },
  24459. "dollhouse-floorplan": {
  24460. rotationDelay: 0,
  24461. rotationDuration: 1,
  24462. cameraMatrixDuration: 1.05,
  24463. cameraMatrixDelay: .5
  24464. },
  24465. "panorama-dollhouse": {
  24466. rotationDelay: 0,
  24467. rotationDuration: .5
  24468. },
  24469. "panorama-floorplan": {
  24470. transitionTime: 1500,
  24471. rotationDelay: 0,
  24472. rotationDuration: .5
  24473. }
  24474. })).path.meshFree && (p.path.typ = l.WALK),
  24475. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24476. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24477. t.exports = p
  24478. }
  24479. , {
  24480. "./constants": 8,
  24481. "./enum/Colors": 19,
  24482. "./enum/VROption": 47,
  24483. "./enum/Viewmode": 51,
  24484. "./enum/WarpStyle": 52,
  24485. "./util/browser": 182,
  24486. "./util/common": 185,
  24487. "./util/easing": 186,
  24488. "./util/showcase": 193,
  24489. three: 217
  24490. }],
  24491. 167: [function(e, t, i) {
  24492. "use strict";
  24493. var n = e("three")
  24494. , r = e("./settings")
  24495. , o = "precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n"
  24496. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24497. t.exports = {
  24498. basicTextured: {
  24499. uniforms: {
  24500. tDiffuse: {
  24501. type: "t",
  24502. value: null
  24503. },
  24504. alpha: {
  24505. type: "f",
  24506. value: 1
  24507. }
  24508. },
  24509. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24510. fragmentShader: "varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  24511. },
  24512. copyCubeMap: {
  24513. uniforms: {
  24514. tDiffuse: {
  24515. type: "t",
  24516. value: null
  24517. },
  24518. alpha: {
  24519. type: "f",
  24520. value: 1
  24521. }
  24522. },
  24523. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24524. fragmentShader: "varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  24525. },
  24526. cube: {
  24527. uniforms: {
  24528. map: {
  24529. type: "t",
  24530. value: null
  24531. },
  24532. opacity: {
  24533. type: "f",
  24534. value: 1
  24535. }
  24536. },
  24537. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24538. fragmentShader: a + "uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n"
  24539. },
  24540. model: {
  24541. uniforms: {
  24542. map: {
  24543. type: "t",
  24544. value: null
  24545. },
  24546. modelAlpha: {
  24547. type: "f",
  24548. value: r.modelAlpha
  24549. },
  24550. opacity: {
  24551. type: "f",
  24552. value: 1
  24553. },
  24554. progress: {
  24555. type: "f",
  24556. value: 0
  24557. },
  24558. blackout: {
  24559. type: "i",
  24560. value: 0
  24561. },
  24562. pano0Map: {
  24563. type: "t",
  24564. value: null
  24565. },
  24566. pano0Position: {
  24567. type: "v3",
  24568. value: new n.Vector3
  24569. },
  24570. pano0Matrix: {
  24571. type: "m4",
  24572. value: new n.Matrix4
  24573. },
  24574. pano1Map: {
  24575. type: "t",
  24576. value: null
  24577. },
  24578. pano1Position: {
  24579. type: "v3",
  24580. value: new n.Vector3
  24581. },
  24582. pano1Matrix: {
  24583. type: "m4",
  24584. value: new n.Matrix4
  24585. }
  24586. },
  24587. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24588. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  24589. },
  24590. hot: {
  24591. uniforms: {
  24592. color: {
  24593. type: "c",
  24594. value: new n.Color(16720384)
  24595. },
  24596. opac: {
  24597. type: "f",
  24598. value: 0
  24599. },
  24600. texture1: {
  24601. type: "t",
  24602. value: null
  24603. },
  24604. texture2: {
  24605. type: "t",
  24606. value: null
  24607. }
  24608. },
  24609. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24610. fragmentShader: "varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  24611. },
  24612. modelOutside: {
  24613. uniforms: {
  24614. map: {
  24615. type: "t",
  24616. value: null
  24617. },
  24618. opacity: {
  24619. type: "f",
  24620. value: 1
  24621. }
  24622. },
  24623. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24624. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n"
  24625. },
  24626. ribbon: {
  24627. uniforms: {
  24628. map: {
  24629. type: "t",
  24630. value: null
  24631. },
  24632. opacity: {
  24633. type: "f",
  24634. value: 1
  24635. },
  24636. color: {
  24637. type: "c",
  24638. value: new n.Color(r.path.color)
  24639. }
  24640. },
  24641. vertexShader: o + "varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n",
  24642. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n"
  24643. },
  24644. waypoint: {
  24645. uniforms: {
  24646. map: {
  24647. type: "t",
  24648. value: null
  24649. },
  24650. opacity: {
  24651. type: "f",
  24652. value: 1
  24653. },
  24654. pulse: {
  24655. type: "f",
  24656. value: 1
  24657. },
  24658. nearFade: {
  24659. type: "v2",
  24660. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24661. },
  24662. color: {
  24663. type: "c",
  24664. value: new n.Color(r.reticuleColor)
  24665. }
  24666. },
  24667. vertexShader: o + "varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n",
  24668. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n"
  24669. },
  24670. modelDebug: {
  24671. uniforms: {
  24672. map: {
  24673. type: "t",
  24674. value: null
  24675. },
  24676. modelAlpha: {
  24677. type: "f",
  24678. value: r.modelAlpha
  24679. },
  24680. depthmapRatio: {
  24681. type: "f",
  24682. value: 0
  24683. },
  24684. opacity: {
  24685. type: "f",
  24686. value: 1
  24687. },
  24688. progress: {
  24689. type: "f",
  24690. value: 0
  24691. },
  24692. considerOcclusion: {
  24693. type: "i",
  24694. value: r.fancierTransition
  24695. },
  24696. highlightPanoSelection: {
  24697. type: "i",
  24698. value: 0
  24699. },
  24700. useThirdPano: {
  24701. type: "i",
  24702. value: r.useThirdPano
  24703. },
  24704. pano0Map: {
  24705. type: "t",
  24706. value: null
  24707. },
  24708. pano0Depth: {
  24709. type: "t",
  24710. value: null
  24711. },
  24712. pano0Position: {
  24713. type: "v3",
  24714. value: new n.Vector3
  24715. },
  24716. pano0Matrix: {
  24717. type: "m4",
  24718. value: new n.Matrix4
  24719. },
  24720. pano0Weight: {
  24721. type: "f",
  24722. value: r.transition.pano0Weight
  24723. },
  24724. pano1Map: {
  24725. type: "t",
  24726. value: null
  24727. },
  24728. pano1Depth: {
  24729. type: "t",
  24730. value: null
  24731. },
  24732. pano1Position: {
  24733. type: "v3",
  24734. value: new n.Vector3
  24735. },
  24736. pano1Matrix: {
  24737. type: "m4",
  24738. value: new n.Matrix4
  24739. },
  24740. pano1Weight: {
  24741. type: "f",
  24742. value: r.transition.pano1Weight
  24743. },
  24744. pano2Map: {
  24745. type: "t",
  24746. value: null
  24747. },
  24748. pano2Depth: {
  24749. type: "t",
  24750. value: null
  24751. },
  24752. pano2Position: {
  24753. type: "v3",
  24754. value: new n.Vector3
  24755. },
  24756. pano2Matrix: {
  24757. type: "m4",
  24758. value: new n.Matrix4
  24759. },
  24760. pano2Weight: {
  24761. type: "f",
  24762. value: r.transition.pano2Weight
  24763. }
  24764. },
  24765. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24766. fragmentShader: a + "uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n"
  24767. },
  24768. customDepth: {
  24769. uniforms: {
  24770. panoPosition: {
  24771. type: "v3",
  24772. value: new n.Vector3
  24773. }
  24774. },
  24775. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24776. fragmentShader: a + "uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n"
  24777. },
  24778. skysphere: {
  24779. uniforms: {
  24780. radius: {
  24781. type: "f",
  24782. value: 0
  24783. }
  24784. },
  24785. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24786. fragmentShader: a + "varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n"
  24787. },
  24788. tagDisc: {
  24789. uniforms: {
  24790. opacity: {
  24791. type: "f",
  24792. value: 0
  24793. },
  24794. color: {
  24795. type: "c",
  24796. value: new n.Color
  24797. },
  24798. bg: {
  24799. type: "t",
  24800. value: null
  24801. },
  24802. mask: {
  24803. type: "t",
  24804. value: null
  24805. }
  24806. },
  24807. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24808. fragmentShader: a + "uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n"
  24809. }
  24810. }
  24811. window.shaders = t.exports;
  24812. }
  24813. , {
  24814. "./settings": 166,
  24815. three: 217
  24816. }],
  24817. 168: [function(E, _, e) {
  24818. (function(e) {
  24819. "use strict";
  24820. var t = E("three")
  24821. , i = (E("url"),
  24822. E("./util/ajax"))
  24823. , n = E("./settings")
  24824. , r = E("./util/logger")
  24825. , o = E("./util/math")
  24826. , a = E("./util/showcase")
  24827. , s = E("./objects/Panorama")
  24828. , l = new r(e)
  24829. , c = E("./model/Model")
  24830. , h = E("./shaders")
  24831. , u = E("./util/transitions")
  24832. , d = E("./objects/Chunk")
  24833. , p = E("./objects/Reticule")
  24834. , f = E("./objects/Skybox")
  24835. , g = E("./objects/Floor")
  24836. , m = E("./cameras/DollhouseCamera")
  24837. , v = E("./cameras/FloorplanCamera")
  24838. , y = E("./cameras/PanoramaCamera")
  24839. , A = E("./controls/DollhouseControls")
  24840. , C = E("./controls/FloorplanControls")
  24841. , I = E("./controls/PanoramaControls");
  24842. t.ImageUtils.crossOrigin = n.crossOrigin,
  24843. _.exports = {
  24844. shaders: h,
  24845. transitions: u,
  24846. Model: c,
  24847. Chunk: d,
  24848. Floor: g,
  24849. Skybox: f,
  24850. Reticule: p,
  24851. Panorama: s,
  24852. DollhouseCamera: m,
  24853. FloorplanCamera: v,
  24854. PanoramaCamera: y,
  24855. DollhouseControls: A,
  24856. FloorplanControls: C,
  24857. PanoramaControls: I,
  24858. getModel: function(e) {
  24859. if (!e.url)
  24860. throw 'getModel(): missing parameter "url"';
  24861. e.autoload = void 0 === e.autoload || e.autoload;
  24862. var t = a.parseSidUrl(e.url);
  24863. e.urlBase = t.urlBase,
  24864. e.urlModel = t.urlModel,
  24865. e.urlFiles = t.urlFiles;
  24866. var i = this._getPlatformError();
  24867. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24868. this._loadModel().then(this._buildModel.bind(this)))
  24869. },
  24870. _getPlatformError: function() {
  24871. return "IE" === $.ua.browser.name && parseInt($.ua.browser.major) < 11 ? "webgl-unsupported" : "iOS" === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version) ? "webgl-ios" : Modernizr.webgl ? null : "webgl-unsupported"
  24872. },
  24873. _loadModel: function() {
  24874. return i.get(this.options.urlModel, {
  24875. responseType: "json",
  24876. prefetchFrom: "model",
  24877. auth: a.getAuthorizationHeader()
  24878. }).then(null, function() {
  24879. return l.warn("Model loading failed at initial metadata load"),
  24880. "loading-failed"
  24881. })
  24882. },
  24883. _buildModel: function(e) {
  24884. e = a.normalizeModeldata(e, o);
  24885. var t = new c(this.options,e);
  24886. return this.options.autoload ? t.load(!0) : $.when(t)
  24887. }
  24888. }
  24889. }
  24890. ).call(this, "/js/showcase.js")
  24891. }
  24892. , {
  24893. "./cameras/DollhouseCamera": 5,
  24894. "./cameras/FloorplanCamera": 6,
  24895. "./cameras/PanoramaCamera": 7,
  24896. "./controls/DollhouseControls": 10,
  24897. "./controls/FloorplanControls": 11,
  24898. "./controls/PanoramaControls": 13,
  24899. "./model/Model": 139,
  24900. "./objects/Chunk": 144,
  24901. "./objects/Floor": 146,
  24902. "./objects/Panorama": 148,
  24903. "./objects/Reticule": 149,
  24904. "./objects/Skybox": 152,
  24905. "./settings": 166,
  24906. "./shaders": 167,
  24907. "./util/ajax": 181,
  24908. "./util/logger": 189,
  24909. "./util/math": 190,
  24910. "./util/showcase": 193,
  24911. "./util/transitions": 195,
  24912. three: 217,
  24913. url: 208
  24914. }],
  24915. 169: [function(e, t, i) {
  24916. "use strict";
  24917. function l(e) {
  24918. var t = {
  24919. renderTarget: null,
  24920. inUse: !1,
  24921. size: -1,
  24922. pano: null
  24923. };
  24924. return t.inUse = !0,
  24925. t.size = e,
  24926. function(e) {
  24927. O.push(e)
  24928. }(t),
  24929. t
  24930. }
  24931. function c(e) {
  24932. for (var t = 0; t < O.length; t++) {
  24933. var i = O[t];
  24934. if (i.renderTarget === e)
  24935. return !(i.inUse = !1)
  24936. }
  24937. return !1
  24938. }
  24939. function n() {
  24940. this.tileDirectory = {},
  24941. this.activeRenderTargetDescriptors = {},
  24942. this.activePanos = [],
  24943. this.panoLODDescriptors = {},
  24944. this.panoDescriptors = {},
  24945. this.tileTrees = {},
  24946. this.sceneRenderer = null,
  24947. this.tileDownloader = null,
  24948. this.forceQueue = [],
  24949. this.uploadQueues = {},
  24950. this.uploadInterval = null,
  24951. this.uploadIntervalCancelled = !1,
  24952. this.usingTileOverlay = !1,
  24953. this.overlayTilesLoaded = !1,
  24954. this.overlayTileBase = null,
  24955. this.overlayTilesBasic = {},
  24956. this.overlayTilesEnhanced = {},
  24957. this.zoomRenderTarget = null,
  24958. this.zoomPano = null,
  24959. this.zoomingActive = !1,
  24960. this.zoomPanoId = null,
  24961. this.zoomPanoRenderingDisabled = !1,
  24962. this.direction = new _.Vector3,
  24963. this.initTime = -1,
  24964. this.maxBaseUploadsPerFrame = R,
  24965. this.maxNonBaseUploadsPerFrame = M
  24966. }
  24967. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  24968. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  24969. e("../objects/Panorama"),
  24970. e("./TileTree")), y = (e("./TileDownloader"),
  24971. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  24972. e("../util/browser"),
  24973. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  24974. Base: 0,
  24975. Remaining: 1
  24976. }, O = [];
  24977. function L(e) {
  24978. var t = e.shift();
  24979. return t.uploadQueued = !1,
  24980. t
  24981. }
  24982. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  24983. this.sceneRenderer = e,
  24984. this.tileDownloader = t,
  24985. this.qualityManager = i,
  24986. this.bindEvents(),
  24987. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  24988. this.initTime = performance.now()
  24989. }
  24990. ,
  24991. n.prototype.getActivePanoTextures = function(e) {
  24992. e = e || [];
  24993. for (var t = 0; t < O.length; t++) {
  24994. var i = O[t];
  24995. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  24996. }
  24997. }
  24998. ,
  24999. n.prototype.hasQueuedTiles = function() {
  25000. var e = this.peekNextFromUploadQueue();
  25001. return null != e
  25002. }
  25003. ,
  25004. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25005. return this.activeRenderTargetDescriptors[e]
  25006. }
  25007. ,
  25008. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25009. this.activeRenderTargetDescriptors[e] = t
  25010. }
  25011. ,
  25012. n.prototype.loadOverlayTiles = function() {
  25013. if (0 !== d.tiling.overlayStyle) {
  25014. var n = 0
  25015. , e = function(e, t, i) {
  25016. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25017. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25018. ++n === r.length && (this.overlayTilesLoaded = !0)
  25019. }
  25020. .bind(this)
  25021. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25022. r.forEach(function(e) {
  25023. this.tileDownloader.loadImage(e[0], 0, e[1])
  25024. }
  25025. .bind(this)),
  25026. this.usingTileOverlay = !0
  25027. } else
  25028. this.usingTileOverlay = !1
  25029. }
  25030. ,
  25031. n.prototype.bindEvents = function() {
  25032. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25033. }
  25034. ,
  25035. n.prototype.setupZoomRenderTarget = function() {
  25036. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25037. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25038. return;
  25039. var e = this.zoomRenderTarget;
  25040. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25041. e) {
  25042. var t = e.width
  25043. , i = this.zoomRenderTarget.width;
  25044. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25045. e.texture.dispose(),
  25046. e.texture.loaded = !1,
  25047. e.texture.version = 0,
  25048. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25049. e.texture = null
  25050. }
  25051. this.zoomPanoRenderingDisabled = !1
  25052. } else
  25053. this.zoomPanoRenderingDisabled = !0
  25054. }
  25055. ,
  25056. n.prototype.enableUltraHighQualityMode = function(t) {
  25057. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25058. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25059. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25060. e && (this.qualityManager.enableUltraHighQualityMode(),
  25061. this.setupZoomRenderTarget(),
  25062. t())
  25063. }
  25064. .bind(this))
  25065. }
  25066. }
  25067. ,
  25068. n.prototype.activateTiledPano = function(e, t, i) {
  25069. i && this.clearAllQueuedUploads();
  25070. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25071. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25072. this.linkAllTilesAndNodes(e);
  25073. var r = this.getActiveRenderTargetDescriptor(e.id)
  25074. , o = t;
  25075. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25076. !r || o !== r.size) {
  25077. if (r && c(r.renderTarget),
  25078. !(r = function(e) {
  25079. for (var t = 0; t < O.length; t++) {
  25080. var i = O[t];
  25081. if (!i.inUse && i.size === e)
  25082. return i.inUse = !0,
  25083. i
  25084. }
  25085. return null
  25086. }(o))) {
  25087. var a = this.initTiledPano(o, !1);
  25088. (r = l(a.width)).renderTarget = a
  25089. }
  25090. r.pano = e,
  25091. this.resetPanoDescriptor(e.id),
  25092. this.resetPanoLODDescriptors(e.id),
  25093. this.resetRenderStatus(e.id, !0, !0)
  25094. }
  25095. this.setActiveRenderTargetDescriptor(e.id, r);
  25096. var s = i ? 0 : 1;
  25097. return this.updateActivePanos(e, s),
  25098. r.renderTarget
  25099. }
  25100. ,
  25101. n.prototype.deactivateTiledPano = function(e) {
  25102. var t = this.getActiveRenderTargetDescriptor(e.id);
  25103. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25104. this.setActiveRenderTargetDescriptor(e.id, null);
  25105. var i = this.getUploadQueueForPano(e.id);
  25106. this.clearUploadQueue(i),
  25107. this.updateActivePanos()
  25108. }
  25109. ,
  25110. n.prototype.updateActivePanos = (s = [],
  25111. function(e, t) {
  25112. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25113. e && s.length === t && s.push(e);
  25114. var n = this.activePanos[i]
  25115. , r = this.getActiveRenderTargetDescriptor(n.id);
  25116. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25117. }
  25118. e && t >= s.length && s.push(e),
  25119. this.activePanos.length = 0,
  25120. this.activePanos.push.apply(this.activePanos, s)
  25121. }
  25122. ),
  25123. n.prototype.getActivePanoCount = function() {
  25124. return this.activePanos.length
  25125. }
  25126. ,
  25127. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25128. var i = null;
  25129. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25130. for (var n = function(e, t, i, n) {
  25131. o && (t.tile.zoomUploaded = !1),
  25132. r && (t.tile.uploaded = !1)
  25133. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25134. this.getTileTree(e, a).breadthFirst({
  25135. callback: n.bind(this, a),
  25136. minLevel: i
  25137. })
  25138. }
  25139. }
  25140. ,
  25141. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25142. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25143. t.tile.zoomUploaded = t.tile.uploaded,
  25144. t.zoomCovered = t.covered
  25145. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25146. this.getTileTree(e, n).breadthFirst({
  25147. callback: i.bind(this, n),
  25148. maxLevel: t
  25149. })
  25150. }
  25151. }
  25152. ,
  25153. n.prototype.renderPanoTiles = (h = [],
  25154. function(e, t, i, n) {
  25155. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25156. t = t || this.direction || m.FORWARD;
  25157. var r = this.getActiveRenderTargetDescriptor(e);
  25158. if (!this.isRenderTargetDescriptorValid(r))
  25159. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25160. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25161. var a = this.getTileTree(e, o);
  25162. h.length = 0,
  25163. a.breadthFirst({
  25164. saveVisited: h
  25165. });
  25166. for (var s = 0; s < h.length; s++) {
  25167. var l = h[s];
  25168. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25169. }
  25170. }
  25171. this.updateDirection(t)
  25172. }
  25173. ),
  25174. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25175. return e && e.renderTarget
  25176. }
  25177. ,
  25178. n.prototype.isPanoActive = function(e) {
  25179. var t = this.getActiveRenderTargetDescriptor(e);
  25180. return this.isRenderTargetDescriptorValid(t)
  25181. }
  25182. ,
  25183. n.prototype.isPanoZoomed = function(e) {
  25184. return this.zoomingActive && this.zoomPanoId === e
  25185. }
  25186. ,
  25187. n.prototype.initTileTree = function(e, t, i) {
  25188. var n = this.tileTrees[e];
  25189. n || (n = [],
  25190. this.tileTrees[e] = n);
  25191. var r = n[t];
  25192. if (!r) {
  25193. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25194. r = new v(A.TILE_SIZE,o),
  25195. n[t] = r
  25196. }
  25197. }
  25198. ,
  25199. n.prototype.getTileTree = function(e, t) {
  25200. var i = this.tileTrees[e];
  25201. if (!i)
  25202. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25203. var n = i[t];
  25204. if (!n)
  25205. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25206. return n
  25207. }
  25208. ,
  25209. n.prototype.initTiledPano = function(e, t) {
  25210. var i = this.sceneRenderer.renderer
  25211. , n = (i.context,
  25212. new _.WebGLRenderTargetCube(e,e,{
  25213. stencilBuffer: !1
  25214. }))
  25215. , r = new _.CubeTexture([]);
  25216. (n.texture = r).image = [null, null, null, null, null, null],
  25217. r.flipY = !0,
  25218. t ? (r.generateMipmaps = !0,
  25219. r.magFilter = _.LinearFilter,
  25220. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25221. r.magFilter = _.LinearFilter,
  25222. r.minFilter = _.LinearFilter),
  25223. r.format = _.RGBAFormat,
  25224. i.setRenderTarget(n),
  25225. i.setRenderTarget(null);
  25226. var o = i.properties.get(r);
  25227. return o.__image__webglTextureCube = o.__webglTexture,
  25228. n
  25229. }
  25230. ,
  25231. n.prototype.getUploadQueueForPano = function(e) {
  25232. var t = this.uploadQueues[e];
  25233. return t || (t = [],
  25234. this.uploadQueues[e] = t),
  25235. t
  25236. }
  25237. ,
  25238. n.prototype.isTileUploaded = function(e) {
  25239. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25240. }
  25241. ,
  25242. n.prototype.setUploaded = function(e, t) {
  25243. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25244. }
  25245. ,
  25246. n.prototype.queueTileUpload = function(e, t, i) {
  25247. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25248. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25249. var r = this.getUploadQueueForPano(e.panoId);
  25250. i ? this.uploadTile(e, !1) : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  25251. e.uploadQueued = !0,
  25252. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25253. }
  25254. }
  25255. ,
  25256. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25257. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25258. }
  25259. ,
  25260. n.prototype.getTopUploadQueue = function() {
  25261. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25262. for (var n = 0; n < this.activePanos.length; n++)
  25263. if (e = this.activePanos[n],
  25264. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25265. switch (i) {
  25266. case P.Base:
  25267. if (0 === t[0].level)
  25268. return t;
  25269. break;
  25270. case P.Remaining:
  25271. return t
  25272. }
  25273. return null
  25274. }
  25275. ,
  25276. n.prototype.getNextFromUploadQueue = function() {
  25277. if (0 < this.forceQueue.length)
  25278. return L(this.forceQueue);
  25279. var e = this.getTopUploadQueue();
  25280. return e && 0 < e.length ? L(e) : null
  25281. }
  25282. ,
  25283. n.prototype.peekNextFromUploadQueue = function() {
  25284. if (0 < this.forceQueue.length)
  25285. return this.forceQueue[0];
  25286. var e = this.getTopUploadQueue();
  25287. return e && 0 < e.length ? e[0] : null
  25288. }
  25289. ,
  25290. n.prototype.clearAllQueuedUploads = function() {
  25291. this.clearAllUploadQueues(null, 0)
  25292. }
  25293. ,
  25294. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25295. this.clearAllUploadQueues(e, 0)
  25296. }
  25297. ,
  25298. n.prototype.clearAllUploadQueues = function(e, t) {
  25299. if (e)
  25300. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25301. this.clearUploadQueue(this.forceQueue, t, e);
  25302. else {
  25303. for (var i = 0; i < this.activePanos.length; i++) {
  25304. var n = this.activePanos[i];
  25305. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25306. }
  25307. this.clearUploadQueue(this.forceQueue, t)
  25308. }
  25309. }
  25310. ,
  25311. n.prototype.clearUploadQueue = function(e, t, i) {
  25312. null != t || (t = 0);
  25313. for (var n = 0; n < e.length; ) {
  25314. var r = e[n];
  25315. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25316. e.splice(n, 1)) : n++
  25317. }
  25318. }
  25319. ,
  25320. n.prototype.refreshUploadInterval = (a = null,
  25321. function(e) {
  25322. this.uploadIntervalCancelled || (a = a || function() {
  25323. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25324. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25325. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25326. }
  25327. .bind(this),
  25328. null != e || (e = x),
  25329. T || (e = S),
  25330. this.uploadInterval = window.setTimeout(a, e),
  25331. this.uploadIntervalDelay = e)
  25332. }
  25333. ),
  25334. n.prototype.update = (r = performance.now(),
  25335. o = 0,
  25336. function() {
  25337. this.uploadIntervalCancelled = !0,
  25338. window.clearTimeout(this.uploadInterval),
  25339. this.uploadInterval = null;
  25340. var e = performance.now() - r;
  25341. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25342. r = performance.now()),
  25343. o++
  25344. }
  25345. ),
  25346. n.prototype.updateUploadQueue = function(e, t) {
  25347. e = e || 1;
  25348. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25349. var r = this.getNextFromUploadQueue();
  25350. if (!r)
  25351. break;
  25352. if (0 !== r.level ? i++ : n++,
  25353. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25354. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25355. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25356. }
  25357. }
  25358. }
  25359. ,
  25360. n.prototype.updateDirection = function(e) {
  25361. if (e = e || this.direction) {
  25362. this.direction = e;
  25363. for (var t = 0; t < this.activePanos.length; t++) {
  25364. var i = this.activePanos[t]
  25365. , n = this.getUploadQueueForPano(i.id);
  25366. y.sortPanoTiles(n, i, this.direction)
  25367. }
  25368. }
  25369. }
  25370. ,
  25371. n.prototype.uploadTile = (I = {},
  25372. new _.Vector4,
  25373. E = d.tiling.overlayStyle,
  25374. function(e, t) {
  25375. var i = e.panoId
  25376. , n = e.image
  25377. , r = e.tileSize
  25378. , o = e.panoSize
  25379. , a = e.tileIndex
  25380. , s = (e.faceTileIndex,
  25381. e.totalTiles)
  25382. , l = (e.face,
  25383. e.tileX)
  25384. , c = e.tileY
  25385. , h = !0
  25386. , u = !1
  25387. , d = (this.getPanoDescriptor(i),
  25388. this.getPanoLODDescriptor(i, o))
  25389. , p = this.getActiveRenderTargetDescriptor(i)
  25390. , f = p.renderTarget
  25391. , g = p.size;
  25392. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25393. g = this.qualityManager.getMaxZoomPanoSize()),
  25394. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25395. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25396. this.isTileUploaded(e) && (u = h = !1)),
  25397. h) {
  25398. var m = r / o * g
  25399. , v = l * r / o * g
  25400. , y = c * r / o * g;
  25401. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25402. var A = I[r];
  25403. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25404. 1 === E || 2 === E) {
  25405. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25406. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25407. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25408. } else
  25409. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25410. d.uploadCount++,
  25411. this.emit(b.TileRenderSuccess, i, o, a, s),
  25412. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25413. this.setUploaded(e, !0),
  25414. this.addCoverageForNode(e.node)
  25415. } else
  25416. this.setUploaded(e, !1);
  25417. return e.uploadAttempted || (d.uploadAttempts++,
  25418. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25419. e.uploadAttempted = !0,
  25420. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25421. u
  25422. }
  25423. ),
  25424. n.prototype.linkTileAndNode = function(e, t) {
  25425. (t.tile = e).node = t
  25426. }
  25427. ,
  25428. n.prototype.linkAllTilesAndNodes = function(a) {
  25429. for (var e = function(e, t, i, n, r) {
  25430. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25431. this.linkTileAndNode(o, i)
  25432. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25433. var i = this.getTileTree(a.id, t);
  25434. i.breadthFirst({
  25435. callback: e.bind(this, i, t)
  25436. })
  25437. }
  25438. }
  25439. ,
  25440. n.prototype.anyUploaded = function(e) {
  25441. if (!e)
  25442. return !1;
  25443. if (e.tile && this.isTileUploaded(e.tile))
  25444. return !0;
  25445. if (e.children)
  25446. for (var t = 0; t < e.children.length; t++) {
  25447. var i = e.children[t];
  25448. if (this.anyUploaded(i))
  25449. return !0
  25450. }
  25451. return !1
  25452. }
  25453. ,
  25454. n.prototype.setNodeCovered = function(e, t) {
  25455. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25456. }
  25457. ,
  25458. n.prototype.isNodeCovered = function(e) {
  25459. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25460. }
  25461. ,
  25462. n.prototype.addCoverageForNode = function(e) {
  25463. if (this.setNodeCovered(e, !0),
  25464. e.parent && e.covered) {
  25465. var t = e.parent;
  25466. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25467. }
  25468. }
  25469. ,
  25470. n.prototype.calcFullCoverage = function(e) {
  25471. var t = !1;
  25472. if (e.children)
  25473. for (var i = 0; i < e.children.length; i++) {
  25474. var n = e.children[i];
  25475. t = t || this.calcFullCoverage(n)
  25476. }
  25477. e.covered = e.tile.uploaded || t
  25478. }
  25479. ,
  25480. n.prototype.nodeSubcovered = function(e) {
  25481. if (!e.children)
  25482. return !1;
  25483. for (var t = 0; t < e.children.length; t++)
  25484. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25485. return !1;
  25486. return !0
  25487. }
  25488. ,
  25489. n.prototype.resetPanoDescriptor = function(e) {
  25490. this.getPanoDescriptor(e)
  25491. }
  25492. ,
  25493. n.prototype.getPanoDescriptor = function(e) {
  25494. var t = this.panoDescriptors[e];
  25495. return t || (t = {},
  25496. this.panoDescriptors[e] = t),
  25497. t
  25498. }
  25499. ,
  25500. n.prototype.resetPanoLODDescriptors = function(e) {
  25501. var t = this.getPanoLODDescriptors(e);
  25502. for (var i in t)
  25503. if (t.hasOwnProperty(i)) {
  25504. var n = t[i];
  25505. n.uploadCount = 0,
  25506. n.uploadAttempts = 0
  25507. }
  25508. }
  25509. ,
  25510. n.prototype.getPanoLODDescriptor = function(e, t) {
  25511. var i = this.getPanoLODDescriptors(e)
  25512. , n = i[t];
  25513. return n || (n = {
  25514. uploadCount: 0,
  25515. uploadAttempts: 0
  25516. },
  25517. i[t] = n),
  25518. n
  25519. }
  25520. ,
  25521. n.prototype.getPanoLODDescriptors = function(e) {
  25522. var t = this.panoLODDescriptors[e];
  25523. return t || (t = {},
  25524. this.panoLODDescriptors[e] = t),
  25525. t
  25526. }
  25527. ,
  25528. n.prototype.onTileDownloaded = function(e) {
  25529. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25530. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25531. if (i.downloaded = !0,
  25532. i.image = e.image,
  25533. i.panoSize = e.panoSize,
  25534. i.tileX = e.tileX,
  25535. i.tileY = e.tileY,
  25536. i.totalTiles = e.totalTiles,
  25537. i.tileIndex = e.tileIndex,
  25538. i.faceTileIndex = e.faceTileIndex,
  25539. i.face = e.face,
  25540. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25541. i.panoId = e.panoId,
  25542. i.tileSize = e.tileSize,
  25543. i.direction = (new _.Vector3).copy(e.direction),
  25544. i.node = null,
  25545. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25546. this.isPanoActive(i.panoId)) {
  25547. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25548. this.linkTileAndNode(i, n),
  25549. this.queueTileUpload(i, !0)
  25550. }
  25551. }
  25552. ,
  25553. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25554. var r = this.tileDirectory[e];
  25555. r || (r = {},
  25556. this.tileDirectory[e] = r);
  25557. var o = 16384 * t + 1024 * i + n
  25558. , a = r[o];
  25559. return a || (a = {
  25560. downloaded: !1,
  25561. uploaded: !1,
  25562. zoomUploaded: !1
  25563. },
  25564. r[o] = a),
  25565. a._key = e + ":" + t + ":" + i + ":" + n,
  25566. a._tileKey = o,
  25567. a
  25568. }
  25569. ,
  25570. n.prototype.setZoomingActive = function(e, t, i) {
  25571. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25572. this.zoomPanoId = t.id,
  25573. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25574. }
  25575. ,
  25576. n.prototype.updateZoomedPanoFromBase = function(e) {
  25577. if (!this.zoomPanoRenderingDisabled) {
  25578. var t = this.getActiveRenderTargetDescriptor(e.id);
  25579. if (t && t.renderTarget) {
  25580. var i = this.qualityManager.getMaxZoomPanoSize()
  25581. , n = t.renderTarget
  25582. , r = t.size;
  25583. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25584. this.copyBaseRenderStatusToZoomed(e.id)
  25585. }
  25586. }
  25587. }
  25588. ,
  25589. t.exports = n
  25590. }
  25591. , {
  25592. "../enum/GLCubeFaces": 25,
  25593. "../enum/PanoRendererEvents": 35,
  25594. "../enum/PanoSizeClass": 36,
  25595. "../enum/SceneRendererEvents": 43,
  25596. "../enum/TileDownloaderEvents": 45,
  25597. "../enum/Vectors": 50,
  25598. "../exception/BasicException": 55,
  25599. "../objects/Panorama": 148,
  25600. "../settings": 166,
  25601. "../util/browser": 182,
  25602. "../util/panorama": 191,
  25603. "./TileDownloader": 171,
  25604. "./TilePrioritizer": 172,
  25605. "./TileTree": 173,
  25606. "./TileUtils": 174,
  25607. events: 202,
  25608. three: 217
  25609. }],
  25610. 170: [function(e, t, i) {
  25611. "use strict";
  25612. function n(e, t, i) {
  25613. this.maxNavPanoSize = -1,
  25614. this.maxZoomPanoSize = -1,
  25615. this.devicePixelDensity = e,
  25616. this.deviceScreenSize = t,
  25617. this.clientBandwidth = i,
  25618. this.panoSizeClassMap = {},
  25619. this.useHighResolutionPanos = !0,
  25620. this.useUltraHighResolutionPanos = !1,
  25621. this.modelHasUltraHighPanos = !1
  25622. }
  25623. var r = e("../enum/PanoSizeClass")
  25624. , o = e("../settings")
  25625. , a = e("../util/browser")
  25626. , s = e("../constants")
  25627. , l = e("../util/showcase")
  25628. , c = e("../enum/ModelManagerEvents");
  25629. n.prototype.init = function(e) {
  25630. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25631. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25632. this.highSize = this.getPanoSize(r.HIGH),
  25633. this.standardSize = this.getPanoSize(r.STANDARD),
  25634. this.baseSize = this.getPanoSize(r.BASE),
  25635. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25636. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25637. this.updateMaximums(),
  25638. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25639. }
  25640. ,
  25641. n.prototype.updateFromModel = function(e) {
  25642. this.updateHighResolutionSettings(e),
  25643. this.updateUltraHighResolutionSettings(e)
  25644. }
  25645. ,
  25646. n.prototype.updateHighResolutionSettings = function(e) {
  25647. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25648. this.updateMaximums()
  25649. }
  25650. ,
  25651. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25652. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25653. this.updateMaximums()
  25654. }
  25655. ,
  25656. n.prototype.enableUltraHighQualityMode = function() {
  25657. this.modelHasUltraHighPanos = !0,
  25658. this.updateUltraHighResolutionSettings(null)
  25659. }
  25660. ,
  25661. n.prototype.ultraHighQualityModeEnabled = function() {
  25662. return this.modelHasUltraHighPanos
  25663. }
  25664. ,
  25665. n.prototype.onModelChanged = function(e) {
  25666. this.updateFromModel(e.model),
  25667. this.updateMaximums()
  25668. }
  25669. ,
  25670. n.prototype.updateMaximums = function() {
  25671. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25672. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25673. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25674. }
  25675. ,
  25676. n.prototype.buildPanoSizeClassMap = function() {
  25677. this.panoSizeClassMap[r.BASE] = 512,
  25678. this.panoSizeClassMap[r.STANDARD] = 1024,
  25679. this.panoSizeClassMap[r.HIGH] = 2048,
  25680. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25681. }
  25682. ,
  25683. n.prototype.getPanoSize = function(e) {
  25684. return this.panoSizeClassMap[e]
  25685. }
  25686. ,
  25687. n.prototype.getMaxPossiblePanoSize = function() {
  25688. return this.getPanoSize(r.ULTRAHIGH)
  25689. }
  25690. ,
  25691. n.prototype.getMaxPanoSize = function() {
  25692. return this.maxZoomPanoSize
  25693. }
  25694. ,
  25695. n.prototype.getMaxNavPanoSize = function() {
  25696. return this.maxNavPanoSize
  25697. }
  25698. ,
  25699. n.prototype.getMaxZoomPanoSize = function() {
  25700. return this.maxZoomPanoSize
  25701. }
  25702. ,
  25703. n.prototype.detectMaxNavPanoSizeClass = function() {
  25704. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25705. }
  25706. ,
  25707. n.prototype.detectMaxNavPanoSize = function() {
  25708. var e = this.detectMaxNavPanoSizeClass();
  25709. return this.getPanoSize(e)
  25710. }
  25711. ,
  25712. n.prototype.detectMaxZoomPanoSize = function() {
  25713. return this.useHighResolutionPanos ? a.isMobile() ? o.tiling.mobileHighQualityOverride ? this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD) : this.useUltraHighResolutionPanos ? this.getPanoSize(r.ULTRAHIGH) : this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD)
  25714. }
  25715. ,
  25716. t.exports = n
  25717. }
  25718. , {
  25719. "../constants": 8,
  25720. "../enum/ModelManagerEvents": 33,
  25721. "../enum/PanoSizeClass": 36,
  25722. "../settings": 166,
  25723. "../util/browser": 182,
  25724. "../util/showcase": 193
  25725. }],
  25726. 171: [function(A, C, e) {
  25727. (function(e) {
  25728. "use strict";
  25729. function i(e) {
  25730. this.panos = null,
  25731. this.retryMinimumTime = 1e4,
  25732. this.urls = null,
  25733. this.panoLoadCallbacks = {},
  25734. this.downloadDescriptors = {},
  25735. this.priorityQueue = [],
  25736. this.forceQueue = [],
  25737. this.activeDownloads = [],
  25738. this.qualityManager = null,
  25739. this.tilePrioritizer = null,
  25740. this.refreshInterval = null,
  25741. this.processPriorityQueue = !1,
  25742. this.concurrentDownloads = e.concurrentDownloads || 1,
  25743. this.downloadTestResults = {}
  25744. }
  25745. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  25746. A("../settings")), r = (A("../objects/Panorama"),
  25747. A("../util/logger")), o = (A("../enum/Vectors"),
  25748. A("../enum/PanoSizeClass"),
  25749. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  25750. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  25751. Object.freeze({
  25752. Testing: 1,
  25753. Success: 2,
  25754. Fail: 3
  25755. }));
  25756. i.prototype = Object.create(l.prototype),
  25757. i.IDLE_REFRESH_DELAY = 500,
  25758. i.ACTIVE_REFRESH_DELAY = 16,
  25759. i.DOWNLOAD_RETRIES = 4,
  25760. i.prototype.init = function(e) {
  25761. this.qualityManager = e
  25762. }
  25763. ,
  25764. i.prototype.setUrls = function(e) {
  25765. this.urls = e
  25766. }
  25767. ,
  25768. i.prototype.setPanoData = function(e, t, i) {
  25769. this.panos = e,
  25770. this.imagePanos = t,
  25771. this.panoGroupId = i
  25772. }
  25773. ,
  25774. i.prototype.start = function() {
  25775. this.refreshUpdateInterval(0)
  25776. }
  25777. ,
  25778. i.prototype.stop = function() {
  25779. window.cancel(this.refreshInterval)
  25780. }
  25781. ,
  25782. i.prototype.refreshUpdateInterval = function(e) {
  25783. e = e || 0,
  25784. this.refreshInterval = window.setTimeout(function() {
  25785. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  25786. }
  25787. .bind(this), e)
  25788. }
  25789. ,
  25790. i.prototype.update = function() {
  25791. var e = 0 < this.forceQueue.length;
  25792. return this.processQueueForDownloading(this.forceQueue),
  25793. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25794. 0 < this.priorityQueue.length && (e = !0),
  25795. this.processQueueForDownloading(this.priorityQueue)),
  25796. e
  25797. }
  25798. ,
  25799. i.prototype.forceQueueTilesForPano = (p = [],
  25800. f = [],
  25801. function(e, t, i, n, r, o) {
  25802. p.length = 0;
  25803. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  25804. var l = a[s];
  25805. l.status !== v.None && l.status !== v.Queued || p.push(l)
  25806. }
  25807. if (i && 0 < p.length) {
  25808. g.sortPanoTiles(p, e, i),
  25809. f.length = 0,
  25810. m.matchingTilesInDirection(e, t, i, n, r, f);
  25811. for (var c = 0, h = function(e) {
  25812. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  25813. }; c < p.length; ) {
  25814. var u = p[c];
  25815. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  25816. }
  25817. }
  25818. for (var d = 0; d < p.length; d++)
  25819. this.forceQueue.push(p[d]);
  25820. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  25821. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  25822. o && this.processQueueForDownloading(this.forceQueue, !0)
  25823. }
  25824. ),
  25825. i.prototype.clearForceQueue = function() {
  25826. this.clearQueue(this.forceQueue)
  25827. }
  25828. ,
  25829. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  25830. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25831. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25832. this.clearFromQueue(this.priorityQueue, v.None, !0),
  25833. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  25834. }
  25835. ,
  25836. i.prototype.clearQueue = function(e) {
  25837. this.setStatusForAllDescriptors(e, v.None),
  25838. e.length = 0
  25839. }
  25840. ,
  25841. i.prototype.clearFromQueue = function(e, t, i) {
  25842. for (var n = 0; n < e.length; n++) {
  25843. var r = e[n];
  25844. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25845. }
  25846. }
  25847. ,
  25848. i.prototype.setStatusForAllDescriptors = function(e, t) {
  25849. for (var i = 0; i < e.length; i++) {
  25850. var n = e[i];
  25851. n && (n.status = t)
  25852. }
  25853. }
  25854. ,
  25855. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25856. for (var i = 0; i < e.length; i++) {
  25857. var n = e[i];
  25858. n && (n.status !== t ? n.status = t : e[i] = null)
  25859. }
  25860. }
  25861. ,
  25862. i.prototype.getTileDownloadDescriptors = function(e, t) {
  25863. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25864. , n = i[t];
  25865. return n || (n = this.buildDownloadDescriptorArray(t),
  25866. i[t] = n,
  25867. this.initTileDownloadDescriptors(n, e, t)),
  25868. n
  25869. }
  25870. ,
  25871. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25872. var t = this.downloadDescriptors[e.id];
  25873. return t || (t = {},
  25874. this.downloadDescriptors[e.id] = t),
  25875. t
  25876. }
  25877. ,
  25878. i.prototype.processQueueForDownloading = function(e, t) {
  25879. if (this.cleanupActiveDownloads(),
  25880. this.activeDownloads.length < this.concurrentDownloads || t)
  25881. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  25882. var r = e.shift();
  25883. r && (this.startDownload(r),
  25884. n++)
  25885. }
  25886. }
  25887. ,
  25888. i.prototype.testDownload = function(t, e, i) {
  25889. var n = this.downloadTestResults[t];
  25890. if (n)
  25891. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  25892. else {
  25893. this.downloadTestResults[t] = y.Testing;
  25894. var r = this.panos.list[0]
  25895. , o = this.getTileUrl(r.id, t, e, 0)
  25896. , a = function(e) {
  25897. this.downloadTestResults[t] = y.Success,
  25898. i(!0)
  25899. }
  25900. .bind(this)
  25901. , s = function() {
  25902. this.downloadTestResults[t] = y.Fail,
  25903. i(!1)
  25904. }
  25905. .bind(this);
  25906. this.loadImage(o, 0, a, s)
  25907. }
  25908. }
  25909. ,
  25910. i.prototype.startDownload = function(e) {
  25911. e.status = v.Downloading;
  25912. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25913. this.activeDownloads.push(e),
  25914. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25915. }
  25916. ,
  25917. i.prototype.downloadFailed = function(e, t) {}
  25918. ,
  25919. i.prototype.downloadComplete = function(e, t) {
  25920. if (e.panoGroupId === this.panoGroupId) {
  25921. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25922. e.status = v.Downloaded,
  25923. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25924. var n = {
  25925. panoId: e.pano.id,
  25926. image: t,
  25927. tileSize: e.tileSize,
  25928. panoSize: e.panoSize,
  25929. tileIndex: e.tileIndex,
  25930. faceTileIndex: e.faceTileIndex,
  25931. totalTiles: e.totalTiles,
  25932. face: e.face,
  25933. tileX: e.tileX,
  25934. tileY: e.tileY,
  25935. direction: e.direction
  25936. };
  25937. e.image = t,
  25938. this.emit(o.TileDownloadSuccess, n),
  25939. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25940. panoId: e.pano.id,
  25941. tileSize: e.tileSize,
  25942. panoSize: e.panoSize
  25943. },
  25944. this.emit(o.PanoDownloadComplete, n),
  25945. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25946. }
  25947. }
  25948. ,
  25949. i.prototype.cleanupActiveDownloads = (n = [],
  25950. function() {
  25951. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  25952. var t = this.activeDownloads[e];
  25953. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  25954. }
  25955. this.activeDownloads.length = 0,
  25956. this.activeDownloads.push.apply(this.activeDownloads, n)
  25957. }
  25958. ),
  25959. i.prototype.isPanoDownloaded = function(e, t) {
  25960. var i = this.getTileDownloadDescriptors(e, t);
  25961. if (i.length <= 0)
  25962. return !1;
  25963. for (var n = 0; n < i.length; n++) {
  25964. if (i[n].status !== v.Downloaded)
  25965. return !1
  25966. }
  25967. return !0
  25968. }
  25969. ,
  25970. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  25971. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  25972. this.panoLoadCallbacks[o] = {
  25973. onLoad: i,
  25974. onFail: n,
  25975. onProgress: r
  25976. }
  25977. }
  25978. ,
  25979. i.prototype.getPanoLoadCallbacks = function(e, t) {
  25980. var i = e.id + ":" + t;
  25981. return this.panoLoadCallbacks[i]
  25982. }
  25983. ,
  25984. i.prototype.buildDownloadDescriptorArray = function(e) {
  25985. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  25986. var r = this.buildDownloadDescriptor();
  25987. i.push(r)
  25988. }
  25989. return i
  25990. }
  25991. ,
  25992. i.prototype.buildDownloadDescriptor = function() {
  25993. return {
  25994. panoGroupId: null,
  25995. pano: null,
  25996. panoSize: -1,
  25997. tileSize: -1,
  25998. tileIndex: -1,
  25999. totalTiles: -1,
  26000. faceTileIndex: -1,
  26001. status: v.None,
  26002. url: null,
  26003. image: null,
  26004. direction: new t.Vector3,
  26005. face: -1,
  26006. cubeFace: -1,
  26007. tileX: -1,
  26008. tileY: -1
  26009. }
  26010. }
  26011. ,
  26012. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26013. for (var n = 0; n < e.length; n++) {
  26014. var r = e[n];
  26015. this.initTileDownloadDescriptor(r, t, i, n)
  26016. }
  26017. }
  26018. ,
  26019. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26020. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26021. e.face = m.getFaceForTile(i, n),
  26022. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26023. e.panoGroupId = this.panoGroupId,
  26024. e.pano = t,
  26025. e.panoSize = i,
  26026. e.tileSize = r,
  26027. e.tileIndex = n,
  26028. e.totalTiles = m.getTileCountForSize(i),
  26029. e.status = v.None,
  26030. e.image = null,
  26031. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26032. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26033. }
  26034. ,
  26035. i.prototype.getTileUrl = (c = {
  26036. 256: "256",
  26037. 512: "512",
  26038. 1024: "1k",
  26039. 2048: "2k",
  26040. 4096: "4k"
  26041. },
  26042. h = {
  26043. face: -1,
  26044. faceTileIndex: -1,
  26045. tileX: -1,
  26046. tileY: -1
  26047. },
  26048. function(e, t, i, n) {
  26049. m.getTileLocation(t, n, h);
  26050. var r = Math.floor(t / i)
  26051. , o = r * r
  26052. , a = Math.floor(n / o)
  26053. , s = "";
  26054. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26055. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26056. return d.changeIfTileGenerating(l)
  26057. }
  26058. ),
  26059. i.prototype.loadImage = function(e, t, i, n) {
  26060. s.getImage(e, t).then(function(e) {
  26061. i(e)
  26062. }).fail(n)
  26063. }
  26064. ,
  26065. C.exports = i
  26066. }
  26067. ).call(this, "/js/tile/TileDownloader.js")
  26068. }
  26069. , {
  26070. "../ab": 3,
  26071. "../enum/DownloadStatus": 24,
  26072. "../enum/GLCubeFaces": 25,
  26073. "../enum/PanoSizeClass": 36,
  26074. "../enum/TileDownloaderEvents": 45,
  26075. "../enum/Vectors": 50,
  26076. "../enum/Viewmode": 51,
  26077. "../objects/Panorama": 148,
  26078. "../settings": 166,
  26079. "../util/ajax": 181,
  26080. "../util/logger": 189,
  26081. "../util/panorama": 191,
  26082. "./TilePrioritizer": 172,
  26083. "./TileUtils": 174,
  26084. events: 202,
  26085. three: 217
  26086. }],
  26087. 172: [function(n, C, e) {
  26088. (function(e) {
  26089. "use strict";
  26090. function h(e, t, i, n, r) {
  26091. this.qualityManager = e,
  26092. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26093. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26094. this.baseSize = t,
  26095. this.standardSize = i,
  26096. this.highSize = n,
  26097. this.ultraHighSize = r,
  26098. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26099. }
  26100. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26101. n("../settings"),
  26102. n("../settings"),
  26103. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26104. n("../enum/PanoSizeClass"),
  26105. n("../enum/ModelManagerEvents"),
  26106. n("../enum/GLCubeFaces"),
  26107. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26108. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26109. new t(e),
  26110. Object.freeze({
  26111. None: 0,
  26112. DirectionalFOV: 1
  26113. }));
  26114. h.PriorityCriteria = function(e, t, i, n, r) {
  26115. this.pano = e,
  26116. this.cameraPosition = (new o.Vector3).copy(t),
  26117. this.cameraDir = (new o.Vector3).copy(i),
  26118. this.panoSpaceDir = (new o.Vector3).copy(n),
  26119. this.upcomingPanos = r,
  26120. this.copy = function(e) {
  26121. this.pano = e.pano,
  26122. this.cameraPosition.copy(e.cameraPosition),
  26123. this.cameraDir.copy(e.cameraDir),
  26124. this.panoSpaceDir.copy(e.panoSpaceDir),
  26125. this.upcomingPanos = r
  26126. }
  26127. ,
  26128. this.zoomingActive = !1
  26129. }
  26130. ,
  26131. h.DIRECTIONAL_FOV = 180,
  26132. h.DIRECTIONAL_FOV_NARROW = 120,
  26133. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26134. h.MAX_SCORED_PANOS_TOADD = 2,
  26135. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26136. h.DIRECTION_SCORE_STRICTNESS = .75,
  26137. h.appendQueue = function(e, t) {
  26138. if (e && t)
  26139. for (var i = 0; i < t.length; i++)
  26140. e.push(t[i])
  26141. }
  26142. ,
  26143. h.prototype.updateCriteria = function(e, t, i, n) {
  26144. this.priorityCriteria.pano = e,
  26145. this.priorityCriteria.cameraPosition.copy(t),
  26146. this.priorityCriteria.cameraDir.copy(i),
  26147. this.priorityCriteria.upcomingPanos = n,
  26148. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26149. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26150. }
  26151. ,
  26152. h.prototype.filterAndPrioritize = (u = [],
  26153. p = [],
  26154. f = [],
  26155. function(e, t, i) {
  26156. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26157. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26158. var n = this.baseSize
  26159. , r = this.standardSize
  26160. , o = this.highSize
  26161. , a = this.ultraHighSize;
  26162. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26163. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26164. f.length = 0,
  26165. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26166. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26167. h.appendQueue(e, f),
  26168. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26169. f.length = 0,
  26170. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26171. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26172. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26173. h.appendQueue(e, f),
  26174. f.length = 0,
  26175. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26176. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26177. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26178. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26179. h.appendQueue(e, f),
  26180. this.queueTilesForPanos(e, u, i, n)
  26181. }
  26182. ),
  26183. h.prototype.canDownloadSize = function(e) {
  26184. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26185. }
  26186. ,
  26187. h.prototype.populateNeighborPanos = function(e, t, i) {
  26188. (i = i || []).length = 0;
  26189. var n = t.getNeighbours(e);
  26190. for (var r in n)
  26191. if (n.hasOwnProperty(r)) {
  26192. var o = t.get(r);
  26193. i.push(o)
  26194. }
  26195. return i
  26196. }
  26197. ,
  26198. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26199. (i = i || []).length = 0;
  26200. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26201. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26202. , s = t.sortByScore(o, a);
  26203. if (s)
  26204. for (var l = 0; l < s.length && l < r; l++) {
  26205. var c = s[l].pano;
  26206. i.push(c)
  26207. }
  26208. return i
  26209. }
  26210. ,
  26211. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26212. for (var o = 0, a = 0; a < t.length; a++) {
  26213. var s = t[a];
  26214. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26215. r && r <= o)
  26216. break
  26217. }
  26218. return o
  26219. }
  26220. ,
  26221. h.prototype.queueTilesForPano = (r = {
  26222. filter: a.None
  26223. },
  26224. function(e, t, i, n) {
  26225. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26226. }
  26227. ),
  26228. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26229. function(e, t, i, n, r, o, a, s) {
  26230. for (var l = 0, c = 0; c < i.length; c++) {
  26231. var h = i[c];
  26232. d.copy(h.position),
  26233. d.sub(r),
  26234. d.normalize();
  26235. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26236. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26237. s && s <= l))
  26238. break
  26239. }
  26240. return l
  26241. }
  26242. ),
  26243. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26244. for (var l = 0, c = 0; c < i.length; c++) {
  26245. var h = i[c];
  26246. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26247. s && s <= l)
  26248. break
  26249. }
  26250. return l
  26251. }
  26252. ,
  26253. h.prototype.queueTilesInDirectionForPano = (s = {
  26254. filter: a.DirectionalFOV,
  26255. direction: new o.Vector3,
  26256. fov: 60
  26257. },
  26258. l = new o.Vector3,
  26259. function(e, t, i, n, r, o, a) {
  26260. return l.copy(o),
  26261. m.getRelativeDirection(i.quaternion, l),
  26262. s.direction.copy(l),
  26263. s.fov = a,
  26264. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26265. }
  26266. ),
  26267. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26268. function(e, t, i, n, r) {
  26269. var o = t.getTileDownloadDescriptors(i, n);
  26270. c.length = 0,
  26271. this.filterTileDownloadDescriptors(i, o, c, r);
  26272. for (var a = 0, s = 0; s < c.length; s++) {
  26273. var l = c[s];
  26274. l && (e.push(l),
  26275. a++)
  26276. }
  26277. return a
  26278. }
  26279. ),
  26280. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26281. function(e, t, i, n) {
  26282. var r, o;
  26283. switch (n.filter) {
  26284. case a.DirectionalFOV:
  26285. for (r = 0; r < t.length; r++)
  26286. o = t[r],
  26287. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26288. break;
  26289. default:
  26290. for (r = 0; r < t.length; r++)
  26291. o = t[r],
  26292. i.push(o)
  26293. }
  26294. for (r = 0; r < i.length; r++)
  26295. o = i[r],
  26296. this.canIncludeDescriptor(o) || (i[r] = null)
  26297. }
  26298. ),
  26299. h.prototype.canIncludeDescriptor = function(e) {
  26300. return e.status !== i.Downloading && e.status !== i.Downloaded
  26301. }
  26302. ,
  26303. h.prototype.canIncludePano = function(e, t) {
  26304. return !e.isLoaded(t)
  26305. }
  26306. ,
  26307. h.getFOVDotThreshold = function(e) {
  26308. return Math.cos(o.Math.degToRad(e / 2))
  26309. }
  26310. ;
  26311. var y = (A._panoSpaceDir = new o.Vector3,
  26312. A._fovThreshold = -1,
  26313. A._fovThresholdNarrow = -1,
  26314. A);
  26315. function A(e, t) {
  26316. var i = A._panoSpaceDir
  26317. , n = A._fovThreshold
  26318. , r = A._fovThresholdNarrow
  26319. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26320. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26321. return e._dot = o,
  26322. t._dot = a,
  26323. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  26324. }
  26325. h.sortPanoTiles = function(e, t, i) {
  26326. y._panoSpaceDir.copy(i),
  26327. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26328. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26329. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26330. e.sort(y)
  26331. }
  26332. ,
  26333. h.insertSortedPanoTile = function(e, t, i, n) {
  26334. y._panoSpaceDir.copy(n),
  26335. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26336. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26337. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26338. for (var r = -1, o = 0; o < e.length; o++) {
  26339. if (y(t, e[o]) <= 0) {
  26340. r = o;
  26341. break
  26342. }
  26343. }
  26344. if (-1 === r)
  26345. e[e.length] = t;
  26346. else {
  26347. for (var a = e.length; r < a; a--)
  26348. e[a] = e[a - 1];
  26349. e[r] = t
  26350. }
  26351. }
  26352. ,
  26353. h.prototype.setZoomingActive = function(e) {
  26354. e !== this.zoomingActive && (this.zoomingActive = e)
  26355. }
  26356. ,
  26357. C.exports = h
  26358. }
  26359. ).call(this, "/js/tile/TilePrioritizer.js")
  26360. }
  26361. , {
  26362. "../enum/DownloadStatus": 24,
  26363. "../enum/GLCubeFaces": 25,
  26364. "../enum/ModelManagerEvents": 33,
  26365. "../enum/PanoSizeClass": 36,
  26366. "../enum/Vectors": 50,
  26367. "../enum/Viewmode": 51,
  26368. "../objects/Panorama": 148,
  26369. "../settings": 166,
  26370. "../util/browser": 182,
  26371. "../util/logger": 189,
  26372. "../util/math": 190,
  26373. "./TileUtils": 174,
  26374. events: 202,
  26375. three: 217
  26376. }],
  26377. 173: [function(e, t, i) {
  26378. "use strict";
  26379. function f(e, t) {
  26380. this.levels = t,
  26381. this.tileSize = e,
  26382. this.root = null,
  26383. this.allNodes = [],
  26384. function(e) {
  26385. e.root = function e(t, i, n) {
  26386. if (n > t.levels)
  26387. return null;
  26388. var r = new a(t,i);
  26389. t.allNodes.push(r);
  26390. for (var o = 0; o < s; o++)
  26391. r.children[o] = e(t, r, n + 1);
  26392. return r
  26393. }(e, null, 0)
  26394. }(this)
  26395. }
  26396. function a(e, t) {
  26397. this.tree = e,
  26398. this.parent = t,
  26399. this.children = [],
  26400. this.id = ++n
  26401. }
  26402. var g = (e("three"),
  26403. e("./TileUtils"),
  26404. e("../objects/Panorama"),
  26405. e("../util/panorama"),
  26406. e("events").EventEmitter,
  26407. 2)
  26408. , s = g * g;
  26409. f.TraversalType = Object.freeze({
  26410. PreOrder: 0,
  26411. PostOrder: 1
  26412. });
  26413. var n = 0;
  26414. f.getLevelCountForSize = function(e, t) {
  26415. var i = 0;
  26416. for (t < e && (t = e); !((t /= g) < e); )
  26417. i++;
  26418. return i
  26419. }
  26420. ,
  26421. f.getSizeForLevel = function(e, t) {
  26422. return Math.pow(g, t) * e
  26423. }
  26424. ,
  26425. f.prototype.getSubNode = function(e, t, i) {
  26426. (!t || e < this.tileSize) && (t = 0),
  26427. (!i || e < this.tileSize) && (i = 0),
  26428. e < this.tileSize && (e = this.tileSize);
  26429. var n = f.getLevelCountForSize(this.tileSize, e);
  26430. return function e(t, i, n, r, o) {
  26431. if (!t)
  26432. return null;
  26433. if (0 === n)
  26434. return t;
  26435. if (!t.children || 0 === t.children.length)
  26436. return null;
  26437. var a = Math.pow(g, n) / g
  26438. , s = r % a
  26439. , l = o % a
  26440. , c = Math.floor(o / a)
  26441. , h = Math.floor(r / a)
  26442. , u = c * g + h;
  26443. return e(t.children[u], i + 1, n - 1, s, l)
  26444. }(this.root, 0, n, t, i)
  26445. }
  26446. ,
  26447. f.prototype.breadthFirst = function(e) {
  26448. var t = !!(e = e || {}).nullLevelEnd
  26449. , i = e.maxLevel
  26450. , n = e.minLevel
  26451. , r = e.callback
  26452. , o = e.saveVisited
  26453. , a = []
  26454. , s = {}
  26455. , l = 0;
  26456. for (a.push(this.root),
  26457. a.push(s); 0 < a.length && !(i && i < l); ) {
  26458. var c = a.shift();
  26459. if (c === s)
  26460. (!n || n <= l) && (r && t && r(null),
  26461. o && t && o.push(null)),
  26462. 0 < a.length && a.push(s),
  26463. l++,
  26464. 0;
  26465. else {
  26466. if (c.children)
  26467. for (var h = 0; h < c.children.length; h++) {
  26468. c.children[h] && a.push(c.children[h])
  26469. }
  26470. var u = this.getFaceIndexFromNode(c);
  26471. (!n || n <= l) && (r && r(c, l, u),
  26472. o && o.push(c)),
  26473. 0
  26474. }
  26475. }
  26476. }
  26477. ,
  26478. f.prototype.getFaceIndexFromNode = function(e) {
  26479. if (!e)
  26480. return -1;
  26481. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26482. var o = i.parent;
  26483. if (!o)
  26484. break;
  26485. for (var a = -1, s = 0; s < o.children.length; s++)
  26486. o.children[s] === i && (a = s);
  26487. n = a % g * t + n,
  26488. r = Math.floor(a / g) * t + r,
  26489. t *= g,
  26490. i = o
  26491. }
  26492. return r * t + n
  26493. }
  26494. ,
  26495. f.prototype.depthFirst = function(e, t, i) {
  26496. !function e(t, i, n, r, o, a, s, l) {
  26497. if (t) {
  26498. s = s || f.TraversalType.PreOrder;
  26499. var c = r * g + n;
  26500. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26501. a && a.push(t)),
  26502. t.children && 0 !== t.children.length) {
  26503. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26504. for (var p = 0; p < g; p++)
  26505. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26506. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26507. a && a.push(t))
  26508. }
  26509. }
  26510. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26511. }
  26512. ,
  26513. t.exports = f
  26514. }
  26515. , {
  26516. "../objects/Panorama": 148,
  26517. "../util/panorama": 191,
  26518. "./TileUtils": 174,
  26519. events: 202,
  26520. three: 217
  26521. }],
  26522. 174: [function(e, t, i) {
  26523. "use strict";
  26524. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26525. b.TILE_SIZE = 512,
  26526. b.FACES_PER_PANO = 6,
  26527. b.LocationOnTile = {
  26528. Center: 0,
  26529. UpperLeft: 1,
  26530. UpperRight: 2,
  26531. LowerRight: 3,
  26532. LowerLeft: 4
  26533. },
  26534. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26535. var l = e / t
  26536. , c = t / e * 2
  26537. , h = c / 2
  26538. , u = n / l * 2 - 1 + h
  26539. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26540. switch (o = o || b.LocationOnTile.Center) {
  26541. case b.LocationOnTile.UpperLeft:
  26542. u -= h,
  26543. d += h,
  26544. u += a * c;
  26545. break;
  26546. case b.LocationOnTile.UpperRight:
  26547. u += h,
  26548. d += h,
  26549. d -= a * c;
  26550. break;
  26551. case b.LocationOnTile.LowerRight:
  26552. u += h,
  26553. d -= h,
  26554. u -= a * c;
  26555. break;
  26556. case b.LocationOnTile.LowerLeft:
  26557. u -= h,
  26558. d -= h,
  26559. d += a * c;
  26560. break;
  26561. case b.LocationOnTile.Center:
  26562. }
  26563. switch (i) {
  26564. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26565. _.setVector(s, -1, d, -u);
  26566. break;
  26567. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26568. _.setVector(s, 1, d, u);
  26569. break;
  26570. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26571. _.setVector(s, -u, 1, -d);
  26572. break;
  26573. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26574. _.setVector(s, -u, -1, d);
  26575. break;
  26576. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26577. _.setVector(s, -u, d, 1);
  26578. break;
  26579. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26580. _.setVector(s, u, d, -1)
  26581. }
  26582. _.normalize(s)
  26583. }
  26584. ,
  26585. b.getFaceForTile = function(e, t) {
  26586. var i = b.TILE_SIZE;
  26587. e < b.TILE_SIZE && (i = e);
  26588. var n = Math.floor(e / i)
  26589. , r = n * n;
  26590. return Math.floor(t / r)
  26591. }
  26592. ,
  26593. b.getTileLocation = function(e, t, i) {
  26594. var n = b.TILE_SIZE;
  26595. e < b.TILE_SIZE && (n = e);
  26596. var r = b.getFaceForTile(e, t)
  26597. , o = Math.floor(e / n)
  26598. , a = t - r * (o * o);
  26599. i.tileX = a % o,
  26600. i.tileY = Math.floor(a / o),
  26601. i.face = r,
  26602. i.faceTileIndex = a
  26603. }
  26604. ,
  26605. b.getTileCountForSize = function(e) {
  26606. if (e <= b.TILE_SIZE)
  26607. return b.FACES_PER_PANO;
  26608. var t = Math.floor(e / b.TILE_SIZE);
  26609. return t * t * b.FACES_PER_PANO
  26610. }
  26611. ,
  26612. b.getRelativeDirection = (r = new _.Matrix4,
  26613. o = new _.Quaternion,
  26614. function(e, t) {
  26615. o.copy(e),
  26616. o.inverse(),
  26617. r.makeRotationFromQuaternion(o),
  26618. r.applyToVector3(t),
  26619. _.normalize(t)
  26620. }
  26621. ),
  26622. b.matchingTilesInDirection = (c = new _.Vector3,
  26623. h = new _.Vector3(0,0,-1),
  26624. u = new _.Quaternion,
  26625. l = {
  26626. face: -1,
  26627. faceTileIndex: -1,
  26628. tileX: -1,
  26629. tileY: -1
  26630. },
  26631. d = function(e, t, i) {
  26632. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26633. b.getTileLocation(e, o, l),
  26634. t && !t(l) || (r++,
  26635. i && (a = l,
  26636. i.push({
  26637. face: a.face,
  26638. faceTileIndex: a.faceTileIndex,
  26639. tileX: a.tileX,
  26640. tileY: a.tileY
  26641. })));
  26642. var a;
  26643. return r
  26644. }
  26645. ,
  26646. function(e, t, i, n, r, o) {
  26647. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26648. if (b.getTileCountForSize(t),
  26649. !n && !r)
  26650. return d(t, null, o);
  26651. var s = !!r;
  26652. return r = r || n,
  26653. r = Math.max(0, Math.min(r, 360)),
  26654. n = Math.max(0, Math.min(n, 360)),
  26655. _.copyVector(i, c),
  26656. b.getRelativeDirection(e.quaternion, c),
  26657. s ? (u.setFromUnitVectors(c, h),
  26658. d(t, function(e) {
  26659. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26660. }, o)) : d(t, function(e) {
  26661. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26662. }, o)
  26663. }
  26664. ),
  26665. b.isTileWithinFrustum = (E = new _.Vector3,
  26666. function(e, t, i, n, r, o, a, s) {
  26667. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  26668. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26669. _.applyQuaternionToVector(o, E),
  26670. -1e-5 <= E.z)
  26671. ;
  26672. else {
  26673. var A = -1 / E.z
  26674. , C = E.x * A
  26675. , I = E.y * A;
  26676. l < I ? p++ : I < c && f++,
  26677. h < C ? g++ : C < u && m++,
  26678. v++
  26679. }
  26680. return f !== v && p !== v && g !== v && m !== v
  26681. }
  26682. ),
  26683. b.isTileWithinFOV = (p = new _.Vector3,
  26684. f = new _.Vector3(0,1,0),
  26685. g = new _.Vector3(1,0,0),
  26686. function(e, t, i, n, r, o, a) {
  26687. var s = b.mapFaceToCubemapFace(i);
  26688. if (_.cross(o, f, g),
  26689. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26690. b.isWithinFOV(p, o, a, null))
  26691. return !0;
  26692. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26693. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26694. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26695. b.isWithinFOV(p, o, a, null))
  26696. return !0;
  26697. h += l
  26698. }
  26699. return !1
  26700. }
  26701. ),
  26702. b.isWithinFOV = (a = new _.Vector3,
  26703. s = new _.Vector3,
  26704. function(e, t, i, n) {
  26705. if (_.copyVector(e, s),
  26706. n) {
  26707. _.copyVector(n, a),
  26708. _.normalize(a);
  26709. var r = _.dot(a, e);
  26710. a.x *= r,
  26711. a.y *= r,
  26712. a.z *= r,
  26713. _.subVector(s, a)
  26714. }
  26715. var o = i / 2 * _.RADIANS_PER_DEGREE;
  26716. return Math.cos(o) <= _.dot(s, t)
  26717. }
  26718. ),
  26719. b.mapFaceToCubemapFace = (n = {
  26720. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26721. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26722. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26723. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26724. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26725. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26726. },
  26727. function(e) {
  26728. return n[e]
  26729. }
  26730. ),
  26731. t.exports = b
  26732. }
  26733. , {
  26734. "../enum/GLCubeFaces": 25,
  26735. "../util/MathLight": 176
  26736. }],
  26737. 175: [function(i, n, e) {
  26738. (function(e) {
  26739. "use strict";
  26740. function t() {
  26741. this.list = [],
  26742. this.index = {},
  26743. Object.defineProperty(this, "length", {
  26744. get: function() {
  26745. return this.list.length
  26746. }
  26747. })
  26748. }
  26749. new (i("./common"),
  26750. i("./logger"))(e),
  26751. t.prototype.forEach = function(e) {
  26752. this.list.forEach(e)
  26753. }
  26754. ,
  26755. t.prototype.add = function(e) {
  26756. this.list.push(e),
  26757. this.index[this.getIndex(e)] = e
  26758. }
  26759. ,
  26760. t.prototype.getIndex = function(e) {
  26761. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26762. }
  26763. ,
  26764. t.prototype.extend = function(e) {
  26765. for (var t = 0; t < e.length; t++)
  26766. this.add(e[t])
  26767. }
  26768. ,
  26769. t.prototype.get = function(e) {
  26770. return this.index[e]
  26771. }
  26772. ,
  26773. t.prototype.first = function() {
  26774. return this.list[0]
  26775. }
  26776. ,
  26777. t.prototype.last = function() {
  26778. return this.list[this.list.length - 1]
  26779. }
  26780. ,
  26781. t.prototype.reIndex = function() {
  26782. this.index = {};
  26783. var t = this;
  26784. this.forEach(function(e) {
  26785. t.index[t.getIndex(e)] = e
  26786. })
  26787. }
  26788. ,
  26789. t.prototype.filter = function(e) {
  26790. var t = this.list.filter(e);
  26791. return this.reIndex(),
  26792. t
  26793. }
  26794. ,
  26795. t.prototype.reduce = function(e, t) {
  26796. return this.list.reduce(e, t)
  26797. }
  26798. ,
  26799. t.prototype.sort = function(e) {
  26800. return this.list.sort(e)
  26801. }
  26802. ,
  26803. t.prototype.indexOf = function(e) {
  26804. for (var t = 0; t < this.list.length; ++t)
  26805. if (this.list[t] === e)
  26806. return t;
  26807. return -1
  26808. }
  26809. ,
  26810. n.exports = t
  26811. }
  26812. ).call(this, "/js/util/IndexedCollection.js")
  26813. }
  26814. , {
  26815. "./common": 185,
  26816. "./logger": 189
  26817. }],
  26818. 176: [function(e, t, i) {
  26819. "use strict";
  26820. e("../constants");
  26821. var n, r, o = {};
  26822. o.RADIANS_PER_DEGREE = Math.PI / 180,
  26823. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  26824. o.Vector3 = function(e, t, i) {
  26825. this.x = e || 0,
  26826. this.y = t || 0,
  26827. this.z = i || 0
  26828. }
  26829. ,
  26830. o.Matrix4 = function() {
  26831. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26832. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26833. }
  26834. ,
  26835. o.Matrix4.prototype = {
  26836. identity: function() {
  26837. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26838. this
  26839. },
  26840. copy: function(e) {
  26841. return this.elements.set(e.elements),
  26842. this
  26843. },
  26844. applyToVector3: function(e) {
  26845. var t = e.x
  26846. , i = e.y
  26847. , n = e.z
  26848. , r = this.elements;
  26849. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26850. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26851. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26852. this
  26853. },
  26854. getInverse: function(e, t) {
  26855. var i = this.elements
  26856. , n = e.elements
  26857. , r = n[0]
  26858. , o = n[1]
  26859. , a = n[2]
  26860. , s = n[3]
  26861. , l = n[4]
  26862. , c = n[5]
  26863. , h = n[6]
  26864. , u = n[7]
  26865. , d = n[8]
  26866. , p = n[9]
  26867. , f = n[10]
  26868. , g = n[11]
  26869. , m = n[12]
  26870. , v = n[13]
  26871. , y = n[14]
  26872. , A = n[15]
  26873. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  26874. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  26875. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  26876. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  26877. , b = r * C + o * I + a * E + s * _;
  26878. if (0 == b) {
  26879. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26880. if (t)
  26881. throw new Error(w);
  26882. return console.warn(w),
  26883. this.identity()
  26884. }
  26885. var T = 1 / b;
  26886. return i[0] = C * T,
  26887. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  26888. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  26889. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  26890. i[4] = I * T,
  26891. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  26892. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  26893. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  26894. i[8] = E * T,
  26895. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  26896. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  26897. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  26898. i[12] = _ * T,
  26899. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  26900. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  26901. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  26902. this
  26903. },
  26904. makeRotationFromQuaternion: function(e) {
  26905. var t = this.elements
  26906. , i = e.x
  26907. , n = e.y
  26908. , r = e.z
  26909. , o = e.w
  26910. , a = i + i
  26911. , s = n + n
  26912. , l = r + r
  26913. , c = i * a
  26914. , h = i * s
  26915. , u = i * l
  26916. , d = n * s
  26917. , p = n * l
  26918. , f = r * l
  26919. , g = o * a
  26920. , m = o * s
  26921. , v = o * l;
  26922. return t[0] = 1 - (d + f),
  26923. t[4] = h - v,
  26924. t[8] = u + m,
  26925. t[1] = h + v,
  26926. t[5] = 1 - (c + f),
  26927. t[9] = p - g,
  26928. t[2] = u - m,
  26929. t[6] = p + g,
  26930. t[10] = 1 - (c + d),
  26931. t[3] = 0,
  26932. t[7] = 0,
  26933. t[11] = 0,
  26934. t[12] = 0,
  26935. t[13] = 0,
  26936. t[14] = 0,
  26937. t[15] = 1,
  26938. this
  26939. }
  26940. },
  26941. o.Quaternion = function(e, t, i, n) {
  26942. this._x = e || 0,
  26943. this._y = t || 0,
  26944. this._z = i || 0,
  26945. this._w = void 0 !== n ? n : 1
  26946. }
  26947. ,
  26948. o.Quaternion.prototype = {
  26949. get x() {
  26950. return this._x
  26951. },
  26952. set x(e) {
  26953. this._x = e
  26954. },
  26955. get y() {
  26956. return this._y
  26957. },
  26958. set y(e) {
  26959. this._y = e
  26960. },
  26961. get z() {
  26962. return this._z
  26963. },
  26964. set z(e) {
  26965. this._z = e
  26966. },
  26967. get w() {
  26968. return this._w
  26969. },
  26970. set w(e) {
  26971. this._w = e
  26972. },
  26973. copy: function(e) {
  26974. this._x = e.x,
  26975. this._y = e.y,
  26976. this._z = e.z,
  26977. this._w = e.w
  26978. },
  26979. inverse: function() {
  26980. return this.conjugate().normalize()
  26981. },
  26982. conjugate: function() {
  26983. return this._x *= -1,
  26984. this._y *= -1,
  26985. this._z *= -1,
  26986. this
  26987. },
  26988. length: function() {
  26989. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  26990. },
  26991. normalize: function() {
  26992. var e = this.length();
  26993. return 0 === e ? (this._x = 0,
  26994. this._y = 0,
  26995. this._z = 0,
  26996. this._w = 1) : (e = 1 / e,
  26997. this._x = this._x * e,
  26998. this._y = this._y * e,
  26999. this._z = this._z * e,
  27000. this._w = this._w * e),
  27001. this
  27002. },
  27003. setFromAxisAngle: function(e, t) {
  27004. var i = t / 2
  27005. , n = Math.sin(i);
  27006. return this._x = e.x * n,
  27007. this._y = e.y * n,
  27008. this._z = e.z * n,
  27009. this._w = Math.cos(i),
  27010. this
  27011. },
  27012. setFromUnitVectors: function(e, t) {
  27013. return void 0 === n && (n = new o.Vector3),
  27014. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27015. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27016. this._x = n.x,
  27017. this._y = n.y,
  27018. this._z = n.z,
  27019. this._w = r,
  27020. this.normalize()
  27021. },
  27022. multiply: function(e) {
  27023. return this.multiplyQuaternions(this, e)
  27024. },
  27025. premultiply: function(e) {
  27026. return this.multiplyQuaternions(e, this)
  27027. },
  27028. multiplyQuaternions: function(e, t) {
  27029. var i = e._x
  27030. , n = e._y
  27031. , r = e._z
  27032. , o = e._w
  27033. , a = t._x
  27034. , s = t._y
  27035. , l = t._z
  27036. , c = t._w;
  27037. return this._x = i * c + o * a + n * l - r * s,
  27038. this._y = n * c + o * s + r * a - i * l,
  27039. this._z = r * c + o * l + i * s - n * a,
  27040. this._w = o * c - i * a - n * s - r * l,
  27041. this
  27042. }
  27043. },
  27044. o.convertWorkshopVector = function(e) {
  27045. return new o.Vector3(-e.x,e.y,e.z)
  27046. }
  27047. ,
  27048. o.convertWorkshopQuaternion = function(e) {
  27049. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27050. }
  27051. ,
  27052. o.convertWorkshopOrthoZoom = function(e) {
  27053. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27054. }
  27055. ,
  27056. o.convertWorkshopPanoramaQuaternion = function(e) {
  27057. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27058. }
  27059. ,
  27060. o.normalize = function(e) {
  27061. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27062. , i = Math.sqrt(t);
  27063. e.x /= i,
  27064. e.y /= i,
  27065. e.z /= i
  27066. }
  27067. ,
  27068. o.dot = function(e, t) {
  27069. return e.x * t.x + e.y * t.y + e.z * t.z
  27070. }
  27071. ,
  27072. o.cross = function(e, t, i) {
  27073. var n = e.x
  27074. , r = e.y
  27075. , o = e.z;
  27076. i.x = r * t.z - o * t.y,
  27077. i.y = o * t.x - n * t.z,
  27078. i.z = n * t.y - r * t.x
  27079. }
  27080. ,
  27081. o.setVector = function(e, t, i, n) {
  27082. e.x = t,
  27083. e.y = i,
  27084. e.z = n
  27085. }
  27086. ,
  27087. o.copyVector = function(e, t) {
  27088. t.x = e.x,
  27089. t.y = e.y,
  27090. t.z = e.z
  27091. }
  27092. ,
  27093. o.addVector = function(e, t) {
  27094. e.x += t.x,
  27095. e.y += t.y,
  27096. e.z += t.z
  27097. }
  27098. ,
  27099. o.subVector = function(e, t) {
  27100. e.x -= t.x,
  27101. e.y -= t.y,
  27102. e.z -= t.z
  27103. }
  27104. ,
  27105. o.applyQuaternionToVector = function(e, t) {
  27106. var i = t.x
  27107. , n = t.y
  27108. , r = t.z
  27109. , o = e.x
  27110. , a = e.y
  27111. , s = e.z
  27112. , l = e.w
  27113. , c = l * i + a * r - s * n
  27114. , h = l * n + s * i - o * r
  27115. , u = l * r + o * n - a * i
  27116. , d = -o * i - a * n - s * r;
  27117. t.x = c * l + d * -o + h * -s - u * -a,
  27118. t.y = h * l + d * -a + u * -o - c * -s,
  27119. t.z = u * l + d * -s + c * -a - h * -o
  27120. }
  27121. ,
  27122. o.angleBetweenVectors = function(e, t) {
  27123. return Math.acos(o.dot(e, t))
  27124. }
  27125. ,
  27126. t.exports = o
  27127. }
  27128. , {
  27129. "../constants": 8
  27130. }],
  27131. 177: [function(c, h, e) {
  27132. (function(e) {
  27133. "use strict";
  27134. function t(e) {
  27135. this.cache = null,
  27136. this.expires = 0
  27137. }
  27138. function i() {
  27139. this.baseUrl = null,
  27140. this.cache = null,
  27141. this.expires = 0
  27142. }
  27143. function n() {
  27144. this.baseUrl = null,
  27145. this.expires = 0
  27146. }
  27147. function r(e) {
  27148. this.initialLoadingPromise = null,
  27149. this.endpoint = e + "?type=3",
  27150. this.urlContainer = null,
  27151. this.authorizationHeader = s.getAuthorizationHeader(),
  27152. this.containerClasses = [n, i, t]
  27153. }
  27154. c("./ajax");
  27155. var o = c("./logger")
  27156. , a = c("../constants")
  27157. , s = c("./showcase")
  27158. , l = (c("../ab"),
  27159. new o(e));
  27160. t.prototype = {
  27161. version: 1,
  27162. validate: function(e) {
  27163. return "catalog.json"in e && 0 < Object.keys(e).length
  27164. },
  27165. update: function(e) {
  27166. return this.cache = e,
  27167. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27168. $.when()
  27169. },
  27170. get: function(e) {
  27171. return this.cache[e]
  27172. }
  27173. },
  27174. i.prototype = {
  27175. version: 2,
  27176. validate: function(e) {
  27177. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27178. },
  27179. update: function(e) {
  27180. return this.baseUrl = e["base.url"],
  27181. this.cache = e,
  27182. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27183. $.when()
  27184. },
  27185. get: function(e) {
  27186. var t = this.cache[e];
  27187. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27188. }
  27189. },
  27190. n.prototype = {
  27191. version: 3,
  27192. validate: function(e) {
  27193. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27194. },
  27195. update: function(e) {
  27196. return this.baseUrl = e.templates[0],
  27197. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27198. $.when()
  27199. },
  27200. get: function(e) {
  27201. return this.baseUrl.replace("{{filename}}", e)
  27202. }
  27203. },
  27204. r.prototype = {
  27205. init: function() {
  27206. return this.initialLoadingPromise || (setInterval(function() {
  27207. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27208. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27209. this.refresh().done(function() {
  27210. l.debug("Refreshed")
  27211. }).fail(function() {
  27212. l.error("Failed url refresh, urls might go stale soon")
  27213. }))
  27214. }
  27215. .bind(this), a.signedUrlCheckInterval),
  27216. this.initialLoadingPromise = this.refresh()),
  27217. this.initialLoadingPromise
  27218. },
  27219. refresh: function(e) {
  27220. return {},
  27221. $.Deferred().resolve()
  27222. },
  27223. get: function(e) {
  27224. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27225. }
  27226. },
  27227. h.exports = r
  27228. }
  27229. ).call(this, "/js/util/ModelUrls.js")
  27230. }
  27231. , {
  27232. "../ab": 3,
  27233. "../constants": 8,
  27234. "./ajax": 181,
  27235. "./logger": 189,
  27236. "./showcase": 193
  27237. }],
  27238. 178: [function(l, c, e) {
  27239. (function(e) {
  27240. "use strict";
  27241. function t() {
  27242. i.call(this),
  27243. this.neighbourMap = {},
  27244. this.map = null
  27245. }
  27246. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  27247. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27248. n.inherit(t, i),
  27249. t.prototype.getIndex = function(e) {
  27250. return e.id
  27251. }
  27252. ,
  27253. t.prototype.find = function(e, t) {
  27254. var i = n.filterAll(this.list, e);
  27255. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27256. i = n.stableSort(i, e)
  27257. }),
  27258. i[0])
  27259. }
  27260. ,
  27261. t.prototype.sortByScore = function(e, t) {
  27262. var i = n.filterAll(this.list, e);
  27263. return 0 === i.length ? null : i = i.map(function(i) {
  27264. return {
  27265. pano: i,
  27266. score: t.reduce(function(e, t) {
  27267. return e + t(i)
  27268. }, 0)
  27269. }
  27270. }).sort(function(e, t) {
  27271. return t.score - e.score
  27272. })
  27273. }
  27274. ,
  27275. t.prototype.lowestByScore = function(e, t, i) {
  27276. return this.findRankedByScore(0, e, t, i)
  27277. }
  27278. ,
  27279. t.prototype.findRankedByScore = function(e, t, i, n) {
  27280. n && (n.candidates = null,
  27281. n.pano = null),
  27282. e = e || 0;
  27283. var r = this.sortByScore(t, i);
  27284. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27285. n.pano = r[e].pano),
  27286. r[e].pano)
  27287. }
  27288. ,
  27289. t.prototype.showPanoScores = function(e) {
  27290. this.list.forEach(function(e) {
  27291. e.removeTextSprite()
  27292. });
  27293. var t = 6344768;
  27294. e.forEach(function(e) {
  27295. e.pano.addTextSprite(e.score.toFixed(2), t),
  27296. t = 16428055
  27297. })
  27298. }
  27299. ,
  27300. t.prototype.isNeighbour = function(e, t) {
  27301. return this.neighbourMap[e.id][t.id]
  27302. }
  27303. ,
  27304. t.prototype.getNeighbours = function(e) {
  27305. return this.neighbourMap[e.id]
  27306. }
  27307. ,
  27308. t.prototype.setNeighbour = function(e, t, i) {
  27309. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27310. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27311. this.neighbourMap[e.id][e.id] = !0,
  27312. this.neighbourMap[t.id][t.id] = !0,
  27313. this.neighbourMap[e.id][t.id] = i,
  27314. this.neighbourMap[t.id][e.id] = i,
  27315. this.neighbourMap[e.id]
  27316. }
  27317. ,
  27318. t.prototype.findClosest = function(e, t) {
  27319. var i = [r.filters.isPanoAligned()];
  27320. return t && i.push(r.filters.inDirection(e, t, .75)),
  27321. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27322. }
  27323. ,
  27324. t.prototype.dualNeighbors = function(e, t) {
  27325. var i, n = [];
  27326. for (i in this.neighbourMap[e.id])
  27327. this.neighbourMap[t.id][i] && n.push(i);
  27328. return n
  27329. }
  27330. ,
  27331. t.prototype.populate_path_graph = function() {
  27332. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27333. for (e = 0; e < this.list.length; e += 1) {
  27334. for (t in s = !(a = {}),
  27335. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27336. if (i[t]) {
  27337. o = this.index[t],
  27338. u.copy(r.floorPosition),
  27339. u.sub(o.floorPosition);
  27340. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27341. , p = (Math.abs(u.y),
  27342. Math.max(d, .01),
  27343. Math.max(0, Math.abs(u.y) - .2));
  27344. n = 0 < p ? (1,
  27345. p = Math.pow(4 * p, 2),
  27346. d = Math.pow(d, 2),
  27347. Math.sqrt(p * p + d * d)) : (1,
  27348. u.length()),
  27349. a[o.id] = n,
  27350. s = !0
  27351. }
  27352. s ? c[r.id] = a : h += 1
  27353. }
  27354. this.map = c,
  27355. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27356. }
  27357. ,
  27358. t.prototype.aStarSearch = function(e, t) {
  27359. var i = Date.now()
  27360. , n = new o({
  27361. start: e,
  27362. isEnd: function(e) {
  27363. return e === t
  27364. },
  27365. neighbor: function(e) {
  27366. var t = e.neighbourPanos || e.findNeighourPanos()
  27367. , i = [];
  27368. for (var n in t)
  27369. i.push(this.index[n]);
  27370. return i
  27371. }
  27372. .bind(this),
  27373. distance: function(e, t) {
  27374. return this.map[e.id][t.id]
  27375. }
  27376. .bind(this),
  27377. heuristic: function(e, t) {
  27378. return 1
  27379. }
  27380. .bind(this),
  27381. hash: function(e) {
  27382. return e.id
  27383. },
  27384. timeout: 5e3
  27385. });
  27386. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27387. "success" !== n.status)
  27388. return T.debug("Did not find A* path from " + e + " to " + t),
  27389. null;
  27390. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27391. var r = [];
  27392. return n.path.forEach(function(e) {
  27393. r.push(e.id)
  27394. }),
  27395. r
  27396. }
  27397. ,
  27398. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27399. g = new w.Vector3,
  27400. m = new w.Vector3,
  27401. v = new w.Vector3,
  27402. y = new w.Vector3,
  27403. A = new w.Vector3,
  27404. C = new w.Vector3,
  27405. I = new w.Vector3,
  27406. E = [],
  27407. _ = new w.Vector3,
  27408. b = new w.Vector3,
  27409. function(e, t) {
  27410. if (e)
  27411. for (var i = function(e, t, i) {
  27412. return y.copy(t).sub(e),
  27413. y.dot(i)
  27414. }, n = function(e, t) {
  27415. return i(_, e.position, m) - i(_, t.position, m)
  27416. }, r = 0; r < e.length - 1; ) {
  27417. var o = e[r]
  27418. , a = e[r + 1]
  27419. , s = this.index[o]
  27420. , l = this.index[a];
  27421. _.copy(s.position),
  27422. b.copy(l.position),
  27423. E.length = 0,
  27424. f.copy(b).sub(_),
  27425. m.copy(f).normalize();
  27426. for (var c = 0; c < this.list.length; c++) {
  27427. var h = this.list[c];
  27428. y.copy(h.position).sub(_);
  27429. var u = y.dot(m);
  27430. 0 < u && (C.copy(m),
  27431. C.multiplyScalar(u),
  27432. A.copy(y),
  27433. A.sub(C),
  27434. A.length() < t && (g.copy(f).negate(),
  27435. v.copy(g).normalize(),
  27436. I.copy(h.position).sub(b),
  27437. 0 < I.dot(v) && E.push(h)))
  27438. }
  27439. if (0 < E.length) {
  27440. E.sort(n);
  27441. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27442. e[d] = e[d - E.length];
  27443. for (var p = 0; p < E.length; p++)
  27444. e[p + r + 1] = E[p].id
  27445. }
  27446. r += E.length + 1
  27447. }
  27448. }
  27449. ),
  27450. t.prototype.fadeMarkerOpacity = function(e, t) {
  27451. var i = void 0 === e ? a.panorama.markerOpacity : e
  27452. , n = this.list.findIndex(function(e) {
  27453. return e.marker
  27454. });
  27455. if (!(n < 0)) {
  27456. var r = this.list[n].marker.material.opacity;
  27457. if (r !== e) {
  27458. var o = i - r;
  27459. s.trigger({
  27460. func: function(e, t) {
  27461. var i = r + e * o;
  27462. this.forEach(function(e) {
  27463. e.marker && (e.marker.material.opacity = i)
  27464. })
  27465. }
  27466. .bind(this),
  27467. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27468. name: "_fpm"
  27469. })
  27470. }
  27471. }
  27472. }
  27473. ,
  27474. c.exports = t
  27475. }
  27476. ).call(this, "/js/util/PanoramaCollection.js")
  27477. }
  27478. , {
  27479. "../objects/Panorama": 148,
  27480. "../settings": 166,
  27481. "./IndexedCollection": 175,
  27482. "./aStar": 180,
  27483. "./common": 185,
  27484. "./logger": 189,
  27485. "./transitions": 195,
  27486. three: 217
  27487. }],
  27488. 179: [function(e, t, i) {
  27489. "use strict";
  27490. function n() {
  27491. this.actionSequence = [],
  27492. this.actionSequenceInProgress = !1
  27493. }
  27494. function r(e, t, i, n) {
  27495. c.trackAlways("zoom_" + e, {
  27496. from: t,
  27497. to: i,
  27498. pano: n
  27499. })
  27500. }
  27501. var o, a, s, l, c = e("../analytics");
  27502. n.prototype.reset = function(e) {
  27503. this.actionSequenceInProgress = !1,
  27504. this.actionSequence.length = 0
  27505. }
  27506. ,
  27507. n.prototype.addZoomAction = (a = o = null,
  27508. s = !1,
  27509. l = function() {
  27510. if (o = null,
  27511. 0 < this.actionSequence.length) {
  27512. var e = this.actionSequence[0].start
  27513. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27514. 1 === e ? function(e, t) {
  27515. r("initial", 1, e, t)
  27516. }(t, a) : function(e, t, i) {
  27517. r("followup", e, t, i)
  27518. }(e, t, a)
  27519. }
  27520. this.reset()
  27521. }
  27522. ,
  27523. function(e, t, i) {
  27524. if (e !== t) {
  27525. s || (l = l.bind(this),
  27526. s = !0),
  27527. o && (window.clearTimeout(o),
  27528. o = null),
  27529. i === a && this.actionSequenceInProgress || (this.reset(),
  27530. a = i),
  27531. this.actionSequenceInProgress = !0;
  27532. var n = {
  27533. start: e,
  27534. end: t
  27535. };
  27536. this.actionSequence.push(n),
  27537. o = window.setTimeout(l, 150)
  27538. }
  27539. }
  27540. ),
  27541. t.exports = n
  27542. }
  27543. , {
  27544. "../analytics": 4
  27545. }],
  27546. 180: [function(e, t, i) {
  27547. "use strict";
  27548. function g(e) {
  27549. if (void 0 === e.parent)
  27550. return [e.data];
  27551. var t = g(e.parent);
  27552. return t.push(e.data),
  27553. t
  27554. }
  27555. function m(e) {
  27556. return e.toString()
  27557. }
  27558. function v(e, t) {
  27559. return e.f - t.f
  27560. }
  27561. var y = e("Set")
  27562. , A = e("heap")
  27563. , C = e("dict");
  27564. t.exports = function(e) {
  27565. void 0 === e.timeout && (e.timeout = 1 / 0);
  27566. var t = e.hash || m
  27567. , i = {
  27568. data: e.start,
  27569. g: 0,
  27570. h: e.heuristic(e.start)
  27571. }
  27572. , n = i;
  27573. i.f = i.h;
  27574. var r = new y
  27575. , o = new A(v)
  27576. , a = C();
  27577. o.push(i),
  27578. a.set(t(i.data), i);
  27579. for (var s = new Date; o.size(); ) {
  27580. if (new Date - s > e.timeout)
  27581. return {
  27582. status: "timeout",
  27583. cost: n.g,
  27584. path: g(n)
  27585. };
  27586. var l = o.pop();
  27587. if (a.delete(t(l.data)),
  27588. e.isEnd(l.data))
  27589. return {
  27590. status: "success",
  27591. cost: l.g,
  27592. path: g(l)
  27593. };
  27594. r.add(t(l.data));
  27595. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27596. var u = c[h];
  27597. if (!r.contains(t(u))) {
  27598. var d = l.g + e.distance(l.data, u)
  27599. , p = a.get(t(u))
  27600. , f = !1;
  27601. if (void 0 === p)
  27602. p = {
  27603. data: u
  27604. },
  27605. a.set(t(u), p);
  27606. else {
  27607. if (p.g < d)
  27608. continue;
  27609. f = !0
  27610. }
  27611. p.parent = l,
  27612. p.g = d,
  27613. p.h = e.heuristic(u),
  27614. p.f = d + p.h,
  27615. p.h < n.h && (n = p),
  27616. f ? o.heapify() : o.push(p)
  27617. }
  27618. }
  27619. }
  27620. return {
  27621. status: "noPath",
  27622. cost: n.g,
  27623. path: g(n)
  27624. }
  27625. }
  27626. }
  27627. , {
  27628. Set: 196,
  27629. dict: 210,
  27630. heap: 211
  27631. }],
  27632. 181: [function(i, n, e) {
  27633. (function(e) {
  27634. "use strict";
  27635. function s(e, t, i) {
  27636. function n() {
  27637. l.warn("Retrying ", t),
  27638. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27639. }
  27640. var r = function(e, t, i) {
  27641. var n = new XMLHttpRequest;
  27642. if (i && "withCredentials"in n)
  27643. n.open(e, t, i);
  27644. else if ("undefined" != typeof XDomainRequest)
  27645. (n = new XDomainRequest).open(e, t);
  27646. else {
  27647. if (i)
  27648. throw "Browser does not support CORS!";
  27649. n.open(e, t)
  27650. }
  27651. return n
  27652. }(e, t, !1);
  27653. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27654. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27655. i.responseType)
  27656. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27657. r.responseType = i.responseType;
  27658. else {
  27659. if ("image/jpeg" !== i.responseType)
  27660. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27661. r.responseType = "arraybuffer"
  27662. }
  27663. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27664. i.auth && r.setRequestHeader("Authorization", i.auth),
  27665. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27666. r.setRequestHeader("Content-Type", "application/json")),
  27667. "object" == typeof i.headers)
  27668. for (var o in i.headers)
  27669. r.setRequestHeader(o, i.headers[o]);
  27670. var a = $.Deferred();
  27671. return r.onreadystatechange = function(e) {
  27672. if (4 === this.readyState)
  27673. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27674. i.retries++,
  27675. setTimeout(n, 1e3);
  27676. else if (200 === this.status) {
  27677. var t = function(e, t) {
  27678. var i = e.response;
  27679. if ("json" === t && "object" != typeof i)
  27680. try {
  27681. i = JSON.parse(e.responseText)
  27682. } catch (e) {
  27683. return void a.reject({
  27684. error: "Failed parsing JSON"
  27685. })
  27686. }
  27687. else if ("image/jpeg" === t) {
  27688. var n = new Uint8Array(e.response)
  27689. , r = new Blob([n],{
  27690. type: "image/jpeg"
  27691. })
  27692. , o = URL.createObjectURL(r);
  27693. (i = new Image).src = o,
  27694. i.crossOrigin = "Anonymous",
  27695. i.onload = function() {
  27696. URL.revokeObjectURL(o)
  27697. }
  27698. }
  27699. return i
  27700. }(this, i.responseType);
  27701. a.resolve(t)
  27702. } else
  27703. a.reject(this)
  27704. }
  27705. ,
  27706. r.onprogress = function(e) {
  27707. a.notify(e)
  27708. }
  27709. ,
  27710. r.send(i.data),
  27711. a.promise()
  27712. }
  27713. function o(e, t) {
  27714. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  27715. return t.headers && function(t) {
  27716. return Object.keys(t).sort().map(function(e) {
  27717. return {
  27718. key: e,
  27719. value: t[e]
  27720. }
  27721. })
  27722. }(t.headers).forEach(function(e) {
  27723. i += "__" + e.key + ":" + e.value
  27724. }),
  27725. i
  27726. }
  27727. var t = i("./logger")
  27728. , a = i("../ab")
  27729. , l = new t(e);
  27730. window.URL = window.URL || window.webkitURL,
  27731. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27732. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  27733. n.exports = {
  27734. get: function(e, t) {
  27735. var i, n = void 0 === (t = t || {}).cache || t.cache;
  27736. if (n) {
  27737. var r = function(e, t) {
  27738. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  27739. }(e, t);
  27740. if (r)
  27741. return r
  27742. }
  27743. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  27744. n && function(e, t, i) {
  27745. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  27746. }(e, t, i),
  27747. i
  27748. },
  27749. post: function(e, t) {
  27750. return s("POST", e, t)
  27751. },
  27752. patch: function(e, t) {
  27753. return s("PATCH", e, t)
  27754. },
  27755. getImage: function(e, t) {
  27756. function i() {
  27757. l.warn("Retrying ", e),
  27758. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27759. }
  27760. var n = $.Deferred()
  27761. , r = new Image
  27762. , o = this;
  27763. return e = a.changeIfImageOptimzing(e),
  27764. null != t || (t = 3),
  27765. r.onerror = function() {
  27766. 0 < t ? setTimeout(i, 1e3) : n.reject()
  27767. }
  27768. ,
  27769. r.onload = function() {
  27770. n.resolve(r)
  27771. }
  27772. ,
  27773. r.crossOrigin = "anonymous",
  27774. r.src = e,
  27775. n
  27776. }
  27777. }
  27778. }
  27779. ).call(this, "/js/util/ajax.js")
  27780. }
  27781. , {
  27782. "../ab": 3,
  27783. "./logger": 189
  27784. }],
  27785. 182: [function(e, t, i) {
  27786. "use strict";
  27787. function n(e, t) {
  27788. var i = window.navigator.userAgent.match(e);
  27789. return i = i ? i[1].split(t) : [],
  27790. {
  27791. major: parseInt(i[0]) || 0,
  27792. minor: parseInt(i[1]) || 0,
  27793. patch: parseInt(i[2]) || 0
  27794. }
  27795. }
  27796. var r = e("../exception/DeviceMismatchException");
  27797. t.exports = {
  27798. isFullscreen: function() {
  27799. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27800. },
  27801. supportsFullscreen: function() {
  27802. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27803. },
  27804. isPointerLocked: function() {
  27805. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27806. },
  27807. requestFullscreen: function(e, t) {
  27808. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  27809. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  27810. },
  27811. requestPointerLock: function() {
  27812. var e;
  27813. if (document.fullscreenElement)
  27814. e = document.fullscreenElement();
  27815. else if (document.mozFullscreenElement)
  27816. e = document.mozFullscreenElement();
  27817. else if (document.mozFullScreenElement)
  27818. e = document.mozFullScreenElement();
  27819. else {
  27820. if (!document.webkitFullscreenElement)
  27821. return;
  27822. e = document.webkitFullscreenElement()
  27823. }
  27824. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  27825. e.requestPointerLock(),
  27826. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  27827. },
  27828. exitPointerLock: function() {
  27829. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  27830. document.exitPointerLock()
  27831. },
  27832. exitFullscreen: function() {
  27833. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  27834. },
  27835. details: function() {
  27836. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  27837. return e ? {
  27838. name: e[1],
  27839. version: parseInt(e[2]),
  27840. platform: navigator.platform
  27841. } : {}
  27842. },
  27843. is: function(e) {
  27844. return this.details() && this.details().name === e
  27845. },
  27846. inIframe: function() {
  27847. return window.parent !== window
  27848. },
  27849. aspectRatio: function() {
  27850. var e = $("#player").width() / $("#player").height();
  27851. return isFinite(e) ? e : 0
  27852. },
  27853. userAgent: function() {
  27854. return window.navigator.userAgent
  27855. },
  27856. isMobile: function() {
  27857. var e = navigator.userAgent || navigator.vendor || window.opera;
  27858. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  27859. },
  27860. isLandscape: function() {
  27861. return this.isMobile && 1 < this.aspectRatio()
  27862. },
  27863. isSmallScreen: function() {
  27864. return screen.width / window.devicePixelRatio < 240
  27865. },
  27866. detectIE: function() {
  27867. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  27868. },
  27869. detectSafari: function() {
  27870. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  27871. },
  27872. detectFirefox: function() {
  27873. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  27874. },
  27875. detectChrome: function() {
  27876. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  27877. },
  27878. detectOpera: function() {
  27879. return -1 !== window.navigator.userAgent.indexOf("OPR")
  27880. },
  27881. detectIOS: function() {
  27882. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  27883. },
  27884. detectIPad: function() {
  27885. var e = window.navigator.userAgent;
  27886. return /iPad/.test(e)
  27887. },
  27888. detectIPod: function() {
  27889. var e = window.navigator.userAgent;
  27890. return /iPod/.test(e)
  27891. },
  27892. detectIPhone: function() {
  27893. var e = window.navigator.userAgent;
  27894. return /iPhone/.test(e)
  27895. },
  27896. detectAndroid: function() {
  27897. return -1 !== window.navigator.userAgent.indexOf("Android")
  27898. },
  27899. detectAndroidMobile: function() {
  27900. var e = window.navigator.userAgent;
  27901. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  27902. },
  27903. detectSamsungNative: function() {
  27904. var e = window.navigator.userAgent;
  27905. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  27906. },
  27907. detectSamsungS6: function() {
  27908. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  27909. },
  27910. detectHUAWEI5X: function() {
  27911. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  27912. },
  27913. detectWebVR: function() {
  27914. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  27915. },
  27916. getVRDisplay: function() {
  27917. var t = $.Deferred();
  27918. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  27919. 1 <= e.length && t.resolve(e[0]),
  27920. t.reject(null)
  27921. }),
  27922. t) : t.reject(null)
  27923. },
  27924. iosVersion: function() {
  27925. if (!this.detectIOS())
  27926. throw new r("Did not detect an iDevice");
  27927. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  27928. },
  27929. androidVersion: function() {
  27930. if (!this.detectAndroid())
  27931. throw new r("Did not detect an Android based device");
  27932. return n(/Android ((?:\d+\.?){1,3})/, ".")
  27933. },
  27934. valueFromCookie: function(e, t) {
  27935. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  27936. if (!i)
  27937. return t;
  27938. var n = i[1];
  27939. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  27940. },
  27941. valueFromHash: function(e, t) {
  27942. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  27943. if (!i)
  27944. return t;
  27945. var n = i[1];
  27946. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  27947. }
  27948. }
  27949. }
  27950. , {
  27951. "../exception/DeviceMismatchException": 56
  27952. }],
  27953. 183: [function(i, n, e) {
  27954. (function(e) {
  27955. "use strict";
  27956. var o = i("../controls/serializer")
  27957. , a = i("../util/math")
  27958. , s = i("./browser")
  27959. , l = i("../enum/Viewmode")
  27960. , t = i("../util/logger")
  27961. , c = i("three")
  27962. , h = new t(e);
  27963. n.exports = {
  27964. getStartCameraOptions: function(e, t) {
  27965. var i = function(e) {
  27966. var t = s.valueFromHash("start", "")
  27967. , i = {};
  27968. if ("" !== t) {
  27969. h.debug("Start override found in parameters, trying to parse..."),
  27970. i = function(e) {
  27971. return o.deserialize(e)
  27972. }(t) || {};
  27973. var n = s.valueFromHash("tag", null);
  27974. n && (i.tag = n),
  27975. i.panoId && (i.pano = e.get(i.panoId))
  27976. }
  27977. return i
  27978. }(t);
  27979. if (0 < Object.keys(i).length)
  27980. return i;
  27981. if (e.heroImage)
  27982. i = function(e, t) {
  27983. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  27984. return {};
  27985. var i = {}
  27986. , n = e.heroImage.metadata;
  27987. h.debug("Using start position from thumbnail image"),
  27988. i.position = n.camera_position,
  27989. i.quaternion = n.camera_quaternion;
  27990. try {
  27991. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  27992. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  27993. } catch (e) {
  27994. h.debug(e.message)
  27995. }
  27996. return i
  27997. }(e, t);
  27998. else if (e.data.camera_start) {
  27999. var n = e.data.camera_start;
  28000. try {
  28001. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28002. i.position = (new c.Vector3).fromArray(n.camera.position),
  28003. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28004. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28005. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28006. h.debug("Using camera_start"),
  28007. h.debug("Modeldata pano: ", i.pano.quaternion),
  28008. h.debug("Camera start pano: ", n.pano.quaternion)),
  28009. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28010. } catch (e) {
  28011. h.warn(e.message)
  28012. }
  28013. }
  28014. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28015. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28016. i.pano = t.findClosest(i.position),
  28017. i.quaternion = i.pano.quaternion),
  28018. 0 === Object.keys(i).length) {
  28019. var r = t.list[0];
  28020. r && (i.mode = l.PANORAMA,
  28021. i.pano = r,
  28022. i.position = r.position,
  28023. i.quaternion = r.quaternion,
  28024. h.info("Starting at 1st pano " + r.id))
  28025. }
  28026. return i.mode = i.mode || l.DOLLHOUSE,
  28027. i
  28028. }
  28029. }
  28030. }
  28031. ).call(this, "/js/util/camera.js")
  28032. }
  28033. , {
  28034. "../controls/serializer": 14,
  28035. "../enum/Viewmode": 51,
  28036. "../util/logger": 189,
  28037. "../util/math": 190,
  28038. "./browser": 182,
  28039. three: 217
  28040. }],
  28041. 184: [function(e, t, i) {
  28042. "use strict";
  28043. function r(e, t, i) {
  28044. var n = t
  28045. , r = i;
  28046. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28047. }
  28048. function o(e, t, i) {
  28049. var n = t
  28050. , r = i;
  28051. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28052. }
  28053. var a = e("./MathLight");
  28054. t.exports = {
  28055. clampVFOV: function(e, t, i, n) {
  28056. return t < r(e, i, n) ? o(t, i, n) : e
  28057. },
  28058. getHFOVForCamera: function(e, t, i) {
  28059. return r(e.fov, t, i)
  28060. },
  28061. getHFOVFromVFOV: r,
  28062. getVFOVFromHFOV: o
  28063. }
  28064. }
  28065. , {
  28066. "./MathLight": 176
  28067. }],
  28068. 185: [function(e, t, i) {
  28069. "use strict";
  28070. var a = e("three");
  28071. t.exports = {
  28072. delayOneFrame: function(e) {
  28073. window.setTimeout(e, 1)
  28074. },
  28075. normalizeUrl: function(e) {
  28076. return e.replace("https://", "http://")
  28077. },
  28078. domainFromUrl: function(e) {
  28079. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28080. return t ? t[3] : e
  28081. },
  28082. average: function(e, t) {
  28083. if (0 === e.length)
  28084. return null;
  28085. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28086. i += t ? e[r][t] : e[r],
  28087. n++
  28088. }
  28089. return i / n
  28090. },
  28091. countUnique: function(e) {
  28092. for (var t = {}, i = 0; i < e.length; i++)
  28093. t[e[i]] = 1 + (t[e[i]] || 0);
  28094. return Object.keys(t).length
  28095. },
  28096. averageVectors: function(e, t) {
  28097. var i = new a.Vector3;
  28098. if (0 === e.length)
  28099. return i;
  28100. for (var n = 0, r = 0; r < e.length; r++) {
  28101. var o = t ? e[r][t] : e[r];
  28102. i.add(o),
  28103. n++
  28104. }
  28105. return i.divideScalar(n)
  28106. },
  28107. equalLists: function(e, t) {
  28108. if (e.length !== t.length)
  28109. return !1;
  28110. for (var i = 0; i < e.length; i++)
  28111. if (e[i] !== t[i])
  28112. return !1;
  28113. return !0
  28114. },
  28115. lowerMedian: function(e, t) {
  28116. return 0 === e.length ? null : (t = t || 2,
  28117. e.sort(function(e, t) {
  28118. return e - t
  28119. }),
  28120. e[Math.floor(e.length / t)])
  28121. },
  28122. stableSort: function(e, n) {
  28123. return e.map(function(e, t) {
  28124. return {
  28125. value: e,
  28126. index: t
  28127. }
  28128. }).sort(function(e, t) {
  28129. var i = n(e.value, t.value);
  28130. return 0 !== i ? i : e.index - t.index
  28131. }).map(function(e) {
  28132. return e.value
  28133. })
  28134. },
  28135. filterAll: function(e, i) {
  28136. return e.filter(function(t) {
  28137. return i.every(function(e) {
  28138. return e(t)
  28139. })
  28140. })
  28141. },
  28142. formatDate: function(e) {
  28143. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28144. },
  28145. formatDatetime: function(e) {
  28146. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28147. },
  28148. randomString: function(e) {
  28149. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28150. t += i.charAt(Math.floor(Math.random() * i.length));
  28151. return t
  28152. },
  28153. uint8ToBase64: function(e, t) {
  28154. t && "number" == typeof t || (t = 8192);
  28155. for (var i = [], n = 0; n < e.length; n += t)
  28156. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28157. return btoa(i.join(""))
  28158. },
  28159. uuid4: function e(t) {
  28160. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28161. },
  28162. nth: function(e) {
  28163. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28164. },
  28165. extendObject: function(t, i) {
  28166. return Object.keys(i).forEach(function(e) {
  28167. t[e] = i[e]
  28168. }),
  28169. t
  28170. },
  28171. deepExtend: function e(t) {
  28172. t = t || {};
  28173. for (var i = 1; i < arguments.length; i++) {
  28174. var n = arguments[i];
  28175. if (n)
  28176. for (var r in n)
  28177. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28178. }
  28179. return t
  28180. },
  28181. inherit: function(e, t) {
  28182. e.prototype = Object.create(t.prototype),
  28183. e.prototype.constructor = e
  28184. },
  28185. extend: function(e, t) {
  28186. for (var i in t.prototype)
  28187. e.prototype[i] = t.prototype[i]
  28188. }
  28189. },
  28190. Math.sign = function(e) {
  28191. return e < 0 ? -1 : 1
  28192. }
  28193. }
  28194. , {
  28195. three: 217
  28196. }],
  28197. 186: [function(e, t, i) {
  28198. "use strict";
  28199. var r = {
  28200. linearTween: function(e, t, i, n) {
  28201. return i * e / n + t
  28202. },
  28203. easeInQuad: function(e, t, i, n) {
  28204. return i * (e /= n) * e + t
  28205. },
  28206. easeOutQuad: function(e, t, i, n) {
  28207. return -i * (e /= n) * (e - 2) + t
  28208. },
  28209. easeInOutQuad: function(e, t, i, n) {
  28210. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28211. },
  28212. easeInCubic: function(e, t, i, n) {
  28213. return i * (e /= n) * e * e + t
  28214. },
  28215. easeOutCubic: function(e, t, i, n) {
  28216. return e /= n,
  28217. i * (--e * e * e + 1) + t
  28218. },
  28219. easeInOutCubic: function(e, t, i, n) {
  28220. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28221. },
  28222. easeInQuart: function(e, t, i, n) {
  28223. return i * (e /= n) * e * e * e + t
  28224. },
  28225. easeOutQuart: function(e, t, i, n) {
  28226. return e /= n,
  28227. -i * (--e * e * e * e - 1) + t
  28228. },
  28229. easeInOutQuart: function(e, t, i, n) {
  28230. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28231. },
  28232. easeInQuint: function(e, t, i, n) {
  28233. return i * (e /= n) * e * e * e * e + t
  28234. },
  28235. easeOutQuint: function(e, t, i, n) {
  28236. return e /= n,
  28237. i * (--e * e * e * e * e + 1) + t
  28238. },
  28239. easeInOutQuint: function(e, t, i, n) {
  28240. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28241. },
  28242. easeInSine: function(e, t, i, n) {
  28243. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28244. },
  28245. easeOutSine: function(e, t, i, n) {
  28246. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28247. },
  28248. easeInOutSine: function(e, t, i, n) {
  28249. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28250. },
  28251. easeInExpo: function(e, t, i, n) {
  28252. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28253. },
  28254. easeOutExpo: function(e, t, i, n) {
  28255. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28256. },
  28257. easeInOutExpo: function(e, t, i, n) {
  28258. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28259. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28260. },
  28261. easeInCirc: function(e, t, i, n) {
  28262. return e /= n,
  28263. -i * (Math.sqrt(1 - e * e) - 1) + t
  28264. },
  28265. easeOutCirc: function(e, t, i, n) {
  28266. return e /= n,
  28267. e--,
  28268. i * Math.sqrt(1 - e * e) + t
  28269. },
  28270. easeInOutCirc: function(e, t, i, n) {
  28271. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28272. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28273. },
  28274. easeInElastic: function(e, t, i, n) {
  28275. var r = 1.70158
  28276. , o = 0
  28277. , a = i;
  28278. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28279. r = a < Math.abs(i) ? (a = i,
  28280. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28281. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28282. },
  28283. easeOutElastic: function(e, t, i, n) {
  28284. var r = 1.70158
  28285. , o = 0
  28286. , a = i;
  28287. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28288. r = a < Math.abs(i) ? (a = i,
  28289. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28290. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28291. },
  28292. easeInOutElastic: function(e, t, i, n) {
  28293. var r = 1.70158
  28294. , o = 0
  28295. , a = i;
  28296. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28297. r = a < Math.abs(i) ? (a = i,
  28298. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28299. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28300. },
  28301. easeInBack: function(e, t, i, n, r) {
  28302. return void 0 === r && (r = 1.70158),
  28303. i * (e /= n) * e * ((r + 1) * e - r) + t
  28304. },
  28305. easeOutBack: function(e, t, i, n, r) {
  28306. return void 0 === r && (r = 1.70158),
  28307. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28308. },
  28309. easeInOutBack: function(e, t, i, n, r) {
  28310. return void 0 === r && (r = 1.70158),
  28311. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  28312. },
  28313. easeOutBounce: function(e, t, i, n) {
  28314. return (e /= n) < 1 / 2.75 ? i * (7.5625 * e * e) + t : e < 2 / 2.75 ? i * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? i * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : i * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  28315. },
  28316. easeInBounce: function(e, t, i, n) {
  28317. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28318. },
  28319. easeInOutBounce: function(e, t, i, n) {
  28320. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  28321. }
  28322. };
  28323. t.exports = r
  28324. }
  28325. , {}],
  28326. 187: [function(e, t, i) {
  28327. "use strict";
  28328. function n() {
  28329. this.events = [],
  28330. this.valid = !1
  28331. }
  28332. var r = e("../enum/Joystick");
  28333. n.prototype.push = function(e, t) {
  28334. this.events.push({
  28335. direction: e,
  28336. pano: t
  28337. }),
  28338. this.valid = !0
  28339. }
  28340. ,
  28341. n.prototype.pop = function(e) {
  28342. var t = this.events.pop();
  28343. return this.events.length < 1 && (this.valid = !1),
  28344. t
  28345. }
  28346. ,
  28347. n.prototype.peek = function() {
  28348. return this.events.length ? this.events[this.events.length - 1] : {
  28349. direction: null,
  28350. pano: null
  28351. }
  28352. }
  28353. ,
  28354. n.prototype.invalidate = function() {
  28355. this.events = [],
  28356. this.valid = !1
  28357. }
  28358. ,
  28359. n.prototype.reversePano = function(e) {
  28360. if (!this.valid)
  28361. return null;
  28362. var t = this.peek();
  28363. return r.opposite(e) === t.direction ? (this.pop(),
  28364. t.pano) : null
  28365. }
  28366. ,
  28367. t.exports = n
  28368. }
  28369. , {
  28370. "../enum/Joystick": 29
  28371. }],
  28372. 188: [function(e, t, i) {
  28373. "use strict";
  28374. t.exports = {
  28375. vector: function(t, i) {
  28376. var n = t.clone();
  28377. return i = i.clone(),
  28378. function(e) {
  28379. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28380. }
  28381. },
  28382. quaternion: function(t, i) {
  28383. var n = t.clone();
  28384. return function(e) {
  28385. t.copy(n).slerp(i, e)
  28386. }
  28387. },
  28388. property: function(t, i, n, r) {
  28389. var o = t[i];
  28390. return function(e) {
  28391. t[i] = o * (1 - e) + n * e,
  28392. r && r(t[i])
  28393. }
  28394. },
  28395. uniform: function(t, i, n) {
  28396. var r = t.material.uniforms[i].value;
  28397. return function(e) {
  28398. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28399. }
  28400. },
  28401. matrix4: function(o, a) {
  28402. var s = o.clone();
  28403. return function(e) {
  28404. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28405. t[r] = i[r] * (1 - e) + n[r] * e
  28406. }
  28407. },
  28408. allUniforms: function(e, t, i) {
  28409. var n = e.map(function(e) {
  28410. return this.uniform(e, t, i)
  28411. }
  28412. .bind(this));
  28413. return function(t) {
  28414. n.forEach(function(e) {
  28415. e(t)
  28416. })
  28417. }
  28418. }
  28419. }
  28420. }
  28421. , {}],
  28422. 189: [function(e, t, i) {
  28423. "use strict";
  28424. function h(n) {
  28425. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28426. if (h.consoleEnabled) {
  28427. var l = function(e) {
  28428. $("#debug-console").append("<p>" + e + "</p>"),
  28429. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28430. };
  28431. e = function(e) {
  28432. l(Array.prototype.slice.call(arguments).join(" "))
  28433. }
  28434. ,
  28435. t = function(e) {
  28436. l(Array.prototype.slice.call(arguments).join(" "))
  28437. }
  28438. ,
  28439. i = function(e) {
  28440. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28441. }
  28442. ,
  28443. r = function(e) {
  28444. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28445. }
  28446. } else
  28447. console.log ? (e = console.log,
  28448. t = console.info ? console.info : console.log,
  28449. i = console.warn ? console.warn : console.log,
  28450. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28451. ;
  28452. function c(e) {
  28453. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28454. }
  28455. return {
  28456. debug: function() {
  28457. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28458. },
  28459. info: function() {
  28460. h.level >= h.levels.info && t.apply(console, c(arguments))
  28461. },
  28462. warn: function() {
  28463. (function(e, t) {
  28464. if (u) {
  28465. var i = Array.prototype.slice.call(e).join(" ");
  28466. u.captureMessage(i, {
  28467. level: t,
  28468. path: n,
  28469. timestamp: h.timestamp()
  28470. })
  28471. }
  28472. }
  28473. )(arguments, "warn"),
  28474. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28475. },
  28476. error: function() {
  28477. (function(e, t) {
  28478. if (u) {
  28479. var i = Array.prototype.slice.call(e).join(" ");
  28480. u.captureException(new Error(i), {
  28481. level: t,
  28482. path: n,
  28483. timestamp: h.timestamp()
  28484. })
  28485. }
  28486. }
  28487. )(arguments, "error"),
  28488. h.level >= h.levels.error && r.apply(console, c(arguments))
  28489. },
  28490. v3str: function(e, t) {
  28491. var i = void 0 === t ? 2 : t;
  28492. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28493. },
  28494. eulstr: function(e, t) {
  28495. var i = void 0 === t ? 2 : t;
  28496. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28497. },
  28498. time: function(e) {
  28499. h.level >= h.levels.debug && (s[e] = Date.now())
  28500. },
  28501. timeEnd: function(e) {
  28502. if (h.level >= h.levels.debug) {
  28503. var t = s[e];
  28504. if (!t)
  28505. return;
  28506. var i = (Date.now() - t) / 1e3;
  28507. this.debug(e, i + "s")
  28508. }
  28509. }
  28510. }
  28511. }
  28512. var u = window.Raven;
  28513. h.timestamp = function() {
  28514. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28515. }
  28516. ,
  28517. h.level = (h.levels = {
  28518. debug: 3,
  28519. info: 2,
  28520. warn: 1,
  28521. error: 0
  28522. }).info,
  28523. t.exports = h
  28524. }
  28525. , {}],
  28526. 190: [function(e, t, i) {
  28527. "use strict";
  28528. var o = e("three")
  28529. , r = e("../enum/GLCubeFaces");
  28530. e("../constants");
  28531. t.exports = {
  28532. convertVisionVector: function(e) {
  28533. return new o.Vector3(e.x,e.z,-e.y)
  28534. },
  28535. convertVisionQuaternion: function(e) {
  28536. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  28537. },
  28538. convertWorkshopVector: function(e) {
  28539. return new o.Vector3(-e.x,e.y,e.z)
  28540. },
  28541. convertWorkshopQuaternion: function(e) {
  28542. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28543. },
  28544. convertWorkshopPanoramaQuaternion: function(e) {
  28545. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  28546. },
  28547. convertWorkshopOrthoZoom: function(e) {
  28548. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28549. },
  28550. toPrecision: function(e, t) {
  28551. function i(e, t) {
  28552. var i = Math.pow(10, t);
  28553. return Math.round(e * i) / i
  28554. }
  28555. if (e instanceof Array) {
  28556. for (var n = 0; n < e.length; n++)
  28557. e[n] = i(e[n], t);
  28558. return e
  28559. }
  28560. return i(e, t)
  28561. },
  28562. isEmptyQuaternion: function(e) {
  28563. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28564. },
  28565. projectPositionToCanvas: function(e, t, i) {
  28566. (i = i || new o.Vector3).copy(e);
  28567. var n = .5 * $("#player").width()
  28568. , r = .5 * $("#player").height();
  28569. return i.project(t),
  28570. i.x = i.x * n + n,
  28571. i.y = -i.y * r + r,
  28572. i
  28573. },
  28574. convertScreenPositionToNDC: function(e, t, i) {
  28575. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28576. i.y = -t / $("#player").height() * 2 + 1,
  28577. i
  28578. },
  28579. constrainedTurn: function(e) {
  28580. var t = e % (2 * Math.PI);
  28581. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28582. },
  28583. getFOVDotThreshold: function(e) {
  28584. return Math.cos(o.Math.degToRad(e / 2))
  28585. },
  28586. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28587. switch (e) {
  28588. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28589. i.set(1, t.y, t.x);
  28590. break;
  28591. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28592. i.set(-1, t.y, -t.x);
  28593. break;
  28594. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28595. i.set(-t.x, 1, -t.y);
  28596. break;
  28597. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28598. i.set(-t.x, -1, t.y);
  28599. break;
  28600. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28601. i.set(-t.x, t.y, 1);
  28602. break;
  28603. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28604. i.set(t.x, t.y, -1)
  28605. }
  28606. n && i.normalize()
  28607. }
  28608. }
  28609. }
  28610. , {
  28611. "../constants": 8,
  28612. "../enum/GLCubeFaces": 25,
  28613. three: 217
  28614. }],
  28615. 191: [function(e, t, i) {
  28616. "use strict";
  28617. function o(e) {
  28618. return r[e]
  28619. }
  28620. var n = e("../enum/GLCubeFaces")
  28621. , a = [0, 1, 2, 3, 4, 5]
  28622. , r = {
  28623. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28624. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28625. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28626. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28627. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28628. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28629. };
  28630. t.exports = {
  28631. mapFaceToCubemapFace: o,
  28632. getCubemapUrls: function(i, n, r) {
  28633. return a.map(function(e, t) {
  28634. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28635. }
  28636. .bind(this))
  28637. }
  28638. }
  28639. }
  28640. , {
  28641. "../enum/GLCubeFaces": 25
  28642. }],
  28643. 192: [function(e, t, i) {
  28644. "use strict";
  28645. t.exports = {
  28646. captureErrors: function(e, t, i) {
  28647. if ("Raven"in window) {
  28648. Raven.config(e, t).install(),
  28649. i && Raven.setTagsContext(i);
  28650. var n = console.warn
  28651. , r = console.error;
  28652. console.warn = function() {
  28653. var e = Array.prototype.slice.call(arguments);
  28654. Raven.captureMessage(e.join(" "), {
  28655. level: "warning"
  28656. }),
  28657. n.apply(console, e)
  28658. }
  28659. ,
  28660. console.error = function() {
  28661. var e = Array.prototype.slice.call(arguments);
  28662. Raven.captureException(new Error(e.join(" ")), {
  28663. level: "error"
  28664. }),
  28665. r.apply(console, e)
  28666. }
  28667. } else
  28668. console.error("Raven not found, not capturing errors.")
  28669. }
  28670. }
  28671. }
  28672. , {}],
  28673. 193: [function(c, h, e) {
  28674. (function(e) {
  28675. "use strict";
  28676. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28677. getAuthorizationHeader: function() {
  28678. var e = n.valueFromHash("auth");
  28679. if (e)
  28680. return e.replace(",", " ");
  28681. var t = n.valueFromCookie("token");
  28682. return t ? "Token " + t : null
  28683. },
  28684. parseSidUrl: function(e) {
  28685. var t, i;
  28686. if (t = g_Prefix,
  28687. (e = e || "").match(/^https?/)) {
  28688. o.parse(e);
  28689. t = g_Prefix,
  28690. i = e
  28691. } else
  28692. i = (t = g_Prefix) + "data/" + e;
  28693. return {
  28694. urlBase: t,
  28695. urlModel: i,
  28696. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28697. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28698. }
  28699. },
  28700. getModelIDFromQueryString: function() {
  28701. return n.valueFromHash("model") || n.valueFromHash("m")
  28702. },
  28703. /* normalizeModeldata: function(e, i) {
  28704. e = JSON.parse(JSON.stringify(e));
  28705. var n = null;
  28706. if (e.images.forEach(function(t) {
  28707. if (t.metadata) {
  28708. if ("string" == typeof t.metadata)
  28709. try {
  28710. t.metadata = JSON.parse(t.metadata)
  28711. } catch (e) {
  28712. s.warn("Unable to parse image metadata"),
  28713. t.metadata = null
  28714. }
  28715. else
  28716. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  28717. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  28718. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  28719. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  28720. t.metadata.zoom = t.metadata.zoom || 1),
  28721. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  28722. }
  28723. }),
  28724. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  28725. var t = {};
  28726. t.pano = {
  28727. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  28728. position: i.convertWorkshopVector(n.scan_position),
  28729. uuid: n.scan_id
  28730. },
  28731. t.camera = {
  28732. quaternion: n.camera_quaternion,
  28733. position: n.camera_position
  28734. },
  28735. e.startPano = t
  28736. }
  28737. return e
  28738. }, */
  28739. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  28740. e = JSON.parse(JSON.stringify(e));
  28741. var i = null;
  28742. if (e.images.forEach(function(n) {
  28743. if(!n.metadata) return;
  28744. if ("string" == typeof n.metadata)
  28745. try {
  28746. n.metadata = JSON.parse(n.metadata)
  28747. } catch (e) {
  28748. s.warn("Unable to parse image metadata"),
  28749. n.metadata = null
  28750. }
  28751. else{
  28752. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  28753. }
  28754. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  28755. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  28756. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  28757. }else{
  28758. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  28759. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  28760. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  28761. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  28762. }
  28763. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  28764. }),
  28765. //icon初始视角的:
  28766. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  28767. var n = {};
  28768. n.pano = {
  28769. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  28770. position: t.convertWorkshopVector(i.scan_position),
  28771. uuid: i.scan_id
  28772. },
  28773. n.camera = {
  28774. quaternion: i.camera_quaternion,
  28775. position: i.camera_position
  28776. },
  28777. e.startPano = n
  28778. }
  28779. return e
  28780. },
  28781. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  28782. function(e) {
  28783. if (!e)
  28784. throw new Error("Vision version is required");
  28785. var t = i.exec(e);
  28786. if (null === t)
  28787. throw new Error("String is not a vision version: " + e);
  28788. return parseInt(t[1])
  28789. }
  28790. ),
  28791. modelDataPromisesTiles: function(e) {
  28792. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  28793. if (t)
  28794. try {
  28795. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  28796. } catch (e) {
  28797. s.warn("Invalid vision version: " + t)
  28798. }
  28799. return !1
  28800. }
  28801. };
  28802. h.exports = l
  28803. }
  28804. ).call(this, "/js/util/showcase.js")
  28805. }
  28806. , {
  28807. "../constants": 8,
  28808. "./browser": 182,
  28809. "./logger": 189,
  28810. three: 217,
  28811. url: 208
  28812. }],
  28813. 194: [function(e, t, i) {
  28814. "use strict";
  28815. var r = e("../util/ajax")
  28816. , o = e("three")
  28817. , a = e("../settings")
  28818. , s = {};
  28819. t.exports = {
  28820. load: function(e, t, i) {
  28821. var n = s[e];
  28822. return n ? t && setTimeout(function() {
  28823. t(n)
  28824. }, 1) : (n = new o.Texture,
  28825. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  28826. n.magFilter = o.LinearFilter,
  28827. n.generateMipmaps = !1),
  28828. n.sourceFile = e,
  28829. s[e] = n,
  28830. r.getImage(e).then(function(e) {
  28831. n.image = e,
  28832. n.needsUpdate = !0,
  28833. t && t(n)
  28834. }).fail(i)),
  28835. n
  28836. },
  28837. loadBase64: function(e, t) {
  28838. t = t || "png";
  28839. var i = new o.Texture;
  28840. return i.image = document.createElement("img"),
  28841. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  28842. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  28843. i.magFilter = o.LinearFilter,
  28844. i.generateMipmaps = !1),
  28845. i.needsUpdate = !0,
  28846. i
  28847. },
  28848. isLoaded: function(e) {
  28849. return !!s[e]
  28850. }
  28851. }
  28852. window.Texture = t.exports
  28853. }
  28854. , {
  28855. "../settings": 166,
  28856. "../util/ajax": 181,
  28857. three: 217
  28858. }],
  28859. 195: [function(e, t, i) {
  28860. "use strict";
  28861. var l = e("./easing");
  28862. t.exports = {
  28863. globalDone: null,
  28864. funcs: [],
  28865. counter: 0,
  28866. uniqueID: 0,
  28867. start: function(e, t, i, n, r, o, a) {
  28868. return n = n || 0,
  28869. this.funcs.push({
  28870. func: e,
  28871. current: -n * Math.abs(t),
  28872. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  28873. done: i,
  28874. easing: r || l.linearTween,
  28875. cycling: t < 0,
  28876. running: !0,
  28877. debug: n < 0,
  28878. name: o || "T" + this.counter,
  28879. id: void 0 === a ? this.counter : a,
  28880. paused: !1
  28881. }),
  28882. e(0, 16),
  28883. this.counter += 1,
  28884. e
  28885. },
  28886. trigger: function(e) {
  28887. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  28888. , i = e.func || function() {}
  28889. , n = void 0 === e.duration ? 0 : e.duration;
  28890. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  28891. var r = e.done || null
  28892. , o = e.easing || l.linearTween
  28893. , a = e.name || "R" + this.counter
  28894. , s = void 0 === e.id ? this.counter : e.id;
  28895. return this.start(i, n, r, t, o, a, s)
  28896. },
  28897. setTimeout: function(e, t, i) {
  28898. var n = void 0 === i ? this.counter : i;
  28899. return this.trigger({
  28900. done: e,
  28901. duration: void 0 === t ? 0 : t,
  28902. name: "O" + this.counter,
  28903. id: n
  28904. })
  28905. },
  28906. pause: function() {
  28907. this.paused = !0
  28908. },
  28909. resume: function() {
  28910. this.paused = !1
  28911. },
  28912. update: function(n) {
  28913. this.funcs.forEach(function(e) {
  28914. if (!(e.paused || (e.current += 1e3 * n,
  28915. e.current < 0)))
  28916. if (e.current >= e.duration && !e.cycling) {
  28917. var t = e.easing(1, 0, 1, 1);
  28918. e.func(t, 1e3 * n),
  28919. e.done && e.done(),
  28920. e.running = !1
  28921. } else {
  28922. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  28923. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  28924. e.running = !1)
  28925. }
  28926. });
  28927. var e = this.funcs.length;
  28928. this.funcs = this.funcs.filter(function(e) {
  28929. return e.running
  28930. });
  28931. var t = this.funcs.length;
  28932. if (0 < e && 0 === t && this.globalDone) {
  28933. var i = this.globalDone;
  28934. this.globalDone = null,
  28935. i()
  28936. }
  28937. },
  28938. adjustSpeed: function(e, t) {
  28939. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  28940. var r = i[n];
  28941. r.duration /= t,
  28942. r.current /= t
  28943. }
  28944. },
  28945. getById: function(t) {
  28946. return this.funcs.filter(function(e) {
  28947. return t === e.id
  28948. })
  28949. },
  28950. get: function(e) {
  28951. for (var t = 0; t < this.funcs.length; t += 1)
  28952. if (this.funcs[t].func === e)
  28953. return this.funcs[t];
  28954. return null
  28955. },
  28956. isRunning: function(e) {
  28957. var t = this.get(e);
  28958. return null !== t && t.running
  28959. },
  28960. countActive: function() {
  28961. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  28962. e += this.funcs[t].running;
  28963. return e
  28964. },
  28965. listActive: function() {
  28966. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  28967. this.funcs[t].running && e.push(this.funcs[t].name);
  28968. return e
  28969. },
  28970. done: function(e) {
  28971. this.globalDone = e
  28972. },
  28973. cancelById: function(e) {
  28974. var t = void 0 === e ? 0 : e;
  28975. this.funcs = this.funcs.filter(function(e) {
  28976. return e.id !== t
  28977. })
  28978. },
  28979. cancel: function(t) {
  28980. this.funcs = this.funcs.filter(function(e) {
  28981. return e.func !== t
  28982. })
  28983. },
  28984. getUniqueId: function() {
  28985. return this.uniqueID -= 1,
  28986. this.uniqueID
  28987. }
  28988. }
  28989. }
  28990. , {
  28991. "./easing": 186
  28992. }],
  28993. 196: [function(e, t, i) {
  28994. function n(e) {
  28995. if (this.set = {},
  28996. this.infContains = function() {
  28997. return !0
  28998. }
  28999. ,
  29000. "object" == typeof e)
  29001. if (e instanceof Array)
  29002. for (var t = 0; t < e.length; t++)
  29003. this.set[e[t]] = !0;
  29004. else
  29005. this.set = e;
  29006. else if ("function" == typeof e)
  29007. this.infContains = e;
  29008. else if (void 0 !== e)
  29009. throw new Error("set must be either an array or an object.")
  29010. }
  29011. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29012. return !!this.set[e]
  29013. }
  29014. ,
  29015. n.prototype.add = function(e) {
  29016. if (1 == arguments.length)
  29017. this.set[e] = !0;
  29018. else
  29019. for (var t = 0; t < arguments.length; t++)
  29020. this.set[arguments[t]] = !0
  29021. }
  29022. ,
  29023. n.prototype.addAll = function(e) {
  29024. if ("object" != typeof e && !(e instanceof Array))
  29025. throw new Error("arr must be an array.");
  29026. for (var t = 0; t < e.length; t++)
  29027. this.add(e[t])
  29028. }
  29029. ,
  29030. n.prototype.delete = n.prototype.remove = function(e) {
  29031. if (1 == arguments.length)
  29032. delete this.set[e];
  29033. else
  29034. for (var t = 0; t < arguments.length; t++)
  29035. delete this.set[arguments[t]]
  29036. }
  29037. ,
  29038. n.prototype.clear = function() {
  29039. this.set = {}
  29040. }
  29041. ,
  29042. n.prototype.size = function() {
  29043. return Object.keys(this.set).length
  29044. }
  29045. ,
  29046. n.prototype.toString = function() {
  29047. return "{" + Object.keys(this.set).toString() + "}"
  29048. }
  29049. ,
  29050. n.prototype["*values"] = n.prototype.toArray = function() {
  29051. return void 0 === this.set ? [] : Object.keys(this.set)
  29052. }
  29053. }
  29054. , {}],
  29055. 197: [function(e, t, i) {}
  29056. , {}],
  29057. 198: [function(N, e, F) {
  29058. (function(e) {
  29059. "use strict";
  29060. function i() {
  29061. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29062. }
  29063. function o(e, t) {
  29064. if (i() < t)
  29065. throw new RangeError("Invalid typed array length");
  29066. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29067. e.length = t),
  29068. e
  29069. }
  29070. function u(e, t, i) {
  29071. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29072. return new u(e,t,i);
  29073. if ("number" != typeof e)
  29074. return n(this, e, t, i);
  29075. if ("string" == typeof t)
  29076. throw new Error("If encoding is specified then the first argument must be a string");
  29077. return a(this, e)
  29078. }
  29079. function n(e, t, i, n) {
  29080. if ("number" == typeof t)
  29081. throw new TypeError('"value" argument must not be a number');
  29082. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29083. if (t.byteLength,
  29084. i < 0 || t.byteLength < i)
  29085. throw new RangeError("'offset' is out of bounds");
  29086. if (t.byteLength < i + (n || 0))
  29087. throw new RangeError("'length' is out of bounds");
  29088. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29089. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29090. e
  29091. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29092. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29093. !u.isEncoding(i))
  29094. throw new TypeError('"encoding" must be a valid string encoding');
  29095. var n = 0 | c(t, i)
  29096. , r = (e = o(e, n)).write(t, i);
  29097. return r !== n && (e = e.slice(0, r)),
  29098. e
  29099. }(e, t, i) : function(e, t) {
  29100. if (u.isBuffer(t)) {
  29101. var i = 0 | l(t.length);
  29102. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29103. e
  29104. }
  29105. if (t) {
  29106. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29107. return "number" != typeof t.length || function(e) {
  29108. return e != e
  29109. }(t.length) ? o(e, 0) : s(e, t);
  29110. if ("Buffer" === t.type && L(t.data))
  29111. return s(e, t.data)
  29112. }
  29113. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29114. }(e, t)
  29115. }
  29116. function r(e) {
  29117. if ("number" != typeof e)
  29118. throw new TypeError('"size" argument must be a number');
  29119. if (e < 0)
  29120. throw new RangeError('"size" argument must not be negative')
  29121. }
  29122. function a(e, t) {
  29123. if (r(t),
  29124. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29125. !u.TYPED_ARRAY_SUPPORT)
  29126. for (var i = 0; i < t; ++i)
  29127. e[i] = 0;
  29128. return e
  29129. }
  29130. function s(e, t) {
  29131. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29132. e = o(e, i);
  29133. for (var n = 0; n < i; n += 1)
  29134. e[n] = 255 & t[n];
  29135. return e
  29136. }
  29137. function l(e) {
  29138. if (e >= i())
  29139. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29140. return 0 | e
  29141. }
  29142. function c(e, t) {
  29143. if (u.isBuffer(e))
  29144. return e.length;
  29145. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29146. return e.byteLength;
  29147. "string" != typeof e && (e = "" + e);
  29148. var i = e.length;
  29149. if (0 === i)
  29150. return 0;
  29151. for (var n = !1; ; )
  29152. switch (t) {
  29153. case "ascii":
  29154. case "latin1":
  29155. case "binary":
  29156. return i;
  29157. case "utf8":
  29158. case "utf-8":
  29159. case void 0:
  29160. return S(e).length;
  29161. case "ucs2":
  29162. case "ucs-2":
  29163. case "utf16le":
  29164. case "utf-16le":
  29165. return 2 * i;
  29166. case "hex":
  29167. return i >>> 1;
  29168. case "base64":
  29169. return M(e).length;
  29170. default:
  29171. if (n)
  29172. return S(e).length;
  29173. t = ("" + t).toLowerCase(),
  29174. n = !0
  29175. }
  29176. }
  29177. function h(e, t, i) {
  29178. var n = e[t];
  29179. e[t] = e[i],
  29180. e[i] = n
  29181. }
  29182. function d(e, t, i, n, r) {
  29183. if (0 === e.length)
  29184. return -1;
  29185. if ("string" == typeof i ? (n = i,
  29186. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29187. i = +i,
  29188. isNaN(i) && (i = r ? 0 : e.length - 1),
  29189. i < 0 && (i = e.length + i),
  29190. i >= e.length) {
  29191. if (r)
  29192. return -1;
  29193. i = e.length - 1
  29194. } else if (i < 0) {
  29195. if (!r)
  29196. return -1;
  29197. i = 0
  29198. }
  29199. if ("string" == typeof t && (t = u.from(t, n)),
  29200. u.isBuffer(t))
  29201. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29202. if ("number" == typeof t)
  29203. return t &= 255,
  29204. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  29205. throw new TypeError("val must be string, number or Buffer")
  29206. }
  29207. function p(e, t, i, n, r) {
  29208. function o(e, t) {
  29209. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29210. }
  29211. var a, s = 1, l = e.length, c = t.length;
  29212. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29213. if (e.length < 2 || t.length < 2)
  29214. return -1;
  29215. l /= s = 2,
  29216. c /= 2,
  29217. i /= 2
  29218. }
  29219. if (r) {
  29220. var h = -1;
  29221. for (a = i; a < l; a++)
  29222. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29223. if (-1 === h && (h = a),
  29224. a - h + 1 === c)
  29225. return h * s
  29226. } else
  29227. -1 !== h && (a -= a - h),
  29228. h = -1
  29229. } else
  29230. for (l < i + c && (i = l - c),
  29231. a = i; 0 <= a; a--) {
  29232. for (var u = !0, d = 0; d < c; d++)
  29233. if (o(e, a + d) !== o(t, d)) {
  29234. u = !1;
  29235. break
  29236. }
  29237. if (u)
  29238. return a
  29239. }
  29240. return -1
  29241. }
  29242. function g(e, t, i, n) {
  29243. i = Number(i) || 0;
  29244. var r = e.length - i;
  29245. n ? r < (n = Number(n)) && (n = r) : n = r;
  29246. var o = t.length;
  29247. if (o % 2 != 0)
  29248. throw new TypeError("Invalid hex string");
  29249. o / 2 < n && (n = o / 2);
  29250. for (var a = 0; a < n; ++a) {
  29251. var s = parseInt(t.substr(2 * a, 2), 16);
  29252. if (isNaN(s))
  29253. return a;
  29254. e[i + a] = s
  29255. }
  29256. return a
  29257. }
  29258. function m(e, t, i, n) {
  29259. return R(function(e) {
  29260. for (var t = [], i = 0; i < e.length; ++i)
  29261. t.push(255 & e.charCodeAt(i));
  29262. return t
  29263. }(t), e, i, n)
  29264. }
  29265. function f(e, t, i) {
  29266. i = Math.min(e.length, i);
  29267. for (var n = [], r = t; r < i; ) {
  29268. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29269. if (r + u <= i)
  29270. switch (u) {
  29271. case 1:
  29272. c < 128 && (h = c);
  29273. break;
  29274. case 2:
  29275. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29276. break;
  29277. case 3:
  29278. o = e[r + 1],
  29279. a = e[r + 2],
  29280. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29281. break;
  29282. case 4:
  29283. o = e[r + 1],
  29284. a = e[r + 2],
  29285. s = e[r + 3],
  29286. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  29287. }
  29288. null === h ? (h = 65533,
  29289. u = 1) : 65535 < h && (h -= 65536,
  29290. n.push(h >>> 10 & 1023 | 55296),
  29291. h = 56320 | 1023 & h),
  29292. n.push(h),
  29293. r += u
  29294. }
  29295. return function(e) {
  29296. var t = e.length;
  29297. if (t <= D)
  29298. return String.fromCharCode.apply(String, e);
  29299. for (var i = "", n = 0; n < t; )
  29300. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29301. return i
  29302. }(n)
  29303. }
  29304. function v(e, t, i) {
  29305. var n = "";
  29306. i = Math.min(e.length, i);
  29307. for (var r = t; r < i; ++r)
  29308. n += String.fromCharCode(127 & e[r]);
  29309. return n
  29310. }
  29311. function y(e, t, i) {
  29312. var n = "";
  29313. i = Math.min(e.length, i);
  29314. for (var r = t; r < i; ++r)
  29315. n += String.fromCharCode(e[r]);
  29316. return n
  29317. }
  29318. function A(e, t, i) {
  29319. var n, r = e.length;
  29320. (!t || t < 0) && (t = 0),
  29321. (!i || i < 0 || r < i) && (i = r);
  29322. for (var o = "", a = t; a < i; ++a)
  29323. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29324. return o
  29325. }
  29326. function C(e, t, i) {
  29327. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29328. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29329. return r
  29330. }
  29331. function I(e, t, i) {
  29332. if (e % 1 != 0 || e < 0)
  29333. throw new RangeError("offset is not uint");
  29334. if (i < e + t)
  29335. throw new RangeError("Trying to access beyond buffer length")
  29336. }
  29337. function E(e, t, i, n, r, o) {
  29338. if (!u.isBuffer(e))
  29339. throw new TypeError('"buffer" argument must be a Buffer instance');
  29340. if (r < t || t < o)
  29341. throw new RangeError('"value" argument is out of bounds');
  29342. if (i + n > e.length)
  29343. throw new RangeError("Index out of range")
  29344. }
  29345. function _(e, t, i, n) {
  29346. t < 0 && (t = 65535 + t + 1);
  29347. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29348. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29349. }
  29350. function b(e, t, i, n) {
  29351. t < 0 && (t = 4294967295 + t + 1);
  29352. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29353. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29354. }
  29355. function w(e, t, i, n) {
  29356. if (i + n > e.length)
  29357. throw new RangeError("Index out of range");
  29358. if (i < 0)
  29359. throw new RangeError("Index out of range")
  29360. }
  29361. function T(e, t, i, n, r) {
  29362. return r || w(e, 0, i, 4),
  29363. O.write(e, t, i, n, 23, 4),
  29364. i + 4
  29365. }
  29366. function x(e, t, i, n, r) {
  29367. return r || w(e, 0, i, 8),
  29368. O.write(e, t, i, n, 52, 8),
  29369. i + 8
  29370. }
  29371. function S(e, t) {
  29372. t = t || 1 / 0;
  29373. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29374. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29375. if (!r) {
  29376. if (56319 < i) {
  29377. -1 < (t -= 3) && o.push(239, 191, 189);
  29378. continue
  29379. }
  29380. if (a + 1 === n) {
  29381. -1 < (t -= 3) && o.push(239, 191, 189);
  29382. continue
  29383. }
  29384. r = i;
  29385. continue
  29386. }
  29387. if (i < 56320) {
  29388. -1 < (t -= 3) && o.push(239, 191, 189),
  29389. r = i;
  29390. continue
  29391. }
  29392. i = 65536 + (r - 55296 << 10 | i - 56320)
  29393. } else
  29394. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29395. if (r = null,
  29396. i < 128) {
  29397. if ((t -= 1) < 0)
  29398. break;
  29399. o.push(i)
  29400. } else if (i < 2048) {
  29401. if ((t -= 2) < 0)
  29402. break;
  29403. o.push(i >> 6 | 192, 63 & i | 128)
  29404. } else if (i < 65536) {
  29405. if ((t -= 3) < 0)
  29406. break;
  29407. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29408. } else {
  29409. if (!(i < 1114112))
  29410. throw new Error("Invalid code point");
  29411. if ((t -= 4) < 0)
  29412. break;
  29413. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29414. }
  29415. }
  29416. return o
  29417. }
  29418. function M(e) {
  29419. return P.toByteArray(function(e) {
  29420. if ((e = function(e) {
  29421. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29422. }(e).replace(t, "")).length < 2)
  29423. return "";
  29424. for (; e.length % 4 != 0; )
  29425. e += "=";
  29426. return e
  29427. }(e))
  29428. }
  29429. function R(e, t, i, n) {
  29430. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29431. t[r + i] = e[r];
  29432. return r
  29433. }
  29434. var P = N("base64-js")
  29435. , O = N("ieee754")
  29436. , L = N("isarray");
  29437. F.Buffer = u,
  29438. F.SlowBuffer = function(e) {
  29439. return +e != e && (e = 0),
  29440. u.alloc(+e)
  29441. }
  29442. ,
  29443. F.INSPECT_MAX_BYTES = 50,
  29444. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29445. try {
  29446. var e = new Uint8Array(1);
  29447. return e.__proto__ = {
  29448. __proto__: Uint8Array.prototype,
  29449. foo: function() {
  29450. return 42
  29451. }
  29452. },
  29453. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29454. } catch (e) {
  29455. return !1
  29456. }
  29457. }(),
  29458. F.kMaxLength = i(),
  29459. u.poolSize = 8192,
  29460. u._augment = function(e) {
  29461. return e.__proto__ = u.prototype,
  29462. e
  29463. }
  29464. ,
  29465. u.from = function(e, t, i) {
  29466. return n(null, e, t, i)
  29467. }
  29468. ,
  29469. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29470. u.__proto__ = Uint8Array,
  29471. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29472. value: null,
  29473. configurable: !0
  29474. })),
  29475. u.alloc = function(e, t, i) {
  29476. return function(e, t, i, n) {
  29477. return r(t),
  29478. t <= 0 ? o(e, t) : void 0 !== i ? "string" == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i) : o(e, t)
  29479. }(null, e, t, i)
  29480. }
  29481. ,
  29482. u.allocUnsafe = function(e) {
  29483. return a(null, e)
  29484. }
  29485. ,
  29486. u.allocUnsafeSlow = function(e) {
  29487. return a(null, e)
  29488. }
  29489. ,
  29490. u.isBuffer = function(e) {
  29491. return !(null == e || !e._isBuffer)
  29492. }
  29493. ,
  29494. u.compare = function(e, t) {
  29495. if (!u.isBuffer(e) || !u.isBuffer(t))
  29496. throw new TypeError("Arguments must be Buffers");
  29497. if (e === t)
  29498. return 0;
  29499. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29500. if (e[r] !== t[r]) {
  29501. i = e[r],
  29502. n = t[r];
  29503. break
  29504. }
  29505. return i < n ? -1 : n < i ? 1 : 0
  29506. }
  29507. ,
  29508. u.isEncoding = function(e) {
  29509. switch (String(e).toLowerCase()) {
  29510. case "hex":
  29511. case "utf8":
  29512. case "utf-8":
  29513. case "ascii":
  29514. case "latin1":
  29515. case "binary":
  29516. case "base64":
  29517. case "ucs2":
  29518. case "ucs-2":
  29519. case "utf16le":
  29520. case "utf-16le":
  29521. return !0;
  29522. default:
  29523. return !1
  29524. }
  29525. }
  29526. ,
  29527. u.concat = function(e, t) {
  29528. if (!L(e))
  29529. throw new TypeError('"list" argument must be an Array of Buffers');
  29530. if (0 === e.length)
  29531. return u.alloc(0);
  29532. var i;
  29533. if (void 0 === t)
  29534. for (i = t = 0; i < e.length; ++i)
  29535. t += e[i].length;
  29536. var n = u.allocUnsafe(t)
  29537. , r = 0;
  29538. for (i = 0; i < e.length; ++i) {
  29539. var o = e[i];
  29540. if (!u.isBuffer(o))
  29541. throw new TypeError('"list" argument must be an Array of Buffers');
  29542. o.copy(n, r),
  29543. r += o.length
  29544. }
  29545. return n
  29546. }
  29547. ,
  29548. u.byteLength = c,
  29549. u.prototype._isBuffer = !0,
  29550. u.prototype.swap16 = function() {
  29551. var e = this.length;
  29552. if (e % 2 != 0)
  29553. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29554. for (var t = 0; t < e; t += 2)
  29555. h(this, t, t + 1);
  29556. return this
  29557. }
  29558. ,
  29559. u.prototype.swap32 = function() {
  29560. var e = this.length;
  29561. if (e % 4 != 0)
  29562. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29563. for (var t = 0; t < e; t += 4)
  29564. h(this, t, t + 3),
  29565. h(this, t + 1, t + 2);
  29566. return this
  29567. }
  29568. ,
  29569. u.prototype.swap64 = function() {
  29570. var e = this.length;
  29571. if (e % 8 != 0)
  29572. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29573. for (var t = 0; t < e; t += 8)
  29574. h(this, t, t + 7),
  29575. h(this, t + 1, t + 6),
  29576. h(this, t + 2, t + 5),
  29577. h(this, t + 3, t + 4);
  29578. return this
  29579. }
  29580. ,
  29581. u.prototype.toString = function() {
  29582. var e = 0 | this.length;
  29583. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29584. var n, r, o, a = !1;
  29585. if ((void 0 === t || t < 0) && (t = 0),
  29586. t > this.length)
  29587. return "";
  29588. if ((void 0 === i || i > this.length) && (i = this.length),
  29589. i <= 0)
  29590. return "";
  29591. if ((i >>>= 0) <= (t >>>= 0))
  29592. return "";
  29593. for (e = e || "utf8"; ; )
  29594. switch (e) {
  29595. case "hex":
  29596. return A(this, t, i);
  29597. case "utf8":
  29598. case "utf-8":
  29599. return f(this, t, i);
  29600. case "ascii":
  29601. return v(this, t, i);
  29602. case "latin1":
  29603. case "binary":
  29604. return y(this, t, i);
  29605. case "base64":
  29606. return n = this,
  29607. o = i,
  29608. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29609. case "ucs2":
  29610. case "ucs-2":
  29611. case "utf16le":
  29612. case "utf-16le":
  29613. return C(this, t, i);
  29614. default:
  29615. if (a)
  29616. throw new TypeError("Unknown encoding: " + e);
  29617. e = (e + "").toLowerCase(),
  29618. a = !0
  29619. }
  29620. }
  29621. .apply(this, arguments)
  29622. }
  29623. ,
  29624. u.prototype.equals = function(e) {
  29625. if (!u.isBuffer(e))
  29626. throw new TypeError("Argument must be a Buffer");
  29627. return this === e || 0 === u.compare(this, e)
  29628. }
  29629. ,
  29630. u.prototype.inspect = function() {
  29631. var e = ""
  29632. , t = F.INSPECT_MAX_BYTES;
  29633. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29634. this.length > t && (e += " ... ")),
  29635. "<Buffer " + e + ">"
  29636. }
  29637. ,
  29638. u.prototype.compare = function(e, t, i, n, r) {
  29639. if (!u.isBuffer(e))
  29640. throw new TypeError("Argument must be a Buffer");
  29641. if (void 0 === t && (t = 0),
  29642. void 0 === i && (i = e ? e.length : 0),
  29643. void 0 === n && (n = 0),
  29644. void 0 === r && (r = this.length),
  29645. t < 0 || i > e.length || n < 0 || r > this.length)
  29646. throw new RangeError("out of range index");
  29647. if (r <= n && i <= t)
  29648. return 0;
  29649. if (r <= n)
  29650. return -1;
  29651. if (i <= t)
  29652. return 1;
  29653. if (this === e)
  29654. return 0;
  29655. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  29656. if (l[h] !== c[h]) {
  29657. o = l[h],
  29658. a = c[h];
  29659. break
  29660. }
  29661. return o < a ? -1 : a < o ? 1 : 0
  29662. }
  29663. ,
  29664. u.prototype.includes = function(e, t, i) {
  29665. return -1 !== this.indexOf(e, t, i)
  29666. }
  29667. ,
  29668. u.prototype.indexOf = function(e, t, i) {
  29669. return d(this, e, t, i, !0)
  29670. }
  29671. ,
  29672. u.prototype.lastIndexOf = function(e, t, i) {
  29673. return d(this, e, t, i, !1)
  29674. }
  29675. ,
  29676. u.prototype.write = function(e, t, i, n) {
  29677. if (void 0 === t)
  29678. n = "utf8",
  29679. i = this.length,
  29680. t = 0;
  29681. else if (void 0 === i && "string" == typeof t)
  29682. n = t,
  29683. i = this.length,
  29684. t = 0;
  29685. else {
  29686. if (!isFinite(t))
  29687. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29688. t |= 0,
  29689. isFinite(i) ? (i |= 0,
  29690. void 0 === n && (n = "utf8")) : (n = i,
  29691. i = void 0)
  29692. }
  29693. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  29694. if ((void 0 === i || p < i) && (i = p),
  29695. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  29696. throw new RangeError("Attempt to write outside buffer bounds");
  29697. n = n || "utf8";
  29698. for (var f = !1; ; )
  29699. switch (n) {
  29700. case "hex":
  29701. return g(this, e, t, i);
  29702. case "utf8":
  29703. case "utf-8":
  29704. return u = t,
  29705. d = i,
  29706. R(S(e, (h = this).length - u), h, u, d);
  29707. case "ascii":
  29708. return m(this, e, t, i);
  29709. case "latin1":
  29710. case "binary":
  29711. return m(this, e, t, i);
  29712. case "base64":
  29713. return s = this,
  29714. l = t,
  29715. c = i,
  29716. R(M(e), s, l, c);
  29717. case "ucs2":
  29718. case "ucs-2":
  29719. case "utf16le":
  29720. case "utf-16le":
  29721. return o = t,
  29722. a = i,
  29723. R(function(e, t) {
  29724. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29725. i = e.charCodeAt(a),
  29726. n = i >> 8,
  29727. r = i % 256,
  29728. o.push(r),
  29729. o.push(n);
  29730. return o
  29731. }(e, (r = this).length - o), r, o, a);
  29732. default:
  29733. if (f)
  29734. throw new TypeError("Unknown encoding: " + n);
  29735. n = ("" + n).toLowerCase(),
  29736. f = !0
  29737. }
  29738. }
  29739. ,
  29740. u.prototype.toJSON = function() {
  29741. return {
  29742. type: "Buffer",
  29743. data: Array.prototype.slice.call(this._arr || this, 0)
  29744. }
  29745. }
  29746. ;
  29747. var D = 4096;
  29748. u.prototype.slice = function(e, t) {
  29749. var i, n = this.length;
  29750. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  29751. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  29752. t < e && (t = e),
  29753. u.TYPED_ARRAY_SUPPORT)
  29754. (i = this.subarray(e, t)).__proto__ = u.prototype;
  29755. else {
  29756. var r = t - e;
  29757. i = new u(r,void 0);
  29758. for (var o = 0; o < r; ++o)
  29759. i[o] = this[o + e]
  29760. }
  29761. return i
  29762. }
  29763. ,
  29764. u.prototype.readUIntLE = function(e, t, i) {
  29765. e |= 0,
  29766. t |= 0,
  29767. i || I(e, t, this.length);
  29768. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29769. n += this[e + o] * r;
  29770. return n
  29771. }
  29772. ,
  29773. u.prototype.readUIntBE = function(e, t, i) {
  29774. e |= 0,
  29775. t |= 0,
  29776. i || I(e, t, this.length);
  29777. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  29778. n += this[e + --t] * r;
  29779. return n
  29780. }
  29781. ,
  29782. u.prototype.readUInt8 = function(e, t) {
  29783. return t || I(e, 1, this.length),
  29784. this[e]
  29785. }
  29786. ,
  29787. u.prototype.readUInt16LE = function(e, t) {
  29788. return t || I(e, 2, this.length),
  29789. this[e] | this[e + 1] << 8
  29790. }
  29791. ,
  29792. u.prototype.readUInt16BE = function(e, t) {
  29793. return t || I(e, 2, this.length),
  29794. this[e] << 8 | this[e + 1]
  29795. }
  29796. ,
  29797. u.prototype.readUInt32LE = function(e, t) {
  29798. return t || I(e, 4, this.length),
  29799. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  29800. }
  29801. ,
  29802. u.prototype.readUInt32BE = function(e, t) {
  29803. return t || I(e, 4, this.length),
  29804. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  29805. }
  29806. ,
  29807. u.prototype.readIntLE = function(e, t, i) {
  29808. e |= 0,
  29809. t |= 0,
  29810. i || I(e, t, this.length);
  29811. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29812. n += this[e + o] * r;
  29813. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  29814. n
  29815. }
  29816. ,
  29817. u.prototype.readIntBE = function(e, t, i) {
  29818. e |= 0,
  29819. t |= 0,
  29820. i || I(e, t, this.length);
  29821. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  29822. o += this[e + --n] * r;
  29823. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  29824. o
  29825. }
  29826. ,
  29827. u.prototype.readInt8 = function(e, t) {
  29828. return t || I(e, 1, this.length),
  29829. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  29830. }
  29831. ,
  29832. u.prototype.readInt16LE = function(e, t) {
  29833. t || I(e, 2, this.length);
  29834. var i = this[e] | this[e + 1] << 8;
  29835. return 32768 & i ? 4294901760 | i : i
  29836. }
  29837. ,
  29838. u.prototype.readInt16BE = function(e, t) {
  29839. t || I(e, 2, this.length);
  29840. var i = this[e + 1] | this[e] << 8;
  29841. return 32768 & i ? 4294901760 | i : i
  29842. }
  29843. ,
  29844. u.prototype.readInt32LE = function(e, t) {
  29845. return t || I(e, 4, this.length),
  29846. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  29847. }
  29848. ,
  29849. u.prototype.readInt32BE = function(e, t) {
  29850. return t || I(e, 4, this.length),
  29851. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  29852. }
  29853. ,
  29854. u.prototype.readFloatLE = function(e, t) {
  29855. return t || I(e, 4, this.length),
  29856. O.read(this, e, !0, 23, 4)
  29857. }
  29858. ,
  29859. u.prototype.readFloatBE = function(e, t) {
  29860. return t || I(e, 4, this.length),
  29861. O.read(this, e, !1, 23, 4)
  29862. }
  29863. ,
  29864. u.prototype.readDoubleLE = function(e, t) {
  29865. return t || I(e, 8, this.length),
  29866. O.read(this, e, !0, 52, 8)
  29867. }
  29868. ,
  29869. u.prototype.readDoubleBE = function(e, t) {
  29870. return t || I(e, 8, this.length),
  29871. O.read(this, e, !1, 52, 8)
  29872. }
  29873. ,
  29874. u.prototype.writeUIntLE = function(e, t, i, n) {
  29875. e = +e,
  29876. t |= 0,
  29877. i |= 0,
  29878. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  29879. var r = 1
  29880. , o = 0;
  29881. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  29882. this[t + o] = e / r & 255;
  29883. return t + i
  29884. }
  29885. ,
  29886. u.prototype.writeUIntBE = function(e, t, i, n) {
  29887. e = +e,
  29888. t |= 0,
  29889. i |= 0,
  29890. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  29891. var r = i - 1
  29892. , o = 1;
  29893. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  29894. this[t + r] = e / o & 255;
  29895. return t + i
  29896. }
  29897. ,
  29898. u.prototype.writeUInt8 = function(e, t, i) {
  29899. return e = +e,
  29900. t |= 0,
  29901. i || E(this, e, t, 1, 255, 0),
  29902. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29903. this[t] = 255 & e,
  29904. t + 1
  29905. }
  29906. ,
  29907. u.prototype.writeUInt16LE = function(e, t, i) {
  29908. return e = +e,
  29909. t |= 0,
  29910. i || E(this, e, t, 2, 65535, 0),
  29911. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29912. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  29913. t + 2
  29914. }
  29915. ,
  29916. u.prototype.writeUInt16BE = function(e, t, i) {
  29917. return e = +e,
  29918. t |= 0,
  29919. i || E(this, e, t, 2, 65535, 0),
  29920. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  29921. this[t + 1] = 255 & e) : _(this, e, t, !1),
  29922. t + 2
  29923. }
  29924. ,
  29925. u.prototype.writeUInt32LE = function(e, t, i) {
  29926. return e = +e,
  29927. t |= 0,
  29928. i || E(this, e, t, 4, 4294967295, 0),
  29929. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  29930. this[t + 2] = e >>> 16,
  29931. this[t + 1] = e >>> 8,
  29932. this[t] = 255 & e) : b(this, e, t, !0),
  29933. t + 4
  29934. }
  29935. ,
  29936. u.prototype.writeUInt32BE = function(e, t, i) {
  29937. return e = +e,
  29938. t |= 0,
  29939. i || E(this, e, t, 4, 4294967295, 0),
  29940. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  29941. this[t + 1] = e >>> 16,
  29942. this[t + 2] = e >>> 8,
  29943. this[t + 3] = 255 & e) : b(this, e, t, !1),
  29944. t + 4
  29945. }
  29946. ,
  29947. u.prototype.writeIntLE = function(e, t, i, n) {
  29948. if (e = +e,
  29949. t |= 0,
  29950. !n) {
  29951. var r = Math.pow(2, 8 * i - 1);
  29952. E(this, e, t, i, r - 1, -r)
  29953. }
  29954. var o = 0
  29955. , a = 1
  29956. , s = 0;
  29957. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  29958. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  29959. this[t + o] = (e / a >> 0) - s & 255;
  29960. return t + i
  29961. }
  29962. ,
  29963. u.prototype.writeIntBE = function(e, t, i, n) {
  29964. if (e = +e,
  29965. t |= 0,
  29966. !n) {
  29967. var r = Math.pow(2, 8 * i - 1);
  29968. E(this, e, t, i, r - 1, -r)
  29969. }
  29970. var o = i - 1
  29971. , a = 1
  29972. , s = 0;
  29973. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  29974. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  29975. this[t + o] = (e / a >> 0) - s & 255;
  29976. return t + i
  29977. }
  29978. ,
  29979. u.prototype.writeInt8 = function(e, t, i) {
  29980. return e = +e,
  29981. t |= 0,
  29982. i || E(this, e, t, 1, 127, -128),
  29983. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29984. e < 0 && (e = 255 + e + 1),
  29985. this[t] = 255 & e,
  29986. t + 1
  29987. }
  29988. ,
  29989. u.prototype.writeInt16LE = function(e, t, i) {
  29990. return e = +e,
  29991. t |= 0,
  29992. i || E(this, e, t, 2, 32767, -32768),
  29993. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29994. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  29995. t + 2
  29996. }
  29997. ,
  29998. u.prototype.writeInt16BE = function(e, t, i) {
  29999. return e = +e,
  30000. t |= 0,
  30001. i || E(this, e, t, 2, 32767, -32768),
  30002. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30003. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30004. t + 2
  30005. }
  30006. ,
  30007. u.prototype.writeInt32LE = function(e, t, i) {
  30008. return e = +e,
  30009. t |= 0,
  30010. i || E(this, e, t, 4, 2147483647, -2147483648),
  30011. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30012. this[t + 1] = e >>> 8,
  30013. this[t + 2] = e >>> 16,
  30014. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30015. t + 4
  30016. }
  30017. ,
  30018. u.prototype.writeInt32BE = function(e, t, i) {
  30019. return e = +e,
  30020. t |= 0,
  30021. i || E(this, e, t, 4, 2147483647, -2147483648),
  30022. e < 0 && (e = 4294967295 + e + 1),
  30023. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30024. this[t + 1] = e >>> 16,
  30025. this[t + 2] = e >>> 8,
  30026. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30027. t + 4
  30028. }
  30029. ,
  30030. u.prototype.writeFloatLE = function(e, t, i) {
  30031. return T(this, e, t, !0, i)
  30032. }
  30033. ,
  30034. u.prototype.writeFloatBE = function(e, t, i) {
  30035. return T(this, e, t, !1, i)
  30036. }
  30037. ,
  30038. u.prototype.writeDoubleLE = function(e, t, i) {
  30039. return x(this, e, t, !0, i)
  30040. }
  30041. ,
  30042. u.prototype.writeDoubleBE = function(e, t, i) {
  30043. return x(this, e, t, !1, i)
  30044. }
  30045. ,
  30046. u.prototype.copy = function(e, t, i, n) {
  30047. if (i = i || 0,
  30048. n || 0 === n || (n = this.length),
  30049. t >= e.length && (t = e.length),
  30050. t = t || 0,
  30051. 0 < n && n < i && (n = i),
  30052. n === i)
  30053. return 0;
  30054. if (0 === e.length || 0 === this.length)
  30055. return 0;
  30056. if (t < 0)
  30057. throw new RangeError("targetStart out of bounds");
  30058. if (i < 0 || i >= this.length)
  30059. throw new RangeError("sourceStart out of bounds");
  30060. if (n < 0)
  30061. throw new RangeError("sourceEnd out of bounds");
  30062. n > this.length && (n = this.length),
  30063. e.length - t < n - i && (n = e.length - t + i);
  30064. var r, o = n - i;
  30065. if (this === e && i < t && t < n)
  30066. for (r = o - 1; 0 <= r; --r)
  30067. e[r + t] = this[r + i];
  30068. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30069. for (r = 0; r < o; ++r)
  30070. e[r + t] = this[r + i];
  30071. else
  30072. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30073. return o
  30074. }
  30075. ,
  30076. u.prototype.fill = function(e, t, i, n) {
  30077. if ("string" == typeof e) {
  30078. if ("string" == typeof t ? (n = t,
  30079. t = 0,
  30080. i = this.length) : "string" == typeof i && (n = i,
  30081. i = this.length),
  30082. 1 === e.length) {
  30083. var r = e.charCodeAt(0);
  30084. r < 256 && (e = r)
  30085. }
  30086. if (void 0 !== n && "string" != typeof n)
  30087. throw new TypeError("encoding must be a string");
  30088. if ("string" == typeof n && !u.isEncoding(n))
  30089. throw new TypeError("Unknown encoding: " + n)
  30090. } else
  30091. "number" == typeof e && (e &= 255);
  30092. if (t < 0 || this.length < t || this.length < i)
  30093. throw new RangeError("Out of range index");
  30094. if (i <= t)
  30095. return this;
  30096. var o;
  30097. if (t >>>= 0,
  30098. i = void 0 === i ? this.length : i >>> 0,
  30099. "number" == typeof (e = e || 0))
  30100. for (o = t; o < i; ++o)
  30101. this[o] = e;
  30102. else {
  30103. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30104. , s = a.length;
  30105. for (o = 0; o < i - t; ++o)
  30106. this[o + t] = a[o % s]
  30107. }
  30108. return this
  30109. }
  30110. ;
  30111. var t = /[^+\/0-9A-Za-z-_]/g
  30112. }
  30113. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30114. }
  30115. , {
  30116. "base64-js": 199,
  30117. ieee754: 200,
  30118. isarray: 201
  30119. }],
  30120. 199: [function(e, t, i) {
  30121. "use strict";
  30122. function l(e) {
  30123. var t = e.length;
  30124. if (0 < t % 4)
  30125. throw new Error("Invalid string. Length must be a multiple of 4");
  30126. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30127. }
  30128. function c(e, t, i) {
  30129. for (var n, r = [], o = t; o < i; o += 3)
  30130. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30131. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30132. var a;
  30133. return r.join("")
  30134. }
  30135. i.byteLength = function(e) {
  30136. return 3 * e.length / 4 - l(e)
  30137. }
  30138. ,
  30139. i.toByteArray = function(e) {
  30140. var t, i, n, r, o, a = e.length;
  30141. r = l(e),
  30142. o = new d(3 * a / 4 - r),
  30143. i = 0 < r ? a - 4 : a;
  30144. var s = 0;
  30145. for (t = 0; t < i; t += 4,
  30146. 3)
  30147. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30148. o[s++] = n >> 16 & 255,
  30149. o[s++] = n >> 8 & 255,
  30150. o[s++] = 255 & n;
  30151. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30152. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30153. o[s++] = n >> 8 & 255,
  30154. o[s++] = 255 & n),
  30155. o
  30156. }
  30157. ,
  30158. i.fromByteArray = function(e) {
  30159. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30160. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30161. return 1 == n ? (t = e[i - 1],
  30162. r += h[t >> 2],
  30163. r += h[t << 4 & 63],
  30164. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30165. r += h[t >> 10],
  30166. r += h[t >> 4 & 63],
  30167. r += h[t << 2 & 63],
  30168. r += "="),
  30169. o.push(r),
  30170. o.join("")
  30171. }
  30172. ;
  30173. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30174. h[r] = n[r],
  30175. u[n.charCodeAt(r)] = r;
  30176. u["-".charCodeAt(0)] = 62,
  30177. u["_".charCodeAt(0)] = 63
  30178. }
  30179. , {}],
  30180. 200: [function(e, t, i) {
  30181. i.read = function(e, t, i, n, r) {
  30182. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  30183. for (u += d,
  30184. o = p & (1 << -h) - 1,
  30185. p >>= -h,
  30186. h += s; 0 < h; o = 256 * o + e[t + u],
  30187. u += d,
  30188. h -= 8)
  30189. ;
  30190. for (a = o & (1 << -h) - 1,
  30191. o >>= -h,
  30192. h += n; 0 < h; a = 256 * a + e[t + u],
  30193. u += d,
  30194. h -= 8)
  30195. ;
  30196. if (0 === o)
  30197. o = 1 - c;
  30198. else {
  30199. if (o === l)
  30200. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30201. a += Math.pow(2, n),
  30202. o -= c
  30203. }
  30204. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30205. }
  30206. ,
  30207. i.write = function(e, t, i, n, r, o) {
  30208. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  30209. for (t = Math.abs(t),
  30210. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30211. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30212. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30213. l *= 2),
  30214. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30215. l /= 2),
  30216. h <= a + u ? (s = 0,
  30217. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30218. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30219. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30220. p += f,
  30221. s /= 256,
  30222. r -= 8)
  30223. ;
  30224. for (a = a << r | s,
  30225. c += r; 0 < c; e[i + p] = 255 & a,
  30226. p += f,
  30227. a /= 256,
  30228. c -= 8)
  30229. ;
  30230. e[i + p - f] |= 128 * g
  30231. }
  30232. }
  30233. , {}],
  30234. 201: [function(e, t, i) {
  30235. var n = {}.toString;
  30236. t.exports = Array.isArray || function(e) {
  30237. return "[object Array]" == n.call(e)
  30238. }
  30239. }
  30240. , {}],
  30241. 202: [function(e, t, i) {
  30242. function n() {
  30243. this._events = this._events || {},
  30244. this._maxListeners = this._maxListeners || void 0
  30245. }
  30246. function l(e) {
  30247. return "function" == typeof e
  30248. }
  30249. function c(e) {
  30250. return "object" == typeof e && null !== e
  30251. }
  30252. function h(e) {
  30253. return void 0 === e
  30254. }
  30255. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30256. n.prototype._maxListeners = void 0,
  30257. n.defaultMaxListeners = 10,
  30258. n.prototype.setMaxListeners = function(e) {
  30259. if (!function(e) {
  30260. return "number" == typeof e
  30261. }(e) || e < 0 || isNaN(e))
  30262. throw TypeError("n must be a positive number");
  30263. return this._maxListeners = e,
  30264. this
  30265. }
  30266. ,
  30267. n.prototype.emit = function(e) {
  30268. var t, i, n, r, o, a;
  30269. if (this._events || (this._events = {}),
  30270. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30271. if ((t = arguments[1])instanceof Error)
  30272. throw t;
  30273. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30274. throw s.context = t,
  30275. s
  30276. }
  30277. if (h(i = this._events[e]))
  30278. return !1;
  30279. if (l(i))
  30280. switch (arguments.length) {
  30281. case 1:
  30282. i.call(this);
  30283. break;
  30284. case 2:
  30285. i.call(this, arguments[1]);
  30286. break;
  30287. case 3:
  30288. i.call(this, arguments[1], arguments[2]);
  30289. break;
  30290. default:
  30291. r = Array.prototype.slice.call(arguments, 1),
  30292. i.apply(this, r)
  30293. }
  30294. else if (c(i))
  30295. for (r = Array.prototype.slice.call(arguments, 1),
  30296. n = (a = i.slice()).length,
  30297. o = 0; o < n; o++)
  30298. a[o].apply(this, r);
  30299. return !0
  30300. }
  30301. ,
  30302. n.prototype.on = n.prototype.addListener = function(e, t) {
  30303. var i;
  30304. if (!l(t))
  30305. throw TypeError("listener must be a function");
  30306. return this._events || (this._events = {}),
  30307. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30308. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30309. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  30310. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30311. "function" == typeof console.trace && console.trace())),
  30312. this
  30313. }
  30314. ,
  30315. n.prototype.once = function(e, t) {
  30316. function i() {
  30317. this.removeListener(e, i),
  30318. n || (n = !0,
  30319. t.apply(this, arguments))
  30320. }
  30321. if (!l(t))
  30322. throw TypeError("listener must be a function");
  30323. var n = !1;
  30324. return i.listener = t,
  30325. this.on(e, i),
  30326. this
  30327. }
  30328. ,
  30329. n.prototype.removeListener = function(e, t) {
  30330. var i, n, r, o;
  30331. if (!l(t))
  30332. throw TypeError("listener must be a function");
  30333. if (!this._events || !this._events[e])
  30334. return this;
  30335. if (r = (i = this._events[e]).length,
  30336. n = -1,
  30337. i === t || l(i.listener) && i.listener === t)
  30338. delete this._events[e],
  30339. this._events.removeListener && this.emit("removeListener", e, t);
  30340. else if (c(i)) {
  30341. for (o = r; 0 < o--; )
  30342. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30343. n = o;
  30344. break
  30345. }
  30346. if (n < 0)
  30347. return this;
  30348. 1 === i.length ? (i.length = 0,
  30349. delete this._events[e]) : i.splice(n, 1),
  30350. this._events.removeListener && this.emit("removeListener", e, t)
  30351. }
  30352. return this
  30353. }
  30354. ,
  30355. n.prototype.removeAllListeners = function(e) {
  30356. var t, i;
  30357. if (!this._events)
  30358. return this;
  30359. if (!this._events.removeListener)
  30360. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30361. this;
  30362. if (0 === arguments.length) {
  30363. for (t in this._events)
  30364. "removeListener" !== t && this.removeAllListeners(t);
  30365. return this.removeAllListeners("removeListener"),
  30366. this._events = {},
  30367. this
  30368. }
  30369. if (l(i = this._events[e]))
  30370. this.removeListener(e, i);
  30371. else if (i)
  30372. for (; i.length; )
  30373. this.removeListener(e, i[i.length - 1]);
  30374. return delete this._events[e],
  30375. this
  30376. }
  30377. ,
  30378. n.prototype.listeners = function(e) {
  30379. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30380. }
  30381. ,
  30382. n.prototype.listenerCount = function(e) {
  30383. if (this._events) {
  30384. var t = this._events[e];
  30385. if (l(t))
  30386. return 1;
  30387. if (t)
  30388. return t.length
  30389. }
  30390. return 0
  30391. }
  30392. ,
  30393. n.listenerCount = function(e, t) {
  30394. return e.listenerCount(t)
  30395. }
  30396. }
  30397. , {}],
  30398. 203: [function(e, t, i) {
  30399. function n() {
  30400. throw new Error("setTimeout has not been defined")
  30401. }
  30402. function r() {
  30403. throw new Error("clearTimeout has not been defined")
  30404. }
  30405. function o(t) {
  30406. if (h === setTimeout)
  30407. return setTimeout(t, 0);
  30408. if ((h === n || !h) && setTimeout)
  30409. return h = setTimeout,
  30410. setTimeout(t, 0);
  30411. try {
  30412. return h(t, 0)
  30413. } catch (e) {
  30414. try {
  30415. return h.call(null, t, 0)
  30416. } catch (e) {
  30417. return h.call(this, t, 0)
  30418. }
  30419. }
  30420. }
  30421. function a() {
  30422. g && p && (g = !1,
  30423. p.length ? f = p.concat(f) : m = -1,
  30424. f.length && s())
  30425. }
  30426. function s() {
  30427. if (!g) {
  30428. var e = o(a);
  30429. g = !0;
  30430. for (var t = f.length; t; ) {
  30431. for (p = f,
  30432. f = []; ++m < t; )
  30433. p && p[m].run();
  30434. m = -1,
  30435. t = f.length
  30436. }
  30437. p = null,
  30438. g = !1,
  30439. function(t) {
  30440. if (u === clearTimeout)
  30441. return clearTimeout(t);
  30442. if ((u === r || !u) && clearTimeout)
  30443. return u = clearTimeout,
  30444. clearTimeout(t);
  30445. try {
  30446. u(t)
  30447. } catch (e) {
  30448. try {
  30449. return u.call(null, t)
  30450. } catch (e) {
  30451. return u.call(this, t)
  30452. }
  30453. }
  30454. }(e)
  30455. }
  30456. }
  30457. function l(e, t) {
  30458. this.fun = e,
  30459. this.array = t
  30460. }
  30461. function c() {}
  30462. var h, u, d = t.exports = {};
  30463. !function() {
  30464. try {
  30465. h = "function" == typeof setTimeout ? setTimeout : n
  30466. } catch (e) {
  30467. h = n
  30468. }
  30469. try {
  30470. u = "function" == typeof clearTimeout ? clearTimeout : r
  30471. } catch (e) {
  30472. u = r
  30473. }
  30474. }();
  30475. var p, f = [], g = !1, m = -1;
  30476. d.nextTick = function(e) {
  30477. var t = new Array(arguments.length - 1);
  30478. if (1 < arguments.length)
  30479. for (var i = 1; i < arguments.length; i++)
  30480. t[i - 1] = arguments[i];
  30481. f.push(new l(e,t)),
  30482. 1 !== f.length || g || o(s)
  30483. }
  30484. ,
  30485. l.prototype.run = function() {
  30486. this.fun.apply(null, this.array)
  30487. }
  30488. ,
  30489. d.title = "browser",
  30490. d.browser = !0,
  30491. d.env = {},
  30492. d.argv = [],
  30493. d.version = "",
  30494. d.versions = {},
  30495. d.on = c,
  30496. d.addListener = c,
  30497. d.once = c,
  30498. d.off = c,
  30499. d.removeListener = c,
  30500. d.removeAllListeners = c,
  30501. d.emit = c,
  30502. d.binding = function(e) {
  30503. throw new Error("process.binding is not supported")
  30504. }
  30505. ,
  30506. d.cwd = function() {
  30507. return "/"
  30508. }
  30509. ,
  30510. d.chdir = function(e) {
  30511. throw new Error("process.chdir is not supported")
  30512. }
  30513. ,
  30514. d.umask = function() {
  30515. return 0
  30516. }
  30517. }
  30518. , {}],
  30519. 204: [function(e, O, L) {
  30520. (function(P) {
  30521. !function(e) {
  30522. function v(e) {
  30523. throw new RangeError(g[e])
  30524. }
  30525. function r(e, t) {
  30526. for (var i = e.length, n = []; i--; )
  30527. n[i] = t(e[i]);
  30528. return n
  30529. }
  30530. function t(e, t) {
  30531. var i = e.split("@")
  30532. , n = "";
  30533. return 1 < i.length && (n = i[0] + "@",
  30534. e = i[1]),
  30535. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30536. }
  30537. function y(e) {
  30538. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30539. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30540. r--) : n.push(t);
  30541. return n
  30542. }
  30543. function A(e) {
  30544. return r(e, function(e) {
  30545. var t = "";
  30546. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30547. e = 56320 | 1023 & e),
  30548. t + R(e)
  30549. }).join("")
  30550. }
  30551. function C(e, t) {
  30552. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30553. }
  30554. function I(e, t, i) {
  30555. var n = 0;
  30556. for (e = i ? M(e / u) : e >> 1,
  30557. e += M(e / t); m * w >> 1 < e; n += _)
  30558. e = M(e / m);
  30559. return M(n + (m + 1) * e / (e + h))
  30560. }
  30561. function i(e) {
  30562. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30563. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30564. n = 0; n < i; ++n)
  30565. 128 <= e.charCodeAt(n) && v("not-basic"),
  30566. d.push(e.charCodeAt(n));
  30567. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30568. for (o = f,
  30569. a = 1,
  30570. s = _; p <= r && v("invalid-input"),
  30571. u = e.charCodeAt(r++),
  30572. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30573. f += l * a,
  30574. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30575. a > M(E / (h = _ - c)) && v("overflow"),
  30576. a *= h;
  30577. m = I(f - o, t = d.length + 1, 0 == o),
  30578. M(f / t) > E - g && v("overflow"),
  30579. g += M(f / t),
  30580. f %= t,
  30581. d.splice(f++, 0, g)
  30582. }
  30583. return A(d)
  30584. }
  30585. function n(e) {
  30586. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30587. for (d = (e = y(e)).length,
  30588. t = x,
  30589. o = T,
  30590. a = i = 0; a < d; ++a)
  30591. (u = e[a]) < 128 && m.push(R(u));
  30592. for (n = r = m.length,
  30593. r && m.push(S); n < d; ) {
  30594. for (s = E,
  30595. a = 0; a < d; ++a)
  30596. t <= (u = e[a]) && u < s && (s = u);
  30597. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30598. i += (s - t) * p,
  30599. t = s,
  30600. a = 0; a < d; ++a)
  30601. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30602. u == t) {
  30603. for (l = i,
  30604. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30605. g = l - h,
  30606. f = _ - h,
  30607. m.push(R(C(h + g % f, 0))),
  30608. l = M(g / f);
  30609. m.push(R(C(l, 0))),
  30610. o = I(i, p, n == r),
  30611. i = 0,
  30612. ++n
  30613. }
  30614. ++i,
  30615. ++t
  30616. }
  30617. return m.join("")
  30618. }
  30619. var o = "object" == typeof L && L && !L.nodeType && L
  30620. , a = "object" == typeof O && O && !O.nodeType && O
  30621. , s = "object" == typeof P && P;
  30622. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30623. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  30624. overflow: "Overflow: input needs wider integers to process",
  30625. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30626. "invalid-input": "Invalid input"
  30627. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30628. if (l = {
  30629. version: "1.4.1",
  30630. ucs2: {
  30631. decode: y,
  30632. encode: A
  30633. },
  30634. decode: i,
  30635. encode: n,
  30636. toASCII: function(e) {
  30637. return t(e, function(e) {
  30638. return p.test(e) ? "xn--" + n(e) : e
  30639. })
  30640. },
  30641. toUnicode: function(e) {
  30642. return t(e, function(e) {
  30643. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30644. })
  30645. }
  30646. },
  30647. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30648. define("punycode", function() {
  30649. return l
  30650. });
  30651. else if (o && a)
  30652. if (O.exports == o)
  30653. a.exports = l;
  30654. else
  30655. for (c in l)
  30656. l.hasOwnProperty(c) && (o[c] = l[c]);
  30657. else
  30658. e.punycode = l
  30659. }(this)
  30660. }
  30661. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30662. }
  30663. , {}],
  30664. 205: [function(e, t, i) {
  30665. "use strict";
  30666. t.exports = function(e, t, i, n) {
  30667. t = t || "&",
  30668. i = i || "=";
  30669. var r = {};
  30670. if ("string" != typeof e || 0 === e.length)
  30671. return r;
  30672. var o = /\+/g;
  30673. e = e.split(t);
  30674. var a = 1e3;
  30675. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30676. var s, l, c = e.length;
  30677. 0 < a && a < c && (c = a);
  30678. for (var h = 0; h < c; ++h) {
  30679. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  30680. d = 0 <= m ? (u = g.substr(0, m),
  30681. g.substr(m + 1)) : (u = g,
  30682. ""),
  30683. p = decodeURIComponent(u),
  30684. f = decodeURIComponent(d),
  30685. s = r,
  30686. l = p,
  30687. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  30688. }
  30689. return r
  30690. }
  30691. ;
  30692. var v = Array.isArray || function(e) {
  30693. return "[object Array]" === Object.prototype.toString.call(e)
  30694. }
  30695. }
  30696. , {}],
  30697. 206: [function(e, t, i) {
  30698. "use strict";
  30699. function o(e, t) {
  30700. if (e.map)
  30701. return e.map(t);
  30702. for (var i = [], n = 0; n < e.length; n++)
  30703. i.push(t(e[n], n));
  30704. return i
  30705. }
  30706. function a(e) {
  30707. switch (typeof e) {
  30708. case "string":
  30709. return e;
  30710. case "boolean":
  30711. return e ? "true" : "false";
  30712. case "number":
  30713. return isFinite(e) ? e : "";
  30714. default:
  30715. return ""
  30716. }
  30717. }
  30718. t.exports = function(i, n, r, e) {
  30719. return n = n || "&",
  30720. r = r || "=",
  30721. null === i && (i = void 0),
  30722. "object" == typeof i ? o(l(i), function(e) {
  30723. var t = encodeURIComponent(a(e)) + r;
  30724. return s(i[e]) ? o(i[e], function(e) {
  30725. return t + encodeURIComponent(a(e))
  30726. }).join(n) : t + encodeURIComponent(a(i[e]))
  30727. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  30728. }
  30729. ;
  30730. var s = Array.isArray || function(e) {
  30731. return "[object Array]" === Object.prototype.toString.call(e)
  30732. }
  30733. , l = Object.keys || function(e) {
  30734. var t = [];
  30735. for (var i in e)
  30736. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  30737. return t
  30738. }
  30739. }
  30740. , {}],
  30741. 207: [function(e, t, i) {
  30742. "use strict";
  30743. i.decode = i.parse = e("./decode"),
  30744. i.encode = i.stringify = e("./encode")
  30745. }
  30746. , {
  30747. "./decode": 205,
  30748. "./encode": 206
  30749. }],
  30750. 208: [function(e, t, i) {
  30751. "use strict";
  30752. function x() {
  30753. this.protocol = null,
  30754. this.slashes = null,
  30755. this.auth = null,
  30756. this.host = null,
  30757. this.port = null,
  30758. this.hostname = null,
  30759. this.hash = null,
  30760. this.search = null,
  30761. this.query = null,
  30762. this.pathname = null,
  30763. this.path = null,
  30764. this.href = null
  30765. }
  30766. function n(e, t, i) {
  30767. if (e && D.isObject(e) && e instanceof x)
  30768. return e;
  30769. var n = new x;
  30770. return n.parse(e, t, i),
  30771. n
  30772. }
  30773. var L = e("punycode")
  30774. , D = e("./util");
  30775. i.parse = n,
  30776. i.resolve = function(e, t) {
  30777. return n(e, !1, !0).resolve(t)
  30778. }
  30779. ,
  30780. i.resolveObject = function(e, t) {
  30781. return e ? n(e, !1, !0).resolveObject(t) : t
  30782. }
  30783. ,
  30784. i.format = function(e) {
  30785. return D.isString(e) && (e = n(e)),
  30786. e instanceof x ? e.format() : x.prototype.format.call(e)
  30787. }
  30788. ,
  30789. i.Url = x;
  30790. var N = /^([a-z0-9.+-]+:)/i
  30791. , r = /:[0-9]*$/
  30792. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  30793. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  30794. , B = ["'"].concat(o)
  30795. , V = ["%", "/", "?", ";", "#"].concat(B)
  30796. , k = ["/", "?", "#"]
  30797. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  30798. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  30799. , z = {
  30800. javascript: !0,
  30801. "javascript:": !0
  30802. }
  30803. , G = {
  30804. javascript: !0,
  30805. "javascript:": !0
  30806. }
  30807. , W = {
  30808. http: !0,
  30809. https: !0,
  30810. ftp: !0,
  30811. gopher: !0,
  30812. file: !0,
  30813. "http:": !0,
  30814. "https:": !0,
  30815. "ftp:": !0,
  30816. "gopher:": !0,
  30817. "file:": !0
  30818. }
  30819. , j = e("querystring");
  30820. x.prototype.parse = function(e, t, i) {
  30821. if (!D.isString(e))
  30822. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  30823. var n = e.indexOf("?")
  30824. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  30825. , o = e.split(r);
  30826. o[0] = o[0].replace(/\\/g, "/");
  30827. var a = e = o.join(r);
  30828. if (a = a.trim(),
  30829. !i && 1 === e.split("#").length) {
  30830. var s = F.exec(a);
  30831. if (s)
  30832. return this.path = a,
  30833. this.href = a,
  30834. this.pathname = s[1],
  30835. s[2] ? (this.search = s[2],
  30836. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  30837. this.query = {}),
  30838. this
  30839. }
  30840. var l = N.exec(a);
  30841. if (l) {
  30842. var c = (l = l[0]).toLowerCase();
  30843. this.protocol = c,
  30844. a = a.substr(l.length)
  30845. }
  30846. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  30847. var h = "//" === a.substr(0, 2);
  30848. !h || l && G[l] || (a = a.substr(2),
  30849. this.slashes = !0)
  30850. }
  30851. if (!G[l] && (h || l && !W[l])) {
  30852. for (var u = -1, d = 0; d < k.length; d++) {
  30853. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  30854. }
  30855. var p, f;
  30856. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  30857. a = a.slice(f + 1),
  30858. this.auth = decodeURIComponent(p)),
  30859. u = -1;
  30860. for (d = 0; d < V.length; d++) {
  30861. var g;
  30862. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  30863. }
  30864. -1 === u && (u = a.length),
  30865. this.host = a.slice(0, u),
  30866. a = a.slice(u),
  30867. this.parseHost(),
  30868. this.hostname = this.hostname || "";
  30869. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  30870. if (!m)
  30871. for (var v = this.hostname.split(/\./), y = (d = 0,
  30872. v.length); d < y; d++) {
  30873. var A = v[d];
  30874. if (A && !A.match(U)) {
  30875. for (var C = "", I = 0, E = A.length; I < E; I++)
  30876. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  30877. if (!C.match(U)) {
  30878. var _ = v.slice(0, d)
  30879. , b = v.slice(d + 1)
  30880. , w = A.match(H);
  30881. w && (_.push(w[1]),
  30882. b.unshift(w[2])),
  30883. b.length && (a = "/" + b.join(".") + a),
  30884. this.hostname = _.join(".");
  30885. break
  30886. }
  30887. }
  30888. }
  30889. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  30890. m || (this.hostname = L.toASCII(this.hostname));
  30891. var T = this.port ? ":" + this.port : ""
  30892. , x = this.hostname || "";
  30893. this.host = x + T,
  30894. this.href += this.host,
  30895. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  30896. "/" !== a[0] && (a = "/" + a))
  30897. }
  30898. if (!z[c])
  30899. for (d = 0,
  30900. y = B.length; d < y; d++) {
  30901. var S = B[d];
  30902. if (-1 !== a.indexOf(S)) {
  30903. var M = encodeURIComponent(S);
  30904. M === S && (M = escape(S)),
  30905. a = a.split(S).join(M)
  30906. }
  30907. }
  30908. var R = a.indexOf("#");
  30909. -1 !== R && (this.hash = a.substr(R),
  30910. a = a.slice(0, R));
  30911. var P = a.indexOf("?");
  30912. if (-1 !== P ? (this.search = a.substr(P),
  30913. this.query = a.substr(P + 1),
  30914. t && (this.query = j.parse(this.query)),
  30915. a = a.slice(0, P)) : t && (this.search = "",
  30916. this.query = {}),
  30917. a && (this.pathname = a),
  30918. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  30919. this.pathname || this.search) {
  30920. T = this.pathname || "";
  30921. var O = this.search || "";
  30922. this.path = T + O
  30923. }
  30924. return this.href = this.format(),
  30925. this
  30926. }
  30927. ,
  30928. x.prototype.format = function() {
  30929. var e = this.auth || "";
  30930. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  30931. e += "@");
  30932. var t = this.protocol || ""
  30933. , i = this.pathname || ""
  30934. , n = this.hash || ""
  30935. , r = !1
  30936. , o = "";
  30937. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  30938. this.port && (r += ":" + this.port)),
  30939. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  30940. var a = this.search || o && "?" + o || "";
  30941. return t && ":" !== t.substr(-1) && (t += ":"),
  30942. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  30943. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  30944. n && "#" !== n.charAt(0) && (n = "#" + n),
  30945. a && "?" !== a.charAt(0) && (a = "?" + a),
  30946. t + r + (i = i.replace(/[?#]/g, function(e) {
  30947. return encodeURIComponent(e)
  30948. })) + (a = a.replace("#", "%23")) + n
  30949. }
  30950. ,
  30951. x.prototype.resolve = function(e) {
  30952. return this.resolveObject(n(e, !1, !0)).format()
  30953. }
  30954. ,
  30955. x.prototype.resolveObject = function(e) {
  30956. if (D.isString(e)) {
  30957. var t = new x;
  30958. t.parse(e, !1, !0),
  30959. e = t
  30960. }
  30961. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  30962. var o = n[r];
  30963. i[o] = this[o]
  30964. }
  30965. if (i.hash = e.hash,
  30966. "" === e.href)
  30967. return i.href = i.format(),
  30968. i;
  30969. if (e.slashes && !e.protocol) {
  30970. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  30971. var l = a[s];
  30972. "protocol" !== l && (i[l] = e[l])
  30973. }
  30974. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  30975. i.href = i.format(),
  30976. i
  30977. }
  30978. if (e.protocol && e.protocol !== i.protocol) {
  30979. if (!W[e.protocol]) {
  30980. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  30981. var u = c[h];
  30982. i[u] = e[u]
  30983. }
  30984. return i.href = i.format(),
  30985. i
  30986. }
  30987. if (i.protocol = e.protocol,
  30988. e.host || G[e.protocol])
  30989. i.pathname = e.pathname;
  30990. else {
  30991. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  30992. ;
  30993. e.host || (e.host = ""),
  30994. e.hostname || (e.hostname = ""),
  30995. "" !== d[0] && d.unshift(""),
  30996. d.length < 2 && d.unshift(""),
  30997. i.pathname = d.join("/")
  30998. }
  30999. if (i.search = e.search,
  31000. i.query = e.query,
  31001. i.host = e.host || "",
  31002. i.auth = e.auth,
  31003. i.hostname = e.hostname || e.host,
  31004. i.port = e.port,
  31005. i.pathname || i.search) {
  31006. var p = i.pathname || ""
  31007. , f = i.search || "";
  31008. i.path = p + f
  31009. }
  31010. return i.slashes = i.slashes || e.slashes,
  31011. i.href = i.format(),
  31012. i
  31013. }
  31014. var g = i.pathname && "/" === i.pathname.charAt(0)
  31015. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31016. , v = m || g || i.host && e.pathname
  31017. , y = v
  31018. , A = i.pathname && i.pathname.split("/") || []
  31019. , C = (d = e.pathname && e.pathname.split("/") || [],
  31020. i.protocol && !W[i.protocol]);
  31021. if (C && (i.hostname = "",
  31022. i.port = null,
  31023. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31024. i.host = "",
  31025. e.protocol && (e.hostname = null,
  31026. e.port = null,
  31027. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31028. e.host = null),
  31029. v = v && ("" === d[0] || "" === A[0])),
  31030. m)
  31031. i.host = e.host || "" === e.host ? e.host : i.host,
  31032. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31033. i.search = e.search,
  31034. i.query = e.query,
  31035. A = d;
  31036. else if (d.length)
  31037. (A = A || []).pop(),
  31038. A = A.concat(d),
  31039. i.search = e.search,
  31040. i.query = e.query;
  31041. else if (!D.isNullOrUndefined(e.search)) {
  31042. if (C)
  31043. i.hostname = i.host = A.shift(),
  31044. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31045. i.host = i.hostname = w.shift());
  31046. return i.search = e.search,
  31047. i.query = e.query,
  31048. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31049. i.href = i.format(),
  31050. i
  31051. }
  31052. if (!A.length)
  31053. return i.pathname = null,
  31054. i.search ? i.path = "/" + i.search : i.path = null,
  31055. i.href = i.format(),
  31056. i;
  31057. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31058. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31059. _++) : _ && (A.splice(b, 1),
  31060. _--);
  31061. if (!v && !y)
  31062. for (; _--; )
  31063. A.unshift("..");
  31064. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31065. E && "/" !== A.join("/").substr(-1) && A.push("");
  31066. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31067. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31068. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31069. i.host = i.hostname = w.shift()));
  31070. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31071. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31072. i.path = null),
  31073. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31074. i.auth = e.auth || i.auth,
  31075. i.slashes = i.slashes || e.slashes,
  31076. i.href = i.format(),
  31077. i
  31078. }
  31079. ,
  31080. x.prototype.parseHost = function() {
  31081. var e = this.host
  31082. , t = r.exec(e);
  31083. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31084. e = e.substr(0, e.length - t.length)),
  31085. e && (this.hostname = e)
  31086. }
  31087. }
  31088. , {
  31089. "./util": 209,
  31090. punycode: 204,
  31091. querystring: 207
  31092. }],
  31093. 209: [function(e, t, i) {
  31094. "use strict";
  31095. t.exports = {
  31096. isString: function(e) {
  31097. return "string" == typeof e
  31098. },
  31099. isObject: function(e) {
  31100. return "object" == typeof e && null !== e
  31101. },
  31102. isNull: function(e) {
  31103. return null === e
  31104. },
  31105. isNullOrUndefined: function(e) {
  31106. return null == e
  31107. }
  31108. }
  31109. }
  31110. , {}],
  31111. 210: [function(e, t, i) {
  31112. "use strict";
  31113. function r(e) {
  31114. return c + e
  31115. }
  31116. function s(e) {
  31117. if ("string" != typeof e)
  31118. throw new TypeError("key must be a string.")
  31119. }
  31120. var l = Object.prototype.hasOwnProperty
  31121. , c = "~";
  31122. t.exports = function(t) {
  31123. var o = Object.create(null)
  31124. , n = 0
  31125. , a = {};
  31126. return function(e, t) {
  31127. for (var i in t)
  31128. Object.defineProperty(e, i, {
  31129. value: t[i],
  31130. configurable: !0,
  31131. writable: !0
  31132. })
  31133. }(a, {
  31134. get: function(e, t) {
  31135. s(e);
  31136. var i = r(e);
  31137. return i in o ? o[i] : t
  31138. },
  31139. set: function(e, t) {
  31140. s(e);
  31141. var i = r(e);
  31142. return i in o || ++n,
  31143. o[i] = t
  31144. },
  31145. has: function(e) {
  31146. return s(e),
  31147. r(e)in o
  31148. },
  31149. delete: function(e) {
  31150. s(e);
  31151. var t = r(e);
  31152. return t in o && (--n,
  31153. delete o[t],
  31154. !0)
  31155. },
  31156. clear: function() {
  31157. o = Object.create(null),
  31158. n = 0
  31159. },
  31160. forEach: function(e, t) {
  31161. if ("function" != typeof e)
  31162. throw new TypeError("`callback` must be a function");
  31163. for (var i in o)
  31164. if (l.call(o, i)) {
  31165. var n = i.substring(c.length)
  31166. , r = o[i];
  31167. e.call(t, r, n, a)
  31168. }
  31169. }
  31170. }),
  31171. Object.defineProperty(a, "size", {
  31172. get: function() {
  31173. return n
  31174. },
  31175. configurable: !0
  31176. }),
  31177. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31178. a.set(e, t[e])
  31179. }),
  31180. a
  31181. }
  31182. }
  31183. , {}],
  31184. 211: [function(e, t, i) {
  31185. t.exports = e("./lib/heap")
  31186. }
  31187. , {
  31188. "./lib/heap": 212
  31189. }],
  31190. 212: [function(e, y, A) {
  31191. (function() {
  31192. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31193. function v(e) {
  31194. this.cmp = null != e ? e : d,
  31195. this.nodes = []
  31196. }
  31197. l = Math.floor,
  31198. m = Math.min,
  31199. d = function(e, t) {
  31200. return e < t ? -1 : t < e ? 1 : 0
  31201. }
  31202. ,
  31203. g = function(e, t, i, n, r) {
  31204. var o;
  31205. if (null == i && (i = 0),
  31206. null == r && (r = d),
  31207. i < 0)
  31208. throw new Error("lo must be non-negative");
  31209. for (null == n && (n = e.length); i < n; )
  31210. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31211. return [].splice.apply(e, [i, i - i].concat(t)),
  31212. t
  31213. }
  31214. ,
  31215. t = function(e, t, i) {
  31216. return null == i && (i = d),
  31217. e.push(t),
  31218. h(e, 0, e.length - 1, i)
  31219. }
  31220. ,
  31221. f = function(e, t) {
  31222. var i, n;
  31223. return null == t && (t = d),
  31224. i = e.pop(),
  31225. e.length ? (n = e[0],
  31226. e[0] = i,
  31227. u(e, 0, t)) : n = i,
  31228. n
  31229. }
  31230. ,
  31231. i = function(e, t, i) {
  31232. var n;
  31233. return null == i && (i = d),
  31234. n = e[0],
  31235. e[0] = t,
  31236. u(e, 0, i),
  31237. n
  31238. }
  31239. ,
  31240. c = function(e, t, i) {
  31241. var n;
  31242. return null == i && (i = d),
  31243. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31244. e[0] = n[1],
  31245. u(e, 0, i)),
  31246. t
  31247. }
  31248. ,
  31249. p = function(i, e) {
  31250. var t, n, r, o, a, s;
  31251. for (null == e && (e = d),
  31252. a = [],
  31253. n = 0,
  31254. r = (o = function() {
  31255. s = [];
  31256. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31257. s.push(e);
  31258. return s
  31259. }
  31260. .apply(this).reverse()).length; n < r; n++)
  31261. t = o[n],
  31262. a.push(u(i, t, e));
  31263. return a
  31264. }
  31265. ,
  31266. o = function(e, t, i) {
  31267. var n;
  31268. if (null == i && (i = d),
  31269. -1 !== (n = e.indexOf(t)))
  31270. return h(e, 0, n, i),
  31271. u(e, n, i)
  31272. }
  31273. ,
  31274. n = function(e, t, i) {
  31275. var n, r, o, a, s;
  31276. if (null == i && (i = d),
  31277. !(r = e.slice(0, t)).length)
  31278. return r;
  31279. for (p(r, i),
  31280. o = 0,
  31281. a = (s = e.slice(t)).length; o < a; o++)
  31282. n = s[o],
  31283. c(r, n, i);
  31284. return r.sort(i).reverse()
  31285. }
  31286. ,
  31287. r = function(e, t, i) {
  31288. var n, r, o, a, s, l, c, h, u;
  31289. if (null == i && (i = d),
  31290. 10 * t <= e.length) {
  31291. if (!(o = e.slice(0, t).sort(i)).length)
  31292. return o;
  31293. for (r = o[o.length - 1],
  31294. a = 0,
  31295. l = (c = e.slice(t)).length; a < l; a++)
  31296. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31297. o.pop(),
  31298. r = o[o.length - 1]);
  31299. return o
  31300. }
  31301. for (p(e, i),
  31302. u = [],
  31303. s = 0,
  31304. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31305. u.push(f(e, i));
  31306. return u
  31307. }
  31308. ,
  31309. h = function(e, t, i, n) {
  31310. var r, o, a;
  31311. for (null == n && (n = d),
  31312. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31313. e[i] = o,
  31314. i = a;
  31315. return e[i] = r
  31316. }
  31317. ,
  31318. u = function(e, t, i) {
  31319. var n, r, o, a, s;
  31320. for (null == i && (i = d),
  31321. r = e.length,
  31322. o = e[s = t],
  31323. n = 2 * t + 1; n < r; )
  31324. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31325. e[t] = e[n],
  31326. n = 2 * (t = n) + 1;
  31327. return e[t] = o,
  31328. h(e, s, t, i)
  31329. }
  31330. ,
  31331. v.push = t,
  31332. v.pop = f,
  31333. v.replace = i,
  31334. v.pushpop = c,
  31335. v.heapify = p,
  31336. v.updateItem = o,
  31337. v.nlargest = n,
  31338. v.nsmallest = r,
  31339. v.prototype.push = function(e) {
  31340. return t(this.nodes, e, this.cmp)
  31341. }
  31342. ,
  31343. v.prototype.pop = function() {
  31344. return f(this.nodes, this.cmp)
  31345. }
  31346. ,
  31347. v.prototype.peek = function() {
  31348. return this.nodes[0]
  31349. }
  31350. ,
  31351. v.prototype.contains = function(e) {
  31352. return -1 !== this.nodes.indexOf(e)
  31353. }
  31354. ,
  31355. v.prototype.replace = function(e) {
  31356. return i(this.nodes, e, this.cmp)
  31357. }
  31358. ,
  31359. v.prototype.pushpop = function(e) {
  31360. return c(this.nodes, e, this.cmp)
  31361. }
  31362. ,
  31363. v.prototype.heapify = function() {
  31364. return p(this.nodes, this.cmp)
  31365. }
  31366. ,
  31367. v.prototype.updateItem = function(e) {
  31368. return o(this.nodes, e, this.cmp)
  31369. }
  31370. ,
  31371. v.prototype.clear = function() {
  31372. return this.nodes = []
  31373. }
  31374. ,
  31375. v.prototype.empty = function() {
  31376. return 0 === this.nodes.length
  31377. }
  31378. ,
  31379. v.prototype.size = function() {
  31380. return this.nodes.length
  31381. }
  31382. ,
  31383. v.prototype.clone = function() {
  31384. var e;
  31385. return (e = new v).nodes = this.nodes.slice(0),
  31386. e
  31387. }
  31388. ,
  31389. v.prototype.toArray = function() {
  31390. return this.nodes.slice(0)
  31391. }
  31392. ,
  31393. v.prototype.insert = v.prototype.push,
  31394. v.prototype.top = v.prototype.peek,
  31395. v.prototype.front = v.prototype.peek,
  31396. v.prototype.has = v.prototype.contains,
  31397. v.prototype.copy = v.prototype.clone,
  31398. e = v,
  31399. a = this,
  31400. s = function() {
  31401. return e
  31402. }
  31403. ,
  31404. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31405. }
  31406. ).call(this)
  31407. }
  31408. , {}],
  31409. 213: [function(e, t, i) {
  31410. function n() {}
  31411. function o(e) {
  31412. if ("object" != typeof this)
  31413. throw new TypeError("Promises must be constructed via new");
  31414. if ("function" != typeof e)
  31415. throw new TypeError("not a function");
  31416. this._state = 0,
  31417. this._handled = !1,
  31418. this._value = void 0,
  31419. this._deferreds = [],
  31420. h(e, this)
  31421. }
  31422. function r(i, n) {
  31423. for (; 3 === i._state; )
  31424. i = i._value;
  31425. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31426. void o._immediateFn(function() {
  31427. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31428. if (null !== e) {
  31429. var t;
  31430. try {
  31431. t = e(i._value)
  31432. } catch (e) {
  31433. return void s(n.promise, e)
  31434. }
  31435. a(n.promise, t)
  31436. } else
  31437. (1 === i._state ? a : s)(n.promise, i._value)
  31438. }))
  31439. }
  31440. function a(e, t) {
  31441. try {
  31442. if (t === e)
  31443. throw new TypeError("A promise cannot be resolved with itself.");
  31444. if (t && ("object" == typeof t || "function" == typeof t)) {
  31445. var i = t.then;
  31446. if (t instanceof o)
  31447. return e._state = 3,
  31448. e._value = t,
  31449. void l(e);
  31450. if ("function" == typeof i)
  31451. return void h(function(e, t) {
  31452. return function() {
  31453. e.apply(t, arguments)
  31454. }
  31455. }(i, t), e)
  31456. }
  31457. e._state = 1,
  31458. e._value = t,
  31459. l(e)
  31460. } catch (t) {
  31461. s(e, t)
  31462. }
  31463. }
  31464. function s(e, t) {
  31465. e._state = 2,
  31466. e._value = t,
  31467. l(e)
  31468. }
  31469. function l(e) {
  31470. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31471. e._handled || o._unhandledRejectionFn(e._value)
  31472. });
  31473. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31474. r(e, e._deferreds[t]);
  31475. e._deferreds = null
  31476. }
  31477. function c(e, t, i) {
  31478. this.onFulfilled = "function" == typeof e ? e : null,
  31479. this.onRejected = "function" == typeof t ? t : null,
  31480. this.promise = i
  31481. }
  31482. function h(e, t) {
  31483. var i = !1;
  31484. try {
  31485. e(function(e) {
  31486. i || (i = !0,
  31487. a(t, e))
  31488. }, function(e) {
  31489. i || (i = !0,
  31490. s(t, e))
  31491. })
  31492. } catch (e) {
  31493. if (i)
  31494. return;
  31495. i = !0,
  31496. s(t, e)
  31497. }
  31498. }
  31499. var u, d;
  31500. u = this,
  31501. d = setTimeout,
  31502. o.prototype.catch = function(e) {
  31503. return this.then(null, e)
  31504. }
  31505. ,
  31506. o.prototype.then = function(e, t) {
  31507. var i = new this.constructor(n);
  31508. return r(this, new c(e,t,i)),
  31509. i
  31510. }
  31511. ,
  31512. o.all = function(e) {
  31513. var s = Array.prototype.slice.call(e);
  31514. return new o(function(n, r) {
  31515. function o(t, e) {
  31516. try {
  31517. if (e && ("object" == typeof e || "function" == typeof e)) {
  31518. var i = e.then;
  31519. if ("function" == typeof i)
  31520. return void i.call(e, function(e) {
  31521. o(t, e)
  31522. }, r)
  31523. }
  31524. s[t] = e,
  31525. 0 == --a && n(s)
  31526. } catch (e) {
  31527. r(e)
  31528. }
  31529. }
  31530. if (0 === s.length)
  31531. return n([]);
  31532. for (var a = s.length, e = 0; e < s.length; e++)
  31533. o(e, s[e])
  31534. }
  31535. )
  31536. }
  31537. ,
  31538. o.resolve = function(t) {
  31539. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31540. e(t)
  31541. }
  31542. )
  31543. }
  31544. ,
  31545. o.reject = function(i) {
  31546. return new o(function(e, t) {
  31547. t(i)
  31548. }
  31549. )
  31550. }
  31551. ,
  31552. o.race = function(r) {
  31553. return new o(function(e, t) {
  31554. for (var i = 0, n = r.length; i < n; i++)
  31555. r[i].then(e, t)
  31556. }
  31557. )
  31558. }
  31559. ,
  31560. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31561. setImmediate(e)
  31562. }
  31563. || function(e) {
  31564. d(e, 0)
  31565. }
  31566. ,
  31567. o._unhandledRejectionFn = function(e) {
  31568. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31569. }
  31570. ,
  31571. o._setImmediateFn = function(e) {
  31572. o._immediateFn = e
  31573. }
  31574. ,
  31575. o._setUnhandledRejectionFn = function(e) {
  31576. o._unhandledRejectionFn = e
  31577. }
  31578. ,
  31579. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31580. }
  31581. , {}],
  31582. 214: [function(p, i, e) {
  31583. (function(d) {
  31584. var e, t;
  31585. e = this,
  31586. t = function(I, e) {
  31587. "use strict";
  31588. var a, t, u, i, s, n, r, o = {};
  31589. return o.ByteBuffer = I,
  31590. o.Long = I.Long || null,
  31591. o.VERSION = "5.0.1",
  31592. o.WIRE_TYPES = {},
  31593. o.WIRE_TYPES.VARINT = 0,
  31594. o.WIRE_TYPES.BITS64 = 1,
  31595. o.WIRE_TYPES.LDELIM = 2,
  31596. o.WIRE_TYPES.STARTGROUP = 3,
  31597. o.WIRE_TYPES.ENDGROUP = 4,
  31598. o.WIRE_TYPES.BITS32 = 5,
  31599. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31600. o.TYPES = {
  31601. int32: {
  31602. name: "int32",
  31603. wireType: o.WIRE_TYPES.VARINT,
  31604. defaultValue: 0
  31605. },
  31606. uint32: {
  31607. name: "uint32",
  31608. wireType: o.WIRE_TYPES.VARINT,
  31609. defaultValue: 0
  31610. },
  31611. sint32: {
  31612. name: "sint32",
  31613. wireType: o.WIRE_TYPES.VARINT,
  31614. defaultValue: 0
  31615. },
  31616. int64: {
  31617. name: "int64",
  31618. wireType: o.WIRE_TYPES.VARINT,
  31619. defaultValue: o.Long ? o.Long.ZERO : void 0
  31620. },
  31621. uint64: {
  31622. name: "uint64",
  31623. wireType: o.WIRE_TYPES.VARINT,
  31624. defaultValue: o.Long ? o.Long.UZERO : void 0
  31625. },
  31626. sint64: {
  31627. name: "sint64",
  31628. wireType: o.WIRE_TYPES.VARINT,
  31629. defaultValue: o.Long ? o.Long.ZERO : void 0
  31630. },
  31631. bool: {
  31632. name: "bool",
  31633. wireType: o.WIRE_TYPES.VARINT,
  31634. defaultValue: !1
  31635. },
  31636. double: {
  31637. name: "double",
  31638. wireType: o.WIRE_TYPES.BITS64,
  31639. defaultValue: 0
  31640. },
  31641. string: {
  31642. name: "string",
  31643. wireType: o.WIRE_TYPES.LDELIM,
  31644. defaultValue: ""
  31645. },
  31646. bytes: {
  31647. name: "bytes",
  31648. wireType: o.WIRE_TYPES.LDELIM,
  31649. defaultValue: null
  31650. },
  31651. fixed32: {
  31652. name: "fixed32",
  31653. wireType: o.WIRE_TYPES.BITS32,
  31654. defaultValue: 0
  31655. },
  31656. sfixed32: {
  31657. name: "sfixed32",
  31658. wireType: o.WIRE_TYPES.BITS32,
  31659. defaultValue: 0
  31660. },
  31661. fixed64: {
  31662. name: "fixed64",
  31663. wireType: o.WIRE_TYPES.BITS64,
  31664. defaultValue: o.Long ? o.Long.UZERO : void 0
  31665. },
  31666. sfixed64: {
  31667. name: "sfixed64",
  31668. wireType: o.WIRE_TYPES.BITS64,
  31669. defaultValue: o.Long ? o.Long.ZERO : void 0
  31670. },
  31671. float: {
  31672. name: "float",
  31673. wireType: o.WIRE_TYPES.BITS32,
  31674. defaultValue: 0
  31675. },
  31676. enum: {
  31677. name: "enum",
  31678. wireType: o.WIRE_TYPES.VARINT,
  31679. defaultValue: 0
  31680. },
  31681. message: {
  31682. name: "message",
  31683. wireType: o.WIRE_TYPES.LDELIM,
  31684. defaultValue: null
  31685. },
  31686. group: {
  31687. name: "group",
  31688. wireType: o.WIRE_TYPES.STARTGROUP,
  31689. defaultValue: null
  31690. }
  31691. },
  31692. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  31693. o.ID_MIN = 1,
  31694. o.ID_MAX = 536870911,
  31695. o.convertFieldsToCamelCase = !1,
  31696. o.populateAccessors = !0,
  31697. o.populateDefaults = !0,
  31698. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  31699. r.XHR = function() {
  31700. for (var e = [function() {
  31701. return new XMLHttpRequest
  31702. }
  31703. , function() {
  31704. return new ActiveXObject("Msxml2.XMLHTTP")
  31705. }
  31706. , function() {
  31707. return new ActiveXObject("Msxml3.XMLHTTP")
  31708. }
  31709. , function() {
  31710. return new ActiveXObject("Microsoft.XMLHTTP")
  31711. }
  31712. ], t = null, i = 0; i < e.length; i++) {
  31713. try {
  31714. t = e[i]()
  31715. } catch (e) {
  31716. continue
  31717. }
  31718. break
  31719. }
  31720. if (!t)
  31721. throw Error("XMLHttpRequest is not supported");
  31722. return t
  31723. }
  31724. ,
  31725. r.fetch = function(e, i) {
  31726. if (i && "function" != typeof i && (i = null),
  31727. r.IS_NODE) {
  31728. var t = p("fs");
  31729. if (i)
  31730. t.readFile(e, function(e, t) {
  31731. i(e ? null : "" + t)
  31732. });
  31733. else
  31734. try {
  31735. return t.readFileSync(e)
  31736. } catch (e) {
  31737. return null
  31738. }
  31739. } else {
  31740. var n = r.XHR();
  31741. if (n.open("GET", e, !!i),
  31742. n.setRequestHeader("Accept", "text/plain"),
  31743. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  31744. !i)
  31745. return n.send(null),
  31746. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  31747. if (n.onreadystatechange = function() {
  31748. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  31749. }
  31750. ,
  31751. 4 == n.readyState)
  31752. return;
  31753. n.send(null)
  31754. }
  31755. }
  31756. ,
  31757. r.toCamelCase = function(e) {
  31758. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  31759. return t.toUpperCase()
  31760. })
  31761. }
  31762. ,
  31763. r),
  31764. o.Lang = {
  31765. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  31766. RULE: /^(?:required|optional|repeated|map)$/,
  31767. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  31768. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  31769. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  31770. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  31771. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  31772. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  31773. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  31774. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  31775. NUMBER_OCT: /^0[0-7]+$/,
  31776. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  31777. BOOL: /^(?:true|false)$/i,
  31778. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31779. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31780. WHITESPACE: /\s/,
  31781. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  31782. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  31783. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  31784. },
  31785. o.DotProto = function(r, a) {
  31786. function s(e, t) {
  31787. var i = -1
  31788. , n = 1;
  31789. if ("-" == e.charAt(0) && (n = -1,
  31790. e = e.substring(1)),
  31791. a.NUMBER_DEC.test(e))
  31792. i = parseInt(e);
  31793. else if (a.NUMBER_HEX.test(e))
  31794. i = parseInt(e.substring(2), 16);
  31795. else {
  31796. if (!a.NUMBER_OCT.test(e))
  31797. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31798. i = parseInt(e.substring(1), 8)
  31799. }
  31800. if (i = n * i | 0,
  31801. !t && i < 0)
  31802. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31803. return i
  31804. }
  31805. function o(e) {
  31806. var t = 1;
  31807. if ("-" == e.charAt(0) && (t = -1,
  31808. e = e.substring(1)),
  31809. a.NUMBER_DEC.test(e))
  31810. return t * parseInt(e, 10);
  31811. if (a.NUMBER_HEX.test(e))
  31812. return t * parseInt(e.substring(2), 16);
  31813. if (a.NUMBER_OCT.test(e))
  31814. return t * parseInt(e.substring(1), 8);
  31815. if ("inf" === e)
  31816. return t * (1 / 0);
  31817. if ("nan" === e)
  31818. return NaN;
  31819. if (a.NUMBER_FLT.test(e))
  31820. return t * parseFloat(e);
  31821. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  31822. }
  31823. function n(e, t, i) {
  31824. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  31825. e[t].push(i))
  31826. }
  31827. function t(e) {
  31828. this.source = e + "",
  31829. this.index = 0,
  31830. this.line = 1,
  31831. this.stack = [],
  31832. this._stringOpen = null
  31833. }
  31834. var e = {}
  31835. , i = t.prototype;
  31836. i._readString = function() {
  31837. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  31838. e.lastIndex = this.index - 1;
  31839. var t = e.exec(this.source);
  31840. if (!t)
  31841. throw Error("unterminated string");
  31842. return this.index = e.lastIndex,
  31843. this.stack.push(this._stringOpen),
  31844. this._stringOpen = null,
  31845. t[1]
  31846. }
  31847. ,
  31848. i.next = function() {
  31849. if (0 < this.stack.length)
  31850. return this.stack.shift();
  31851. if (this.index >= this.source.length)
  31852. return null;
  31853. if (null !== this._stringOpen)
  31854. return this._readString();
  31855. var e, t, i;
  31856. do {
  31857. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  31858. if ("\n" === i && ++this.line,
  31859. ++this.index === this.source.length)
  31860. return null;
  31861. if ("/" === this.source.charAt(this.index))
  31862. if (++this.index,
  31863. "/" === this.source.charAt(this.index)) {
  31864. for (; "\n" !== this.source.charAt(++this.index); )
  31865. if (this.index == this.source.length)
  31866. return null;
  31867. ++this.index,
  31868. ++this.line,
  31869. e = !0
  31870. } else {
  31871. if ("*" !== (i = this.source.charAt(this.index)))
  31872. return "/";
  31873. do {
  31874. if ("\n" === i && ++this.line,
  31875. ++this.index === this.source.length)
  31876. return null;
  31877. t = i,
  31878. i = this.source.charAt(this.index)
  31879. } while ("*" !== t || "/" !== i);++this.index,
  31880. e = !0
  31881. }
  31882. } while (e);if (this.index === this.source.length)
  31883. return null;
  31884. var n = this.index;
  31885. if (a.DELIM.lastIndex = 0,
  31886. !a.DELIM.test(this.source.charAt(n++)))
  31887. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  31888. ++n;
  31889. var r = this.source.substring(this.index, this.index = n);
  31890. return '"' !== r && "'" !== r || (this._stringOpen = r),
  31891. r
  31892. }
  31893. ,
  31894. i.peek = function() {
  31895. if (0 === this.stack.length) {
  31896. var e = this.next();
  31897. if (null === e)
  31898. return null;
  31899. this.stack.push(e)
  31900. }
  31901. return this.stack[0]
  31902. }
  31903. ,
  31904. i.skip = function(e) {
  31905. var t = this.next();
  31906. if (t !== e)
  31907. throw Error("illegal '" + t + "', '" + e + "' expected")
  31908. }
  31909. ,
  31910. i.omit = function(e) {
  31911. return this.peek() === e && (this.next(),
  31912. !0)
  31913. }
  31914. ,
  31915. i.toString = function() {
  31916. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  31917. }
  31918. ,
  31919. e.Tokenizer = t;
  31920. function l(e) {
  31921. this.tn = new t(e),
  31922. this.proto3 = !1
  31923. }
  31924. var c = l.prototype;
  31925. return c.parse = function() {
  31926. var e, t, i = {
  31927. name: "[ROOT]",
  31928. package: null,
  31929. messages: [],
  31930. enums: [],
  31931. imports: [],
  31932. options: {},
  31933. services: []
  31934. }, n = !0;
  31935. try {
  31936. for (; e = this.tn.next(); )
  31937. switch (e) {
  31938. case "package":
  31939. if (!n || null !== i.package)
  31940. throw Error("unexpected 'package'");
  31941. if (e = this.tn.next(),
  31942. !a.TYPEREF.test(e))
  31943. throw Error("illegal package name: " + e);
  31944. this.tn.skip(";"),
  31945. i.package = e;
  31946. break;
  31947. case "import":
  31948. if (!n)
  31949. throw Error("unexpected 'import'");
  31950. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  31951. e = this._readString(),
  31952. this.tn.skip(";"),
  31953. t || i.imports.push(e);
  31954. break;
  31955. case "syntax":
  31956. if (!n)
  31957. throw Error("unexpected 'syntax'");
  31958. this.tn.skip("="),
  31959. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  31960. this.tn.skip(";");
  31961. break;
  31962. case "message":
  31963. this._parseMessage(i, null),
  31964. n = !1;
  31965. break;
  31966. case "enum":
  31967. this._parseEnum(i),
  31968. n = !1;
  31969. break;
  31970. case "option":
  31971. this._parseOption(i);
  31972. break;
  31973. case "service":
  31974. this._parseService(i);
  31975. break;
  31976. case "extend":
  31977. this._parseExtend(i);
  31978. break;
  31979. default:
  31980. throw Error("unexpected '" + e + "'")
  31981. }
  31982. } catch (e) {
  31983. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  31984. e
  31985. }
  31986. return delete i.name,
  31987. i
  31988. }
  31989. ,
  31990. l.parse = function(e) {
  31991. return new l(e).parse()
  31992. }
  31993. ,
  31994. c._readString = function() {
  31995. var e, t, i = "";
  31996. do {
  31997. if ("'" !== (t = this.tn.next()) && '"' !== t)
  31998. throw Error("illegal string delimiter: " + t);
  31999. i += this.tn.next(),
  32000. this.tn.skip(t),
  32001. e = this.tn.peek()
  32002. } while ('"' === e || '"' === e);return i
  32003. }
  32004. ,
  32005. c._readValue = function(e) {
  32006. var t = this.tn.peek();
  32007. if ('"' === t || "'" === t)
  32008. return this._readString();
  32009. if (this.tn.next(),
  32010. a.NUMBER.test(t))
  32011. return o(t);
  32012. if (a.BOOL.test(t))
  32013. return "true" === t.toLowerCase();
  32014. if (e && a.TYPEREF.test(t))
  32015. return t;
  32016. throw Error("illegal value: " + t)
  32017. }
  32018. ,
  32019. c._parseOption = function(e, t) {
  32020. var i = this.tn.next()
  32021. , n = !1;
  32022. if ("(" === i && (n = !0,
  32023. i = this.tn.next()),
  32024. !a.TYPEREF.test(i))
  32025. throw Error("illegal option name: " + i);
  32026. var r = i;
  32027. n && (this.tn.skip(")"),
  32028. r = "(" + r + ")",
  32029. i = this.tn.peek(),
  32030. a.FQTYPEREF.test(i) && (r += i,
  32031. this.tn.next())),
  32032. this.tn.skip("="),
  32033. this._parseOptionValue(e, r),
  32034. t || this.tn.skip(";")
  32035. }
  32036. ,
  32037. c._parseOptionValue = function(e, t) {
  32038. var i = this.tn.peek();
  32039. if ("{" !== i)
  32040. n(e.options, t, this._readValue(!0));
  32041. else
  32042. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32043. if (!a.NAME.test(i))
  32044. throw Error("illegal option name: " + t + "." + i);
  32045. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32046. }
  32047. }
  32048. ,
  32049. c._parseService = function(e) {
  32050. var t = this.tn.next();
  32051. if (!a.NAME.test(t))
  32052. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32053. var i = {
  32054. name: t,
  32055. rpc: {},
  32056. options: {}
  32057. };
  32058. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32059. if ("option" === t)
  32060. this._parseOption(i);
  32061. else {
  32062. if ("rpc" !== t)
  32063. throw Error("illegal service token: " + t);
  32064. this._parseServiceRPC(i)
  32065. }
  32066. this.tn.omit(";"),
  32067. e.services.push(i)
  32068. }
  32069. ,
  32070. c._parseServiceRPC = function(e) {
  32071. var t = this.tn.next();
  32072. if (!a.NAME.test(t))
  32073. throw Error("illegal rpc service method name: " + t);
  32074. var i = t
  32075. , n = {
  32076. request: null,
  32077. response: null,
  32078. request_stream: !1,
  32079. response_stream: !1,
  32080. options: {}
  32081. };
  32082. if (this.tn.skip("("),
  32083. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32084. t = this.tn.next()),
  32085. !a.TYPEREF.test(t))
  32086. throw Error("illegal rpc service request type: " + t);
  32087. if (n.request = t,
  32088. this.tn.skip(")"),
  32089. "returns" !== (t = this.tn.next()).toLowerCase())
  32090. throw Error("illegal rpc service request type delimiter: " + t);
  32091. if (this.tn.skip("("),
  32092. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32093. t = this.tn.next()),
  32094. n.response = t,
  32095. this.tn.skip(")"),
  32096. "{" === (t = this.tn.peek())) {
  32097. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32098. if ("option" !== t)
  32099. throw Error("illegal rpc service token: " + t);
  32100. this._parseOption(n)
  32101. }
  32102. this.tn.omit(";")
  32103. } else
  32104. this.tn.skip(";");
  32105. void 0 === e.rpc && (e.rpc = {}),
  32106. e.rpc[i] = n
  32107. }
  32108. ,
  32109. c._parseMessage = function(e, t) {
  32110. var i = !!t
  32111. , n = this.tn.next()
  32112. , r = {
  32113. name: "",
  32114. fields: [],
  32115. enums: [],
  32116. messages: [],
  32117. options: {},
  32118. services: [],
  32119. oneofs: {}
  32120. };
  32121. if (!a.NAME.test(n))
  32122. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32123. for (r.name = n,
  32124. i && (this.tn.skip("="),
  32125. t.id = s(this.tn.next()),
  32126. r.isGroup = !0),
  32127. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32128. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32129. if (a.RULE.test(n))
  32130. this._parseMessageField(r, n);
  32131. else if ("oneof" === n)
  32132. this._parseMessageOneOf(r);
  32133. else if ("enum" === n)
  32134. this._parseEnum(r);
  32135. else if ("message" === n)
  32136. this._parseMessage(r);
  32137. else if ("option" === n)
  32138. this._parseOption(r);
  32139. else if ("service" === n)
  32140. this._parseService(r);
  32141. else if ("extensions" === n)
  32142. r.extensions = this._parseExtensionRanges();
  32143. else if ("reserved" === n)
  32144. this._parseIgnored();
  32145. else if ("extend" === n)
  32146. this._parseExtend(r);
  32147. else {
  32148. if (!a.TYPEREF.test(n))
  32149. throw Error("illegal message token: " + n);
  32150. if (!this.proto3)
  32151. throw Error("illegal field rule: " + n);
  32152. this._parseMessageField(r, "optional", n)
  32153. }
  32154. return this.tn.omit(";"),
  32155. e.messages.push(r),
  32156. r
  32157. }
  32158. ,
  32159. c._parseIgnored = function() {
  32160. for (; ";" !== this.tn.peek(); )
  32161. this.tn.next();
  32162. this.tn.skip(";")
  32163. }
  32164. ,
  32165. c._parseMessageField = function(e, t, i) {
  32166. if (!a.RULE.test(t))
  32167. throw Error("illegal message field rule: " + t);
  32168. var n, r = {
  32169. rule: t,
  32170. type: "",
  32171. name: "",
  32172. options: {},
  32173. id: 0
  32174. };
  32175. if ("map" === t) {
  32176. if (i)
  32177. throw Error("illegal type: " + i);
  32178. if (this.tn.skip("<"),
  32179. n = this.tn.next(),
  32180. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32181. throw Error("illegal message field type: " + n);
  32182. if (r.keytype = n,
  32183. this.tn.skip(","),
  32184. n = this.tn.next(),
  32185. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32186. throw Error("illegal message field: " + n);
  32187. if (r.type = n,
  32188. this.tn.skip(">"),
  32189. n = this.tn.next(),
  32190. !a.NAME.test(n))
  32191. throw Error("illegal message field name: " + n);
  32192. r.name = n,
  32193. this.tn.skip("="),
  32194. r.id = s(this.tn.next()),
  32195. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32196. this.tn.skip(";")
  32197. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32198. var o = this._parseMessage(e, r);
  32199. if (!/^[A-Z]/.test(o.name))
  32200. throw Error("illegal group name: " + o.name);
  32201. r.type = o.name,
  32202. r.name = o.name.toLowerCase(),
  32203. this.tn.omit(";")
  32204. } else {
  32205. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32206. throw Error("illegal message field type: " + i);
  32207. if (r.type = i,
  32208. n = this.tn.next(),
  32209. !a.NAME.test(n))
  32210. throw Error("illegal message field name: " + n);
  32211. r.name = n,
  32212. this.tn.skip("="),
  32213. r.id = s(this.tn.next()),
  32214. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32215. this.tn.skip(";")
  32216. }
  32217. return e.fields.push(r),
  32218. r
  32219. }
  32220. ,
  32221. c._parseMessageOneOf = function(e) {
  32222. var t = this.tn.next();
  32223. if (!a.NAME.test(t))
  32224. throw Error("illegal oneof name: " + t);
  32225. var i, n = t, r = [];
  32226. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32227. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32228. r.push(i.id);
  32229. this.tn.omit(";"),
  32230. e.oneofs[n] = r
  32231. }
  32232. ,
  32233. c._parseFieldOptions = function(e) {
  32234. this.tn.skip("[");
  32235. for (var t = !0; "]" !== this.tn.peek(); )
  32236. t || this.tn.skip(","),
  32237. this._parseOption(e, !0),
  32238. t = !1;
  32239. this.tn.next()
  32240. }
  32241. ,
  32242. c._parseEnum = function(e) {
  32243. var t = {
  32244. name: "",
  32245. values: [],
  32246. options: {}
  32247. }
  32248. , i = this.tn.next();
  32249. if (!a.NAME.test(i))
  32250. throw Error("illegal name: " + i);
  32251. for (t.name = i,
  32252. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32253. if ("option" === i)
  32254. this._parseOption(t);
  32255. else {
  32256. if (!a.NAME.test(i))
  32257. throw Error("illegal name: " + i);
  32258. this.tn.skip("=");
  32259. var n = {
  32260. name: i,
  32261. id: s(this.tn.next(), !0)
  32262. };
  32263. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32264. options: {}
  32265. }),
  32266. this.tn.skip(";"),
  32267. t.values.push(n)
  32268. }
  32269. this.tn.omit(";"),
  32270. e.enums.push(t)
  32271. }
  32272. ,
  32273. c._parseExtensionRanges = function() {
  32274. var e, t, i, n = [];
  32275. do {
  32276. for (t = []; ; ) {
  32277. switch (e = this.tn.next()) {
  32278. case "min":
  32279. i = r.ID_MIN;
  32280. break;
  32281. case "max":
  32282. i = r.ID_MAX;
  32283. break;
  32284. default:
  32285. i = o(e)
  32286. }
  32287. if (t.push(i),
  32288. 2 === t.length)
  32289. break;
  32290. if ("to" !== this.tn.peek()) {
  32291. t.push(i);
  32292. break
  32293. }
  32294. this.tn.next()
  32295. }
  32296. n.push(t)
  32297. } while (this.tn.omit(","));return this.tn.skip(";"),
  32298. n
  32299. }
  32300. ,
  32301. c._parseExtend = function(e) {
  32302. var t = this.tn.next();
  32303. if (!a.TYPEREF.test(t))
  32304. throw Error("illegal extend reference: " + t);
  32305. var i = {
  32306. ref: t,
  32307. fields: []
  32308. };
  32309. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32310. if (a.RULE.test(t))
  32311. this._parseMessageField(i, t);
  32312. else {
  32313. if (!a.TYPEREF.test(t))
  32314. throw Error("illegal extend token: " + t);
  32315. if (!this.proto3)
  32316. throw Error("illegal field rule: " + t);
  32317. this._parseMessageField(i, "optional", t)
  32318. }
  32319. return this.tn.omit(";"),
  32320. e.messages.push(i),
  32321. i
  32322. }
  32323. ,
  32324. c.toString = function() {
  32325. return "Parser at line " + this.tn.line
  32326. }
  32327. ,
  32328. e.Parser = l,
  32329. e
  32330. }(o, o.Lang),
  32331. o.Reflect = function(g) {
  32332. function a(e, t) {
  32333. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32334. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32335. if ("string" == typeof e)
  32336. return g.Long.fromString(e, t || !1, 10);
  32337. if ("number" == typeof e)
  32338. return g.Long.fromNumber(e, t || !1);
  32339. throw Error("not convertible to Long")
  32340. }
  32341. function m(e, t) {
  32342. var i = t.readVarint32()
  32343. , n = 7 & i
  32344. , r = i >>> 3;
  32345. switch (n) {
  32346. case g.WIRE_TYPES.VARINT:
  32347. for (; 128 == (128 & (i = t.readUint8())); )
  32348. ;
  32349. break;
  32350. case g.WIRE_TYPES.BITS64:
  32351. t.offset += 8;
  32352. break;
  32353. case g.WIRE_TYPES.LDELIM:
  32354. i = t.readVarint32(),
  32355. t.offset += i;
  32356. break;
  32357. case g.WIRE_TYPES.STARTGROUP:
  32358. m(r, t);
  32359. break;
  32360. case g.WIRE_TYPES.ENDGROUP:
  32361. if (r === e)
  32362. return !1;
  32363. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32364. case g.WIRE_TYPES.BITS32:
  32365. t.offset += 4;
  32366. break;
  32367. default:
  32368. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32369. }
  32370. return !0
  32371. }
  32372. function h(e, t, i) {
  32373. this.builder = e,
  32374. this.parent = t,
  32375. this.name = i,
  32376. this.className
  32377. }
  32378. var s = {}
  32379. , e = h.prototype;
  32380. e.fqn = function() {
  32381. for (var e = this.name, t = this; null != (t = t.parent); )
  32382. e = t.name + "." + e;
  32383. return e
  32384. }
  32385. ,
  32386. e.toString = function(e) {
  32387. return (e ? this.className + " " : "") + this.fqn()
  32388. }
  32389. ,
  32390. e.build = function() {
  32391. throw Error(this.toString(!0) + " cannot be built directly")
  32392. }
  32393. ,
  32394. s.T = h;
  32395. function l(e, t, i, n, r) {
  32396. h.call(this, e, t, i),
  32397. this.className = "Namespace",
  32398. this.children = [],
  32399. this.options = n || {},
  32400. this.syntax = r || "proto2"
  32401. }
  32402. var t = l.prototype = Object.create(h.prototype);
  32403. t.getChildren = function(e) {
  32404. if (null == (e = e || null))
  32405. return this.children.slice();
  32406. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32407. this.children[i]instanceof e && t.push(this.children[i]);
  32408. return t
  32409. }
  32410. ,
  32411. t.addChild = function(e) {
  32412. var t;
  32413. if (t = this.getChild(e.name))
  32414. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32415. t.name = t.originalName;
  32416. else {
  32417. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32418. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32419. e.name = e.originalName
  32420. }
  32421. this.children.push(e)
  32422. }
  32423. ,
  32424. t.getChild = function(e) {
  32425. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32426. if (this.children[i][t] === e)
  32427. return this.children[i];
  32428. return null
  32429. }
  32430. ,
  32431. t.resolve = function(e, t) {
  32432. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32433. if ("" === n[o]) {
  32434. for (; null !== r.parent; )
  32435. r = r.parent;
  32436. o++
  32437. }
  32438. do {
  32439. do {
  32440. if (!(r instanceof s.Namespace)) {
  32441. r = null;
  32442. break
  32443. }
  32444. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32445. r = null;
  32446. break
  32447. }
  32448. r = i,
  32449. o++
  32450. } while (o < n.length);if (null != r)
  32451. break;
  32452. if (null !== this.parent)
  32453. return this.parent.resolve(e, t)
  32454. } while (null != r);return r
  32455. }
  32456. ,
  32457. t.qn = function(e) {
  32458. for (var t = [], i = e; t.unshift(i.name),
  32459. null !== (i = i.parent); )
  32460. ;
  32461. for (var n = 1; n <= t.length; n++) {
  32462. var r = t.slice(t.length - n);
  32463. if (e === this.resolve(r, e instanceof s.Namespace))
  32464. return r.join(".")
  32465. }
  32466. return e.fqn()
  32467. }
  32468. ,
  32469. t.build = function() {
  32470. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32471. (e = i[n])instanceof l && (t[e.name] = e.build());
  32472. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32473. value: this.buildOpt()
  32474. }),
  32475. t
  32476. }
  32477. ,
  32478. t.buildOpt = function() {
  32479. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32480. var r = t[i]
  32481. , o = this.options[t[i]];
  32482. e[r] = o
  32483. }
  32484. return e
  32485. }
  32486. ,
  32487. t.getOption = function(e) {
  32488. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32489. }
  32490. ,
  32491. s.Namespace = l;
  32492. function u(e, t, i, n) {
  32493. if (this.type = e,
  32494. this.resolvedType = t,
  32495. this.isMapKey = i,
  32496. this.syntax = n,
  32497. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32498. throw Error("Invalid map key type: " + e.name)
  32499. }
  32500. var i = u.prototype;
  32501. u.defaultFieldValue = function(e) {
  32502. if ("string" == typeof e && (e = g.TYPES[e]),
  32503. void 0 === e.defaultValue)
  32504. throw Error("default value for type " + e.name + " is not supported");
  32505. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32506. }
  32507. ,
  32508. i.verifyValue = function(t) {
  32509. function i(e, t) {
  32510. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32511. }
  32512. var n = this;
  32513. switch (this.type) {
  32514. case g.TYPES.int32:
  32515. case g.TYPES.sint32:
  32516. case g.TYPES.sfixed32:
  32517. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32518. 4294967295 < t ? 0 | t : t;
  32519. case g.TYPES.uint32:
  32520. case g.TYPES.fixed32:
  32521. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32522. t < 0 ? t >>> 0 : t;
  32523. case g.TYPES.int64:
  32524. case g.TYPES.sint64:
  32525. case g.TYPES.sfixed64:
  32526. if (g.Long)
  32527. try {
  32528. return a(t, !1)
  32529. } catch (e) {
  32530. i(typeof t, e.message)
  32531. }
  32532. else
  32533. i(typeof t, "requires Long.js");
  32534. case g.TYPES.uint64:
  32535. case g.TYPES.fixed64:
  32536. if (g.Long)
  32537. try {
  32538. return a(t, !0)
  32539. } catch (e) {
  32540. i(typeof t, e.message)
  32541. }
  32542. else
  32543. i(typeof t, "requires Long.js");
  32544. case g.TYPES.bool:
  32545. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32546. t;
  32547. case g.TYPES.float:
  32548. case g.TYPES.double:
  32549. return "number" != typeof t && i(typeof t, "not a number"),
  32550. t;
  32551. case g.TYPES.string:
  32552. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32553. "" + t;
  32554. case g.TYPES.bytes:
  32555. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32556. case g.TYPES.enum:
  32557. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32558. for (o = 0; o < e.length; o++) {
  32559. if (e[o].name == t)
  32560. return e[o].id;
  32561. if (e[o].id == t)
  32562. return e[o].id
  32563. }
  32564. if ("proto3" === this.syntax)
  32565. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32566. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32567. t;
  32568. i(t, "not a valid enum value");
  32569. case g.TYPES.group:
  32570. case g.TYPES.message:
  32571. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32572. t instanceof this.resolvedType.clazz)
  32573. return t;
  32574. if (t instanceof g.Builder.Message) {
  32575. var r = {};
  32576. for (var o in t)
  32577. t.hasOwnProperty(o) && (r[o] = t[o]);
  32578. t = r
  32579. }
  32580. return new this.resolvedType.clazz(t)
  32581. }
  32582. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32583. }
  32584. ,
  32585. i.calculateLength = function(e, t) {
  32586. if (null === t)
  32587. return 0;
  32588. var i;
  32589. switch (this.type) {
  32590. case g.TYPES.int32:
  32591. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32592. case g.TYPES.uint32:
  32593. return I.calculateVarint32(t);
  32594. case g.TYPES.sint32:
  32595. return I.calculateVarint32(I.zigZagEncode32(t));
  32596. case g.TYPES.fixed32:
  32597. case g.TYPES.sfixed32:
  32598. case g.TYPES.float:
  32599. return 4;
  32600. case g.TYPES.int64:
  32601. case g.TYPES.uint64:
  32602. return I.calculateVarint64(t);
  32603. case g.TYPES.sint64:
  32604. return I.calculateVarint64(I.zigZagEncode64(t));
  32605. case g.TYPES.fixed64:
  32606. case g.TYPES.sfixed64:
  32607. return 8;
  32608. case g.TYPES.bool:
  32609. return 1;
  32610. case g.TYPES.enum:
  32611. return I.calculateVarint32(t);
  32612. case g.TYPES.double:
  32613. return 8;
  32614. case g.TYPES.string:
  32615. return i = I.calculateUTF8Bytes(t),
  32616. I.calculateVarint32(i) + i;
  32617. case g.TYPES.bytes:
  32618. if (t.remaining() < 0)
  32619. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32620. return I.calculateVarint32(t.remaining()) + t.remaining();
  32621. case g.TYPES.message:
  32622. return i = this.resolvedType.calculate(t),
  32623. I.calculateVarint32(i) + i;
  32624. case g.TYPES.group:
  32625. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32626. }
  32627. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32628. }
  32629. ,
  32630. i.encodeValue = function(e, t, i) {
  32631. if (null === t)
  32632. return i;
  32633. switch (this.type) {
  32634. case g.TYPES.int32:
  32635. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32636. break;
  32637. case g.TYPES.uint32:
  32638. i.writeVarint32(t);
  32639. break;
  32640. case g.TYPES.sint32:
  32641. i.writeVarint32ZigZag(t);
  32642. break;
  32643. case g.TYPES.fixed32:
  32644. i.writeUint32(t);
  32645. break;
  32646. case g.TYPES.sfixed32:
  32647. i.writeInt32(t);
  32648. break;
  32649. case g.TYPES.int64:
  32650. case g.TYPES.uint64:
  32651. i.writeVarint64(t);
  32652. break;
  32653. case g.TYPES.sint64:
  32654. i.writeVarint64ZigZag(t);
  32655. break;
  32656. case g.TYPES.fixed64:
  32657. i.writeUint64(t);
  32658. break;
  32659. case g.TYPES.sfixed64:
  32660. i.writeInt64(t);
  32661. break;
  32662. case g.TYPES.bool:
  32663. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32664. break;
  32665. case g.TYPES.enum:
  32666. i.writeVarint32(t);
  32667. break;
  32668. case g.TYPES.float:
  32669. i.writeFloat32(t);
  32670. break;
  32671. case g.TYPES.double:
  32672. i.writeFloat64(t);
  32673. break;
  32674. case g.TYPES.string:
  32675. i.writeVString(t);
  32676. break;
  32677. case g.TYPES.bytes:
  32678. if (t.remaining() < 0)
  32679. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32680. var n = t.offset;
  32681. i.writeVarint32(t.remaining()),
  32682. i.append(t),
  32683. t.offset = n;
  32684. break;
  32685. case g.TYPES.message:
  32686. var r = (new I).LE();
  32687. this.resolvedType.encode(t, r),
  32688. i.writeVarint32(r.offset),
  32689. i.append(r.flip());
  32690. break;
  32691. case g.TYPES.group:
  32692. this.resolvedType.encode(t, i),
  32693. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  32694. break;
  32695. default:
  32696. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32697. }
  32698. return i
  32699. }
  32700. ,
  32701. i.decode = function(e, t, i) {
  32702. if (t != this.type.wireType)
  32703. throw Error("Unexpected wire type for element");
  32704. var n, r;
  32705. switch (this.type) {
  32706. case g.TYPES.int32:
  32707. return 0 | e.readVarint32();
  32708. case g.TYPES.uint32:
  32709. return e.readVarint32() >>> 0;
  32710. case g.TYPES.sint32:
  32711. return 0 | e.readVarint32ZigZag();
  32712. case g.TYPES.fixed32:
  32713. return e.readUint32() >>> 0;
  32714. case g.TYPES.sfixed32:
  32715. return 0 | e.readInt32();
  32716. case g.TYPES.int64:
  32717. return e.readVarint64();
  32718. case g.TYPES.uint64:
  32719. return e.readVarint64().toUnsigned();
  32720. case g.TYPES.sint64:
  32721. return e.readVarint64ZigZag();
  32722. case g.TYPES.fixed64:
  32723. return e.readUint64();
  32724. case g.TYPES.sfixed64:
  32725. return e.readInt64();
  32726. case g.TYPES.bool:
  32727. return !!e.readVarint32();
  32728. case g.TYPES.enum:
  32729. return e.readVarint32();
  32730. case g.TYPES.float:
  32731. return e.readFloat();
  32732. case g.TYPES.double:
  32733. return e.readDouble();
  32734. case g.TYPES.string:
  32735. return e.readVString();
  32736. case g.TYPES.bytes:
  32737. if (r = e.readVarint32(),
  32738. e.remaining() < r)
  32739. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  32740. return (n = e.clone()).limit = n.offset + r,
  32741. e.offset += r,
  32742. n;
  32743. case g.TYPES.message:
  32744. return r = e.readVarint32(),
  32745. this.resolvedType.decode(e, r);
  32746. case g.TYPES.group:
  32747. return this.resolvedType.decode(e, -1, i)
  32748. }
  32749. throw Error("[INTERNAL] Illegal decode type")
  32750. }
  32751. ,
  32752. i.valueFromString = function(e) {
  32753. if (!this.isMapKey)
  32754. throw Error("valueFromString() called on non-map-key element");
  32755. switch (this.type) {
  32756. case g.TYPES.int32:
  32757. case g.TYPES.sint32:
  32758. case g.TYPES.sfixed32:
  32759. case g.TYPES.uint32:
  32760. case g.TYPES.fixed32:
  32761. return this.verifyValue(parseInt(e));
  32762. case g.TYPES.int64:
  32763. case g.TYPES.sint64:
  32764. case g.TYPES.sfixed64:
  32765. case g.TYPES.uint64:
  32766. case g.TYPES.fixed64:
  32767. return this.verifyValue(e);
  32768. case g.TYPES.bool:
  32769. return "true" === e;
  32770. case g.TYPES.string:
  32771. return this.verifyValue(e);
  32772. case g.TYPES.bytes:
  32773. return I.fromBinary(e)
  32774. }
  32775. }
  32776. ,
  32777. i.valueToString = function(e) {
  32778. if (!this.isMapKey)
  32779. throw Error("valueToString() called on non-map-key element");
  32780. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  32781. }
  32782. ,
  32783. s.Element = u;
  32784. var d = function(e, t, i, n, r, o) {
  32785. l.call(this, e, t, i, n, o),
  32786. this.className = "Message",
  32787. this.extensions = void 0,
  32788. this.clazz = null,
  32789. this.isGroup = !!r,
  32790. this._fields = null,
  32791. this._fieldsById = null,
  32792. this._fieldsByName = null
  32793. }
  32794. , n = d.prototype = Object.create(l.prototype);
  32795. n.build = function(e) {
  32796. if (this.clazz && !e)
  32797. return this.clazz;
  32798. var t = function(u, a) {
  32799. function d(e, i, n, r) {
  32800. if (null === e || "object" != typeof e) {
  32801. if (r && r instanceof u.Reflect.Enum) {
  32802. var t = u.Reflect.Enum.getName(r.object, e);
  32803. if (null !== t)
  32804. return t
  32805. }
  32806. return e
  32807. }
  32808. if (I.isByteBuffer(e))
  32809. return i ? e.toBase64() : e.toBuffer();
  32810. if (u.Long.isLong(e))
  32811. return n ? e.toString() : u.Long.fromValue(e);
  32812. var o;
  32813. if (Array.isArray(e))
  32814. return o = [],
  32815. e.forEach(function(e, t) {
  32816. o[t] = d(e, i, n, r)
  32817. }),
  32818. o;
  32819. if (o = {},
  32820. e instanceof u.Map) {
  32821. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  32822. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  32823. return o
  32824. }
  32825. var l = e.$type
  32826. , c = void 0;
  32827. for (var h in e)
  32828. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  32829. return o
  32830. }
  32831. var s = a.getChildren(u.Reflect.Message.Field)
  32832. , l = a.getChildren(u.Reflect.Message.OneOf)
  32833. , c = function(e, t) {
  32834. u.Builder.Message.call(this);
  32835. for (var i = 0, n = l.length; i < n; ++i)
  32836. this[l[i].name] = null;
  32837. for (i = 0,
  32838. n = s.length; i < n; ++i) {
  32839. var r = s[i];
  32840. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  32841. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  32842. }
  32843. var o;
  32844. if (0 < arguments.length)
  32845. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  32846. for (i = 0,
  32847. n = arguments.length; i < n; ++i)
  32848. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  32849. else
  32850. this.$set(e)
  32851. }
  32852. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  32853. o.add = function(e, t, i) {
  32854. var n = a._fieldsByName[e];
  32855. if (!i) {
  32856. if (!n)
  32857. throw Error(this + "#" + e + " is undefined");
  32858. if (!(n instanceof u.Reflect.Message.Field))
  32859. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  32860. if (!n.repeated)
  32861. throw Error(this + "#" + e + " is not a repeated field");
  32862. t = n.verifyValue(t, !0)
  32863. }
  32864. return null === this[e] && (this[e] = []),
  32865. this[e].push(t),
  32866. this
  32867. }
  32868. ,
  32869. o.$add = o.add,
  32870. o.set = function(e, t, i) {
  32871. if (e && "object" == typeof e) {
  32872. for (var n in i = t,
  32873. e)
  32874. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  32875. return this
  32876. }
  32877. var r = a._fieldsByName[e];
  32878. if (i)
  32879. this[e] = t;
  32880. else {
  32881. if (!r)
  32882. throw Error(this + "#" + e + " is not a field: undefined");
  32883. if (!(r instanceof u.Reflect.Message.Field))
  32884. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  32885. this[r.name] = t = r.verifyValue(t)
  32886. }
  32887. if (r && r.oneof) {
  32888. var o = this[r.oneof.name];
  32889. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  32890. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  32891. }
  32892. return this
  32893. }
  32894. ,
  32895. o.$set = o.set,
  32896. o.get = function(e, t) {
  32897. if (t)
  32898. return this[e];
  32899. var i = a._fieldsByName[e];
  32900. if (!(i && i instanceof u.Reflect.Message.Field))
  32901. throw Error(this + "#" + e + " is not a field: undefined");
  32902. if (!(i instanceof u.Reflect.Message.Field))
  32903. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  32904. return this[i.name]
  32905. }
  32906. ,
  32907. o.$get = o.get;
  32908. for (var e = 0; e < s.length; e++) {
  32909. var t = s[e];
  32910. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  32911. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  32912. return e.toUpperCase().replace("_", "")
  32913. });
  32914. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  32915. function t(e, t) {
  32916. return this[i.name] = t ? e : i.verifyValue(e),
  32917. this
  32918. }
  32919. function n() {
  32920. return this[i.name]
  32921. }
  32922. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  32923. return "_" + e
  32924. });
  32925. null === a.getChild("set" + e) && (o["set" + e] = t),
  32926. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  32927. null === a.getChild("get" + e) && (o["get" + e] = n),
  32928. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  32929. }(t)
  32930. }
  32931. return o.encode = function(t, e) {
  32932. "boolean" == typeof t && (e = t,
  32933. t = void 0);
  32934. var i = !1;
  32935. t || (t = new I,
  32936. i = !0);
  32937. var n = t.littleEndian;
  32938. try {
  32939. return a.encode(this, t.LE(), e),
  32940. (i ? t.flip() : t).LE(n)
  32941. } catch (e) {
  32942. throw t.LE(n),
  32943. e
  32944. }
  32945. }
  32946. ,
  32947. c.encode = function(e, t, i) {
  32948. return new c(e).encode(t, i)
  32949. }
  32950. ,
  32951. o.calculate = function() {
  32952. return a.calculate(this)
  32953. }
  32954. ,
  32955. o.encodeDelimited = function(e, t) {
  32956. var i = !1;
  32957. e || (e = new I,
  32958. i = !0);
  32959. var n = (new I).LE();
  32960. return a.encode(this, n, t).flip(),
  32961. e.writeVarint32(n.remaining()),
  32962. e.append(n),
  32963. i ? e.flip() : e
  32964. }
  32965. ,
  32966. o.encodeAB = function() {
  32967. try {
  32968. return this.encode().toArrayBuffer()
  32969. } catch (e) {
  32970. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  32971. e
  32972. }
  32973. }
  32974. ,
  32975. o.toArrayBuffer = o.encodeAB,
  32976. o.encodeNB = function() {
  32977. try {
  32978. return this.encode().toBuffer()
  32979. } catch (e) {
  32980. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  32981. e
  32982. }
  32983. }
  32984. ,
  32985. o.toBuffer = o.encodeNB,
  32986. o.encode64 = function() {
  32987. try {
  32988. return this.encode().toBase64()
  32989. } catch (e) {
  32990. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  32991. e
  32992. }
  32993. }
  32994. ,
  32995. o.toBase64 = o.encode64,
  32996. o.encodeHex = function() {
  32997. try {
  32998. return this.encode().toHex()
  32999. } catch (e) {
  33000. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33001. e
  33002. }
  33003. }
  33004. ,
  33005. o.toHex = o.encodeHex,
  33006. o.toRaw = function(e, t) {
  33007. return d(this, !!e, !!t, this.$type)
  33008. }
  33009. ,
  33010. o.encodeJSON = function() {
  33011. return JSON.stringify(d(this, !0, !0, this.$type))
  33012. }
  33013. ,
  33014. c.decode = function(t, e, i) {
  33015. "string" == typeof e && (i = e,
  33016. e = -1),
  33017. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33018. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33019. try {
  33020. var r = a.decode(t.LE());
  33021. return t.LE(n),
  33022. r
  33023. } catch (e) {
  33024. throw t.LE(n),
  33025. e
  33026. }
  33027. }
  33028. ,
  33029. c.decodeDelimited = function(t, e) {
  33030. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33031. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33032. return null;
  33033. var i = t.offset
  33034. , n = t.readVarint32();
  33035. if (t.remaining() < n)
  33036. return t.offset = i,
  33037. null;
  33038. try {
  33039. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33040. return t.offset += n,
  33041. r
  33042. } catch (e) {
  33043. throw t.offset += n,
  33044. e
  33045. }
  33046. }
  33047. ,
  33048. c.decode64 = function(e) {
  33049. return c.decode(e, "base64")
  33050. }
  33051. ,
  33052. c.decodeHex = function(e) {
  33053. return c.decode(e, "hex")
  33054. }
  33055. ,
  33056. c.decodeJSON = function(e) {
  33057. return new c(JSON.parse(e))
  33058. }
  33059. ,
  33060. o.toString = function() {
  33061. return a.toString()
  33062. }
  33063. ,
  33064. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33065. value: a.buildOpt()
  33066. }),
  33067. Object.defineProperty(o, "$options", {
  33068. value: c.$options
  33069. }),
  33070. Object.defineProperty(c, "$type", {
  33071. value: a
  33072. }),
  33073. Object.defineProperty(o, "$type", {
  33074. value: a
  33075. })),
  33076. c
  33077. }(g, this);
  33078. this._fields = [],
  33079. this._fieldsById = {},
  33080. this._fieldsByName = {};
  33081. for (var i, n = 0, r = this.children.length; n < r; n++)
  33082. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33083. if (t.hasOwnProperty(i.name))
  33084. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33085. t[i.name] = i.build()
  33086. } else if (i instanceof d.Field)
  33087. i.build(),
  33088. this._fields.push(i),
  33089. this._fieldsById[i.id] = i,
  33090. this._fieldsByName[i.name] = i;
  33091. else if (!(i instanceof d.OneOf || i instanceof v))
  33092. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33093. return this.clazz = t
  33094. }
  33095. ,
  33096. n.encode = function(e, t, i) {
  33097. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33098. r = e[(n = this._fields[a]).name],
  33099. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33100. if (null === o)
  33101. return t;
  33102. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33103. throw l.encoded = t,
  33104. l
  33105. }
  33106. ,
  33107. n.calculate = function(e) {
  33108. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33109. if (i = e[(t = this._fields[r]).name],
  33110. t.required && null === i)
  33111. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33112. n += t.calculate(i, e)
  33113. }
  33114. return n
  33115. }
  33116. ,
  33117. n.decode = function(e, t, i) {
  33118. t = "number" == typeof t ? t : -1;
  33119. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33120. if (o = (n = e.readVarint32()) >>> 3,
  33121. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33122. if (o !== i)
  33123. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33124. break
  33125. }
  33126. if (a = this._fieldsById[o]) {
  33127. if (a.repeated && !a.options.packed)
  33128. l[a.name].push(a.decode(r, e));
  33129. else if (a.map) {
  33130. var c = a.decode(r, e);
  33131. l[a.name].set(c[0], c[1])
  33132. } else if (l[a.name] = a.decode(r, e),
  33133. a.oneof) {
  33134. var h = l[a.oneof.name];
  33135. null !== h && h !== a.name && (l[h] = null),
  33136. l[a.oneof.name] = a.name
  33137. }
  33138. } else
  33139. switch (r) {
  33140. case g.WIRE_TYPES.VARINT:
  33141. e.readVarint32();
  33142. break;
  33143. case g.WIRE_TYPES.BITS32:
  33144. e.offset += 4;
  33145. break;
  33146. case g.WIRE_TYPES.BITS64:
  33147. e.offset += 8;
  33148. break;
  33149. case g.WIRE_TYPES.LDELIM:
  33150. var u = e.readVarint32();
  33151. e.offset += u;
  33152. break;
  33153. case g.WIRE_TYPES.STARTGROUP:
  33154. for (; m(o, e); )
  33155. ;
  33156. break;
  33157. default:
  33158. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33159. }
  33160. }
  33161. for (var d = 0, p = this._fields.length; d < p; ++d)
  33162. if (null === l[(a = this._fields[d]).name])
  33163. if ("proto3" === this.syntax)
  33164. l[a.name] = a.defaultValue;
  33165. else {
  33166. if (a.required) {
  33167. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33168. throw f.decoded = l,
  33169. f
  33170. }
  33171. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33172. }
  33173. return l
  33174. }
  33175. ,
  33176. s.Message = d;
  33177. function c(e, t, i, n, r, o, a, s, l, c) {
  33178. h.call(this, e, t, o),
  33179. this.className = "Message.Field",
  33180. this.required = "required" === i,
  33181. this.repeated = "repeated" === i,
  33182. this.map = "map" === i,
  33183. this.keyType = n || null,
  33184. this.type = r,
  33185. this.resolvedType = null,
  33186. this.id = a,
  33187. this.options = s || {},
  33188. this.defaultValue = null,
  33189. this.oneof = l || null,
  33190. this.syntax = c || "proto2",
  33191. this.originalName = this.name,
  33192. this.element = null,
  33193. this.keyElement = null,
  33194. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33195. }
  33196. var r = c.prototype = Object.create(h.prototype);
  33197. r.build = function() {
  33198. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33199. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33200. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  33201. }
  33202. ,
  33203. r.verifyValue = function(e, t) {
  33204. function i(e, t) {
  33205. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33206. }
  33207. t = t || !1;
  33208. var n, r = this;
  33209. if (null === e)
  33210. return this.required && i(typeof e, "required"),
  33211. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33212. null;
  33213. if (!this.repeated || t)
  33214. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33215. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33216. this.element.verifyValue(e));
  33217. Array.isArray(e) || (e = [e]);
  33218. var o = [];
  33219. for (n = 0; n < e.length; n++)
  33220. o.push(this.element.verifyValue(e[n]));
  33221. return o
  33222. }
  33223. ,
  33224. r.hasWirePresence = function(e, t) {
  33225. if ("proto3" !== this.syntax)
  33226. return null !== e;
  33227. if (this.oneof && t[this.oneof.name] === this.name)
  33228. return !0;
  33229. switch (this.type) {
  33230. case g.TYPES.int32:
  33231. case g.TYPES.sint32:
  33232. case g.TYPES.sfixed32:
  33233. case g.TYPES.uint32:
  33234. case g.TYPES.fixed32:
  33235. return 0 !== e;
  33236. case g.TYPES.int64:
  33237. case g.TYPES.sint64:
  33238. case g.TYPES.sfixed64:
  33239. case g.TYPES.uint64:
  33240. case g.TYPES.fixed64:
  33241. return 0 !== e.low || 0 !== e.high;
  33242. case g.TYPES.bool:
  33243. return e;
  33244. case g.TYPES.float:
  33245. case g.TYPES.double:
  33246. return 0 !== e;
  33247. case g.TYPES.string:
  33248. return 0 < e.length;
  33249. case g.TYPES.bytes:
  33250. return 0 < e.remaining();
  33251. case g.TYPES.enum:
  33252. return 0 !== e;
  33253. case g.TYPES.message:
  33254. return null !== e;
  33255. default:
  33256. return !0
  33257. }
  33258. }
  33259. ,
  33260. r.encode = function(t, r, e) {
  33261. if (null === this.type || "object" != typeof this.type)
  33262. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33263. if (null === t || this.repeated && 0 == t.length)
  33264. return r;
  33265. try {
  33266. var i;
  33267. if (this.repeated)
  33268. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33269. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33270. r.ensureCapacity(r.offset += 1);
  33271. var n = r.offset;
  33272. for (i = 0; i < t.length; i++)
  33273. this.element.encodeValue(this.id, t[i], r);
  33274. var o = r.offset - n
  33275. , a = I.calculateVarint32(o);
  33276. if (1 < a) {
  33277. var s = r.slice(n, r.offset);
  33278. n += a - 1,
  33279. r.offset = n,
  33280. r.append(s)
  33281. }
  33282. r.writeVarint32(o, n - a)
  33283. } else
  33284. for (i = 0; i < t.length; i++)
  33285. r.writeVarint32(this.id << 3 | this.type.wireType),
  33286. this.element.encodeValue(this.id, t[i], r);
  33287. else
  33288. this.map ? t.forEach(function(e, t, i) {
  33289. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33290. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33291. r.writeVarint32(n),
  33292. r.writeVarint32(8 | this.keyType.wireType),
  33293. this.keyElement.encodeValue(1, t, r),
  33294. r.writeVarint32(16 | this.type.wireType),
  33295. this.element.encodeValue(2, e, r)
  33296. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33297. this.element.encodeValue(this.id, t, r))
  33298. } catch (e) {
  33299. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33300. }
  33301. return r
  33302. }
  33303. ,
  33304. r.calculate = function(t, e) {
  33305. if (t = this.verifyValue(t),
  33306. null === this.type || "object" != typeof this.type)
  33307. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33308. if (null === t || this.repeated && 0 == t.length)
  33309. return 0;
  33310. var r = 0;
  33311. try {
  33312. var i, n;
  33313. if (this.repeated)
  33314. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33315. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33316. i = n = 0; i < t.length; i++)
  33317. n += this.element.calculateLength(this.id, t[i]);
  33318. r += I.calculateVarint32(n),
  33319. r += n
  33320. } else
  33321. for (i = 0; i < t.length; i++)
  33322. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33323. r += this.element.calculateLength(this.id, t[i]);
  33324. else
  33325. this.map ? t.forEach(function(e, t, i) {
  33326. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33327. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33328. r += I.calculateVarint32(n),
  33329. r += n
  33330. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33331. r += this.element.calculateLength(this.id, t))
  33332. } catch (e) {
  33333. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33334. }
  33335. return r
  33336. }
  33337. ,
  33338. r.decode = function(e, t, i) {
  33339. var n, r;
  33340. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  33341. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33342. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33343. r = t.readVarint32(),
  33344. r = t.offset + r;
  33345. for (var o = []; t.offset < r; )
  33346. o.push(this.decode(this.type.wireType, t, !0));
  33347. return o
  33348. }
  33349. if (this.map) {
  33350. var a = u.defaultFieldValue(this.keyType);
  33351. if (n = u.defaultFieldValue(this.type),
  33352. r = t.readVarint32(),
  33353. t.remaining() < r)
  33354. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33355. var s = t.clone();
  33356. for (s.limit = s.offset + r,
  33357. t.offset += r; 0 < s.remaining(); ) {
  33358. var l = s.readVarint32();
  33359. e = 7 & l;
  33360. var c = l >>> 3;
  33361. if (1 == c)
  33362. a = this.keyElement.decode(s, e, c);
  33363. else {
  33364. if (2 != c)
  33365. throw Error("Unexpected tag in map field key/value submessage");
  33366. n = this.element.decode(s, e, c)
  33367. }
  33368. }
  33369. return [a, n]
  33370. }
  33371. return this.element.decode(t, e, this.id)
  33372. }
  33373. ,
  33374. s.Message.Field = c;
  33375. function o(e, t, i, n, r, o, a) {
  33376. c.call(this, e, t, i, null, n, r, o, a),
  33377. this.extension
  33378. }
  33379. o.prototype = Object.create(c.prototype),
  33380. s.Message.ExtensionField = o;
  33381. s.Message.OneOf = function(e, t, i) {
  33382. h.call(this, e, t, i),
  33383. this.fields = []
  33384. }
  33385. ;
  33386. var p = function(e, t, i, n, r) {
  33387. l.call(this, e, t, i, n, r),
  33388. this.className = "Enum",
  33389. this.object = null
  33390. };
  33391. p.getName = function(e, t) {
  33392. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33393. if (e[i = n[r]] === t)
  33394. return i;
  33395. return null
  33396. }
  33397. ,
  33398. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33399. if (this.object && !e)
  33400. return this.object;
  33401. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33402. t[i[n].name] = i[n].id;
  33403. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33404. value: this.buildOpt(),
  33405. enumerable: !1
  33406. }),
  33407. this.object = t
  33408. }
  33409. ,
  33410. s.Enum = p;
  33411. function f(e, t, i, n) {
  33412. h.call(this, e, t, i),
  33413. this.className = "Enum.Value",
  33414. this.id = n
  33415. }
  33416. f.prototype = Object.create(h.prototype),
  33417. s.Enum.Value = f;
  33418. var v = function(e, t, i, n) {
  33419. h.call(this, e, t, i),
  33420. this.field = n
  33421. };
  33422. v.prototype = Object.create(h.prototype),
  33423. s.Extension = v;
  33424. var y = function(e, t, i, n) {
  33425. l.call(this, e, t, i, n),
  33426. this.className = "Service",
  33427. this.clazz = null
  33428. };
  33429. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33430. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33431. for (var o = function(e) {
  33432. t.Builder.Service.call(this),
  33433. this.rpcImpl = e || function(e, t, i) {
  33434. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33435. }
  33436. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33437. !function(n) {
  33438. e[n.name] = function(e, i) {
  33439. try {
  33440. try {
  33441. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33442. } catch (e) {
  33443. if (!(e instanceof TypeError))
  33444. throw e
  33445. }
  33446. if (null === e || "object" != typeof e)
  33447. throw Error("Illegal arguments");
  33448. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33449. this.rpcImpl(n.fqn(), e, function(e, t) {
  33450. if (!e) {
  33451. null === t && (t = "");
  33452. try {
  33453. t = n.resolvedResponseType.clazz.decode(t)
  33454. } catch (e) {}
  33455. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  33456. }
  33457. i(e)
  33458. })
  33459. } catch (e) {
  33460. setTimeout(i.bind(this, e), 0)
  33461. }
  33462. }
  33463. ,
  33464. o[n.name] = function(e, t, i) {
  33465. new o(e)[n.name](t, i)
  33466. }
  33467. ,
  33468. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33469. value: n.buildOpt()
  33470. }),
  33471. Object.defineProperty(e[n.name], "$options", {
  33472. value: o[n.name].$options
  33473. }))
  33474. }(i[n]);
  33475. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33476. value: r.buildOpt()
  33477. }),
  33478. Object.defineProperty(e, "$options", {
  33479. value: o.$options
  33480. }),
  33481. Object.defineProperty(o, "$type", {
  33482. value: r
  33483. }),
  33484. Object.defineProperty(e, "$type", {
  33485. value: r
  33486. })),
  33487. o
  33488. }(g, this)
  33489. }
  33490. ,
  33491. s.Service = y;
  33492. function A(e, t, i, n) {
  33493. h.call(this, e, t, i),
  33494. this.className = "Service.Method",
  33495. this.options = n || {}
  33496. }
  33497. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33498. s.Service.Method = A;
  33499. function C(e, t, i, n, r, o, a, s) {
  33500. A.call(this, e, t, i, s),
  33501. this.className = "Service.RPCMethod",
  33502. this.requestName = n,
  33503. this.responseName = r,
  33504. this.requestStream = o,
  33505. this.responseStream = a,
  33506. this.resolvedRequestType = null,
  33507. this.resolvedResponseType = null
  33508. }
  33509. return C.prototype = Object.create(A.prototype),
  33510. s.Service.RPCMethod = C,
  33511. s
  33512. }(o),
  33513. o.Builder = (i = (u = o).Lang,
  33514. s = o.Reflect,
  33515. n = h.prototype,
  33516. h.isMessage = function(e) {
  33517. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33518. }
  33519. ,
  33520. h.isMessageField = function(e) {
  33521. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33522. }
  33523. ,
  33524. h.isEnum = function(e) {
  33525. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33526. }
  33527. ,
  33528. h.isService = function(e) {
  33529. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33530. }
  33531. ,
  33532. h.isExtend = function(e) {
  33533. return "string" == typeof e.ref
  33534. }
  33535. ,
  33536. n.reset = function() {
  33537. return this.ptr = this.ns,
  33538. this
  33539. }
  33540. ,
  33541. n.define = function(e) {
  33542. if ("string" != typeof e || !i.TYPEREF.test(e))
  33543. throw Error("illegal namespace: " + e);
  33544. return e.split(".").forEach(function(e) {
  33545. var t = this.ptr.getChild(e);
  33546. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33547. this.ptr = t
  33548. }, this),
  33549. this
  33550. }
  33551. ,
  33552. n.create = function(e) {
  33553. if (!e)
  33554. return this;
  33555. if (Array.isArray(e)) {
  33556. if (0 === e.length)
  33557. return this;
  33558. e = e.slice()
  33559. } else
  33560. e = [e];
  33561. for (var t = [e]; 0 < t.length; ) {
  33562. if (e = t.pop(),
  33563. !Array.isArray(e))
  33564. throw Error("not a valid namespace: " + JSON.stringify(e));
  33565. for (; 0 < e.length; ) {
  33566. var i = e.shift();
  33567. if (h.isMessage(i)) {
  33568. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33569. , n = {};
  33570. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33571. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33572. }, this),
  33573. i.fields && i.fields.forEach(function(e) {
  33574. if (null !== o.getChild(0 | e.id))
  33575. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33576. if (e.options && "object" != typeof e.options)
  33577. throw Error("illegal field options in " + o.name + "#" + e.name);
  33578. var t = null;
  33579. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33580. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33581. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33582. t && t.fields.push(e),
  33583. o.addChild(e)
  33584. }, this);
  33585. var r = [];
  33586. if (i.enums && i.enums.forEach(function(e) {
  33587. r.push(e)
  33588. }),
  33589. i.messages && i.messages.forEach(function(e) {
  33590. r.push(e)
  33591. }),
  33592. i.services && i.services.forEach(function(e) {
  33593. r.push(e)
  33594. }),
  33595. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33596. this.ptr.addChild(o),
  33597. 0 < r.length) {
  33598. t.push(e),
  33599. e = r,
  33600. r = null,
  33601. this.ptr = o,
  33602. o = null;
  33603. continue
  33604. }
  33605. r = null
  33606. } else if (h.isEnum(i))
  33607. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33608. i.values.forEach(function(e) {
  33609. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33610. }, this),
  33611. this.ptr.addChild(o);
  33612. else if (h.isService(i))
  33613. o = new s.Service(this,this.ptr,i.name,i.options),
  33614. Object.keys(i.rpc).forEach(function(e) {
  33615. var t = i.rpc[e];
  33616. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33617. }, this),
  33618. this.ptr.addChild(o);
  33619. else {
  33620. if (!h.isExtend(i))
  33621. throw Error("not a valid definition: " + JSON.stringify(i));
  33622. if (o = this.ptr.resolve(i.ref, !0))
  33623. i.fields.forEach(function(t) {
  33624. if (null !== o.getChild(0 | t.id))
  33625. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33626. if (o.extensions) {
  33627. var i = !1;
  33628. if (o.extensions.forEach(function(e) {
  33629. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33630. }),
  33631. !i)
  33632. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33633. }
  33634. var e = t.name;
  33635. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33636. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33637. , r = new s.Extension(this,this.ptr,t.name,n);
  33638. n.extension = r,
  33639. this.ptr.addChild(r),
  33640. o.addChild(n)
  33641. }, this);
  33642. else if (!/\.?google\.protobuf\./.test(i.ref))
  33643. throw Error("extended message " + i.ref + " is not defined")
  33644. }
  33645. o = i = null
  33646. }
  33647. e = null,
  33648. this.ptr = this.ptr.parent
  33649. }
  33650. return this.resolved = !1,
  33651. this.result = null,
  33652. this
  33653. }
  33654. ,
  33655. n.import = function(t, e) {
  33656. var i = "/";
  33657. if ("string" == typeof e) {
  33658. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33659. !0 === this.files[e])
  33660. return this.reset();
  33661. this.files[e] = !0
  33662. } else if ("object" == typeof e) {
  33663. var n = e.root;
  33664. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33665. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33666. var r = n + i + e.file;
  33667. if (!0 === this.files[r])
  33668. return this.reset();
  33669. this.files[r] = !0
  33670. }
  33671. if (t.imports && 0 < t.imports.length) {
  33672. var o, a = !1;
  33673. "object" == typeof e ? (this.importRoot = e.root,
  33674. a = !0,
  33675. o = this.importRoot,
  33676. e = e.file,
  33677. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  33678. i = "\\") : o = "." : o = null;
  33679. for (var s = 0; s < t.imports.length; s++)
  33680. if ("string" == typeof t.imports[s]) {
  33681. if (!o)
  33682. throw Error("cannot determine import root");
  33683. var l = t.imports[s];
  33684. if ("google/protobuf/descriptor.proto" === l)
  33685. continue;
  33686. if (l = o + i + l,
  33687. !0 === this.files[l])
  33688. continue;
  33689. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  33690. var c = u.Util.fetch(l);
  33691. if (null === c)
  33692. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  33693. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  33694. } else
  33695. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  33696. return t + "_import" + s + "." + i
  33697. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  33698. a && (this.importRoot = null)
  33699. }
  33700. t.package && this.define(t.package),
  33701. t.syntax && function t(i) {
  33702. i.messages && i.messages.forEach(function(e) {
  33703. e.syntax = i.syntax,
  33704. t(e)
  33705. }),
  33706. i.enums && i.enums.forEach(function(e) {
  33707. e.syntax = i.syntax
  33708. })
  33709. }(t);
  33710. var h = this.ptr;
  33711. return t.options && Object.keys(t.options).forEach(function(e) {
  33712. h.options[e] = t.options[e]
  33713. }),
  33714. t.messages && (this.create(t.messages),
  33715. this.ptr = h),
  33716. t.enums && (this.create(t.enums),
  33717. this.ptr = h),
  33718. t.services && (this.create(t.services),
  33719. this.ptr = h),
  33720. t.extends && this.create(t.extends),
  33721. this.reset()
  33722. }
  33723. ,
  33724. n.resolveAll = function() {
  33725. var e;
  33726. if (null == this.ptr || "object" == typeof this.ptr.type)
  33727. return this;
  33728. if (this.ptr instanceof s.Namespace)
  33729. this.ptr.children.forEach(function(e) {
  33730. this.ptr = e,
  33731. this.resolveAll()
  33732. }, this);
  33733. else if (this.ptr instanceof s.Message.Field) {
  33734. if (i.TYPE.test(this.ptr.type))
  33735. this.ptr.type = u.TYPES[this.ptr.type];
  33736. else {
  33737. if (!i.TYPEREF.test(this.ptr.type))
  33738. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33739. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  33740. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33741. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  33742. if (this.ptr.type = u.TYPES.enum,
  33743. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  33744. throw Error("proto3 message cannot reference proto2 enum")
  33745. } else {
  33746. if (!(e instanceof s.Message))
  33747. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33748. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  33749. }
  33750. }
  33751. if (this.ptr.map) {
  33752. if (!i.TYPE.test(this.ptr.keyType))
  33753. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  33754. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  33755. }
  33756. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  33757. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  33758. throw Error("illegal service type in " + this.ptr.toString(!0));
  33759. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  33760. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  33761. if (this.ptr.resolvedRequestType = e,
  33762. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  33763. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  33764. this.ptr.resolvedResponseType = e
  33765. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  33766. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  33767. return this.reset()
  33768. }
  33769. ,
  33770. n.build = function(e) {
  33771. if (this.reset(),
  33772. this.resolved || (this.resolveAll(),
  33773. this.resolved = !0,
  33774. this.result = null),
  33775. null === this.result && (this.result = this.ns.build()),
  33776. !e)
  33777. return this.result;
  33778. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  33779. if (!i[t[n]]) {
  33780. i = null;
  33781. break
  33782. }
  33783. i = i[t[n]]
  33784. }
  33785. return i
  33786. }
  33787. ,
  33788. n.lookup = function(e, t) {
  33789. return e ? this.ns.resolve(e, t) : this.ns
  33790. }
  33791. ,
  33792. n.toString = function() {
  33793. return "Builder"
  33794. }
  33795. ,
  33796. h.Message = function() {}
  33797. ,
  33798. h.Enum = function() {}
  33799. ,
  33800. h.Service = function() {}
  33801. ,
  33802. h),
  33803. o.Map = (a = o.Reflect,
  33804. (t = c.prototype).clear = function() {
  33805. this.map = {}
  33806. }
  33807. ,
  33808. t.delete = function(e) {
  33809. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  33810. , i = t in this.map;
  33811. return delete this.map[t],
  33812. i
  33813. }
  33814. ,
  33815. t.entries = function() {
  33816. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  33817. t.push([(e = this.map[i[n]]).key, e.value]);
  33818. return l(t)
  33819. }
  33820. ,
  33821. t.keys = function() {
  33822. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33823. e.push(this.map[t[i]].key);
  33824. return l(e)
  33825. }
  33826. ,
  33827. t.values = function() {
  33828. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33829. e.push(this.map[t[i]].value);
  33830. return l(e)
  33831. }
  33832. ,
  33833. t.forEach = function(e, t) {
  33834. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  33835. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  33836. }
  33837. ,
  33838. t.set = function(e, t) {
  33839. var i = this.keyElem.verifyValue(e)
  33840. , n = this.valueElem.verifyValue(t);
  33841. return this.map[this.keyElem.valueToString(i)] = {
  33842. key: i,
  33843. value: n
  33844. },
  33845. this
  33846. }
  33847. ,
  33848. t.get = function(e) {
  33849. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  33850. if (t in this.map)
  33851. return this.map[t].value
  33852. }
  33853. ,
  33854. t.has = function(e) {
  33855. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  33856. }
  33857. ,
  33858. c),
  33859. o.loadProto = function(e, t, i) {
  33860. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33861. t = void 0),
  33862. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  33863. }
  33864. ,
  33865. o.protoFromString = o.loadProto,
  33866. o.loadProtoFile = function(t, i, n) {
  33867. if (i && "object" == typeof i ? (n = i,
  33868. i = null) : i && "function" == typeof i || (i = null),
  33869. i)
  33870. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33871. if (null !== e)
  33872. try {
  33873. i(null, o.loadProto(e, n, t))
  33874. } catch (e) {
  33875. i(e)
  33876. }
  33877. else
  33878. i(Error("Failed to fetch file"))
  33879. });
  33880. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  33881. return null === e ? null : o.loadProto(e, n, t)
  33882. }
  33883. ,
  33884. o.protoFromFile = o.loadProtoFile,
  33885. o.newBuilder = function(e) {
  33886. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  33887. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  33888. new o.Builder(e)
  33889. }
  33890. ,
  33891. o.loadJson = function(e, t, i) {
  33892. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33893. t = null),
  33894. t && "object" == typeof t || (t = o.newBuilder()),
  33895. "string" == typeof e && (e = JSON.parse(e)),
  33896. t.import(e, i),
  33897. t.resolveAll(),
  33898. t
  33899. }
  33900. ,
  33901. o.loadJsonFile = function(t, i, n) {
  33902. if (i && "object" == typeof i ? (n = i,
  33903. i = null) : i && "function" == typeof i || (i = null),
  33904. i)
  33905. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33906. if (null !== e)
  33907. try {
  33908. i(null, o.loadJson(JSON.parse(e), n, t))
  33909. } catch (e) {
  33910. i(e)
  33911. }
  33912. else
  33913. i(Error("Failed to fetch file"))
  33914. });
  33915. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  33916. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  33917. }
  33918. ,
  33919. o;
  33920. function l(e) {
  33921. var t = 0;
  33922. return {
  33923. next: function() {
  33924. return t < e.length ? {
  33925. done: !1,
  33926. value: e[t++]
  33927. } : {
  33928. done: !0
  33929. }
  33930. }
  33931. }
  33932. }
  33933. function c(e, t) {
  33934. if (!e.map)
  33935. throw Error("field is not a map");
  33936. if (this.field = e,
  33937. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  33938. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  33939. this.map = {},
  33940. Object.defineProperty(this, "size", {
  33941. get: function() {
  33942. return Object.keys(this.map).length
  33943. }
  33944. }),
  33945. t)
  33946. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  33947. var r = this.keyElem.valueFromString(i[n])
  33948. , o = this.valueElem.verifyValue(t[i[n]]);
  33949. this.map[this.keyElem.valueToString(r)] = {
  33950. key: r,
  33951. value: o
  33952. }
  33953. }
  33954. }
  33955. function h(e) {
  33956. this.ns = new s.Namespace(this,null,""),
  33957. this.ptr = this.ns,
  33958. this.resolved = !1,
  33959. this.result = null,
  33960. this.files = {},
  33961. this.importRoot = null,
  33962. this.options = e || {}
  33963. }
  33964. }
  33965. ,
  33966. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  33967. }
  33968. ).call(this, p("_process"))
  33969. }
  33970. , {
  33971. _process: 203,
  33972. bytebuffer: 215,
  33973. fs: 197,
  33974. path: 197
  33975. }],
  33976. 215: [function(t, e, i) {
  33977. var n, r;
  33978. n = this,
  33979. r = function(l) {
  33980. "use strict";
  33981. function s(e) {
  33982. var t = 0;
  33983. return function() {
  33984. return t < e.length ? e.charCodeAt(t++) : null
  33985. }
  33986. }
  33987. function c() {
  33988. var e = []
  33989. , t = [];
  33990. return function() {
  33991. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  33992. e.length = 0),
  33993. void Array.prototype.push.apply(e, arguments))
  33994. }
  33995. }
  33996. function n(e, t, i, n, r) {
  33997. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  33998. for (u += d,
  33999. o = p & (1 << -h) - 1,
  34000. p >>= -h,
  34001. h += s; 0 < h; o = 256 * o + e[t + u],
  34002. u += d,
  34003. h -= 8)
  34004. ;
  34005. for (a = o & (1 << -h) - 1,
  34006. o >>= -h,
  34007. h += n; 0 < h; a = 256 * a + e[t + u],
  34008. u += d,
  34009. h -= 8)
  34010. ;
  34011. if (0 === o)
  34012. o = 1 - c;
  34013. else {
  34014. if (o === l)
  34015. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34016. a += Math.pow(2, n),
  34017. o -= c
  34018. }
  34019. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34020. }
  34021. function r(e, t, i, n, r, o) {
  34022. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  34023. for (t = Math.abs(t),
  34024. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34025. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34026. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34027. l *= 2),
  34028. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34029. l /= 2),
  34030. h <= a + u ? (s = 0,
  34031. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34032. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34033. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34034. p += f,
  34035. s /= 256,
  34036. r -= 8)
  34037. ;
  34038. for (a = a << r | s,
  34039. c += r; 0 < c; e[i + p] = 255 & a,
  34040. p += f,
  34041. a /= 256,
  34042. c -= 8)
  34043. ;
  34044. e[i + p - f] |= 128 * g
  34045. }
  34046. var f = function(e, t, i) {
  34047. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34048. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34049. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34050. !i) {
  34051. if ((e |= 0) < 0)
  34052. throw RangeError("Illegal capacity");
  34053. t = !!t,
  34054. i = !!i
  34055. }
  34056. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34057. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34058. this.offset = 0,
  34059. this.markedOffset = -1,
  34060. this.limit = e,
  34061. this.littleEndian = t,
  34062. this.noAssert = i
  34063. };
  34064. f.VERSION = "5.0.1",
  34065. f.LITTLE_ENDIAN = !0,
  34066. f.BIG_ENDIAN = !1,
  34067. f.DEFAULT_CAPACITY = 16,
  34068. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34069. f.DEFAULT_NOASSERT = !1,
  34070. f.Long = l || null;
  34071. var a = f.prototype;
  34072. a.__isByteBuffer__,
  34073. Object.defineProperty(a, "__isByteBuffer__", {
  34074. value: !0,
  34075. enumerable: !1,
  34076. configurable: !1
  34077. });
  34078. var o = new ArrayBuffer(0)
  34079. , i = String.fromCharCode;
  34080. f.accessor = function() {
  34081. return Uint8Array
  34082. }
  34083. ,
  34084. f.allocate = function(e, t, i) {
  34085. return new f(e,t,i)
  34086. }
  34087. ,
  34088. f.concat = function(e, t, i, n) {
  34089. "boolean" != typeof t && "string" == typeof t || (n = i,
  34090. i = t,
  34091. t = void 0);
  34092. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34093. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34094. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34095. if (0 === o)
  34096. return new f(0,i,n);
  34097. var l, c = new f(o,i,n);
  34098. for (a = 0; a < s; )
  34099. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34100. c.offset += r);
  34101. return c.limit = c.offset,
  34102. c.offset = 0,
  34103. c
  34104. }
  34105. ,
  34106. f.isByteBuffer = function(e) {
  34107. return !0 === (e && e.__isByteBuffer__)
  34108. }
  34109. ,
  34110. f.type = function() {
  34111. return ArrayBuffer
  34112. }
  34113. ,
  34114. f.wrap = function(e, t, i, n) {
  34115. if ("string" != typeof t && (n = i,
  34116. i = t,
  34117. t = void 0),
  34118. "string" == typeof e)
  34119. switch (void 0 === t && (t = "utf8"),
  34120. t) {
  34121. case "base64":
  34122. return f.fromBase64(e, i);
  34123. case "hex":
  34124. return f.fromHex(e, i);
  34125. case "binary":
  34126. return f.fromBinary(e, i);
  34127. case "utf8":
  34128. return f.fromUTF8(e, i);
  34129. case "debug":
  34130. return f.fromDebug(e, i);
  34131. default:
  34132. throw Error("Unsupported encoding: " + t)
  34133. }
  34134. if (null === e || "object" != typeof e)
  34135. throw TypeError("Illegal buffer");
  34136. var r;
  34137. if (f.isByteBuffer(e))
  34138. return (r = a.clone.call(e)).markedOffset = -1,
  34139. r;
  34140. if (e instanceof Uint8Array)
  34141. r = new f(0,i,n),
  34142. 0 < e.length && (r.buffer = e.buffer,
  34143. r.offset = e.byteOffset,
  34144. r.limit = e.byteOffset + e.byteLength,
  34145. r.view = new Uint8Array(e.buffer));
  34146. else if (e instanceof ArrayBuffer)
  34147. r = new f(0,i,n),
  34148. 0 < e.byteLength && (r.buffer = e,
  34149. r.offset = 0,
  34150. r.limit = e.byteLength,
  34151. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34152. else {
  34153. if ("[object Array]" !== Object.prototype.toString.call(e))
  34154. throw TypeError("Illegal buffer");
  34155. (r = new f(e.length,i,n)).limit = e.length;
  34156. for (var o = 0; o < e.length; ++o)
  34157. r.view[o] = e[o]
  34158. }
  34159. return r
  34160. }
  34161. ,
  34162. a.writeBitSet = function(e, t) {
  34163. var i = void 0 === t;
  34164. if (i && (t = this.offset),
  34165. !this.noAssert) {
  34166. if (!(e instanceof Array))
  34167. throw TypeError("Illegal BitSet: Not an array");
  34168. if ("number" != typeof t || t % 1 != 0)
  34169. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34170. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34171. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34172. }
  34173. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34174. for (t += this.writeVarint32(o, t); a--; )
  34175. n = 1 & !!e[s++] | (1 & !!e[s++]) << 1 | (1 & !!e[s++]) << 2 | (1 & !!e[s++]) << 3 | (1 & !!e[s++]) << 4 | (1 & !!e[s++]) << 5 | (1 & !!e[s++]) << 6 | (1 & !!e[s++]) << 7,
  34176. this.writeByte(n, t++);
  34177. if (s < o) {
  34178. var l = 0;
  34179. for (n = 0; s < o; )
  34180. n |= (1 & !!e[s++]) << l++;
  34181. this.writeByte(n, t++)
  34182. }
  34183. return i ? (this.offset = t,
  34184. this) : t - r
  34185. }
  34186. ,
  34187. a.readBitSet = function(e) {
  34188. var t = void 0 === e;
  34189. t && (e = this.offset);
  34190. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34191. for (e += n.length; o--; )
  34192. i = this.readByte(e++),
  34193. s[a++] = !!(1 & i),
  34194. s[a++] = !!(2 & i),
  34195. s[a++] = !!(4 & i),
  34196. s[a++] = !!(8 & i),
  34197. s[a++] = !!(16 & i),
  34198. s[a++] = !!(32 & i),
  34199. s[a++] = !!(64 & i),
  34200. s[a++] = !!(128 & i);
  34201. if (a < r) {
  34202. var l = 0;
  34203. for (i = this.readByte(e++); a < r; )
  34204. s[a++] = !!(i >> l++ & 1)
  34205. }
  34206. return t && (this.offset = e),
  34207. s
  34208. }
  34209. ,
  34210. a.readBytes = function(e, t) {
  34211. var i = void 0 === t;
  34212. if (i && (t = this.offset),
  34213. !this.noAssert) {
  34214. if ("number" != typeof t || t % 1 != 0)
  34215. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34216. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34217. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34218. }
  34219. var n = this.slice(t, t + e);
  34220. return i && (this.offset += e),
  34221. n
  34222. }
  34223. ,
  34224. a.writeBytes = a.append,
  34225. a.writeInt8 = function(e, t) {
  34226. var i = void 0 === t;
  34227. if (i && (t = this.offset),
  34228. !this.noAssert) {
  34229. if ("number" != typeof e || e % 1 != 0)
  34230. throw TypeError("Illegal value: " + e + " (not an integer)");
  34231. if (e |= 0,
  34232. "number" != typeof t || t % 1 != 0)
  34233. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34234. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34235. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34236. }
  34237. t += 1;
  34238. var n = this.buffer.byteLength;
  34239. return n < t && this.resize((n *= 2) > t ? n : t),
  34240. t -= 1,
  34241. this.view[t] = e,
  34242. i && (this.offset += 1),
  34243. this
  34244. }
  34245. ,
  34246. a.writeByte = a.writeInt8,
  34247. a.readInt8 = function(e) {
  34248. var t = void 0 === e;
  34249. if (t && (e = this.offset),
  34250. !this.noAssert) {
  34251. if ("number" != typeof e || e % 1 != 0)
  34252. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34253. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34254. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34255. }
  34256. var i = this.view[e];
  34257. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34258. t && (this.offset += 1),
  34259. i
  34260. }
  34261. ,
  34262. a.readByte = a.readInt8,
  34263. a.writeUint8 = function(e, t) {
  34264. var i = void 0 === t;
  34265. if (i && (t = this.offset),
  34266. !this.noAssert) {
  34267. if ("number" != typeof e || e % 1 != 0)
  34268. throw TypeError("Illegal value: " + e + " (not an integer)");
  34269. if (e >>>= 0,
  34270. "number" != typeof t || t % 1 != 0)
  34271. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34272. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34273. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34274. }
  34275. t += 1;
  34276. var n = this.buffer.byteLength;
  34277. return n < t && this.resize((n *= 2) > t ? n : t),
  34278. t -= 1,
  34279. this.view[t] = e,
  34280. i && (this.offset += 1),
  34281. this
  34282. }
  34283. ,
  34284. a.writeUInt8 = a.writeUint8,
  34285. a.readUint8 = function(e) {
  34286. var t = void 0 === e;
  34287. if (t && (e = this.offset),
  34288. !this.noAssert) {
  34289. if ("number" != typeof e || e % 1 != 0)
  34290. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34291. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34292. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34293. }
  34294. var i = this.view[e];
  34295. return t && (this.offset += 1),
  34296. i
  34297. }
  34298. ,
  34299. a.readUInt8 = a.readUint8,
  34300. a.writeInt16 = function(e, t) {
  34301. var i = void 0 === t;
  34302. if (i && (t = this.offset),
  34303. !this.noAssert) {
  34304. if ("number" != typeof e || e % 1 != 0)
  34305. throw TypeError("Illegal value: " + e + " (not an integer)");
  34306. if (e |= 0,
  34307. "number" != typeof t || t % 1 != 0)
  34308. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34309. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34310. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34311. }
  34312. t += 2;
  34313. var n = this.buffer.byteLength;
  34314. return n < t && this.resize((n *= 2) > t ? n : t),
  34315. t -= 2,
  34316. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34317. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34318. this.view[t + 1] = 255 & e),
  34319. i && (this.offset += 2),
  34320. this
  34321. }
  34322. ,
  34323. a.writeShort = a.writeInt16,
  34324. a.readInt16 = function(e) {
  34325. var t = void 0 === e;
  34326. if (t && (e = this.offset),
  34327. !this.noAssert) {
  34328. if ("number" != typeof e || e % 1 != 0)
  34329. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34330. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34331. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34332. }
  34333. var i = 0;
  34334. return this.littleEndian ? (i = this.view[e],
  34335. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34336. i |= this.view[e + 1]),
  34337. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34338. t && (this.offset += 2),
  34339. i
  34340. }
  34341. ,
  34342. a.readShort = a.readInt16,
  34343. a.writeUint16 = function(e, t) {
  34344. var i = void 0 === t;
  34345. if (i && (t = this.offset),
  34346. !this.noAssert) {
  34347. if ("number" != typeof e || e % 1 != 0)
  34348. throw TypeError("Illegal value: " + e + " (not an integer)");
  34349. if (e >>>= 0,
  34350. "number" != typeof t || t % 1 != 0)
  34351. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34352. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34353. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34354. }
  34355. t += 2;
  34356. var n = this.buffer.byteLength;
  34357. return n < t && this.resize((n *= 2) > t ? n : t),
  34358. t -= 2,
  34359. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34360. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34361. this.view[t + 1] = 255 & e),
  34362. i && (this.offset += 2),
  34363. this
  34364. }
  34365. ,
  34366. a.writeUInt16 = a.writeUint16,
  34367. a.readUint16 = function(e) {
  34368. var t = void 0 === e;
  34369. if (t && (e = this.offset),
  34370. !this.noAssert) {
  34371. if ("number" != typeof e || e % 1 != 0)
  34372. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34373. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34374. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34375. }
  34376. var i = 0;
  34377. return this.littleEndian ? (i = this.view[e],
  34378. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34379. i |= this.view[e + 1]),
  34380. t && (this.offset += 2),
  34381. i
  34382. }
  34383. ,
  34384. a.readUInt16 = a.readUint16,
  34385. a.writeInt32 = function(e, t) {
  34386. var i = void 0 === t;
  34387. if (i && (t = this.offset),
  34388. !this.noAssert) {
  34389. if ("number" != typeof e || e % 1 != 0)
  34390. throw TypeError("Illegal value: " + e + " (not an integer)");
  34391. if (e |= 0,
  34392. "number" != typeof t || t % 1 != 0)
  34393. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34394. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34395. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34396. }
  34397. t += 4;
  34398. var n = this.buffer.byteLength;
  34399. return n < t && this.resize((n *= 2) > t ? n : t),
  34400. t -= 4,
  34401. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34402. this.view[t + 2] = e >>> 16 & 255,
  34403. this.view[t + 1] = e >>> 8 & 255,
  34404. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34405. this.view[t + 1] = e >>> 16 & 255,
  34406. this.view[t + 2] = e >>> 8 & 255,
  34407. this.view[t + 3] = 255 & e),
  34408. i && (this.offset += 4),
  34409. this
  34410. }
  34411. ,
  34412. a.writeInt = a.writeInt32,
  34413. a.readInt32 = function(e) {
  34414. var t = void 0 === e;
  34415. if (t && (e = this.offset),
  34416. !this.noAssert) {
  34417. if ("number" != typeof e || e % 1 != 0)
  34418. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34419. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34420. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34421. }
  34422. var i = 0;
  34423. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34424. i |= this.view[e + 1] << 8,
  34425. i |= this.view[e],
  34426. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34427. i |= this.view[e + 2] << 8,
  34428. i |= this.view[e + 3],
  34429. i += this.view[e] << 24 >>> 0),
  34430. i |= 0,
  34431. t && (this.offset += 4),
  34432. i
  34433. }
  34434. ,
  34435. a.readInt = a.readInt32,
  34436. a.writeUint32 = function(e, t) {
  34437. var i = void 0 === t;
  34438. if (i && (t = this.offset),
  34439. !this.noAssert) {
  34440. if ("number" != typeof e || e % 1 != 0)
  34441. throw TypeError("Illegal value: " + e + " (not an integer)");
  34442. if (e >>>= 0,
  34443. "number" != typeof t || t % 1 != 0)
  34444. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34445. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34446. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34447. }
  34448. t += 4;
  34449. var n = this.buffer.byteLength;
  34450. return n < t && this.resize((n *= 2) > t ? n : t),
  34451. t -= 4,
  34452. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34453. this.view[t + 2] = e >>> 16 & 255,
  34454. this.view[t + 1] = e >>> 8 & 255,
  34455. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34456. this.view[t + 1] = e >>> 16 & 255,
  34457. this.view[t + 2] = e >>> 8 & 255,
  34458. this.view[t + 3] = 255 & e),
  34459. i && (this.offset += 4),
  34460. this
  34461. }
  34462. ,
  34463. a.writeUInt32 = a.writeUint32,
  34464. a.readUint32 = function(e) {
  34465. var t = void 0 === e;
  34466. if (t && (e = this.offset),
  34467. !this.noAssert) {
  34468. if ("number" != typeof e || e % 1 != 0)
  34469. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34470. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34471. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34472. }
  34473. var i = 0;
  34474. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34475. i |= this.view[e + 1] << 8,
  34476. i |= this.view[e],
  34477. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34478. i |= this.view[e + 2] << 8,
  34479. i |= this.view[e + 3],
  34480. i += this.view[e] << 24 >>> 0),
  34481. t && (this.offset += 4),
  34482. i
  34483. }
  34484. ,
  34485. a.readUInt32 = a.readUint32,
  34486. l && (a.writeInt64 = function(e, t) {
  34487. var i = void 0 === t;
  34488. if (i && (t = this.offset),
  34489. !this.noAssert) {
  34490. if ("number" == typeof e)
  34491. e = l.fromNumber(e);
  34492. else if ("string" == typeof e)
  34493. e = l.fromString(e);
  34494. else if (!(e && e instanceof l))
  34495. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34496. if ("number" != typeof t || t % 1 != 0)
  34497. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34498. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34499. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34500. }
  34501. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34502. t += 8;
  34503. var n = this.buffer.byteLength;
  34504. n < t && this.resize((n *= 2) > t ? n : t),
  34505. t -= 8;
  34506. var r = e.low
  34507. , o = e.high;
  34508. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34509. this.view[t + 2] = r >>> 16 & 255,
  34510. this.view[t + 1] = r >>> 8 & 255,
  34511. this.view[t] = 255 & r,
  34512. t += 4,
  34513. this.view[t + 3] = o >>> 24 & 255,
  34514. this.view[t + 2] = o >>> 16 & 255,
  34515. this.view[t + 1] = o >>> 8 & 255,
  34516. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34517. this.view[t + 1] = o >>> 16 & 255,
  34518. this.view[t + 2] = o >>> 8 & 255,
  34519. this.view[t + 3] = 255 & o,
  34520. t += 4,
  34521. this.view[t] = r >>> 24 & 255,
  34522. this.view[t + 1] = r >>> 16 & 255,
  34523. this.view[t + 2] = r >>> 8 & 255,
  34524. this.view[t + 3] = 255 & r),
  34525. i && (this.offset += 8),
  34526. this
  34527. }
  34528. ,
  34529. a.writeLong = a.writeInt64,
  34530. a.readInt64 = function(e) {
  34531. var t = void 0 === e;
  34532. if (t && (e = this.offset),
  34533. !this.noAssert) {
  34534. if ("number" != typeof e || e % 1 != 0)
  34535. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34536. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34537. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34538. }
  34539. var i = 0
  34540. , n = 0;
  34541. this.littleEndian ? (i = this.view[e + 2] << 16,
  34542. i |= this.view[e + 1] << 8,
  34543. i |= this.view[e],
  34544. i += this.view[e + 3] << 24 >>> 0,
  34545. e += 4,
  34546. n = this.view[e + 2] << 16,
  34547. n |= this.view[e + 1] << 8,
  34548. n |= this.view[e],
  34549. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34550. n |= this.view[e + 2] << 8,
  34551. n |= this.view[e + 3],
  34552. n += this.view[e] << 24 >>> 0,
  34553. e += 4,
  34554. i = this.view[e + 1] << 16,
  34555. i |= this.view[e + 2] << 8,
  34556. i |= this.view[e + 3],
  34557. i += this.view[e] << 24 >>> 0);
  34558. var r = new l(i,n,!1);
  34559. return t && (this.offset += 8),
  34560. r
  34561. }
  34562. ,
  34563. a.readLong = a.readInt64,
  34564. a.writeUint64 = function(e, t) {
  34565. var i = void 0 === t;
  34566. if (i && (t = this.offset),
  34567. !this.noAssert) {
  34568. if ("number" == typeof e)
  34569. e = l.fromNumber(e);
  34570. else if ("string" == typeof e)
  34571. e = l.fromString(e);
  34572. else if (!(e && e instanceof l))
  34573. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34574. if ("number" != typeof t || t % 1 != 0)
  34575. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34576. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34577. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34578. }
  34579. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34580. t += 8;
  34581. var n = this.buffer.byteLength;
  34582. n < t && this.resize((n *= 2) > t ? n : t),
  34583. t -= 8;
  34584. var r = e.low
  34585. , o = e.high;
  34586. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34587. this.view[t + 2] = r >>> 16 & 255,
  34588. this.view[t + 1] = r >>> 8 & 255,
  34589. this.view[t] = 255 & r,
  34590. t += 4,
  34591. this.view[t + 3] = o >>> 24 & 255,
  34592. this.view[t + 2] = o >>> 16 & 255,
  34593. this.view[t + 1] = o >>> 8 & 255,
  34594. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34595. this.view[t + 1] = o >>> 16 & 255,
  34596. this.view[t + 2] = o >>> 8 & 255,
  34597. this.view[t + 3] = 255 & o,
  34598. t += 4,
  34599. this.view[t] = r >>> 24 & 255,
  34600. this.view[t + 1] = r >>> 16 & 255,
  34601. this.view[t + 2] = r >>> 8 & 255,
  34602. this.view[t + 3] = 255 & r),
  34603. i && (this.offset += 8),
  34604. this
  34605. }
  34606. ,
  34607. a.writeUInt64 = a.writeUint64,
  34608. a.readUint64 = function(e) {
  34609. var t = void 0 === e;
  34610. if (t && (e = this.offset),
  34611. !this.noAssert) {
  34612. if ("number" != typeof e || e % 1 != 0)
  34613. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34614. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34615. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34616. }
  34617. var i = 0
  34618. , n = 0;
  34619. this.littleEndian ? (i = this.view[e + 2] << 16,
  34620. i |= this.view[e + 1] << 8,
  34621. i |= this.view[e],
  34622. i += this.view[e + 3] << 24 >>> 0,
  34623. e += 4,
  34624. n = this.view[e + 2] << 16,
  34625. n |= this.view[e + 1] << 8,
  34626. n |= this.view[e],
  34627. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34628. n |= this.view[e + 2] << 8,
  34629. n |= this.view[e + 3],
  34630. n += this.view[e] << 24 >>> 0,
  34631. e += 4,
  34632. i = this.view[e + 1] << 16,
  34633. i |= this.view[e + 2] << 8,
  34634. i |= this.view[e + 3],
  34635. i += this.view[e] << 24 >>> 0);
  34636. var r = new l(i,n,!0);
  34637. return t && (this.offset += 8),
  34638. r
  34639. }
  34640. ,
  34641. a.readUInt64 = a.readUint64),
  34642. a.writeFloat32 = function(e, t) {
  34643. var i = void 0 === t;
  34644. if (i && (t = this.offset),
  34645. !this.noAssert) {
  34646. if ("number" != typeof e)
  34647. throw TypeError("Illegal value: " + e + " (not a number)");
  34648. if ("number" != typeof t || t % 1 != 0)
  34649. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34650. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34651. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34652. }
  34653. t += 4;
  34654. var n = this.buffer.byteLength;
  34655. return n < t && this.resize((n *= 2) > t ? n : t),
  34656. t -= 4,
  34657. r(this.view, e, t, this.littleEndian, 23, 4),
  34658. i && (this.offset += 4),
  34659. this
  34660. }
  34661. ,
  34662. a.writeFloat = a.writeFloat32,
  34663. a.readFloat32 = function(e) {
  34664. var t = void 0 === e;
  34665. if (t && (e = this.offset),
  34666. !this.noAssert) {
  34667. if ("number" != typeof e || e % 1 != 0)
  34668. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34669. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34670. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34671. }
  34672. var i = n(this.view, e, this.littleEndian, 23, 4);
  34673. return t && (this.offset += 4),
  34674. i
  34675. }
  34676. ,
  34677. a.readFloat = a.readFloat32,
  34678. a.writeFloat64 = function(e, t) {
  34679. var i = void 0 === t;
  34680. if (i && (t = this.offset),
  34681. !this.noAssert) {
  34682. if ("number" != typeof e)
  34683. throw TypeError("Illegal value: " + e + " (not a number)");
  34684. if ("number" != typeof t || t % 1 != 0)
  34685. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34686. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34687. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34688. }
  34689. t += 8;
  34690. var n = this.buffer.byteLength;
  34691. return n < t && this.resize((n *= 2) > t ? n : t),
  34692. t -= 8,
  34693. r(this.view, e, t, this.littleEndian, 52, 8),
  34694. i && (this.offset += 8),
  34695. this
  34696. }
  34697. ,
  34698. a.writeDouble = a.writeFloat64,
  34699. a.readFloat64 = function(e) {
  34700. var t = void 0 === e;
  34701. if (t && (e = this.offset),
  34702. !this.noAssert) {
  34703. if ("number" != typeof e || e % 1 != 0)
  34704. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34705. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34706. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34707. }
  34708. var i = n(this.view, e, this.littleEndian, 52, 8);
  34709. return t && (this.offset += 8),
  34710. i
  34711. }
  34712. ,
  34713. a.readDouble = a.readFloat64,
  34714. f.MAX_VARINT32_BYTES = 5,
  34715. f.calculateVarint32 = function(e) {
  34716. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34717. }
  34718. ,
  34719. f.zigZagEncode32 = function(e) {
  34720. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  34721. }
  34722. ,
  34723. f.zigZagDecode32 = function(e) {
  34724. return e >>> 1 ^ -(1 & e) | 0
  34725. }
  34726. ,
  34727. a.writeVarint32 = function(e, t) {
  34728. var i = void 0 === t;
  34729. if (i && (t = this.offset),
  34730. !this.noAssert) {
  34731. if ("number" != typeof e || e % 1 != 0)
  34732. throw TypeError("Illegal value: " + e + " (not an integer)");
  34733. if (e |= 0,
  34734. "number" != typeof t || t % 1 != 0)
  34735. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34736. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34737. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34738. }
  34739. var n, r = f.calculateVarint32(e);
  34740. t += r;
  34741. var o = this.buffer.byteLength;
  34742. for (o < t && this.resize((o *= 2) > t ? o : t),
  34743. t -= r,
  34744. e >>>= 0; 128 <= e; )
  34745. n = 127 & e | 128,
  34746. this.view[t++] = n,
  34747. e >>>= 7;
  34748. return this.view[t++] = e,
  34749. i ? (this.offset = t,
  34750. this) : r
  34751. }
  34752. ,
  34753. a.writeVarint32ZigZag = function(e, t) {
  34754. return this.writeVarint32(f.zigZagEncode32(e), t)
  34755. }
  34756. ,
  34757. a.readVarint32 = function(e) {
  34758. var t = void 0 === e;
  34759. if (t && (e = this.offset),
  34760. !this.noAssert) {
  34761. if ("number" != typeof e || e % 1 != 0)
  34762. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34763. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34764. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34765. }
  34766. var i, n = 0, r = 0;
  34767. do {
  34768. if (!this.noAssert && e > this.limit) {
  34769. var o = Error("Truncated");
  34770. throw o.truncated = !0,
  34771. o
  34772. }
  34773. i = this.view[e++],
  34774. n < 5 && (r |= (127 & i) << 7 * n),
  34775. ++n
  34776. } while (0 != (128 & i));return r |= 0,
  34777. t ? (this.offset = e,
  34778. r) : {
  34779. value: r,
  34780. length: n
  34781. }
  34782. }
  34783. ,
  34784. a.readVarint32ZigZag = function(e) {
  34785. var t = this.readVarint32(e);
  34786. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  34787. t
  34788. }
  34789. ,
  34790. l && (f.MAX_VARINT64_BYTES = 10,
  34791. f.calculateVarint64 = function(e) {
  34792. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  34793. var t = e.toInt() >>> 0
  34794. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  34795. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  34796. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  34797. }
  34798. ,
  34799. f.zigZagEncode64 = function(e) {
  34800. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34801. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  34802. }
  34803. ,
  34804. f.zigZagDecode64 = function(e) {
  34805. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34806. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  34807. }
  34808. ,
  34809. a.writeVarint64 = function(e, t) {
  34810. var i = void 0 === t;
  34811. if (i && (t = this.offset),
  34812. !this.noAssert) {
  34813. if ("number" == typeof e)
  34814. e = l.fromNumber(e);
  34815. else if ("string" == typeof e)
  34816. e = l.fromString(e);
  34817. else if (!(e && e instanceof l))
  34818. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34819. if ("number" != typeof t || t % 1 != 0)
  34820. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34821. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34822. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34823. }
  34824. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  34825. var n = f.calculateVarint64(e)
  34826. , r = e.toInt() >>> 0
  34827. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  34828. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  34829. t += n;
  34830. var s = this.buffer.byteLength;
  34831. switch (s < t && this.resize((s *= 2) > t ? s : t),
  34832. t -= n,
  34833. n) {
  34834. case 10:
  34835. this.view[t + 9] = a >>> 7 & 1;
  34836. case 9:
  34837. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  34838. case 8:
  34839. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  34840. case 7:
  34841. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  34842. case 6:
  34843. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  34844. case 5:
  34845. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  34846. case 4:
  34847. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  34848. case 3:
  34849. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  34850. case 2:
  34851. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  34852. case 1:
  34853. this.view[t] = 1 !== n ? 128 | r : 127 & r
  34854. }
  34855. return i ? (this.offset += n,
  34856. this) : n
  34857. }
  34858. ,
  34859. a.writeVarint64ZigZag = function(e, t) {
  34860. return this.writeVarint64(f.zigZagEncode64(e), t)
  34861. }
  34862. ,
  34863. a.readVarint64 = function(e) {
  34864. var t = void 0 === e;
  34865. if (t && (e = this.offset),
  34866. !this.noAssert) {
  34867. if ("number" != typeof e || e % 1 != 0)
  34868. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34869. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34870. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34871. }
  34872. var i = e
  34873. , n = 0
  34874. , r = 0
  34875. , o = 0
  34876. , a = 0;
  34877. if (n = 127 & (a = this.view[e++]),
  34878. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  34879. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  34880. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  34881. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  34882. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  34883. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  34884. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  34885. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  34886. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  34887. 128 & a || this.noAssert && void 0 === a))))))))))
  34888. throw Error("Buffer overrun");
  34889. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  34890. return t ? (this.offset = e,
  34891. s) : {
  34892. value: s,
  34893. length: e - i
  34894. }
  34895. }
  34896. ,
  34897. a.readVarint64ZigZag = function(e) {
  34898. var t = this.readVarint64(e);
  34899. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  34900. t
  34901. }
  34902. ),
  34903. a.writeCString = function(e, t) {
  34904. var i = void 0 === t;
  34905. i && (t = this.offset);
  34906. var n, r = e.length;
  34907. if (!this.noAssert) {
  34908. if ("string" != typeof e)
  34909. throw TypeError("Illegal str: Not a string");
  34910. for (n = 0; n < r; ++n)
  34911. if (0 === e.charCodeAt(n))
  34912. throw RangeError("Illegal str: Contains NULL-characters");
  34913. if ("number" != typeof t || t % 1 != 0)
  34914. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34915. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34916. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34917. }
  34918. r = d.calculateUTF16asUTF8(s(e))[1],
  34919. t += r + 1;
  34920. var o = this.buffer.byteLength;
  34921. return o < t && this.resize((o *= 2) > t ? o : t),
  34922. t -= r + 1,
  34923. d.encodeUTF16toUTF8(s(e), function(e) {
  34924. this.view[t++] = e
  34925. }
  34926. .bind(this)),
  34927. this.view[t++] = 0,
  34928. i ? (this.offset = t,
  34929. this) : r
  34930. }
  34931. ,
  34932. a.readCString = function(e) {
  34933. var t = void 0 === e;
  34934. if (t && (e = this.offset),
  34935. !this.noAssert) {
  34936. if ("number" != typeof e || e % 1 != 0)
  34937. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34938. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34939. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34940. }
  34941. var i, n = e, r = -1;
  34942. return d.decodeUTF8toUTF16(function() {
  34943. if (0 === r)
  34944. return null;
  34945. if (e >= this.limit)
  34946. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  34947. return 0 === (r = this.view[e++]) ? null : r
  34948. }
  34949. .bind(this), i = c(), !0),
  34950. t ? (this.offset = e,
  34951. i()) : {
  34952. string: i(),
  34953. length: e - n
  34954. }
  34955. }
  34956. ,
  34957. a.writeIString = function(e, t) {
  34958. var i = void 0 === t;
  34959. if (i && (t = this.offset),
  34960. !this.noAssert) {
  34961. if ("string" != typeof e)
  34962. throw TypeError("Illegal str: Not a string");
  34963. if ("number" != typeof t || t % 1 != 0)
  34964. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34965. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34966. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34967. }
  34968. var n, r = t;
  34969. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  34970. t += 4 + n;
  34971. var o = this.buffer.byteLength;
  34972. if (o < t && this.resize((o *= 2) > t ? o : t),
  34973. t -= 4 + n,
  34974. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  34975. this.view[t + 2] = n >>> 16 & 255,
  34976. this.view[t + 1] = n >>> 8 & 255,
  34977. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  34978. this.view[t + 1] = n >>> 16 & 255,
  34979. this.view[t + 2] = n >>> 8 & 255,
  34980. this.view[t + 3] = 255 & n),
  34981. t += 4,
  34982. d.encodeUTF16toUTF8(s(e), function(e) {
  34983. this.view[t++] = e
  34984. }
  34985. .bind(this)),
  34986. t !== r + 4 + n)
  34987. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  34988. return i ? (this.offset = t,
  34989. this) : t - r
  34990. }
  34991. ,
  34992. a.readIString = function(e) {
  34993. var t = void 0 === e;
  34994. if (t && (e = this.offset),
  34995. !this.noAssert) {
  34996. if ("number" != typeof e || e % 1 != 0)
  34997. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34998. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34999. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35000. }
  35001. var i = e
  35002. , n = this.readUint32(e)
  35003. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35004. return e += r.length,
  35005. t ? (this.offset = e,
  35006. r.string) : {
  35007. string: r.string,
  35008. length: e - i
  35009. }
  35010. }
  35011. ,
  35012. f.METRICS_CHARS = "c",
  35013. f.METRICS_BYTES = "b",
  35014. a.writeUTF8String = function(e, t) {
  35015. var i = void 0 === t;
  35016. if (i && (t = this.offset),
  35017. !this.noAssert) {
  35018. if ("number" != typeof t || t % 1 != 0)
  35019. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35020. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35021. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35022. }
  35023. var n, r = t;
  35024. n = d.calculateUTF16asUTF8(s(e))[1],
  35025. t += n;
  35026. var o = this.buffer.byteLength;
  35027. return o < t && this.resize((o *= 2) > t ? o : t),
  35028. t -= n,
  35029. d.encodeUTF16toUTF8(s(e), function(e) {
  35030. this.view[t++] = e
  35031. }
  35032. .bind(this)),
  35033. i ? (this.offset = t,
  35034. this) : t - r
  35035. }
  35036. ,
  35037. a.writeString = a.writeUTF8String,
  35038. f.calculateUTF8Chars = function(e) {
  35039. return d.calculateUTF16asUTF8(s(e))[0]
  35040. }
  35041. ,
  35042. f.calculateUTF8Bytes = function(e) {
  35043. return d.calculateUTF16asUTF8(s(e))[1]
  35044. }
  35045. ,
  35046. f.calculateString = f.calculateUTF8Bytes,
  35047. a.readUTF8String = function(e, t, i) {
  35048. "number" == typeof t && (i = t,
  35049. t = void 0);
  35050. var n = void 0 === i;
  35051. if (n && (i = this.offset),
  35052. void 0 === t && (t = f.METRICS_CHARS),
  35053. !this.noAssert) {
  35054. if ("number" != typeof e || e % 1 != 0)
  35055. throw TypeError("Illegal length: " + e + " (not an integer)");
  35056. if (e |= 0,
  35057. "number" != typeof i || i % 1 != 0)
  35058. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35059. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35060. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35061. }
  35062. var r, o = 0, a = i;
  35063. if (t === f.METRICS_CHARS) {
  35064. if (r = c(),
  35065. d.decodeUTF8(function() {
  35066. return o < e && i < this.limit ? this.view[i++] : null
  35067. }
  35068. .bind(this), function(e) {
  35069. ++o,
  35070. d.UTF8toUTF16(e, r)
  35071. }),
  35072. o !== e)
  35073. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35074. return n ? (this.offset = i,
  35075. r()) : {
  35076. string: r(),
  35077. length: i - a
  35078. }
  35079. }
  35080. if (t !== f.METRICS_BYTES)
  35081. throw TypeError("Unsupported metrics: " + t);
  35082. if (!this.noAssert) {
  35083. if ("number" != typeof i || i % 1 != 0)
  35084. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35085. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35086. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35087. }
  35088. var s = i + e;
  35089. if (d.decodeUTF8toUTF16(function() {
  35090. return i < s ? this.view[i++] : null
  35091. }
  35092. .bind(this), r = c(), this.noAssert),
  35093. i !== s)
  35094. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35095. return n ? (this.offset = i,
  35096. r()) : {
  35097. string: r(),
  35098. length: i - a
  35099. }
  35100. }
  35101. ,
  35102. a.readString = a.readUTF8String,
  35103. a.writeVString = function(e, t) {
  35104. var i = void 0 === t;
  35105. if (i && (t = this.offset),
  35106. !this.noAssert) {
  35107. if ("string" != typeof e)
  35108. throw TypeError("Illegal str: Not a string");
  35109. if ("number" != typeof t || t % 1 != 0)
  35110. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35111. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35112. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35113. }
  35114. var n, r, o = t;
  35115. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35116. r = f.calculateVarint32(n),
  35117. t += r + n;
  35118. var a = this.buffer.byteLength;
  35119. if (a < t && this.resize((a *= 2) > t ? a : t),
  35120. t -= r + n,
  35121. t += this.writeVarint32(n, t),
  35122. d.encodeUTF16toUTF8(s(e), function(e) {
  35123. this.view[t++] = e
  35124. }
  35125. .bind(this)),
  35126. t !== o + n + r)
  35127. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35128. return i ? (this.offset = t,
  35129. this) : t - o
  35130. }
  35131. ,
  35132. a.readVString = function(e) {
  35133. var t = void 0 === e;
  35134. if (t && (e = this.offset),
  35135. !this.noAssert) {
  35136. if ("number" != typeof e || e % 1 != 0)
  35137. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35138. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35139. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35140. }
  35141. var i = e
  35142. , n = this.readVarint32(e)
  35143. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35144. return e += r.length,
  35145. t ? (this.offset = e,
  35146. r.string) : {
  35147. string: r.string,
  35148. length: e - i
  35149. }
  35150. }
  35151. ,
  35152. a.append = function(e, t, i) {
  35153. "number" != typeof t && "string" == typeof t || (i = t,
  35154. t = void 0);
  35155. var n = void 0 === i;
  35156. if (n && (i = this.offset),
  35157. !this.noAssert) {
  35158. if ("number" != typeof i || i % 1 != 0)
  35159. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35160. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35161. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35162. }
  35163. e instanceof f || (e = f.wrap(e, t));
  35164. var r = e.limit - e.offset;
  35165. if (r <= 0)
  35166. return this;
  35167. i += r;
  35168. var o = this.buffer.byteLength;
  35169. return o < i && this.resize((o *= 2) > i ? o : i),
  35170. i -= r,
  35171. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35172. e.offset += r,
  35173. n && (this.offset += r),
  35174. this
  35175. }
  35176. ,
  35177. a.appendTo = function(e, t) {
  35178. return e.append(this, t),
  35179. this
  35180. }
  35181. ,
  35182. a.assert = function(e) {
  35183. return this.noAssert = !e,
  35184. this
  35185. }
  35186. ,
  35187. a.capacity = function() {
  35188. return this.buffer.byteLength
  35189. }
  35190. ,
  35191. a.clear = function() {
  35192. return this.offset = 0,
  35193. this.limit = this.buffer.byteLength,
  35194. this.markedOffset = -1,
  35195. this
  35196. }
  35197. ,
  35198. a.clone = function(e) {
  35199. var t = new f(0,this.littleEndian,this.noAssert);
  35200. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35201. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35202. t.view = this.view),
  35203. t.offset = this.offset,
  35204. t.markedOffset = this.markedOffset,
  35205. t.limit = this.limit,
  35206. t
  35207. }
  35208. ,
  35209. a.compact = function(e, t) {
  35210. if (void 0 === e && (e = this.offset),
  35211. void 0 === t && (t = this.limit),
  35212. !this.noAssert) {
  35213. if ("number" != typeof e || e % 1 != 0)
  35214. throw TypeError("Illegal begin: Not an integer");
  35215. if (e >>>= 0,
  35216. "number" != typeof t || t % 1 != 0)
  35217. throw TypeError("Illegal end: Not an integer");
  35218. if (t >>>= 0,
  35219. e < 0 || t < e || t > this.buffer.byteLength)
  35220. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35221. }
  35222. if (0 === e && t === this.buffer.byteLength)
  35223. return this;
  35224. var i = t - e;
  35225. if (0 == i)
  35226. return this.buffer = o,
  35227. this.view = null,
  35228. 0 <= this.markedOffset && (this.markedOffset -= e),
  35229. this.offset = 0,
  35230. this.limit = 0,
  35231. this;
  35232. var n = new ArrayBuffer(i)
  35233. , r = new Uint8Array(n);
  35234. return r.set(this.view.subarray(e, t)),
  35235. this.buffer = n,
  35236. this.view = r,
  35237. 0 <= this.markedOffset && (this.markedOffset -= e),
  35238. this.offset = 0,
  35239. this.limit = i,
  35240. this
  35241. }
  35242. ,
  35243. a.copy = function(e, t) {
  35244. if (void 0 === e && (e = this.offset),
  35245. void 0 === t && (t = this.limit),
  35246. !this.noAssert) {
  35247. if ("number" != typeof e || e % 1 != 0)
  35248. throw TypeError("Illegal begin: Not an integer");
  35249. if (e >>>= 0,
  35250. "number" != typeof t || t % 1 != 0)
  35251. throw TypeError("Illegal end: Not an integer");
  35252. if (t >>>= 0,
  35253. e < 0 || t < e || t > this.buffer.byteLength)
  35254. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35255. }
  35256. if (e === t)
  35257. return new f(0,this.littleEndian,this.noAssert);
  35258. var i = t - e
  35259. , n = new f(i,this.littleEndian,this.noAssert);
  35260. return n.offset = 0,
  35261. n.limit = i,
  35262. 0 <= n.markedOffset && (n.markedOffset -= e),
  35263. this.copyTo(n, 0, e, t),
  35264. n
  35265. }
  35266. ,
  35267. a.copyTo = function(e, t, i, n) {
  35268. var r, o;
  35269. if (!this.noAssert && !f.isByteBuffer(e))
  35270. throw TypeError("Illegal target: Not a ByteBuffer");
  35271. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35272. i = (r = void 0 === i) ? this.offset : 0 | i,
  35273. n = void 0 === n ? this.limit : 0 | n,
  35274. t < 0 || t > e.buffer.byteLength)
  35275. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35276. if (i < 0 || n > this.buffer.byteLength)
  35277. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35278. var a = n - i;
  35279. return 0 == a ? e : (e.ensureCapacity(t + a),
  35280. e.view.set(this.view.subarray(i, n), t),
  35281. r && (this.offset += a),
  35282. o && (e.offset += a),
  35283. this)
  35284. }
  35285. ,
  35286. a.ensureCapacity = function(e) {
  35287. var t = this.buffer.byteLength;
  35288. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35289. }
  35290. ,
  35291. a.fill = function(e, t, i) {
  35292. var n = void 0 === t;
  35293. if (n && (t = this.offset),
  35294. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35295. void 0 === t && (t = this.offset),
  35296. void 0 === i && (i = this.limit),
  35297. !this.noAssert) {
  35298. if ("number" != typeof e || e % 1 != 0)
  35299. throw TypeError("Illegal value: " + e + " (not an integer)");
  35300. if (e |= 0,
  35301. "number" != typeof t || t % 1 != 0)
  35302. throw TypeError("Illegal begin: Not an integer");
  35303. if (t >>>= 0,
  35304. "number" != typeof i || i % 1 != 0)
  35305. throw TypeError("Illegal end: Not an integer");
  35306. if (i >>>= 0,
  35307. t < 0 || i < t || i > this.buffer.byteLength)
  35308. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35309. }
  35310. if (i <= t)
  35311. return this;
  35312. for (; t < i; )
  35313. this.view[t++] = e;
  35314. return n && (this.offset = t),
  35315. this
  35316. }
  35317. ,
  35318. a.flip = function() {
  35319. return this.limit = this.offset,
  35320. this.offset = 0,
  35321. this
  35322. }
  35323. ,
  35324. a.mark = function(e) {
  35325. if (e = void 0 === e ? this.offset : e,
  35326. !this.noAssert) {
  35327. if ("number" != typeof e || e % 1 != 0)
  35328. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35329. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35330. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35331. }
  35332. return this.markedOffset = e,
  35333. this
  35334. }
  35335. ,
  35336. a.order = function(e) {
  35337. if (!this.noAssert && "boolean" != typeof e)
  35338. throw TypeError("Illegal littleEndian: Not a boolean");
  35339. return this.littleEndian = !!e,
  35340. this
  35341. }
  35342. ,
  35343. a.LE = function(e) {
  35344. return this.littleEndian = void 0 === e || !!e,
  35345. this
  35346. }
  35347. ,
  35348. a.BE = function(e) {
  35349. return this.littleEndian = void 0 !== e && !e,
  35350. this
  35351. }
  35352. ,
  35353. a.prepend = function(e, t, i) {
  35354. "number" != typeof t && "string" == typeof t || (i = t,
  35355. t = void 0);
  35356. var n = void 0 === i;
  35357. if (n && (i = this.offset),
  35358. !this.noAssert) {
  35359. if ("number" != typeof i || i % 1 != 0)
  35360. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35361. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35362. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35363. }
  35364. e instanceof f || (e = f.wrap(e, t));
  35365. var r = e.limit - e.offset;
  35366. if (r <= 0)
  35367. return this;
  35368. var o = r - i;
  35369. if (0 < o) {
  35370. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35371. , s = new Uint8Array(a);
  35372. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35373. this.buffer = a,
  35374. this.view = s,
  35375. this.offset += o,
  35376. 0 <= this.markedOffset && (this.markedOffset += o),
  35377. this.limit += o,
  35378. i += o
  35379. } else
  35380. new Uint8Array(this.buffer);
  35381. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35382. e.offset = e.limit,
  35383. n && (this.offset -= r),
  35384. this
  35385. }
  35386. ,
  35387. a.prependTo = function(e, t) {
  35388. return e.prepend(this, t),
  35389. this
  35390. }
  35391. ,
  35392. a.printDebug = function(e) {
  35393. "function" != typeof e && (e = console.log.bind(console)),
  35394. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35395. }
  35396. ,
  35397. a.remaining = function() {
  35398. return this.limit - this.offset
  35399. }
  35400. ,
  35401. a.reset = function() {
  35402. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35403. this.markedOffset = -1) : this.offset = 0,
  35404. this
  35405. }
  35406. ,
  35407. a.resize = function(e) {
  35408. if (!this.noAssert) {
  35409. if ("number" != typeof e || e % 1 != 0)
  35410. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35411. if ((e |= 0) < 0)
  35412. throw RangeError("Illegal capacity: 0 <= " + e)
  35413. }
  35414. if (this.buffer.byteLength < e) {
  35415. var t = new ArrayBuffer(e)
  35416. , i = new Uint8Array(t);
  35417. i.set(this.view),
  35418. this.buffer = t,
  35419. this.view = i
  35420. }
  35421. return this
  35422. }
  35423. ,
  35424. a.reverse = function(e, t) {
  35425. if (void 0 === e && (e = this.offset),
  35426. void 0 === t && (t = this.limit),
  35427. !this.noAssert) {
  35428. if ("number" != typeof e || e % 1 != 0)
  35429. throw TypeError("Illegal begin: Not an integer");
  35430. if (e >>>= 0,
  35431. "number" != typeof t || t % 1 != 0)
  35432. throw TypeError("Illegal end: Not an integer");
  35433. if (t >>>= 0,
  35434. e < 0 || t < e || t > this.buffer.byteLength)
  35435. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35436. }
  35437. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35438. this
  35439. }
  35440. ,
  35441. a.skip = function(e) {
  35442. if (!this.noAssert) {
  35443. if ("number" != typeof e || e % 1 != 0)
  35444. throw TypeError("Illegal length: " + e + " (not an integer)");
  35445. e |= 0
  35446. }
  35447. var t = this.offset + e;
  35448. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35449. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35450. return this.offset = t,
  35451. this
  35452. }
  35453. ,
  35454. a.slice = function(e, t) {
  35455. if (void 0 === e && (e = this.offset),
  35456. void 0 === t && (t = this.limit),
  35457. !this.noAssert) {
  35458. if ("number" != typeof e || e % 1 != 0)
  35459. throw TypeError("Illegal begin: Not an integer");
  35460. if (e >>>= 0,
  35461. "number" != typeof t || t % 1 != 0)
  35462. throw TypeError("Illegal end: Not an integer");
  35463. if (t >>>= 0,
  35464. e < 0 || t < e || t > this.buffer.byteLength)
  35465. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35466. }
  35467. var i = this.clone();
  35468. return i.offset = e,
  35469. i.limit = t,
  35470. i
  35471. }
  35472. ,
  35473. a.toBuffer = function(e) {
  35474. var t = this.offset
  35475. , i = this.limit;
  35476. if (!this.noAssert) {
  35477. if ("number" != typeof t || t % 1 != 0)
  35478. throw TypeError("Illegal offset: Not an integer");
  35479. if (t >>>= 0,
  35480. "number" != typeof i || i % 1 != 0)
  35481. throw TypeError("Illegal limit: Not an integer");
  35482. if (i >>>= 0,
  35483. t < 0 || i < t || i > this.buffer.byteLength)
  35484. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35485. }
  35486. if (!e && 0 === t && i === this.buffer.byteLength)
  35487. return this.buffer;
  35488. if (t === i)
  35489. return o;
  35490. var n = new ArrayBuffer(i - t);
  35491. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35492. n
  35493. }
  35494. ,
  35495. a.toArrayBuffer = a.toBuffer,
  35496. a.toString = function(e, t, i) {
  35497. if (void 0 === e)
  35498. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35499. switch ("number" == typeof e && (i = t = e = "utf8"),
  35500. e) {
  35501. case "utf8":
  35502. return this.toUTF8(t, i);
  35503. case "base64":
  35504. return this.toBase64(t, i);
  35505. case "hex":
  35506. return this.toHex(t, i);
  35507. case "binary":
  35508. return this.toBinary(t, i);
  35509. case "debug":
  35510. return this.toDebug();
  35511. case "columns":
  35512. return this.toColumns();
  35513. default:
  35514. throw Error("Unsupported encoding: " + e)
  35515. }
  35516. }
  35517. ;
  35518. var h = function() {
  35519. for (var e = {}, r = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], a = [], t = 0, i = r.length; t < i; ++t)
  35520. a[r[t]] = t;
  35521. return e.encode = function(e, t) {
  35522. for (var i, n; null !== (i = e()); )
  35523. t(r[i >> 2 & 63]),
  35524. n = (3 & i) << 4,
  35525. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35526. n = (15 & i) << 2,
  35527. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35528. t(r[63 & i])) : (t(r[63 & n]),
  35529. t(61))) : (t(r[63 & n]),
  35530. t(61),
  35531. t(61))
  35532. }
  35533. ,
  35534. e.decode = function(e, t) {
  35535. function i(e) {
  35536. throw Error("Illegal character code: " + e)
  35537. }
  35538. for (var n, r, o; null !== (n = e()); )
  35539. if (void 0 === (r = a[n]) && i(n),
  35540. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35541. t(r << 2 >>> 0 | (48 & o) >> 4),
  35542. null !== (n = e()))) {
  35543. if (void 0 === (r = a[n])) {
  35544. if (61 === n)
  35545. break;
  35546. i(n)
  35547. }
  35548. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35549. null !== (n = e())) {
  35550. if (void 0 === (o = a[n])) {
  35551. if (61 === n)
  35552. break;
  35553. i(n)
  35554. }
  35555. t((3 & r) << 6 >>> 0 | o)
  35556. }
  35557. }
  35558. }
  35559. ,
  35560. e.test = function(e) {
  35561. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35562. }
  35563. ,
  35564. e
  35565. }();
  35566. a.toBase64 = function(e, t) {
  35567. if (void 0 === e && (e = this.offset),
  35568. void 0 === t && (t = this.limit),
  35569. t |= 0,
  35570. (e |= 0) < 0 || t > this.capacity || t < e)
  35571. throw RangeError("begin, end");
  35572. var i;
  35573. return h.encode(function() {
  35574. return e < t ? this.view[e++] : null
  35575. }
  35576. .bind(this), i = c()),
  35577. i()
  35578. }
  35579. ,
  35580. f.fromBase64 = function(e, t) {
  35581. if ("string" != typeof e)
  35582. throw TypeError("str");
  35583. var i = new f(e.length / 4 * 3,t)
  35584. , n = 0;
  35585. return h.decode(s(e), function(e) {
  35586. i.view[n++] = e
  35587. }),
  35588. i.limit = n,
  35589. i
  35590. }
  35591. ,
  35592. f.btoa = function(e) {
  35593. return f.fromBinary(e).toBase64()
  35594. }
  35595. ,
  35596. f.atob = function(e) {
  35597. return f.fromBase64(e).toBinary()
  35598. }
  35599. ,
  35600. a.toBinary = function(e, t) {
  35601. if (void 0 === e && (e = this.offset),
  35602. void 0 === t && (t = this.limit),
  35603. t |= 0,
  35604. (e |= 0) < 0 || t > this.capacity() || t < e)
  35605. throw RangeError("begin, end");
  35606. if (e === t)
  35607. return "";
  35608. for (var i = [], n = []; e < t; )
  35609. i.push(this.view[e++]),
  35610. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35611. i = []);
  35612. return n.join("") + String.fromCharCode.apply(String, i)
  35613. }
  35614. ,
  35615. f.fromBinary = function(e, t) {
  35616. if ("string" != typeof e)
  35617. throw TypeError("str");
  35618. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35619. if (255 < (i = e.charCodeAt(n)))
  35620. throw RangeError("illegal char code: " + i);
  35621. o.view[n++] = i
  35622. }
  35623. return o.limit = r,
  35624. o
  35625. }
  35626. ,
  35627. a.toDebug = function(e) {
  35628. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35629. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35630. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35631. ++i,
  35632. e && 0 < i && i % 16 == 0 && i !== n) {
  35633. for (; r.length < 51; )
  35634. r += " ";
  35635. a += r + o + "\n",
  35636. r = o = ""
  35637. }
  35638. r += i === this.offset && i === this.limit ? i === this.markedOffset ? "!" : "|" : i === this.offset ? i === this.markedOffset ? "[" : "<" : i === this.limit ? i === this.markedOffset ? "]" : ">" : i === this.markedOffset ? "'" : e || 0 !== i && i !== n ? " " : ""
  35639. }
  35640. if (e && " " !== r) {
  35641. for (; r.length < 51; )
  35642. r += " ";
  35643. a += r + o + "\n"
  35644. }
  35645. return e ? a : r
  35646. }
  35647. ,
  35648. f.fromDebug = function(e, t, i) {
  35649. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  35650. switch (n = e.charAt(s++)) {
  35651. case "!":
  35652. if (!i) {
  35653. if (h || u || d) {
  35654. p = !0;
  35655. break
  35656. }
  35657. h = u = d = !0
  35658. }
  35659. a.offset = a.markedOffset = a.limit = l,
  35660. c = !1;
  35661. break;
  35662. case "|":
  35663. if (!i) {
  35664. if (h || d) {
  35665. p = !0;
  35666. break
  35667. }
  35668. h = d = !0
  35669. }
  35670. a.offset = a.limit = l,
  35671. c = !1;
  35672. break;
  35673. case "[":
  35674. if (!i) {
  35675. if (h || u) {
  35676. p = !0;
  35677. break
  35678. }
  35679. h = u = !0
  35680. }
  35681. a.offset = a.markedOffset = l,
  35682. c = !1;
  35683. break;
  35684. case "<":
  35685. if (!i) {
  35686. if (h) {
  35687. p = !0;
  35688. break
  35689. }
  35690. h = !0
  35691. }
  35692. a.offset = l,
  35693. c = !1;
  35694. break;
  35695. case "]":
  35696. if (!i) {
  35697. if (d || u) {
  35698. p = !0;
  35699. break
  35700. }
  35701. d = u = !0
  35702. }
  35703. a.limit = a.markedOffset = l,
  35704. c = !1;
  35705. break;
  35706. case ">":
  35707. if (!i) {
  35708. if (d) {
  35709. p = !0;
  35710. break
  35711. }
  35712. d = !0
  35713. }
  35714. a.limit = l,
  35715. c = !1;
  35716. break;
  35717. case "'":
  35718. if (!i) {
  35719. if (u) {
  35720. p = !0;
  35721. break
  35722. }
  35723. u = !0
  35724. }
  35725. a.markedOffset = l,
  35726. c = !1;
  35727. break;
  35728. case " ":
  35729. c = !1;
  35730. break;
  35731. default:
  35732. if (!i && c) {
  35733. p = !0;
  35734. break
  35735. }
  35736. if (r = parseInt(n + e.charAt(s++), 16),
  35737. !i && (isNaN(r) || r < 0 || 255 < r))
  35738. throw TypeError("Illegal str: Not a debug encoded string");
  35739. a.view[l++] = r,
  35740. c = !0
  35741. }
  35742. if (p)
  35743. throw TypeError("Illegal str: Invalid symbol at " + s)
  35744. }
  35745. if (!i) {
  35746. if (!h || !d)
  35747. throw TypeError("Illegal str: Missing offset or limit");
  35748. if (l < a.buffer.byteLength)
  35749. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  35750. }
  35751. return a
  35752. }
  35753. ,
  35754. a.toHex = function(e, t) {
  35755. if (e = void 0 === e ? this.offset : e,
  35756. t = void 0 === t ? this.limit : t,
  35757. !this.noAssert) {
  35758. if ("number" != typeof e || e % 1 != 0)
  35759. throw TypeError("Illegal begin: Not an integer");
  35760. if (e >>>= 0,
  35761. "number" != typeof t || t % 1 != 0)
  35762. throw TypeError("Illegal end: Not an integer");
  35763. if (t >>>= 0,
  35764. e < 0 || t < e || t > this.buffer.byteLength)
  35765. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35766. }
  35767. for (var i, n = new Array(t - e); e < t; )
  35768. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  35769. return n.join("")
  35770. }
  35771. ,
  35772. f.fromHex = function(e, t, i) {
  35773. if (!i) {
  35774. if ("string" != typeof e)
  35775. throw TypeError("Illegal str: Not a string");
  35776. if (e.length % 2 != 0)
  35777. throw TypeError("Illegal str: Length not a multiple of 2")
  35778. }
  35779. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  35780. if (n = parseInt(e.substring(a, a + 2), 16),
  35781. !i && (!isFinite(n) || n < 0 || 255 < n))
  35782. throw TypeError("Illegal str: Contains non-hex characters");
  35783. o.view[s++] = n
  35784. }
  35785. return o.limit = s,
  35786. o
  35787. }
  35788. ;
  35789. var u, d = u = {
  35790. MAX_CODEPOINT: 1114111,
  35791. encodeUTF8: function(e, t) {
  35792. var i = null;
  35793. for ("number" == typeof e && (i = e,
  35794. e = function() {
  35795. return null
  35796. }
  35797. ); null !== i || null !== (i = e()); )
  35798. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  35799. t(i >> 12 & 63 | 128)),
  35800. t(i >> 6 & 63 | 128)),
  35801. t(63 & i | 128)),
  35802. i = null
  35803. },
  35804. decodeUTF8: function(e, t) {
  35805. for (var i, n, r, o, a = function(e) {
  35806. e = e.slice(0, e.indexOf(null));
  35807. var t = Error(e.toString());
  35808. throw t.name = "TruncatedError",
  35809. t.bytes = e,
  35810. t
  35811. }; null !== (i = e()); )
  35812. if (0 == (128 & i))
  35813. t(i);
  35814. else if (192 == (224 & i))
  35815. null === (n = e()) && a([i, n]),
  35816. t((31 & i) << 6 | 63 & n);
  35817. else if (224 == (240 & i))
  35818. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  35819. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  35820. else {
  35821. if (240 != (248 & i))
  35822. throw RangeError("Illegal starting byte: " + i);
  35823. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  35824. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  35825. }
  35826. },
  35827. UTF16toUTF8: function(e, t) {
  35828. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  35829. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  35830. n = null) : t(i);
  35831. null !== n && t(n)
  35832. },
  35833. UTF8toUTF16: function(e, t) {
  35834. var i = null;
  35835. for ("number" == typeof e && (i = e,
  35836. e = function() {
  35837. return null
  35838. }
  35839. ); null !== i || null !== (i = e()); )
  35840. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  35841. t(i % 1024 + 56320)),
  35842. i = null
  35843. },
  35844. encodeUTF16toUTF8: function(e, t) {
  35845. u.UTF16toUTF8(e, function(e) {
  35846. u.encodeUTF8(e, t)
  35847. })
  35848. },
  35849. decodeUTF8toUTF16: function(e, t) {
  35850. u.decodeUTF8(e, function(e) {
  35851. u.UTF8toUTF16(e, t)
  35852. })
  35853. },
  35854. calculateCodePoint: function(e) {
  35855. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35856. },
  35857. calculateUTF8: function(e) {
  35858. for (var t, i = 0; null !== (t = e()); )
  35859. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  35860. return i
  35861. },
  35862. calculateUTF16asUTF8: function(e) {
  35863. var t = 0
  35864. , i = 0;
  35865. return u.UTF16toUTF8(e, function(e) {
  35866. ++t,
  35867. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35868. }),
  35869. [t, i]
  35870. }
  35871. };
  35872. return a.toUTF8 = function(t, i) {
  35873. if (void 0 === t && (t = this.offset),
  35874. void 0 === i && (i = this.limit),
  35875. !this.noAssert) {
  35876. if ("number" != typeof t || t % 1 != 0)
  35877. throw TypeError("Illegal begin: Not an integer");
  35878. if (t >>>= 0,
  35879. "number" != typeof i || i % 1 != 0)
  35880. throw TypeError("Illegal end: Not an integer");
  35881. if (i >>>= 0,
  35882. t < 0 || i < t || i > this.buffer.byteLength)
  35883. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35884. }
  35885. var e;
  35886. try {
  35887. d.decodeUTF8toUTF16(function() {
  35888. return t < i ? this.view[t++] : null
  35889. }
  35890. .bind(this), e = c())
  35891. } catch (e) {
  35892. if (t !== i)
  35893. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  35894. }
  35895. return e()
  35896. }
  35897. ,
  35898. f.fromUTF8 = function(e, t, i) {
  35899. if (!i && "string" != typeof e)
  35900. throw TypeError("Illegal str: Not a string");
  35901. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  35902. , r = 0;
  35903. return d.encodeUTF16toUTF8(s(e), function(e) {
  35904. n.view[r++] = e
  35905. }),
  35906. n.limit = r,
  35907. n
  35908. }
  35909. ,
  35910. f
  35911. }
  35912. ,
  35913. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  35914. var e;
  35915. try {
  35916. e = t("long")
  35917. } catch (e) {}
  35918. return r(e)
  35919. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  35920. }
  35921. , {
  35922. long: 216
  35923. }],
  35924. 216: [function(e, t, i) {
  35925. var n, r;
  35926. n = this,
  35927. r = function() {
  35928. "use strict";
  35929. function n(e, t, i) {
  35930. this.low = 0 | e,
  35931. this.high = 0 | t,
  35932. this.unsigned = !!i
  35933. }
  35934. function p(e) {
  35935. return !0 === (e && e.__isLong__)
  35936. }
  35937. function e(e, t) {
  35938. var i, n, r;
  35939. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  35940. r && (a[e] = i),
  35941. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  35942. r && (o[e] = i),
  35943. i)
  35944. }
  35945. function f(e, t) {
  35946. if (isNaN(e) || !isFinite(e))
  35947. return t ? l : y;
  35948. if (t) {
  35949. if (e < 0)
  35950. return l;
  35951. if (r <= e)
  35952. return I
  35953. } else {
  35954. if (e <= -s)
  35955. return E;
  35956. if (s <= e + 1)
  35957. return C
  35958. }
  35959. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  35960. }
  35961. function g(e, t, i) {
  35962. return new n(e,t,i)
  35963. }
  35964. function h(e, t, i) {
  35965. if (0 === e.length)
  35966. throw Error("empty string");
  35967. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  35968. return y;
  35969. if (t = "number" == typeof t ? (i = t,
  35970. !1) : !!t,
  35971. (i = i || 10) < 2 || 36 < i)
  35972. throw RangeError("radix");
  35973. var n;
  35974. if (0 < (n = e.indexOf("-")))
  35975. throw Error("interior hyphen");
  35976. if (0 === n)
  35977. return h(e.substring(1), t, i).neg();
  35978. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  35979. var s = Math.min(8, e.length - a)
  35980. , l = parseInt(e.substring(a, a + s), i);
  35981. if (s < 8) {
  35982. var c = f(u(i, s));
  35983. o = o.mul(c).add(f(l))
  35984. } else
  35985. o = (o = o.mul(r)).add(f(l))
  35986. }
  35987. return o.unsigned = t,
  35988. o
  35989. }
  35990. function m(e) {
  35991. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  35992. }
  35993. Object.defineProperty(n.prototype, "__isLong__", {
  35994. value: !0,
  35995. enumerable: !1,
  35996. configurable: !1
  35997. }),
  35998. n.isLong = p;
  35999. var o = {}
  36000. , a = {};
  36001. n.fromInt = e,
  36002. n.fromNumber = f,
  36003. n.fromBits = g;
  36004. var u = Math.pow;
  36005. n.fromString = h,
  36006. n.fromValue = m;
  36007. var i = 4294967296
  36008. , r = 0x10000000000000000
  36009. , s = r / 2
  36010. , v = e(1 << 24)
  36011. , y = e(0);
  36012. n.ZERO = y;
  36013. var l = e(0, !0);
  36014. n.UZERO = l;
  36015. var c = e(1);
  36016. n.ONE = c;
  36017. var d = e(1, !0);
  36018. n.UONE = d;
  36019. var A = e(-1);
  36020. n.NEG_ONE = A;
  36021. var C = g(-1, 2147483647, !1);
  36022. n.MAX_VALUE = C;
  36023. var I = g(-1, -1, !0);
  36024. n.MAX_UNSIGNED_VALUE = I;
  36025. var E = g(0, -2147483648, !1);
  36026. n.MIN_VALUE = E;
  36027. var t = n.prototype;
  36028. return t.toInt = function() {
  36029. return this.unsigned ? this.low >>> 0 : this.low
  36030. }
  36031. ,
  36032. t.toNumber = function() {
  36033. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36034. }
  36035. ,
  36036. t.toString = function(e) {
  36037. if ((e = e || 10) < 2 || 36 < e)
  36038. throw RangeError("radix");
  36039. if (this.isZero())
  36040. return "0";
  36041. if (this.isNegative()) {
  36042. if (this.eq(E)) {
  36043. var t = f(e)
  36044. , i = this.div(t)
  36045. , n = i.mul(t).sub(this);
  36046. return i.toString(e) + n.toInt().toString(e)
  36047. }
  36048. return "-" + this.neg().toString(e)
  36049. }
  36050. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36051. var s = o.div(r)
  36052. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36053. if ((o = s).isZero())
  36054. return l + a;
  36055. for (; l.length < 6; )
  36056. l = "0" + l;
  36057. a = "" + l + a
  36058. }
  36059. }
  36060. ,
  36061. t.getHighBits = function() {
  36062. return this.high
  36063. }
  36064. ,
  36065. t.getHighBitsUnsigned = function() {
  36066. return this.high >>> 0
  36067. }
  36068. ,
  36069. t.getLowBits = function() {
  36070. return this.low
  36071. }
  36072. ,
  36073. t.getLowBitsUnsigned = function() {
  36074. return this.low >>> 0
  36075. }
  36076. ,
  36077. t.getNumBitsAbs = function() {
  36078. if (this.isNegative())
  36079. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36080. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36081. ;
  36082. return 0 != this.high ? t + 33 : t + 1
  36083. }
  36084. ,
  36085. t.isZero = function() {
  36086. return 0 === this.high && 0 === this.low
  36087. }
  36088. ,
  36089. t.isNegative = function() {
  36090. return !this.unsigned && this.high < 0
  36091. }
  36092. ,
  36093. t.isPositive = function() {
  36094. return this.unsigned || 0 <= this.high
  36095. }
  36096. ,
  36097. t.isOdd = function() {
  36098. return 1 == (1 & this.low)
  36099. }
  36100. ,
  36101. t.isEven = function() {
  36102. return 0 == (1 & this.low)
  36103. }
  36104. ,
  36105. t.equals = function(e) {
  36106. return p(e) || (e = m(e)),
  36107. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36108. }
  36109. ,
  36110. t.eq = t.equals,
  36111. t.notEquals = function(e) {
  36112. return !this.eq(e)
  36113. }
  36114. ,
  36115. t.neq = t.notEquals,
  36116. t.lessThan = function(e) {
  36117. return this.comp(e) < 0
  36118. }
  36119. ,
  36120. t.lt = t.lessThan,
  36121. t.lessThanOrEqual = function(e) {
  36122. return this.comp(e) <= 0
  36123. }
  36124. ,
  36125. t.lte = t.lessThanOrEqual,
  36126. t.greaterThan = function(e) {
  36127. return 0 < this.comp(e)
  36128. }
  36129. ,
  36130. t.gt = t.greaterThan,
  36131. t.greaterThanOrEqual = function(e) {
  36132. return 0 <= this.comp(e)
  36133. }
  36134. ,
  36135. t.gte = t.greaterThanOrEqual,
  36136. t.compare = function(e) {
  36137. if (p(e) || (e = m(e)),
  36138. this.eq(e))
  36139. return 0;
  36140. var t = this.isNegative()
  36141. , i = e.isNegative();
  36142. return t && !i ? -1 : !t && i ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36143. }
  36144. ,
  36145. t.comp = t.compare,
  36146. t.negate = function() {
  36147. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36148. }
  36149. ,
  36150. t.neg = t.negate,
  36151. t.add = function(e) {
  36152. p(e) || (e = m(e));
  36153. var t = this.high >>> 16
  36154. , i = 65535 & this.high
  36155. , n = this.low >>> 16
  36156. , r = 65535 & this.low
  36157. , o = e.high >>> 16
  36158. , a = 65535 & e.high
  36159. , s = e.low >>> 16
  36160. , l = 0
  36161. , c = 0
  36162. , h = 0
  36163. , u = 0;
  36164. return h += (u += r + (65535 & e.low)) >>> 16,
  36165. c += (h += n + s) >>> 16,
  36166. l += (c += i + a) >>> 16,
  36167. l += t + o,
  36168. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36169. }
  36170. ,
  36171. t.subtract = function(e) {
  36172. return p(e) || (e = m(e)),
  36173. this.add(e.neg())
  36174. }
  36175. ,
  36176. t.sub = t.subtract,
  36177. t.multiply = function(e) {
  36178. if (this.isZero())
  36179. return y;
  36180. if (p(e) || (e = m(e)),
  36181. e.isZero())
  36182. return y;
  36183. if (this.eq(E))
  36184. return e.isOdd() ? E : y;
  36185. if (e.eq(E))
  36186. return this.isOdd() ? E : y;
  36187. if (this.isNegative())
  36188. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36189. if (e.isNegative())
  36190. return this.mul(e.neg()).neg();
  36191. if (this.lt(v) && e.lt(v))
  36192. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36193. var t = this.high >>> 16
  36194. , i = 65535 & this.high
  36195. , n = this.low >>> 16
  36196. , r = 65535 & this.low
  36197. , o = e.high >>> 16
  36198. , a = 65535 & e.high
  36199. , s = e.low >>> 16
  36200. , l = 65535 & e.low
  36201. , c = 0
  36202. , h = 0
  36203. , u = 0
  36204. , d = 0;
  36205. return u += (d += r * l) >>> 16,
  36206. h += (u += n * l) >>> 16,
  36207. u &= 65535,
  36208. h += (u += r * s) >>> 16,
  36209. c += (h += i * l) >>> 16,
  36210. h &= 65535,
  36211. c += (h += n * s) >>> 16,
  36212. h &= 65535,
  36213. c += (h += r * a) >>> 16,
  36214. c += t * l + i * s + n * a + r * o,
  36215. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36216. }
  36217. ,
  36218. t.mul = t.multiply,
  36219. t.divide = function(e) {
  36220. if (p(e) || (e = m(e)),
  36221. e.isZero())
  36222. throw Error("division by zero");
  36223. if (this.isZero())
  36224. return this.unsigned ? l : y;
  36225. var t, i, n;
  36226. if (this.unsigned) {
  36227. if (e.unsigned || (e = e.toUnsigned()),
  36228. e.gt(this))
  36229. return l;
  36230. if (e.gt(this.shru(1)))
  36231. return d;
  36232. n = l
  36233. } else {
  36234. if (this.eq(E))
  36235. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  36236. n = t.add(i.div(e)));
  36237. if (e.eq(E))
  36238. return this.unsigned ? l : y;
  36239. if (this.isNegative())
  36240. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36241. if (e.isNegative())
  36242. return this.div(e.neg()).neg();
  36243. n = y
  36244. }
  36245. for (i = this; i.gte(e); ) {
  36246. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36247. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  36248. s = (a = f(t -= o, this.unsigned)).mul(e);
  36249. a.isZero() && (a = c),
  36250. n = n.add(a),
  36251. i = i.sub(s)
  36252. }
  36253. return n
  36254. }
  36255. ,
  36256. t.div = t.divide,
  36257. t.modulo = function(e) {
  36258. return p(e) || (e = m(e)),
  36259. this.sub(this.div(e).mul(e))
  36260. }
  36261. ,
  36262. t.mod = t.modulo,
  36263. t.not = function() {
  36264. return g(~this.low, ~this.high, this.unsigned)
  36265. }
  36266. ,
  36267. t.and = function(e) {
  36268. return p(e) || (e = m(e)),
  36269. g(this.low & e.low, this.high & e.high, this.unsigned)
  36270. }
  36271. ,
  36272. t.or = function(e) {
  36273. return p(e) || (e = m(e)),
  36274. g(this.low | e.low, this.high | e.high, this.unsigned)
  36275. }
  36276. ,
  36277. t.xor = function(e) {
  36278. return p(e) || (e = m(e)),
  36279. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36280. }
  36281. ,
  36282. t.shiftLeft = function(e) {
  36283. return p(e) && (e = e.toInt()),
  36284. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  36285. }
  36286. ,
  36287. t.shl = t.shiftLeft,
  36288. t.shiftRight = function(e) {
  36289. return p(e) && (e = e.toInt()),
  36290. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  36291. }
  36292. ,
  36293. t.shr = t.shiftRight,
  36294. t.shiftRightUnsigned = function(e) {
  36295. if (p(e) && (e = e.toInt()),
  36296. 0 === (e &= 63))
  36297. return this;
  36298. var t = this.high;
  36299. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36300. }
  36301. ,
  36302. t.shru = t.shiftRightUnsigned,
  36303. t.toSigned = function() {
  36304. return this.unsigned ? g(this.low, this.high, !1) : this
  36305. }
  36306. ,
  36307. t.toUnsigned = function() {
  36308. return this.unsigned ? this : g(this.low, this.high, !0)
  36309. }
  36310. ,
  36311. t.toBytes = function(e) {
  36312. return e ? this.toBytesLE() : this.toBytesBE()
  36313. }
  36314. ,
  36315. t.toBytesLE = function() {
  36316. var e = this.high
  36317. , t = this.low;
  36318. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36319. }
  36320. ,
  36321. t.toBytesBE = function() {
  36322. var e = this.high
  36323. , t = this.low;
  36324. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36325. }
  36326. ,
  36327. n
  36328. }
  36329. ,
  36330. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  36331. }
  36332. , {}],
  36333. 217: [function(e, t, i) {
  36334. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  36335. REVISION: "75"
  36336. };
  36337. function Ii(e, t) {
  36338. return e.distance - t.distance
  36339. }
  36340. function Ei(e, t, i, n) {
  36341. if (!1 !== e.visible && (e.raycast(t, i),
  36342. !0 === n))
  36343. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36344. Ei(r[o], t, i, !0)
  36345. }
  36346. function _i(e, t, i) {
  36347. return i < 0 && (i += 1),
  36348. 1 < i && (i -= 1),
  36349. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36350. }
  36351. function bi(e, t, i, n, r, o, a) {
  36352. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36353. r.multiplyScalar(Vt.x),
  36354. o.multiplyScalar(Vt.y),
  36355. a.multiplyScalar(Vt.z),
  36356. r.add(o).add(a),
  36357. r.clone()
  36358. }
  36359. function wi(e, t, i, n, r, o, a) {
  36360. var s = e.material;
  36361. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36362. return null;
  36363. Ut.copy(a),
  36364. Ut.applyMatrix4(e.matrixWorld);
  36365. var l = t.ray.origin.distanceTo(Ut);
  36366. return l < t.near || l > t.far ? null : {
  36367. distance: l,
  36368. point: Ut.clone(),
  36369. object: e
  36370. }
  36371. }
  36372. function Ti(e, t, i, n, r, o, a, s) {
  36373. Mt.fromArray(n, 3 * o),
  36374. Rt.fromArray(n, 3 * a),
  36375. Pt.fromArray(n, 3 * s);
  36376. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36377. return l && (r && (Nt.fromArray(r, 2 * o),
  36378. Ft.fromArray(r, 2 * a),
  36379. Bt.fromArray(r, 2 * s),
  36380. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36381. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36382. l.faceIndex = o),
  36383. l
  36384. }
  36385. function xi() {}
  36386. function Si(e, t, i, n, r, o) {
  36387. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36388. if (s = e[o[t]].x,
  36389. l = e[o[t]].y,
  36390. c = e[o[i]].x,
  36391. h = e[o[i]].y,
  36392. u = e[o[n]].x,
  36393. d = e[o[n]].y,
  36394. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36395. return !1;
  36396. for (g = u - c,
  36397. m = d - h,
  36398. v = s - u,
  36399. y = l - d,
  36400. A = c - s,
  36401. C = h - l,
  36402. a = 0; a < r; a++)
  36403. if (p = e[o[a]].x,
  36404. f = e[o[a]].y,
  36405. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36406. E = v * (f - d) - y * (p - u),
  36407. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36408. return !1;
  36409. return !0
  36410. }
  36411. function Mi(e) {
  36412. switch (e) {
  36413. case Ci.LinearEncoding:
  36414. return ["Linear", "( value )"];
  36415. case Ci.sRGBEncoding:
  36416. return ["sRGB", "( value )"];
  36417. case Ci.RGBEEncoding:
  36418. return ["RGBE", "( value )"];
  36419. case Ci.RGBM7Encoding:
  36420. return ["RGBM", "( value, 7.0 )"];
  36421. case Ci.RGBM16Encoding:
  36422. return ["RGBM", "( value, 16.0 )"];
  36423. case Ci.RGBDEncoding:
  36424. return ["RGBD", "( value, 256.0 )"];
  36425. case Ci.GammaEncoding:
  36426. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36427. default:
  36428. throw new Error("unsupported encoding: " + e)
  36429. }
  36430. }
  36431. function Ri(e, t) {
  36432. var i = Mi(t);
  36433. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36434. }
  36435. function Pi(e) {
  36436. return "" !== e
  36437. }
  36438. function Oi(e, t) {
  36439. return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  36440. }
  36441. function Li(e) {
  36442. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36443. var i = Ci.ShaderChunk[t];
  36444. if (void 0 === i)
  36445. throw new Error("Can not resolve #include <" + t + ">");
  36446. return Li(i)
  36447. })
  36448. }
  36449. function Di(e) {
  36450. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36451. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36452. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36453. return r
  36454. })
  36455. }
  36456. function Ni(e, t, i, n) {
  36457. gi.set(t, i, n).unproject(mi);
  36458. var r = fi[e];
  36459. if (void 0 !== r)
  36460. for (var o = 0, a = r.length; o < a; o++)
  36461. pi.vertices[r[o]].copy(gi)
  36462. }
  36463. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36464. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36465. void 0 === Math.sign && (Math.sign = function(e) {
  36466. return e < 0 ? -1 : 0 < e ? 1 : +e
  36467. }
  36468. ),
  36469. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36470. get: function() {
  36471. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36472. }
  36473. }),
  36474. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36475. writable: !0,
  36476. configurable: !0,
  36477. value: function(e) {
  36478. "use strict";
  36479. if (null == e)
  36480. throw new TypeError("Cannot convert first argument to object");
  36481. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36482. var r = arguments[i];
  36483. if (null != r) {
  36484. r = Object(r);
  36485. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36486. var l = o[a]
  36487. , c = Object.getOwnPropertyDescriptor(r, l);
  36488. void 0 !== c && c.enumerable && (t[l] = r[l])
  36489. }
  36490. }
  36491. }
  36492. return t
  36493. }
  36494. }),
  36495. Ci.MOUSE = {
  36496. LEFT: 0,
  36497. MIDDLE: 1,
  36498. RIGHT: 2
  36499. },
  36500. Ci.CullFaceNone = 0,
  36501. Ci.CullFaceBack = 1,
  36502. Ci.CullFaceFront = 2,
  36503. Ci.CullFaceFrontBack = 3,
  36504. Ci.FrontFaceDirectionCW = 0,
  36505. Ci.FrontFaceDirectionCCW = 1,
  36506. Ci.BasicShadowMap = 0,
  36507. Ci.PCFShadowMap = 1,
  36508. Ci.PCFSoftShadowMap = 2,
  36509. Ci.FrontSide = 0,
  36510. Ci.BackSide = 1,
  36511. Ci.DoubleSide = 2,
  36512. Ci.FlatShading = 1,
  36513. Ci.SmoothShading = 2,
  36514. Ci.NoColors = 0,
  36515. Ci.FaceColors = 1,
  36516. Ci.VertexColors = 2,
  36517. Ci.NoBlending = 0,
  36518. Ci.NormalBlending = 1,
  36519. Ci.AdditiveBlending = 2,
  36520. Ci.SubtractiveBlending = 3,
  36521. Ci.MultiplyBlending = 4,
  36522. Ci.CustomBlending = 5,
  36523. Ci.AddEquation = 100,
  36524. Ci.SubtractEquation = 101,
  36525. Ci.ReverseSubtractEquation = 102,
  36526. Ci.MinEquation = 103,
  36527. Ci.MaxEquation = 104,
  36528. Ci.ZeroFactor = 200,
  36529. Ci.OneFactor = 201,
  36530. Ci.SrcColorFactor = 202,
  36531. Ci.OneMinusSrcColorFactor = 203,
  36532. Ci.SrcAlphaFactor = 204,
  36533. Ci.OneMinusSrcAlphaFactor = 205,
  36534. Ci.DstAlphaFactor = 206,
  36535. Ci.OneMinusDstAlphaFactor = 207,
  36536. Ci.DstColorFactor = 208,
  36537. Ci.OneMinusDstColorFactor = 209,
  36538. Ci.SrcAlphaSaturateFactor = 210,
  36539. Ci.NeverDepth = 0,
  36540. Ci.AlwaysDepth = 1,
  36541. Ci.LessDepth = 2,
  36542. Ci.LessEqualDepth = 3,
  36543. Ci.EqualDepth = 4,
  36544. Ci.GreaterEqualDepth = 5,
  36545. Ci.GreaterDepth = 6,
  36546. Ci.NotEqualDepth = 7,
  36547. Ci.MultiplyOperation = 0,
  36548. Ci.MixOperation = 1,
  36549. Ci.AddOperation = 2,
  36550. Ci.NoToneMapping = 0,
  36551. Ci.LinearToneMapping = 1,
  36552. Ci.ReinhardToneMapping = 2,
  36553. Ci.Uncharted2ToneMapping = 3,
  36554. Ci.CineonToneMapping = 4,
  36555. Ci.UVMapping = 300,
  36556. Ci.CubeReflectionMapping = 301,
  36557. Ci.CubeRefractionMapping = 302,
  36558. Ci.EquirectangularReflectionMapping = 303,
  36559. Ci.EquirectangularRefractionMapping = 304,
  36560. Ci.SphericalReflectionMapping = 305,
  36561. Ci.CubeUVReflectionMapping = 306,
  36562. Ci.CubeUVRefractionMapping = 307,
  36563. Ci.RepeatWrapping = 1e3,
  36564. Ci.ClampToEdgeWrapping = 1001,
  36565. Ci.MirroredRepeatWrapping = 1002,
  36566. Ci.NearestFilter = 1003,
  36567. Ci.NearestMipMapNearestFilter = 1004,
  36568. Ci.NearestMipMapLinearFilter = 1005,
  36569. Ci.LinearFilter = 1006,
  36570. Ci.LinearMipMapNearestFilter = 1007,
  36571. Ci.LinearMipMapLinearFilter = 1008,
  36572. Ci.UnsignedByteType = 1009,
  36573. Ci.ByteType = 1010,
  36574. Ci.ShortType = 1011,
  36575. Ci.UnsignedShortType = 1012,
  36576. Ci.IntType = 1013,
  36577. Ci.UnsignedIntType = 1014,
  36578. Ci.FloatType = 1015,
  36579. Ci.HalfFloatType = 1025,
  36580. Ci.UnsignedShort4444Type = 1016,
  36581. Ci.UnsignedShort5551Type = 1017,
  36582. Ci.UnsignedShort565Type = 1018,
  36583. Ci.AlphaFormat = 1019,
  36584. Ci.RGBFormat = 1020,
  36585. Ci.RGBAFormat = 1021,
  36586. Ci.LuminanceFormat = 1022,
  36587. Ci.LuminanceAlphaFormat = 1023,
  36588. Ci.RGBEFormat = Ci.RGBAFormat,
  36589. Ci.RGB_S3TC_DXT1_Format = 2001,
  36590. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36591. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36592. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36593. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36594. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36595. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36596. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36597. Ci.RGB_ETC1_Format = 2151,
  36598. Ci.LoopOnce = 2200,
  36599. Ci.LoopRepeat = 2201,
  36600. Ci.LoopPingPong = 2202,
  36601. Ci.InterpolateDiscrete = 2300,
  36602. Ci.InterpolateLinear = 2301,
  36603. Ci.InterpolateSmooth = 2302,
  36604. Ci.ZeroCurvatureEnding = 2400,
  36605. Ci.ZeroSlopeEnding = 2401,
  36606. Ci.WrapAroundEnding = 2402,
  36607. Ci.TrianglesDrawMode = 0,
  36608. Ci.TriangleStripDrawMode = 1,
  36609. Ci.TriangleFanDrawMode = 2,
  36610. Ci.LinearEncoding = 3e3,
  36611. Ci.sRGBEncoding = 3001,
  36612. Ci.GammaEncoding = 3007,
  36613. Ci.RGBEEncoding = 3002,
  36614. Ci.LogLuvEncoding = 3003,
  36615. Ci.RGBM7Encoding = 3004,
  36616. Ci.RGBM16Encoding = 3005,
  36617. Ci.RGBDEncoding = 3006,
  36618. Ci.Color = function(e) {
  36619. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36620. }
  36621. ,
  36622. Ci.Color.prototype = {
  36623. constructor: Ci.Color,
  36624. r: 1,
  36625. g: 1,
  36626. b: 1,
  36627. set: function(e) {
  36628. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36629. this
  36630. },
  36631. setScalar: function(e) {
  36632. this.r = e,
  36633. this.g = e,
  36634. this.b = e
  36635. },
  36636. setHex: function(e) {
  36637. return e = Math.floor(e),
  36638. this.r = (e >> 16 & 255) / 255,
  36639. this.g = (e >> 8 & 255) / 255,
  36640. this.b = (255 & e) / 255,
  36641. this
  36642. },
  36643. setRGB: function(e, t, i) {
  36644. return this.r = e,
  36645. this.g = t,
  36646. this.b = i,
  36647. this
  36648. },
  36649. setHSL: function(e, t, i) {
  36650. if (e = Ci.Math.euclideanModulo(e, 1),
  36651. t = Ci.Math.clamp(t, 0, 1),
  36652. i = Ci.Math.clamp(i, 0, 1),
  36653. 0 === t)
  36654. this.r = this.g = this.b = i;
  36655. else {
  36656. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36657. , r = 2 * i - n;
  36658. this.r = _i(r, n, e + 1 / 3),
  36659. this.g = _i(r, n, e),
  36660. this.b = _i(r, n, e - 1 / 3)
  36661. }
  36662. return this
  36663. },
  36664. setStyle: function(t) {
  36665. function e(e) {
  36666. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36667. }
  36668. var i;
  36669. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36670. var n, r = i[1], o = i[2];
  36671. switch (r) {
  36672. case "rgb":
  36673. case "rgba":
  36674. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36675. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36676. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  36677. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  36678. e(n[5]),
  36679. this;
  36680. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36681. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  36682. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  36683. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  36684. e(n[5]),
  36685. this;
  36686. break;
  36687. case "hsl":
  36688. case "hsla":
  36689. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  36690. var a = parseFloat(n[1]) / 360
  36691. , s = parseInt(n[2], 10) / 100
  36692. , l = parseInt(n[3], 10) / 100;
  36693. return e(n[5]),
  36694. this.setHSL(a, s, l)
  36695. }
  36696. }
  36697. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  36698. var c, h = (c = i[1]).length;
  36699. if (3 === h)
  36700. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  36701. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  36702. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  36703. this;
  36704. if (6 === h)
  36705. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  36706. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  36707. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  36708. this
  36709. }
  36710. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  36711. return this
  36712. },
  36713. clone: function() {
  36714. return new this.constructor(this.r,this.g,this.b)
  36715. },
  36716. copy: function(e) {
  36717. return this.r = e.r,
  36718. this.g = e.g,
  36719. this.b = e.b,
  36720. this
  36721. },
  36722. copyGammaToLinear: function(e, t) {
  36723. return void 0 === t && (t = 2),
  36724. this.r = Math.pow(e.r, t),
  36725. this.g = Math.pow(e.g, t),
  36726. this.b = Math.pow(e.b, t),
  36727. this
  36728. },
  36729. copyLinearToGamma: function(e, t) {
  36730. void 0 === t && (t = 2);
  36731. var i = 0 < t ? 1 / t : 1;
  36732. return this.r = Math.pow(e.r, i),
  36733. this.g = Math.pow(e.g, i),
  36734. this.b = Math.pow(e.b, i),
  36735. this
  36736. },
  36737. convertGammaToLinear: function() {
  36738. var e = this.r
  36739. , t = this.g
  36740. , i = this.b;
  36741. return this.r = e * e,
  36742. this.g = t * t,
  36743. this.b = i * i,
  36744. this
  36745. },
  36746. convertLinearToGamma: function() {
  36747. return this.r = Math.sqrt(this.r),
  36748. this.g = Math.sqrt(this.g),
  36749. this.b = Math.sqrt(this.b),
  36750. this
  36751. },
  36752. getHex: function() {
  36753. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  36754. },
  36755. getHexString: function() {
  36756. return ("000000" + this.getHex().toString(16)).slice(-6)
  36757. },
  36758. getHSL: function(e) {
  36759. var t, i, n = e || {
  36760. h: 0,
  36761. s: 0,
  36762. l: 0
  36763. }, r = this.r, o = this.g, a = this.b, s = Math.max(r, o, a), l = Math.min(r, o, a), c = (l + s) / 2;
  36764. if (l === s)
  36765. i = t = 0;
  36766. else {
  36767. var h = s - l;
  36768. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  36769. s) {
  36770. case r:
  36771. t = (o - a) / h + (o < a ? 6 : 0);
  36772. break;
  36773. case o:
  36774. t = (a - r) / h + 2;
  36775. break;
  36776. case a:
  36777. t = (r - o) / h + 4
  36778. }
  36779. t /= 6
  36780. }
  36781. return n.h = t,
  36782. n.s = i,
  36783. n.l = c,
  36784. n
  36785. },
  36786. getStyle: function() {
  36787. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  36788. },
  36789. offsetHSL: function(e, t, i) {
  36790. var n = this.getHSL();
  36791. return n.h += e,
  36792. n.s += t,
  36793. n.l += i,
  36794. this.setHSL(n.h, n.s, n.l),
  36795. this
  36796. },
  36797. add: function(e) {
  36798. return this.r += e.r,
  36799. this.g += e.g,
  36800. this.b += e.b,
  36801. this
  36802. },
  36803. addColors: function(e, t) {
  36804. return this.r = e.r + t.r,
  36805. this.g = e.g + t.g,
  36806. this.b = e.b + t.b,
  36807. this
  36808. },
  36809. addScalar: function(e) {
  36810. return this.r += e,
  36811. this.g += e,
  36812. this.b += e,
  36813. this
  36814. },
  36815. multiply: function(e) {
  36816. return this.r *= e.r,
  36817. this.g *= e.g,
  36818. this.b *= e.b,
  36819. this
  36820. },
  36821. multiplyScalar: function(e) {
  36822. return this.r *= e,
  36823. this.g *= e,
  36824. this.b *= e,
  36825. this
  36826. },
  36827. lerp: function(e, t) {
  36828. return this.r += (e.r - this.r) * t,
  36829. this.g += (e.g - this.g) * t,
  36830. this.b += (e.b - this.b) * t,
  36831. this
  36832. },
  36833. equals: function(e) {
  36834. return e.r === this.r && e.g === this.g && e.b === this.b
  36835. },
  36836. fromArray: function(e, t) {
  36837. return void 0 === t && (t = 0),
  36838. this.r = e[t],
  36839. this.g = e[t + 1],
  36840. this.b = e[t + 2],
  36841. this
  36842. },
  36843. toArray: function(e, t) {
  36844. return void 0 === e && (e = []),
  36845. void 0 === t && (t = 0),
  36846. e[t] = this.r,
  36847. e[t + 1] = this.g,
  36848. e[t + 2] = this.b,
  36849. e
  36850. }
  36851. },
  36852. Ci.ColorKeywords = {
  36853. aliceblue: 15792383,
  36854. antiquewhite: 16444375,
  36855. aqua: 65535,
  36856. aquamarine: 8388564,
  36857. azure: 15794175,
  36858. beige: 16119260,
  36859. bisque: 16770244,
  36860. black: 0,
  36861. blanchedalmond: 16772045,
  36862. blue: 255,
  36863. blueviolet: 9055202,
  36864. brown: 10824234,
  36865. burlywood: 14596231,
  36866. cadetblue: 6266528,
  36867. chartreuse: 8388352,
  36868. chocolate: 13789470,
  36869. coral: 16744272,
  36870. cornflowerblue: 6591981,
  36871. cornsilk: 16775388,
  36872. crimson: 14423100,
  36873. cyan: 65535,
  36874. darkblue: 139,
  36875. darkcyan: 35723,
  36876. darkgoldenrod: 12092939,
  36877. darkgray: 11119017,
  36878. darkgreen: 25600,
  36879. darkgrey: 11119017,
  36880. darkkhaki: 12433259,
  36881. darkmagenta: 9109643,
  36882. darkolivegreen: 5597999,
  36883. darkorange: 16747520,
  36884. darkorchid: 10040012,
  36885. darkred: 9109504,
  36886. darksalmon: 15308410,
  36887. darkseagreen: 9419919,
  36888. darkslateblue: 4734347,
  36889. darkslategray: 3100495,
  36890. darkslategrey: 3100495,
  36891. darkturquoise: 52945,
  36892. darkviolet: 9699539,
  36893. deeppink: 16716947,
  36894. deepskyblue: 49151,
  36895. dimgray: 6908265,
  36896. dimgrey: 6908265,
  36897. dodgerblue: 2003199,
  36898. firebrick: 11674146,
  36899. floralwhite: 16775920,
  36900. forestgreen: 2263842,
  36901. fuchsia: 16711935,
  36902. gainsboro: 14474460,
  36903. ghostwhite: 16316671,
  36904. gold: 16766720,
  36905. goldenrod: 14329120,
  36906. gray: 8421504,
  36907. green: 32768,
  36908. greenyellow: 11403055,
  36909. grey: 8421504,
  36910. honeydew: 15794160,
  36911. hotpink: 16738740,
  36912. indianred: 13458524,
  36913. indigo: 4915330,
  36914. ivory: 16777200,
  36915. khaki: 15787660,
  36916. lavender: 15132410,
  36917. lavenderblush: 16773365,
  36918. lawngreen: 8190976,
  36919. lemonchiffon: 16775885,
  36920. lightblue: 11393254,
  36921. lightcoral: 15761536,
  36922. lightcyan: 14745599,
  36923. lightgoldenrodyellow: 16448210,
  36924. lightgray: 13882323,
  36925. lightgreen: 9498256,
  36926. lightgrey: 13882323,
  36927. lightpink: 16758465,
  36928. lightsalmon: 16752762,
  36929. lightseagreen: 2142890,
  36930. lightskyblue: 8900346,
  36931. lightslategray: 7833753,
  36932. lightslategrey: 7833753,
  36933. lightsteelblue: 11584734,
  36934. lightyellow: 16777184,
  36935. lime: 65280,
  36936. limegreen: 3329330,
  36937. linen: 16445670,
  36938. magenta: 16711935,
  36939. maroon: 8388608,
  36940. mediumaquamarine: 6737322,
  36941. mediumblue: 205,
  36942. mediumorchid: 12211667,
  36943. mediumpurple: 9662683,
  36944. mediumseagreen: 3978097,
  36945. mediumslateblue: 8087790,
  36946. mediumspringgreen: 64154,
  36947. mediumturquoise: 4772300,
  36948. mediumvioletred: 13047173,
  36949. midnightblue: 1644912,
  36950. mintcream: 16121850,
  36951. mistyrose: 16770273,
  36952. moccasin: 16770229,
  36953. navajowhite: 16768685,
  36954. navy: 128,
  36955. oldlace: 16643558,
  36956. olive: 8421376,
  36957. olivedrab: 7048739,
  36958. orange: 16753920,
  36959. orangered: 16729344,
  36960. orchid: 14315734,
  36961. palegoldenrod: 15657130,
  36962. palegreen: 10025880,
  36963. paleturquoise: 11529966,
  36964. palevioletred: 14381203,
  36965. papayawhip: 16773077,
  36966. peachpuff: 16767673,
  36967. peru: 13468991,
  36968. pink: 16761035,
  36969. plum: 14524637,
  36970. powderblue: 11591910,
  36971. purple: 8388736,
  36972. red: 16711680,
  36973. rosybrown: 12357519,
  36974. royalblue: 4286945,
  36975. saddlebrown: 9127187,
  36976. salmon: 16416882,
  36977. sandybrown: 16032864,
  36978. seagreen: 3050327,
  36979. seashell: 16774638,
  36980. sienna: 10506797,
  36981. silver: 12632256,
  36982. skyblue: 8900331,
  36983. slateblue: 6970061,
  36984. slategray: 7372944,
  36985. slategrey: 7372944,
  36986. snow: 16775930,
  36987. springgreen: 65407,
  36988. steelblue: 4620980,
  36989. tan: 13808780,
  36990. teal: 32896,
  36991. thistle: 14204888,
  36992. tomato: 16737095,
  36993. turquoise: 4251856,
  36994. violet: 15631086,
  36995. wheat: 16113331,
  36996. white: 16777215,
  36997. whitesmoke: 16119285,
  36998. yellow: 16776960,
  36999. yellowgreen: 10145074
  37000. },
  37001. Ci.Quaternion = function(e, t, i, n) {
  37002. this._x = e || 0,
  37003. this._y = t || 0,
  37004. this._z = i || 0,
  37005. this._w = void 0 !== n ? n : 1
  37006. }
  37007. ,
  37008. Ci.Quaternion.prototype = {
  37009. constructor: Ci.Quaternion,
  37010. get x() {
  37011. return this._x
  37012. },
  37013. set x(e) {
  37014. this._x = e,
  37015. this.onChangeCallback()
  37016. },
  37017. get y() {
  37018. return this._y
  37019. },
  37020. set y(e) {
  37021. this._y = e,
  37022. this.onChangeCallback()
  37023. },
  37024. get z() {
  37025. return this._z
  37026. },
  37027. set z(e) {
  37028. this._z = e,
  37029. this.onChangeCallback()
  37030. },
  37031. get w() {
  37032. return this._w
  37033. },
  37034. set w(e) {
  37035. this._w = e,
  37036. this.onChangeCallback()
  37037. },
  37038. set: function(e, t, i, n) {
  37039. return this._x = e,
  37040. this._y = t,
  37041. this._z = i,
  37042. this._w = n,
  37043. this.onChangeCallback(),
  37044. this
  37045. },
  37046. clone: function() {
  37047. return new this.constructor(this._x,this._y,this._z,this._w)
  37048. },
  37049. copy: function(e) {
  37050. return this._x = e.x,
  37051. this._y = e.y,
  37052. this._z = e.z,
  37053. this._w = e.w,
  37054. this.onChangeCallback(),
  37055. this
  37056. },
  37057. setFromEuler: function(e, t) {
  37058. if (e instanceof Ci.Euler == 0)
  37059. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37060. var i = Math.cos(e._x / 2)
  37061. , n = Math.cos(e._y / 2)
  37062. , r = Math.cos(e._z / 2)
  37063. , o = Math.sin(e._x / 2)
  37064. , a = Math.sin(e._y / 2)
  37065. , s = Math.sin(e._z / 2)
  37066. , l = e.order;
  37067. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37068. this._y = i * a * r - o * n * s,
  37069. this._z = i * n * s + o * a * r,
  37070. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37071. this._y = i * a * r - o * n * s,
  37072. this._z = i * n * s - o * a * r,
  37073. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37074. this._y = i * a * r + o * n * s,
  37075. this._z = i * n * s + o * a * r,
  37076. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37077. this._y = i * a * r + o * n * s,
  37078. this._z = i * n * s - o * a * r,
  37079. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37080. this._y = i * a * r + o * n * s,
  37081. this._z = i * n * s - o * a * r,
  37082. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37083. this._y = i * a * r - o * n * s,
  37084. this._z = i * n * s + o * a * r,
  37085. this._w = i * n * r + o * a * s),
  37086. !1 !== t && this.onChangeCallback(),
  37087. this
  37088. },
  37089. setFromAxisAngle: function(e, t) {
  37090. var i = t / 2
  37091. , n = Math.sin(i);
  37092. return this._x = e.x * n,
  37093. this._y = e.y * n,
  37094. this._z = e.z * n,
  37095. this._w = Math.cos(i),
  37096. this.onChangeCallback(),
  37097. this
  37098. },
  37099. setFromRotationMatrix: function(e) {
  37100. var t, i = e.elements, n = i[0], r = i[4], o = i[8], a = i[1], s = i[5], l = i[9], c = i[2], h = i[6], u = i[10], d = n + s + u;
  37101. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37102. this._w = .25 / t,
  37103. this._x = (h - l) * t,
  37104. this._y = (o - c) * t,
  37105. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37106. this._w = (h - l) / t,
  37107. this._x = .25 * t,
  37108. this._y = (r + a) / t,
  37109. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37110. this._w = (o - c) / t,
  37111. this._x = (r + a) / t,
  37112. this._y = .25 * t,
  37113. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37114. this._w = (a - r) / t,
  37115. this._x = (o + c) / t,
  37116. this._y = (l + h) / t,
  37117. this._z = .25 * t),
  37118. this.onChangeCallback(),
  37119. this
  37120. },
  37121. setFromUnitVectors: function(e, t) {
  37122. return void 0 === Be && (Be = new Ci.Vector3),
  37123. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37124. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  37125. this._x = Be.x,
  37126. this._y = Be.y,
  37127. this._z = Be.z,
  37128. this._w = Ve,
  37129. this.normalize(),
  37130. this
  37131. },
  37132. inverse: function() {
  37133. return this.conjugate().normalize(),
  37134. this
  37135. },
  37136. conjugate: function() {
  37137. return this._x *= -1,
  37138. this._y *= -1,
  37139. this._z *= -1,
  37140. this.onChangeCallback(),
  37141. this
  37142. },
  37143. dot: function(e) {
  37144. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37145. },
  37146. lengthSq: function() {
  37147. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37148. },
  37149. length: function() {
  37150. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37151. },
  37152. normalize: function() {
  37153. var e = this.length();
  37154. return 0 === e ? (this._x = 0,
  37155. this._y = 0,
  37156. this._z = 0,
  37157. this._w = 1) : (e = 1 / e,
  37158. this._x = this._x * e,
  37159. this._y = this._y * e,
  37160. this._z = this._z * e,
  37161. this._w = this._w * e),
  37162. this.onChangeCallback(),
  37163. this
  37164. },
  37165. multiply: function(e, t) {
  37166. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37167. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37168. },
  37169. multiplyQuaternions: function(e, t) {
  37170. var i = e._x
  37171. , n = e._y
  37172. , r = e._z
  37173. , o = e._w
  37174. , a = t._x
  37175. , s = t._y
  37176. , l = t._z
  37177. , c = t._w;
  37178. return this._x = i * c + o * a + n * l - r * s,
  37179. this._y = n * c + o * s + r * a - i * l,
  37180. this._z = r * c + o * l + i * s - n * a,
  37181. this._w = o * c - i * a - n * s - r * l,
  37182. this.onChangeCallback(),
  37183. this
  37184. },
  37185. slerp: function(e, t) {
  37186. if (0 === t)
  37187. return this;
  37188. if (1 === t)
  37189. return this.copy(e);
  37190. var i = this._x
  37191. , n = this._y
  37192. , r = this._z
  37193. , o = this._w
  37194. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37195. if (a < 0 ? (this._w = -e._w,
  37196. this._x = -e._x,
  37197. this._y = -e._y,
  37198. this._z = -e._z,
  37199. a = -a) : this.copy(e),
  37200. 1 <= a)
  37201. return this._w = o,
  37202. this._x = i,
  37203. this._y = n,
  37204. this._z = r,
  37205. this;
  37206. var s = Math.sqrt(1 - a * a);
  37207. if (Math.abs(s) < .001)
  37208. return this._w = .5 * (o + this._w),
  37209. this._x = .5 * (i + this._x),
  37210. this._y = .5 * (n + this._y),
  37211. this._z = .5 * (r + this._z),
  37212. this;
  37213. var l = Math.atan2(s, a)
  37214. , c = Math.sin((1 - t) * l) / s
  37215. , h = Math.sin(t * l) / s;
  37216. return this._w = o * c + this._w * h,
  37217. this._x = i * c + this._x * h,
  37218. this._y = n * c + this._y * h,
  37219. this._z = r * c + this._z * h,
  37220. this.onChangeCallback(),
  37221. this
  37222. },
  37223. equals: function(e) {
  37224. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37225. },
  37226. fromArray: function(e, t) {
  37227. return void 0 === t && (t = 0),
  37228. this._x = e[t],
  37229. this._y = e[t + 1],
  37230. this._z = e[t + 2],
  37231. this._w = e[t + 3],
  37232. this.onChangeCallback(),
  37233. this
  37234. },
  37235. toArray: function(e, t) {
  37236. return void 0 === e && (e = []),
  37237. void 0 === t && (t = 0),
  37238. e[t] = this._x,
  37239. e[t + 1] = this._y,
  37240. e[t + 2] = this._z,
  37241. e[t + 3] = this._w,
  37242. e
  37243. },
  37244. onChange: function(e) {
  37245. return this.onChangeCallback = e,
  37246. this
  37247. },
  37248. onChangeCallback: function() {}
  37249. },
  37250. Object.assign(Ci.Quaternion, {
  37251. slerp: function(e, t, i, n) {
  37252. return i.copy(e).slerp(t, n)
  37253. },
  37254. slerpFlat: function(e, t, i, n, r, o, a) {
  37255. var s = i[n + 0]
  37256. , l = i[n + 1]
  37257. , c = i[n + 2]
  37258. , h = i[n + 3]
  37259. , u = r[o + 0]
  37260. , d = r[o + 1]
  37261. , p = r[o + 2]
  37262. , f = r[o + 3];
  37263. if (h !== f || s !== u || l !== d || c !== p) {
  37264. var g = 1 - a
  37265. , m = s * u + l * d + c * p + h * f
  37266. , v = 0 <= m ? 1 : -1
  37267. , y = 1 - m * m;
  37268. if (y > Number.EPSILON) {
  37269. var A = Math.sqrt(y)
  37270. , C = Math.atan2(A, m * v);
  37271. g = Math.sin(g * C) / A,
  37272. a = Math.sin(a * C) / A
  37273. }
  37274. var I = a * v;
  37275. if (s = s * g + u * I,
  37276. l = l * g + d * I,
  37277. c = c * g + p * I,
  37278. h = h * g + f * I,
  37279. g === 1 - a) {
  37280. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37281. s *= E,
  37282. l *= E,
  37283. c *= E,
  37284. h *= E
  37285. }
  37286. }
  37287. e[t] = s,
  37288. e[t + 1] = l,
  37289. e[t + 2] = c,
  37290. e[t + 3] = h
  37291. }
  37292. }),
  37293. Ci.Vector2 = function(e, t) {
  37294. this.x = e || 0,
  37295. this.y = t || 0
  37296. }
  37297. ,
  37298. Ci.Vector2.prototype = {
  37299. constructor: Ci.Vector2,
  37300. get width() {
  37301. return this.x
  37302. },
  37303. set width(e) {
  37304. this.x = e
  37305. },
  37306. get height() {
  37307. return this.y
  37308. },
  37309. set height(e) {
  37310. this.y = e
  37311. },
  37312. set: function(e, t) {
  37313. return this.x = e,
  37314. this.y = t,
  37315. this
  37316. },
  37317. setScalar: function(e) {
  37318. return this.x = e,
  37319. this.y = e,
  37320. this
  37321. },
  37322. setX: function(e) {
  37323. return this.x = e,
  37324. this
  37325. },
  37326. setY: function(e) {
  37327. return this.y = e,
  37328. this
  37329. },
  37330. setComponent: function(e, t) {
  37331. switch (e) {
  37332. case 0:
  37333. this.x = t;
  37334. break;
  37335. case 1:
  37336. this.y = t;
  37337. break;
  37338. default:
  37339. throw new Error("index is out of range: " + e)
  37340. }
  37341. },
  37342. getComponent: function(e) {
  37343. switch (e) {
  37344. case 0:
  37345. return this.x;
  37346. case 1:
  37347. return this.y;
  37348. default:
  37349. throw new Error("index is out of range: " + e)
  37350. }
  37351. },
  37352. clone: function() {
  37353. return new this.constructor(this.x,this.y)
  37354. },
  37355. copy: function(e) {
  37356. return this.x = e.x,
  37357. this.y = e.y,
  37358. this
  37359. },
  37360. add: function(e, t) {
  37361. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37362. this.addVectors(e, t)) : (this.x += e.x,
  37363. this.y += e.y,
  37364. this)
  37365. },
  37366. addScalar: function(e) {
  37367. return this.x += e,
  37368. this.y += e,
  37369. this
  37370. },
  37371. addVectors: function(e, t) {
  37372. return this.x = e.x + t.x,
  37373. this.y = e.y + t.y,
  37374. this
  37375. },
  37376. addScaledVector: function(e, t) {
  37377. return this.x += e.x * t,
  37378. this.y += e.y * t,
  37379. this
  37380. },
  37381. sub: function(e, t) {
  37382. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37383. this.subVectors(e, t)) : (this.x -= e.x,
  37384. this.y -= e.y,
  37385. this)
  37386. },
  37387. subScalar: function(e) {
  37388. return this.x -= e,
  37389. this.y -= e,
  37390. this
  37391. },
  37392. subVectors: function(e, t) {
  37393. return this.x = e.x - t.x,
  37394. this.y = e.y - t.y,
  37395. this
  37396. },
  37397. multiply: function(e) {
  37398. return this.x *= e.x,
  37399. this.y *= e.y,
  37400. this
  37401. },
  37402. multiplyScalar: function(e) {
  37403. return isFinite(e) ? (this.x *= e,
  37404. this.y *= e) : (this.x = 0,
  37405. this.y = 0),
  37406. this
  37407. },
  37408. divide: function(e) {
  37409. return this.x /= e.x,
  37410. this.y /= e.y,
  37411. this
  37412. },
  37413. divideScalar: function(e) {
  37414. return this.multiplyScalar(1 / e)
  37415. },
  37416. min: function(e) {
  37417. return this.x = Math.min(this.x, e.x),
  37418. this.y = Math.min(this.y, e.y),
  37419. this
  37420. },
  37421. max: function(e) {
  37422. return this.x = Math.max(this.x, e.x),
  37423. this.y = Math.max(this.y, e.y),
  37424. this
  37425. },
  37426. clamp: function(e, t) {
  37427. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37428. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37429. this
  37430. },
  37431. clampScalar: function(e, t) {
  37432. return void 0 === Ne && (Ne = new Ci.Vector2,
  37433. Fe = new Ci.Vector2),
  37434. Ne.set(e, e),
  37435. Fe.set(t, t),
  37436. this.clamp(Ne, Fe)
  37437. },
  37438. clampLength: function(e, t) {
  37439. var i = this.length();
  37440. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37441. this
  37442. },
  37443. floor: function() {
  37444. return this.x = Math.floor(this.x),
  37445. this.y = Math.floor(this.y),
  37446. this
  37447. },
  37448. ceil: function() {
  37449. return this.x = Math.ceil(this.x),
  37450. this.y = Math.ceil(this.y),
  37451. this
  37452. },
  37453. round: function() {
  37454. return this.x = Math.round(this.x),
  37455. this.y = Math.round(this.y),
  37456. this
  37457. },
  37458. roundToZero: function() {
  37459. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37460. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37461. this
  37462. },
  37463. negate: function() {
  37464. return this.x = -this.x,
  37465. this.y = -this.y,
  37466. this
  37467. },
  37468. dot: function(e) {
  37469. return this.x * e.x + this.y * e.y
  37470. },
  37471. lengthSq: function() {
  37472. return this.x * this.x + this.y * this.y
  37473. },
  37474. length: function() {
  37475. return Math.sqrt(this.x * this.x + this.y * this.y)
  37476. },
  37477. lengthManhattan: function() {
  37478. return Math.abs(this.x) + Math.abs(this.y)
  37479. },
  37480. normalize: function() {
  37481. return this.divideScalar(this.length())
  37482. },
  37483. angle: function() {
  37484. var e = Math.atan2(this.y, this.x);
  37485. return e < 0 && (e += 2 * Math.PI),
  37486. e
  37487. },
  37488. distanceTo: function(e) {
  37489. return Math.sqrt(this.distanceToSquared(e))
  37490. },
  37491. distanceToSquared: function(e) {
  37492. var t = this.x - e.x
  37493. , i = this.y - e.y;
  37494. return t * t + i * i
  37495. },
  37496. setLength: function(e) {
  37497. return this.multiplyScalar(e / this.length())
  37498. },
  37499. lerp: function(e, t) {
  37500. return this.x += (e.x - this.x) * t,
  37501. this.y += (e.y - this.y) * t,
  37502. this
  37503. },
  37504. lerpVectors: function(e, t, i) {
  37505. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37506. this
  37507. },
  37508. equals: function(e) {
  37509. return e.x === this.x && e.y === this.y
  37510. },
  37511. fromArray: function(e, t) {
  37512. return void 0 === t && (t = 0),
  37513. this.x = e[t],
  37514. this.y = e[t + 1],
  37515. this
  37516. },
  37517. toArray: function(e, t) {
  37518. return void 0 === e && (e = []),
  37519. void 0 === t && (t = 0),
  37520. e[t] = this.x,
  37521. e[t + 1] = this.y,
  37522. e
  37523. },
  37524. fromAttribute: function(e, t, i) {
  37525. return void 0 === i && (i = 0),
  37526. t = t * e.itemSize + i,
  37527. this.x = e.array[t],
  37528. this.y = e.array[t + 1],
  37529. this
  37530. },
  37531. rotateAround: function(e, t) {
  37532. var i = Math.cos(t)
  37533. , n = Math.sin(t)
  37534. , r = this.x - e.x
  37535. , o = this.y - e.y;
  37536. return this.x = r * i - o * n + e.x,
  37537. this.y = r * n + o * i + e.y,
  37538. this
  37539. }
  37540. },
  37541. Ci.Vector3 = function(e, t, i) {
  37542. this.x = e || 0,
  37543. this.y = t || 0,
  37544. this.z = i || 0
  37545. }
  37546. ,
  37547. Ci.Vector3.prototype = {
  37548. constructor: Ci.Vector3,
  37549. set: function(e, t, i) {
  37550. return this.x = e,
  37551. this.y = t,
  37552. this.z = i,
  37553. this
  37554. },
  37555. setScalar: function(e) {
  37556. return this.x = e,
  37557. this.y = e,
  37558. this.z = e,
  37559. this
  37560. },
  37561. setX: function(e) {
  37562. return this.x = e,
  37563. this
  37564. },
  37565. setY: function(e) {
  37566. return this.y = e,
  37567. this
  37568. },
  37569. setZ: function(e) {
  37570. return this.z = e,
  37571. this
  37572. },
  37573. setComponent: function(e, t) {
  37574. switch (e) {
  37575. case 0:
  37576. this.x = t;
  37577. break;
  37578. case 1:
  37579. this.y = t;
  37580. break;
  37581. case 2:
  37582. this.z = t;
  37583. break;
  37584. default:
  37585. throw new Error("index is out of range: " + e)
  37586. }
  37587. },
  37588. getComponent: function(e) {
  37589. switch (e) {
  37590. case 0:
  37591. return this.x;
  37592. case 1:
  37593. return this.y;
  37594. case 2:
  37595. return this.z;
  37596. default:
  37597. throw new Error("index is out of range: " + e)
  37598. }
  37599. },
  37600. clone: function() {
  37601. return new this.constructor(this.x,this.y,this.z)
  37602. },
  37603. copy: function(e) {
  37604. return this.x = e.x,
  37605. this.y = e.y,
  37606. this.z = e.z,
  37607. this
  37608. },
  37609. add: function(e, t) {
  37610. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37611. this.addVectors(e, t)) : (this.x += e.x,
  37612. this.y += e.y,
  37613. this.z += e.z,
  37614. this)
  37615. },
  37616. addScalar: function(e) {
  37617. return this.x += e,
  37618. this.y += e,
  37619. this.z += e,
  37620. this
  37621. },
  37622. addVectors: function(e, t) {
  37623. return this.x = e.x + t.x,
  37624. this.y = e.y + t.y,
  37625. this.z = e.z + t.z,
  37626. this
  37627. },
  37628. addScaledVector: function(e, t) {
  37629. return this.x += e.x * t,
  37630. this.y += e.y * t,
  37631. this.z += e.z * t,
  37632. this
  37633. },
  37634. sub: function(e, t) {
  37635. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37636. this.subVectors(e, t)) : (this.x -= e.x,
  37637. this.y -= e.y,
  37638. this.z -= e.z,
  37639. this)
  37640. },
  37641. subScalar: function(e) {
  37642. return this.x -= e,
  37643. this.y -= e,
  37644. this.z -= e,
  37645. this
  37646. },
  37647. subVectors: function(e, t) {
  37648. return this.x = e.x - t.x,
  37649. this.y = e.y - t.y,
  37650. this.z = e.z - t.z,
  37651. this
  37652. },
  37653. multiply: function(e, t) {
  37654. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37655. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37656. this.y *= e.y,
  37657. this.z *= e.z,
  37658. this)
  37659. },
  37660. multiplyScalar: function(e) {
  37661. return isFinite(e) ? (this.x *= e,
  37662. this.y *= e,
  37663. this.z *= e) : (this.x = 0,
  37664. this.y = 0,
  37665. this.z = 0),
  37666. this
  37667. },
  37668. multiplyVectors: function(e, t) {
  37669. return this.x = e.x * t.x,
  37670. this.y = e.y * t.y,
  37671. this.z = e.z * t.z,
  37672. this
  37673. },
  37674. applyEuler: function(e) {
  37675. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  37676. void 0 === De && (De = new Ci.Quaternion),
  37677. this.applyQuaternion(De.setFromEuler(e)),
  37678. this
  37679. },
  37680. applyAxisAngle: function(e, t) {
  37681. return void 0 === Le && (Le = new Ci.Quaternion),
  37682. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  37683. this
  37684. },
  37685. applyMatrix3: function(e) {
  37686. var t = this.x
  37687. , i = this.y
  37688. , n = this.z
  37689. , r = e.elements;
  37690. return this.x = r[0] * t + r[3] * i + r[6] * n,
  37691. this.y = r[1] * t + r[4] * i + r[7] * n,
  37692. this.z = r[2] * t + r[5] * i + r[8] * n,
  37693. this
  37694. },
  37695. applyMatrix4: function(e) {
  37696. var t = this.x
  37697. , i = this.y
  37698. , n = this.z
  37699. , r = e.elements;
  37700. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  37701. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  37702. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  37703. this
  37704. },
  37705. applyProjection: function(e) {
  37706. var t = this.x
  37707. , i = this.y
  37708. , n = this.z
  37709. , r = e.elements
  37710. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  37711. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  37712. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  37713. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  37714. this
  37715. },
  37716. applyQuaternion: function(e) {
  37717. var t = this.x
  37718. , i = this.y
  37719. , n = this.z
  37720. , r = e.x
  37721. , o = e.y
  37722. , a = e.z
  37723. , s = e.w
  37724. , l = s * t + o * n - a * i
  37725. , c = s * i + a * t - r * n
  37726. , h = s * n + r * i - o * t
  37727. , u = -r * t - o * i - a * n;
  37728. return this.x = l * s + u * -r + c * -a - h * -o,
  37729. this.y = c * s + u * -o + h * -r - l * -a,
  37730. this.z = h * s + u * -a + l * -o - c * -r,
  37731. this
  37732. },
  37733. project: function(e) {
  37734. return void 0 === Oe && (Oe = new Ci.Matrix4),
  37735. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  37736. this.applyProjection(Oe)
  37737. },
  37738. unproject: function(e) {
  37739. return void 0 === Pe && (Pe = new Ci.Matrix4),
  37740. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  37741. this.applyProjection(Pe)
  37742. },
  37743. transformDirection: function(e) {
  37744. var t = this.x
  37745. , i = this.y
  37746. , n = this.z
  37747. , r = e.elements;
  37748. return this.x = r[0] * t + r[4] * i + r[8] * n,
  37749. this.y = r[1] * t + r[5] * i + r[9] * n,
  37750. this.z = r[2] * t + r[6] * i + r[10] * n,
  37751. this.normalize(),
  37752. this
  37753. },
  37754. divide: function(e) {
  37755. return this.x /= e.x,
  37756. this.y /= e.y,
  37757. this.z /= e.z,
  37758. this
  37759. },
  37760. divideScalar: function(e) {
  37761. return this.multiplyScalar(1 / e)
  37762. },
  37763. min: function(e) {
  37764. return this.x = Math.min(this.x, e.x),
  37765. this.y = Math.min(this.y, e.y),
  37766. this.z = Math.min(this.z, e.z),
  37767. this
  37768. },
  37769. max: function(e) {
  37770. return this.x = Math.max(this.x, e.x),
  37771. this.y = Math.max(this.y, e.y),
  37772. this.z = Math.max(this.z, e.z),
  37773. this
  37774. },
  37775. clamp: function(e, t) {
  37776. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37777. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37778. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  37779. this
  37780. },
  37781. clampScalar: function(e, t) {
  37782. return void 0 === Me && (Me = new Ci.Vector3,
  37783. Re = new Ci.Vector3),
  37784. Me.set(e, e, e),
  37785. Re.set(t, t, t),
  37786. this.clamp(Me, Re)
  37787. },
  37788. clampLength: function(e, t) {
  37789. var i = this.length();
  37790. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37791. this
  37792. },
  37793. floor: function() {
  37794. return this.x = Math.floor(this.x),
  37795. this.y = Math.floor(this.y),
  37796. this.z = Math.floor(this.z),
  37797. this
  37798. },
  37799. ceil: function() {
  37800. return this.x = Math.ceil(this.x),
  37801. this.y = Math.ceil(this.y),
  37802. this.z = Math.ceil(this.z),
  37803. this
  37804. },
  37805. round: function() {
  37806. return this.x = Math.round(this.x),
  37807. this.y = Math.round(this.y),
  37808. this.z = Math.round(this.z),
  37809. this
  37810. },
  37811. roundToZero: function() {
  37812. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37813. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37814. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  37815. this
  37816. },
  37817. negate: function() {
  37818. return this.x = -this.x,
  37819. this.y = -this.y,
  37820. this.z = -this.z,
  37821. this
  37822. },
  37823. dot: function(e) {
  37824. return this.x * e.x + this.y * e.y + this.z * e.z
  37825. },
  37826. lengthSq: function() {
  37827. return this.x * this.x + this.y * this.y + this.z * this.z
  37828. },
  37829. length: function() {
  37830. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  37831. },
  37832. lengthManhattan: function() {
  37833. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  37834. },
  37835. normalize: function() {
  37836. return this.divideScalar(this.length())
  37837. },
  37838. setLength: function(e) {
  37839. return this.multiplyScalar(e / this.length())
  37840. },
  37841. lerp: function(e, t) {
  37842. return this.x += (e.x - this.x) * t,
  37843. this.y += (e.y - this.y) * t,
  37844. this.z += (e.z - this.z) * t,
  37845. this
  37846. },
  37847. lerpVectors: function(e, t, i) {
  37848. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37849. this
  37850. },
  37851. cross: function(e, t) {
  37852. if (void 0 !== t)
  37853. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  37854. this.crossVectors(e, t);
  37855. var i = this.x
  37856. , n = this.y
  37857. , r = this.z;
  37858. return this.x = n * e.z - r * e.y,
  37859. this.y = r * e.x - i * e.z,
  37860. this.z = i * e.y - n * e.x,
  37861. this
  37862. },
  37863. crossVectors: function(e, t) {
  37864. var i = e.x
  37865. , n = e.y
  37866. , r = e.z
  37867. , o = t.x
  37868. , a = t.y
  37869. , s = t.z;
  37870. return this.x = n * s - r * a,
  37871. this.y = r * o - i * s,
  37872. this.z = i * a - n * o,
  37873. this
  37874. },
  37875. projectOnVector: function(e) {
  37876. return void 0 === xe && (xe = new Ci.Vector3),
  37877. xe.copy(e).normalize(),
  37878. Se = this.dot(xe),
  37879. this.copy(xe).multiplyScalar(Se)
  37880. },
  37881. projectOnPlane: function(e) {
  37882. return void 0 === Te && (Te = new Ci.Vector3),
  37883. Te.copy(this).projectOnVector(e),
  37884. this.sub(Te)
  37885. },
  37886. reflect: function(e) {
  37887. return void 0 === we && (we = new Ci.Vector3),
  37888. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  37889. },
  37890. angleTo: function(e) {
  37891. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  37892. return Math.acos(Ci.Math.clamp(t, -1, 1))
  37893. },
  37894. distanceTo: function(e) {
  37895. return Math.sqrt(this.distanceToSquared(e))
  37896. },
  37897. distanceToSquared: function(e) {
  37898. var t = this.x - e.x
  37899. , i = this.y - e.y
  37900. , n = this.z - e.z;
  37901. return t * t + i * i + n * n
  37902. },
  37903. setFromSpherical: function(e) {
  37904. var t = Math.sin(e.phi) * e.radius;
  37905. return this.x = t * Math.sin(e.theta),
  37906. this.y = Math.cos(e.phi) * e.radius,
  37907. this.z = t * Math.cos(e.theta),
  37908. this
  37909. },
  37910. setFromMatrixPosition: function(e) {
  37911. return this.setFromMatrixColumn(e, 3)
  37912. },
  37913. setFromMatrixScale: function(e) {
  37914. var t = this.setFromMatrixColumn(e, 0).length()
  37915. , i = this.setFromMatrixColumn(e, 1).length()
  37916. , n = this.setFromMatrixColumn(e, 2).length();
  37917. return this.x = t,
  37918. this.y = i,
  37919. this.z = n,
  37920. this
  37921. },
  37922. setFromMatrixColumn: function(e, t) {
  37923. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  37924. t = e = t),
  37925. this.fromArray(e.elements, 4 * t)
  37926. },
  37927. equals: function(e) {
  37928. return e.x === this.x && e.y === this.y && e.z === this.z
  37929. },
  37930. fromArray: function(e, t) {
  37931. return void 0 === t && (t = 0),
  37932. this.x = e[t],
  37933. this.y = e[t + 1],
  37934. this.z = e[t + 2],
  37935. this
  37936. },
  37937. toArray: function(e, t) {
  37938. return void 0 === e && (e = []),
  37939. void 0 === t && (t = 0),
  37940. e[t] = this.x,
  37941. e[t + 1] = this.y,
  37942. e[t + 2] = this.z,
  37943. e
  37944. },
  37945. fromAttribute: function(e, t, i) {
  37946. return void 0 === i && (i = 0),
  37947. t = t * e.itemSize + i,
  37948. this.x = e.array[t],
  37949. this.y = e.array[t + 1],
  37950. this.z = e.array[t + 2],
  37951. this
  37952. }
  37953. },
  37954. Ci.Vector4 = function(e, t, i, n) {
  37955. this.x = e || 0,
  37956. this.y = t || 0,
  37957. this.z = i || 0,
  37958. this.w = void 0 !== n ? n : 1
  37959. }
  37960. ,
  37961. Ci.Vector4.prototype = {
  37962. constructor: Ci.Vector4,
  37963. set: function(e, t, i, n) {
  37964. return this.x = e,
  37965. this.y = t,
  37966. this.z = i,
  37967. this.w = n,
  37968. this
  37969. },
  37970. setScalar: function(e) {
  37971. return this.x = e,
  37972. this.y = e,
  37973. this.z = e,
  37974. this.w = e,
  37975. this
  37976. },
  37977. setX: function(e) {
  37978. return this.x = e,
  37979. this
  37980. },
  37981. setY: function(e) {
  37982. return this.y = e,
  37983. this
  37984. },
  37985. setZ: function(e) {
  37986. return this.z = e,
  37987. this
  37988. },
  37989. setW: function(e) {
  37990. return this.w = e,
  37991. this
  37992. },
  37993. setComponent: function(e, t) {
  37994. switch (e) {
  37995. case 0:
  37996. this.x = t;
  37997. break;
  37998. case 1:
  37999. this.y = t;
  38000. break;
  38001. case 2:
  38002. this.z = t;
  38003. break;
  38004. case 3:
  38005. this.w = t;
  38006. break;
  38007. default:
  38008. throw new Error("index is out of range: " + e)
  38009. }
  38010. },
  38011. getComponent: function(e) {
  38012. switch (e) {
  38013. case 0:
  38014. return this.x;
  38015. case 1:
  38016. return this.y;
  38017. case 2:
  38018. return this.z;
  38019. case 3:
  38020. return this.w;
  38021. default:
  38022. throw new Error("index is out of range: " + e)
  38023. }
  38024. },
  38025. clone: function() {
  38026. return new this.constructor(this.x,this.y,this.z,this.w)
  38027. },
  38028. copy: function(e) {
  38029. return this.x = e.x,
  38030. this.y = e.y,
  38031. this.z = e.z,
  38032. this.w = void 0 !== e.w ? e.w : 1,
  38033. this
  38034. },
  38035. add: function(e, t) {
  38036. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38037. this.addVectors(e, t)) : (this.x += e.x,
  38038. this.y += e.y,
  38039. this.z += e.z,
  38040. this.w += e.w,
  38041. this)
  38042. },
  38043. addScalar: function(e) {
  38044. return this.x += e,
  38045. this.y += e,
  38046. this.z += e,
  38047. this.w += e,
  38048. this
  38049. },
  38050. addVectors: function(e, t) {
  38051. return this.x = e.x + t.x,
  38052. this.y = e.y + t.y,
  38053. this.z = e.z + t.z,
  38054. this.w = e.w + t.w,
  38055. this
  38056. },
  38057. addScaledVector: function(e, t) {
  38058. return this.x += e.x * t,
  38059. this.y += e.y * t,
  38060. this.z += e.z * t,
  38061. this.w += e.w * t,
  38062. this
  38063. },
  38064. sub: function(e, t) {
  38065. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38066. this.subVectors(e, t)) : (this.x -= e.x,
  38067. this.y -= e.y,
  38068. this.z -= e.z,
  38069. this.w -= e.w,
  38070. this)
  38071. },
  38072. subScalar: function(e) {
  38073. return this.x -= e,
  38074. this.y -= e,
  38075. this.z -= e,
  38076. this.w -= e,
  38077. this
  38078. },
  38079. subVectors: function(e, t) {
  38080. return this.x = e.x - t.x,
  38081. this.y = e.y - t.y,
  38082. this.z = e.z - t.z,
  38083. this.w = e.w - t.w,
  38084. this
  38085. },
  38086. multiplyScalar: function(e) {
  38087. return isFinite(e) ? (this.x *= e,
  38088. this.y *= e,
  38089. this.z *= e,
  38090. this.w *= e) : (this.x = 0,
  38091. this.y = 0,
  38092. this.z = 0,
  38093. this.w = 0),
  38094. this
  38095. },
  38096. applyMatrix4: function(e) {
  38097. var t = this.x
  38098. , i = this.y
  38099. , n = this.z
  38100. , r = this.w
  38101. , o = e.elements;
  38102. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38103. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38104. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38105. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38106. this
  38107. },
  38108. divideScalar: function(e) {
  38109. return this.multiplyScalar(1 / e)
  38110. },
  38111. setAxisAngleFromQuaternion: function(e) {
  38112. this.w = 2 * Math.acos(e.w);
  38113. var t = Math.sqrt(1 - e.w * e.w);
  38114. return t < 1e-4 ? (this.x = 1,
  38115. this.y = 0,
  38116. this.z = 0) : (this.x = e.x / t,
  38117. this.y = e.y / t,
  38118. this.z = e.z / t),
  38119. this
  38120. },
  38121. setAxisAngleFromRotationMatrix: function(e) {
  38122. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  38123. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38124. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38125. return this.set(1, 0, 0, 0),
  38126. this;
  38127. t = Math.PI;
  38128. var g = (a + 1) / 2
  38129. , m = (h + 1) / 2
  38130. , v = (f + 1) / 2
  38131. , y = (s + c) / 4
  38132. , A = (l + d) / 4
  38133. , C = (u + p) / 4;
  38134. return m < g && v < g ? r = g < .01 ? (i = 0,
  38135. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38136. A / i) : v < m ? r = m < .01 ? (n = 0,
  38137. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38138. C / n) : v < .01 ? (n = i = .707106781,
  38139. r = 0) : (i = A / (r = Math.sqrt(v)),
  38140. n = C / r),
  38141. this.set(i, n, r, t),
  38142. this
  38143. }
  38144. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38145. return Math.abs(I) < .001 && (I = 1),
  38146. this.x = (p - u) / I,
  38147. this.y = (l - d) / I,
  38148. this.z = (c - s) / I,
  38149. this.w = Math.acos((a + h + f - 1) / 2),
  38150. this
  38151. },
  38152. min: function(e) {
  38153. return this.x = Math.min(this.x, e.x),
  38154. this.y = Math.min(this.y, e.y),
  38155. this.z = Math.min(this.z, e.z),
  38156. this.w = Math.min(this.w, e.w),
  38157. this
  38158. },
  38159. max: function(e) {
  38160. return this.x = Math.max(this.x, e.x),
  38161. this.y = Math.max(this.y, e.y),
  38162. this.z = Math.max(this.z, e.z),
  38163. this.w = Math.max(this.w, e.w),
  38164. this
  38165. },
  38166. clamp: function(e, t) {
  38167. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38168. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38169. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38170. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38171. this
  38172. },
  38173. clampScalar: function(e, t) {
  38174. return void 0 === _e && (_e = new Ci.Vector4,
  38175. be = new Ci.Vector4),
  38176. _e.set(e, e, e, e),
  38177. be.set(t, t, t, t),
  38178. this.clamp(_e, be)
  38179. },
  38180. floor: function() {
  38181. return this.x = Math.floor(this.x),
  38182. this.y = Math.floor(this.y),
  38183. this.z = Math.floor(this.z),
  38184. this.w = Math.floor(this.w),
  38185. this
  38186. },
  38187. ceil: function() {
  38188. return this.x = Math.ceil(this.x),
  38189. this.y = Math.ceil(this.y),
  38190. this.z = Math.ceil(this.z),
  38191. this.w = Math.ceil(this.w),
  38192. this
  38193. },
  38194. round: function() {
  38195. return this.x = Math.round(this.x),
  38196. this.y = Math.round(this.y),
  38197. this.z = Math.round(this.z),
  38198. this.w = Math.round(this.w),
  38199. this
  38200. },
  38201. roundToZero: function() {
  38202. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38203. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38204. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38205. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38206. this
  38207. },
  38208. negate: function() {
  38209. return this.x = -this.x,
  38210. this.y = -this.y,
  38211. this.z = -this.z,
  38212. this.w = -this.w,
  38213. this
  38214. },
  38215. dot: function(e) {
  38216. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38217. },
  38218. lengthSq: function() {
  38219. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38220. },
  38221. length: function() {
  38222. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38223. },
  38224. lengthManhattan: function() {
  38225. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38226. },
  38227. normalize: function() {
  38228. return this.divideScalar(this.length())
  38229. },
  38230. setLength: function(e) {
  38231. return this.multiplyScalar(e / this.length())
  38232. },
  38233. lerp: function(e, t) {
  38234. return this.x += (e.x - this.x) * t,
  38235. this.y += (e.y - this.y) * t,
  38236. this.z += (e.z - this.z) * t,
  38237. this.w += (e.w - this.w) * t,
  38238. this
  38239. },
  38240. lerpVectors: function(e, t, i) {
  38241. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38242. this
  38243. },
  38244. equals: function(e) {
  38245. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38246. },
  38247. fromArray: function(e, t) {
  38248. return void 0 === t && (t = 0),
  38249. this.x = e[t],
  38250. this.y = e[t + 1],
  38251. this.z = e[t + 2],
  38252. this.w = e[t + 3],
  38253. this
  38254. },
  38255. toArray: function(e, t) {
  38256. return void 0 === e && (e = []),
  38257. void 0 === t && (t = 0),
  38258. e[t] = this.x,
  38259. e[t + 1] = this.y,
  38260. e[t + 2] = this.z,
  38261. e[t + 3] = this.w,
  38262. e
  38263. },
  38264. fromAttribute: function(e, t, i) {
  38265. return void 0 === i && (i = 0),
  38266. t = t * e.itemSize + i,
  38267. this.x = e.array[t],
  38268. this.y = e.array[t + 1],
  38269. this.z = e.array[t + 2],
  38270. this.w = e.array[t + 3],
  38271. this
  38272. }
  38273. },
  38274. Ci.Euler = function(e, t, i, n) {
  38275. this._x = e || 0,
  38276. this._y = t || 0,
  38277. this._z = i || 0,
  38278. this._order = n || Ci.Euler.DefaultOrder
  38279. }
  38280. ,
  38281. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38282. Ci.Euler.DefaultOrder = "XYZ",
  38283. Ci.Euler.prototype = {
  38284. constructor: Ci.Euler,
  38285. get x() {
  38286. return this._x
  38287. },
  38288. set x(e) {
  38289. this._x = e,
  38290. this.onChangeCallback()
  38291. },
  38292. get y() {
  38293. return this._y
  38294. },
  38295. set y(e) {
  38296. this._y = e,
  38297. this.onChangeCallback()
  38298. },
  38299. get z() {
  38300. return this._z
  38301. },
  38302. set z(e) {
  38303. this._z = e,
  38304. this.onChangeCallback()
  38305. },
  38306. get order() {
  38307. return this._order
  38308. },
  38309. set order(e) {
  38310. this._order = e,
  38311. this.onChangeCallback()
  38312. },
  38313. set: function(e, t, i, n) {
  38314. return this._x = e,
  38315. this._y = t,
  38316. this._z = i,
  38317. this._order = n || this._order,
  38318. this.onChangeCallback(),
  38319. this
  38320. },
  38321. clone: function() {
  38322. return new this.constructor(this._x,this._y,this._z,this._order)
  38323. },
  38324. copy: function(e) {
  38325. return this._x = e._x,
  38326. this._y = e._y,
  38327. this._z = e._z,
  38328. this._order = e._order,
  38329. this.onChangeCallback(),
  38330. this
  38331. },
  38332. setFromRotationMatrix: function(e, t, i) {
  38333. var n = Ci.Math.clamp
  38334. , r = e.elements
  38335. , o = r[0]
  38336. , a = r[4]
  38337. , s = r[8]
  38338. , l = r[1]
  38339. , c = r[5]
  38340. , h = r[9]
  38341. , u = r[2]
  38342. , d = r[6]
  38343. , p = r[10];
  38344. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38345. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38346. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38347. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38348. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38349. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38350. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38351. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38352. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38353. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38354. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38355. this._z = Math.atan2(l, o)) : (this._x = 0,
  38356. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38357. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38358. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38359. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38360. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38361. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38362. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38363. this._order = t,
  38364. !1 !== i && this.onChangeCallback(),
  38365. this
  38366. },
  38367. setFromQuaternion: function(e, t, i) {
  38368. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38369. Ee.makeRotationFromQuaternion(e),
  38370. this.setFromRotationMatrix(Ee, t, i),
  38371. this
  38372. },
  38373. setFromVector3: function(e, t) {
  38374. return this.set(e.x, e.y, e.z, t || this._order)
  38375. },
  38376. reorder: (Ie = new Ci.Quaternion,
  38377. function(e) {
  38378. Ie.setFromEuler(this),
  38379. this.setFromQuaternion(Ie, e)
  38380. }
  38381. ),
  38382. equals: function(e) {
  38383. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38384. },
  38385. fromArray: function(e) {
  38386. return this._x = e[0],
  38387. this._y = e[1],
  38388. this._z = e[2],
  38389. void 0 !== e[3] && (this._order = e[3]),
  38390. this.onChangeCallback(),
  38391. this
  38392. },
  38393. toArray: function(e, t) {
  38394. return void 0 === e && (e = []),
  38395. void 0 === t && (t = 0),
  38396. e[t] = this._x,
  38397. e[t + 1] = this._y,
  38398. e[t + 2] = this._z,
  38399. e[t + 3] = this._order,
  38400. e
  38401. },
  38402. toVector3: function(e) {
  38403. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38404. },
  38405. onChange: function(e) {
  38406. return this.onChangeCallback = e,
  38407. this
  38408. },
  38409. onChangeCallback: function() {}
  38410. },
  38411. Ci.Line3 = function(e, t) {
  38412. this.start = void 0 !== e ? e : new Ci.Vector3,
  38413. this.end = void 0 !== t ? t : new Ci.Vector3
  38414. }
  38415. ,
  38416. Ci.Line3.prototype = {
  38417. constructor: Ci.Line3,
  38418. set: function(e, t) {
  38419. return this.start.copy(e),
  38420. this.end.copy(t),
  38421. this
  38422. },
  38423. clone: function() {
  38424. return (new this.constructor).copy(this)
  38425. },
  38426. copy: function(e) {
  38427. return this.start.copy(e.start),
  38428. this.end.copy(e.end),
  38429. this
  38430. },
  38431. center: function(e) {
  38432. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38433. },
  38434. delta: function(e) {
  38435. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38436. },
  38437. distanceSq: function() {
  38438. return this.start.distanceToSquared(this.end)
  38439. },
  38440. distance: function() {
  38441. return this.start.distanceTo(this.end)
  38442. },
  38443. at: function(e, t) {
  38444. var i = t || new Ci.Vector3;
  38445. return this.delta(i).multiplyScalar(e).add(this.start)
  38446. },
  38447. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38448. Ce = new Ci.Vector3,
  38449. function(e, t) {
  38450. Ae.subVectors(e, this.start),
  38451. Ce.subVectors(this.end, this.start);
  38452. var i = Ce.dot(Ce)
  38453. , n = Ce.dot(Ae) / i;
  38454. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38455. n
  38456. }
  38457. ),
  38458. closestPointToPoint: function(e, t, i) {
  38459. var n = this.closestPointToPointParameter(e, t)
  38460. , r = i || new Ci.Vector3;
  38461. return this.delta(r).multiplyScalar(n).add(this.start)
  38462. },
  38463. applyMatrix4: function(e) {
  38464. return this.start.applyMatrix4(e),
  38465. this.end.applyMatrix4(e),
  38466. this
  38467. },
  38468. equals: function(e) {
  38469. return e.start.equals(this.start) && e.end.equals(this.end)
  38470. }
  38471. },
  38472. Ci.Box2 = function(e, t) {
  38473. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38474. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38475. }
  38476. ,
  38477. Ci.Box2.prototype = {
  38478. constructor: Ci.Box2,
  38479. set: function(e, t) {
  38480. return this.min.copy(e),
  38481. this.max.copy(t),
  38482. this
  38483. },
  38484. setFromPoints: function(e) {
  38485. this.makeEmpty();
  38486. for (var t = 0, i = e.length; t < i; t++)
  38487. this.expandByPoint(e[t]);
  38488. return this
  38489. },
  38490. setFromCenterAndSize: (ye = new Ci.Vector2,
  38491. function(e, t) {
  38492. var i = ye.copy(t).multiplyScalar(.5);
  38493. return this.min.copy(e).sub(i),
  38494. this.max.copy(e).add(i),
  38495. this
  38496. }
  38497. ),
  38498. clone: function() {
  38499. return (new this.constructor).copy(this)
  38500. },
  38501. copy: function(e) {
  38502. return this.min.copy(e.min),
  38503. this.max.copy(e.max),
  38504. this
  38505. },
  38506. makeEmpty: function() {
  38507. return this.min.x = this.min.y = 1 / 0,
  38508. this.max.x = this.max.y = -1 / 0,
  38509. this
  38510. },
  38511. isEmpty: function() {
  38512. return this.max.x < this.min.x || this.max.y < this.min.y
  38513. },
  38514. center: function(e) {
  38515. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38516. },
  38517. size: function(e) {
  38518. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38519. },
  38520. expandByPoint: function(e) {
  38521. return this.min.min(e),
  38522. this.max.max(e),
  38523. this
  38524. },
  38525. expandByVector: function(e) {
  38526. return this.min.sub(e),
  38527. this.max.add(e),
  38528. this
  38529. },
  38530. expandByScalar: function(e) {
  38531. return this.min.addScalar(-e),
  38532. this.max.addScalar(e),
  38533. this
  38534. },
  38535. containsPoint: function(e) {
  38536. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38537. },
  38538. containsBox: function(e) {
  38539. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  38540. },
  38541. getParameter: function(e, t) {
  38542. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  38543. },
  38544. intersectsBox: function(e) {
  38545. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  38546. },
  38547. clampPoint: function(e, t) {
  38548. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38549. },
  38550. distanceToPoint: (ve = new Ci.Vector2,
  38551. function(e) {
  38552. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38553. }
  38554. ),
  38555. intersect: function(e) {
  38556. return this.min.max(e.min),
  38557. this.max.min(e.max),
  38558. this
  38559. },
  38560. union: function(e) {
  38561. return this.min.min(e.min),
  38562. this.max.max(e.max),
  38563. this
  38564. },
  38565. translate: function(e) {
  38566. return this.min.add(e),
  38567. this.max.add(e),
  38568. this
  38569. },
  38570. equals: function(e) {
  38571. return e.min.equals(this.min) && e.max.equals(this.max)
  38572. }
  38573. },
  38574. Ci.Box3 = function(e, t) {
  38575. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38576. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38577. }
  38578. ,
  38579. Ci.Box3.prototype = {
  38580. constructor: Ci.Box3,
  38581. set: function(e, t) {
  38582. return this.min.copy(e),
  38583. this.max.copy(t),
  38584. this
  38585. },
  38586. setFromArray: function(e) {
  38587. this.makeEmpty();
  38588. for (var t = 1 / 0, i = 1 / 0, n = 1 / 0, r = -1 / 0, o = -1 / 0, a = -1 / 0, s = 0, l = e.length; s < l; s += 3) {
  38589. var c = e[s]
  38590. , h = e[s + 1]
  38591. , u = e[s + 2];
  38592. c < t && (t = c),
  38593. h < i && (i = h),
  38594. u < n && (n = u),
  38595. r < c && (r = c),
  38596. o < h && (o = h),
  38597. a < u && (a = u)
  38598. }
  38599. this.min.set(t, i, n),
  38600. this.max.set(r, o, a)
  38601. },
  38602. setFromPoints: function(e) {
  38603. this.makeEmpty();
  38604. for (var t = 0, i = e.length; t < i; t++)
  38605. this.expandByPoint(e[t]);
  38606. return this
  38607. },
  38608. setFromCenterAndSize: (me = new Ci.Vector3,
  38609. function(e, t) {
  38610. var i = me.copy(t).multiplyScalar(.5);
  38611. return this.min.copy(e).sub(i),
  38612. this.max.copy(e).add(i),
  38613. this
  38614. }
  38615. ),
  38616. setFromObject: function(e) {
  38617. void 0 === ge && (ge = new Ci.Box3);
  38618. var i = this;
  38619. return this.makeEmpty(),
  38620. e.updateMatrixWorld(!0),
  38621. e.traverse(function(e) {
  38622. var t = e.geometry;
  38623. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38624. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38625. ge.applyMatrix4(e.matrixWorld),
  38626. i.union(ge)))
  38627. }),
  38628. this
  38629. },
  38630. clone: function() {
  38631. return (new this.constructor).copy(this)
  38632. },
  38633. copy: function(e) {
  38634. return this.min.copy(e.min),
  38635. this.max.copy(e.max),
  38636. this
  38637. },
  38638. makeEmpty: function() {
  38639. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38640. this.max.x = this.max.y = this.max.z = -1 / 0,
  38641. this
  38642. },
  38643. isEmpty: function() {
  38644. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38645. },
  38646. center: function(e) {
  38647. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38648. },
  38649. size: function(e) {
  38650. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38651. },
  38652. expandByPoint: function(e) {
  38653. return this.min.min(e),
  38654. this.max.max(e),
  38655. this
  38656. },
  38657. expandByVector: function(e) {
  38658. return this.min.sub(e),
  38659. this.max.add(e),
  38660. this
  38661. },
  38662. expandByScalar: function(e) {
  38663. return this.min.addScalar(-e),
  38664. this.max.addScalar(e),
  38665. this
  38666. },
  38667. containsPoint: function(e) {
  38668. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  38669. },
  38670. containsBox: function(e) {
  38671. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  38672. },
  38673. getParameter: function(e, t) {
  38674. return (t || new Ci.Vector3).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  38675. },
  38676. intersectsBox: function(e) {
  38677. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  38678. },
  38679. intersectsSphere: function(e) {
  38680. return void 0 === fe && (fe = new Ci.Vector3),
  38681. this.clampPoint(e.center, fe),
  38682. fe.distanceToSquared(e.center) <= e.radius * e.radius
  38683. },
  38684. intersectsPlane: function(e) {
  38685. var t, i;
  38686. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  38687. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  38688. e.normal.x * this.min.x),
  38689. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  38690. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  38691. i += e.normal.y * this.min.y),
  38692. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  38693. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  38694. i += e.normal.z * this.min.z),
  38695. t <= e.constant && i >= e.constant
  38696. },
  38697. clampPoint: function(e, t) {
  38698. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  38699. },
  38700. distanceToPoint: (pe = new Ci.Vector3,
  38701. function(e) {
  38702. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  38703. }
  38704. ),
  38705. getBoundingSphere: (de = new Ci.Vector3,
  38706. function(e) {
  38707. var t = e || new Ci.Sphere;
  38708. return t.center = this.center(),
  38709. t.radius = .5 * this.size(de).length(),
  38710. t
  38711. }
  38712. ),
  38713. intersect: function(e) {
  38714. return this.min.max(e.min),
  38715. this.max.min(e.max),
  38716. this
  38717. },
  38718. union: function(e) {
  38719. return this.min.min(e.min),
  38720. this.max.max(e.max),
  38721. this
  38722. },
  38723. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  38724. function(e) {
  38725. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  38726. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  38727. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  38728. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  38729. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  38730. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  38731. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  38732. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  38733. this.makeEmpty(),
  38734. this.setFromPoints(ue),
  38735. this
  38736. }
  38737. ),
  38738. translate: function(e) {
  38739. return this.min.add(e),
  38740. this.max.add(e),
  38741. this
  38742. },
  38743. equals: function(e) {
  38744. return e.min.equals(this.min) && e.max.equals(this.max)
  38745. }
  38746. },
  38747. Ci.Matrix3 = function() {
  38748. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  38749. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  38750. }
  38751. ,
  38752. Ci.Matrix3.prototype = {
  38753. constructor: Ci.Matrix3,
  38754. set: function(e, t, i, n, r, o, a, s, l) {
  38755. var c = this.elements;
  38756. return c[0] = e,
  38757. c[1] = n,
  38758. c[2] = a,
  38759. c[3] = t,
  38760. c[4] = r,
  38761. c[5] = s,
  38762. c[6] = i,
  38763. c[7] = o,
  38764. c[8] = l,
  38765. this
  38766. },
  38767. identity: function() {
  38768. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  38769. this
  38770. },
  38771. clone: function() {
  38772. return (new this.constructor).fromArray(this.elements)
  38773. },
  38774. copy: function(e) {
  38775. var t = e.elements;
  38776. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  38777. this
  38778. },
  38779. setFromMatrix4: function(e) {
  38780. var t = e.elements;
  38781. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  38782. this
  38783. },
  38784. applyToVector3Array: function(e, t, i) {
  38785. void 0 === he && (he = new Ci.Vector3),
  38786. void 0 === t && (t = 0),
  38787. void 0 === i && (i = e.length);
  38788. for (var n = 0, r = t; n < i; n += 3,
  38789. r += 3)
  38790. he.fromArray(e, r),
  38791. he.applyMatrix3(this),
  38792. he.toArray(e, r);
  38793. return e
  38794. },
  38795. applyToBuffer: function(e, t, i) {
  38796. void 0 === ce && (ce = new Ci.Vector3),
  38797. void 0 === t && (t = 0),
  38798. void 0 === i && (i = e.length / e.itemSize);
  38799. for (var n = 0, r = t; n < i; n++,
  38800. r++)
  38801. ce.x = e.getX(r),
  38802. ce.y = e.getY(r),
  38803. ce.z = e.getZ(r),
  38804. ce.applyMatrix3(this),
  38805. e.setXYZ(ce.x, ce.y, ce.z);
  38806. return e
  38807. },
  38808. multiplyScalar: function(e) {
  38809. var t = this.elements;
  38810. return t[0] *= e,
  38811. t[3] *= e,
  38812. t[6] *= e,
  38813. t[1] *= e,
  38814. t[4] *= e,
  38815. t[7] *= e,
  38816. t[2] *= e,
  38817. t[5] *= e,
  38818. t[8] *= e,
  38819. this
  38820. },
  38821. determinant: function() {
  38822. var e = this.elements
  38823. , t = e[0]
  38824. , i = e[1]
  38825. , n = e[2]
  38826. , r = e[3]
  38827. , o = e[4]
  38828. , a = e[5]
  38829. , s = e[6]
  38830. , l = e[7]
  38831. , c = e[8];
  38832. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  38833. },
  38834. getInverse: function(e, t) {
  38835. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  38836. var i = e.elements
  38837. , n = this.elements
  38838. , r = i[0]
  38839. , o = i[1]
  38840. , a = i[2]
  38841. , s = i[3]
  38842. , l = i[4]
  38843. , c = i[5]
  38844. , h = i[6]
  38845. , u = i[7]
  38846. , d = i[8]
  38847. , p = d * l - c * u
  38848. , f = c * h - d * s
  38849. , g = u * s - l * h
  38850. , m = r * p + o * f + a * g;
  38851. if (0 != m)
  38852. return n[0] = p,
  38853. n[1] = a * u - d * o,
  38854. n[2] = c * o - a * l,
  38855. n[3] = f,
  38856. n[4] = d * r - a * h,
  38857. n[5] = a * s - c * r,
  38858. n[6] = g,
  38859. n[7] = o * h - u * r,
  38860. n[8] = l * r - o * s,
  38861. this.multiplyScalar(1 / m);
  38862. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  38863. if (t)
  38864. throw new Error(v);
  38865. return console.warn(v),
  38866. this.identity()
  38867. },
  38868. transpose: function() {
  38869. var e, t = this.elements;
  38870. return e = t[1],
  38871. t[1] = t[3],
  38872. t[3] = e,
  38873. e = t[2],
  38874. t[2] = t[6],
  38875. t[6] = e,
  38876. e = t[5],
  38877. t[5] = t[7],
  38878. t[7] = e,
  38879. this
  38880. },
  38881. flattenToArrayOffset: function(e, t) {
  38882. var i = this.elements;
  38883. return e[t] = i[0],
  38884. e[t + 1] = i[1],
  38885. e[t + 2] = i[2],
  38886. e[t + 3] = i[3],
  38887. e[t + 4] = i[4],
  38888. e[t + 5] = i[5],
  38889. e[t + 6] = i[6],
  38890. e[t + 7] = i[7],
  38891. e[t + 8] = i[8],
  38892. e
  38893. },
  38894. getNormalMatrix: function(e) {
  38895. return this.setFromMatrix4(e).getInverse(this).transpose()
  38896. },
  38897. transposeIntoArray: function(e) {
  38898. var t = this.elements;
  38899. return e[0] = t[0],
  38900. e[1] = t[3],
  38901. e[2] = t[6],
  38902. e[3] = t[1],
  38903. e[4] = t[4],
  38904. e[5] = t[7],
  38905. e[6] = t[2],
  38906. e[7] = t[5],
  38907. e[8] = t[8],
  38908. this
  38909. },
  38910. fromArray: function(e) {
  38911. return this.elements.set(e),
  38912. this
  38913. },
  38914. toArray: function() {
  38915. var e = this.elements;
  38916. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  38917. }
  38918. },
  38919. Ci.Matrix4 = function() {
  38920. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  38921. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  38922. }
  38923. ,
  38924. Ci.Matrix4.prototype = {
  38925. constructor: Ci.Matrix4,
  38926. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  38927. var m = this.elements;
  38928. return m[0] = e,
  38929. m[4] = t,
  38930. m[8] = i,
  38931. m[12] = n,
  38932. m[1] = r,
  38933. m[5] = o,
  38934. m[9] = a,
  38935. m[13] = s,
  38936. m[2] = l,
  38937. m[6] = c,
  38938. m[10] = h,
  38939. m[14] = u,
  38940. m[3] = d,
  38941. m[7] = p,
  38942. m[11] = f,
  38943. m[15] = g,
  38944. this
  38945. },
  38946. identity: function() {
  38947. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  38948. this
  38949. },
  38950. clone: function() {
  38951. return (new Ci.Matrix4).fromArray(this.elements)
  38952. },
  38953. copy: function(e) {
  38954. return this.elements.set(e.elements),
  38955. this
  38956. },
  38957. copyPosition: function(e) {
  38958. var t = this.elements
  38959. , i = e.elements;
  38960. return t[12] = i[12],
  38961. t[13] = i[13],
  38962. t[14] = i[14],
  38963. this
  38964. },
  38965. extractBasis: function(e, t, i) {
  38966. return e.setFromMatrixColumn(this, 0),
  38967. t.setFromMatrixColumn(this, 1),
  38968. i.setFromMatrixColumn(this, 2),
  38969. this
  38970. },
  38971. makeBasis: function(e, t, i) {
  38972. return this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1),
  38973. this
  38974. },
  38975. extractRotation: function(e) {
  38976. void 0 === le && (le = new Ci.Vector3);
  38977. var t = this.elements
  38978. , i = e.elements
  38979. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  38980. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  38981. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  38982. return t[0] = i[0] * n,
  38983. t[1] = i[1] * n,
  38984. t[2] = i[2] * n,
  38985. t[4] = i[4] * r,
  38986. t[5] = i[5] * r,
  38987. t[6] = i[6] * r,
  38988. t[8] = i[8] * o,
  38989. t[9] = i[9] * o,
  38990. t[10] = i[10] * o,
  38991. this
  38992. },
  38993. makeRotationFromEuler: function(e) {
  38994. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  38995. var t = this.elements
  38996. , i = e.x
  38997. , n = e.y
  38998. , r = e.z
  38999. , o = Math.cos(i)
  39000. , a = Math.sin(i)
  39001. , s = Math.cos(n)
  39002. , l = Math.sin(n)
  39003. , c = Math.cos(r)
  39004. , h = Math.sin(r);
  39005. if ("XYZ" === e.order) {
  39006. var u = o * c
  39007. , d = o * h
  39008. , p = a * c
  39009. , f = a * h;
  39010. t[0] = s * c,
  39011. t[4] = -s * h,
  39012. t[8] = l,
  39013. t[1] = d + p * l,
  39014. t[5] = u - f * l,
  39015. t[9] = -a * s,
  39016. t[2] = f - u * l,
  39017. t[6] = p + d * l,
  39018. t[10] = o * s
  39019. } else if ("YXZ" === e.order) {
  39020. var g = s * c
  39021. , m = s * h
  39022. , v = l * c
  39023. , y = l * h;
  39024. t[0] = g + y * a,
  39025. t[4] = v * a - m,
  39026. t[8] = o * l,
  39027. t[1] = o * h,
  39028. t[5] = o * c,
  39029. t[9] = -a,
  39030. t[2] = m * a - v,
  39031. t[6] = y + g * a,
  39032. t[10] = o * s
  39033. } else if ("ZXY" === e.order) {
  39034. g = s * c,
  39035. m = s * h,
  39036. v = l * c,
  39037. y = l * h;
  39038. t[0] = g - y * a,
  39039. t[4] = -o * h,
  39040. t[8] = v + m * a,
  39041. t[1] = m + v * a,
  39042. t[5] = o * c,
  39043. t[9] = y - g * a,
  39044. t[2] = -o * l,
  39045. t[6] = a,
  39046. t[10] = o * s
  39047. } else if ("ZYX" === e.order) {
  39048. u = o * c,
  39049. d = o * h,
  39050. p = a * c,
  39051. f = a * h;
  39052. t[0] = s * c,
  39053. t[4] = p * l - d,
  39054. t[8] = u * l + f,
  39055. t[1] = s * h,
  39056. t[5] = f * l + u,
  39057. t[9] = d * l - p,
  39058. t[2] = -l,
  39059. t[6] = a * s,
  39060. t[10] = o * s
  39061. } else if ("YZX" === e.order) {
  39062. var A = o * s
  39063. , C = o * l
  39064. , I = a * s
  39065. , E = a * l;
  39066. t[0] = s * c,
  39067. t[4] = E - A * h,
  39068. t[8] = I * h + C,
  39069. t[1] = h,
  39070. t[5] = o * c,
  39071. t[9] = -a * c,
  39072. t[2] = -l * c,
  39073. t[6] = C * h + I,
  39074. t[10] = A - E * h
  39075. } else if ("XZY" === e.order) {
  39076. A = o * s,
  39077. C = o * l,
  39078. I = a * s,
  39079. E = a * l;
  39080. t[0] = s * c,
  39081. t[4] = -h,
  39082. t[8] = l * c,
  39083. t[1] = A * h + E,
  39084. t[5] = o * c,
  39085. t[9] = C * h - I,
  39086. t[2] = I * h - C,
  39087. t[6] = a * c,
  39088. t[10] = E * h + A
  39089. }
  39090. return t[3] = 0,
  39091. t[7] = 0,
  39092. t[11] = 0,
  39093. t[12] = 0,
  39094. t[13] = 0,
  39095. t[14] = 0,
  39096. t[15] = 1,
  39097. this
  39098. },
  39099. makeRotationFromQuaternion: function(e) {
  39100. var t = this.elements
  39101. , i = e.x
  39102. , n = e.y
  39103. , r = e.z
  39104. , o = e.w
  39105. , a = i + i
  39106. , s = n + n
  39107. , l = r + r
  39108. , c = i * a
  39109. , h = i * s
  39110. , u = i * l
  39111. , d = n * s
  39112. , p = n * l
  39113. , f = r * l
  39114. , g = o * a
  39115. , m = o * s
  39116. , v = o * l;
  39117. return t[0] = 1 - (d + f),
  39118. t[4] = h - v,
  39119. t[8] = u + m,
  39120. t[1] = h + v,
  39121. t[5] = 1 - (c + f),
  39122. t[9] = p - g,
  39123. t[2] = u - m,
  39124. t[6] = p + g,
  39125. t[10] = 1 - (c + d),
  39126. t[3] = 0,
  39127. t[7] = 0,
  39128. t[11] = 0,
  39129. t[12] = 0,
  39130. t[13] = 0,
  39131. t[14] = 0,
  39132. t[15] = 1,
  39133. this
  39134. },
  39135. lookAt: function(e, t, i) {
  39136. void 0 === oe && (oe = new Ci.Vector3),
  39137. void 0 === ae && (ae = new Ci.Vector3),
  39138. void 0 === se && (se = new Ci.Vector3);
  39139. var n = this.elements;
  39140. return se.subVectors(e, t).normalize(),
  39141. 0 === se.lengthSq() && (se.z = 1),
  39142. oe.crossVectors(i, se).normalize(),
  39143. 0 === oe.lengthSq() && (se.x += 1e-4,
  39144. oe.crossVectors(i, se).normalize()),
  39145. ae.crossVectors(se, oe),
  39146. n[0] = oe.x,
  39147. n[4] = ae.x,
  39148. n[8] = se.x,
  39149. n[1] = oe.y,
  39150. n[5] = ae.y,
  39151. n[9] = se.y,
  39152. n[2] = oe.z,
  39153. n[6] = ae.z,
  39154. n[10] = se.z,
  39155. this
  39156. },
  39157. multiply: function(e, t) {
  39158. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39159. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39160. },
  39161. multiplyMatrices: function(e, t) {
  39162. var i = e.elements
  39163. , n = t.elements
  39164. , r = this.elements
  39165. , o = i[0]
  39166. , a = i[4]
  39167. , s = i[8]
  39168. , l = i[12]
  39169. , c = i[1]
  39170. , h = i[5]
  39171. , u = i[9]
  39172. , d = i[13]
  39173. , p = i[2]
  39174. , f = i[6]
  39175. , g = i[10]
  39176. , m = i[14]
  39177. , v = i[3]
  39178. , y = i[7]
  39179. , A = i[11]
  39180. , C = i[15]
  39181. , I = n[0]
  39182. , E = n[4]
  39183. , _ = n[8]
  39184. , b = n[12]
  39185. , w = n[1]
  39186. , T = n[5]
  39187. , x = n[9]
  39188. , S = n[13]
  39189. , M = n[2]
  39190. , R = n[6]
  39191. , P = n[10]
  39192. , O = n[14]
  39193. , L = n[3]
  39194. , D = n[7]
  39195. , N = n[11]
  39196. , F = n[15];
  39197. return r[0] = o * I + a * w + s * M + l * L,
  39198. r[4] = o * E + a * T + s * R + l * D,
  39199. r[8] = o * _ + a * x + s * P + l * N,
  39200. r[12] = o * b + a * S + s * O + l * F,
  39201. r[1] = c * I + h * w + u * M + d * L,
  39202. r[5] = c * E + h * T + u * R + d * D,
  39203. r[9] = c * _ + h * x + u * P + d * N,
  39204. r[13] = c * b + h * S + u * O + d * F,
  39205. r[2] = p * I + f * w + g * M + m * L,
  39206. r[6] = p * E + f * T + g * R + m * D,
  39207. r[10] = p * _ + f * x + g * P + m * N,
  39208. r[14] = p * b + f * S + g * O + m * F,
  39209. r[3] = v * I + y * w + A * M + C * L,
  39210. r[7] = v * E + y * T + A * R + C * D,
  39211. r[11] = v * _ + y * x + A * P + C * N,
  39212. r[15] = v * b + y * S + A * O + C * F,
  39213. this
  39214. },
  39215. multiplyToArray: function(e, t, i) {
  39216. var n = this.elements;
  39217. return this.multiplyMatrices(e, t),
  39218. i[0] = n[0],
  39219. i[1] = n[1],
  39220. i[2] = n[2],
  39221. i[3] = n[3],
  39222. i[4] = n[4],
  39223. i[5] = n[5],
  39224. i[6] = n[6],
  39225. i[7] = n[7],
  39226. i[8] = n[8],
  39227. i[9] = n[9],
  39228. i[10] = n[10],
  39229. i[11] = n[11],
  39230. i[12] = n[12],
  39231. i[13] = n[13],
  39232. i[14] = n[14],
  39233. i[15] = n[15],
  39234. this
  39235. },
  39236. multiplyScalar: function(e) {
  39237. var t = this.elements;
  39238. return t[0] *= e,
  39239. t[4] *= e,
  39240. t[8] *= e,
  39241. t[12] *= e,
  39242. t[1] *= e,
  39243. t[5] *= e,
  39244. t[9] *= e,
  39245. t[13] *= e,
  39246. t[2] *= e,
  39247. t[6] *= e,
  39248. t[10] *= e,
  39249. t[14] *= e,
  39250. t[3] *= e,
  39251. t[7] *= e,
  39252. t[11] *= e,
  39253. t[15] *= e,
  39254. this
  39255. },
  39256. applyToVector3Array: function(e, t, i) {
  39257. void 0 === re && (re = new Ci.Vector3),
  39258. void 0 === t && (t = 0),
  39259. void 0 === i && (i = e.length);
  39260. for (var n = 0, r = t; n < i; n += 3,
  39261. r += 3)
  39262. re.fromArray(e, r),
  39263. re.applyMatrix4(this),
  39264. re.toArray(e, r);
  39265. return e
  39266. },
  39267. applyToBuffer: function(e, t, i) {
  39268. void 0 === ne && (ne = new Ci.Vector3),
  39269. void 0 === t && (t = 0),
  39270. void 0 === i && (i = e.length / e.itemSize);
  39271. for (var n = 0, r = t; n < i; n++,
  39272. r++)
  39273. ne.x = e.getX(r),
  39274. ne.y = e.getY(r),
  39275. ne.z = e.getZ(r),
  39276. ne.applyMatrix4(this),
  39277. e.setXYZ(ne.x, ne.y, ne.z);
  39278. return e
  39279. },
  39280. determinant: function() {
  39281. var e = this.elements
  39282. , t = e[0]
  39283. , i = e[4]
  39284. , n = e[8]
  39285. , r = e[12]
  39286. , o = e[1]
  39287. , a = e[5]
  39288. , s = e[9]
  39289. , l = e[13]
  39290. , c = e[2]
  39291. , h = e[6]
  39292. , u = e[10]
  39293. , d = e[14];
  39294. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39295. },
  39296. transpose: function() {
  39297. var e, t = this.elements;
  39298. return e = t[1],
  39299. t[1] = t[4],
  39300. t[4] = e,
  39301. e = t[2],
  39302. t[2] = t[8],
  39303. t[8] = e,
  39304. e = t[6],
  39305. t[6] = t[9],
  39306. t[9] = e,
  39307. e = t[3],
  39308. t[3] = t[12],
  39309. t[12] = e,
  39310. e = t[7],
  39311. t[7] = t[13],
  39312. t[13] = e,
  39313. e = t[11],
  39314. t[11] = t[14],
  39315. t[14] = e,
  39316. this
  39317. },
  39318. flattenToArrayOffset: function(e, t) {
  39319. var i = this.elements;
  39320. return e[t] = i[0],
  39321. e[t + 1] = i[1],
  39322. e[t + 2] = i[2],
  39323. e[t + 3] = i[3],
  39324. e[t + 4] = i[4],
  39325. e[t + 5] = i[5],
  39326. e[t + 6] = i[6],
  39327. e[t + 7] = i[7],
  39328. e[t + 8] = i[8],
  39329. e[t + 9] = i[9],
  39330. e[t + 10] = i[10],
  39331. e[t + 11] = i[11],
  39332. e[t + 12] = i[12],
  39333. e[t + 13] = i[13],
  39334. e[t + 14] = i[14],
  39335. e[t + 15] = i[15],
  39336. e
  39337. },
  39338. getPosition: function() {
  39339. return void 0 === ie && (ie = new Ci.Vector3),
  39340. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39341. ie.setFromMatrixColumn(this, 3)
  39342. },
  39343. setPosition: function(e) {
  39344. var t = this.elements;
  39345. return t[12] = e.x,
  39346. t[13] = e.y,
  39347. t[14] = e.z,
  39348. this
  39349. },
  39350. getInverse: function(e, t) {
  39351. var i = this.elements
  39352. , n = e.elements
  39353. , r = n[0]
  39354. , o = n[1]
  39355. , a = n[2]
  39356. , s = n[3]
  39357. , l = n[4]
  39358. , c = n[5]
  39359. , h = n[6]
  39360. , u = n[7]
  39361. , d = n[8]
  39362. , p = n[9]
  39363. , f = n[10]
  39364. , g = n[11]
  39365. , m = n[12]
  39366. , v = n[13]
  39367. , y = n[14]
  39368. , A = n[15]
  39369. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39370. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39371. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39372. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39373. , b = r * C + o * I + a * E + s * _;
  39374. if (0 != b)
  39375. return i[0] = C,
  39376. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39377. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39378. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39379. i[4] = I,
  39380. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39381. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39382. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39383. i[8] = E,
  39384. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39385. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39386. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39387. i[12] = _,
  39388. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39389. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39390. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39391. this.multiplyScalar(1 / b);
  39392. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39393. if (t)
  39394. throw new Error(w);
  39395. return console.warn(w),
  39396. this.identity()
  39397. },
  39398. scale: function(e) {
  39399. var t = this.elements
  39400. , i = e.x
  39401. , n = e.y
  39402. , r = e.z;
  39403. return t[0] *= i,
  39404. t[4] *= n,
  39405. t[8] *= r,
  39406. t[1] *= i,
  39407. t[5] *= n,
  39408. t[9] *= r,
  39409. t[2] *= i,
  39410. t[6] *= n,
  39411. t[10] *= r,
  39412. t[3] *= i,
  39413. t[7] *= n,
  39414. t[11] *= r,
  39415. this
  39416. },
  39417. getMaxScaleOnAxis: function() {
  39418. var e = this.elements
  39419. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39420. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39421. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39422. return Math.sqrt(Math.max(t, i, n))
  39423. },
  39424. makeTranslation: function(e, t, i) {
  39425. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39426. this
  39427. },
  39428. makeRotationX: function(e) {
  39429. var t = Math.cos(e)
  39430. , i = Math.sin(e);
  39431. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39432. this
  39433. },
  39434. makeRotationY: function(e) {
  39435. var t = Math.cos(e)
  39436. , i = Math.sin(e);
  39437. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39438. this
  39439. },
  39440. makeRotationZ: function(e) {
  39441. var t = Math.cos(e)
  39442. , i = Math.sin(e);
  39443. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39444. this
  39445. },
  39446. makeRotationAxis: function(e, t) {
  39447. var i = Math.cos(t)
  39448. , n = Math.sin(t)
  39449. , r = 1 - i
  39450. , o = e.x
  39451. , a = e.y
  39452. , s = e.z
  39453. , l = r * o
  39454. , c = r * a;
  39455. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1),
  39456. this
  39457. },
  39458. makeScale: function(e, t, i) {
  39459. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39460. this
  39461. },
  39462. compose: function(e, t, i) {
  39463. return this.makeRotationFromQuaternion(t),
  39464. this.scale(i),
  39465. this.setPosition(e),
  39466. this
  39467. },
  39468. decompose: function(e, t, i) {
  39469. void 0 === ee && (ee = new Ci.Vector3),
  39470. void 0 === te && (te = new Ci.Matrix4);
  39471. var n = this.elements
  39472. , r = ee.set(n[0], n[1], n[2]).length()
  39473. , o = ee.set(n[4], n[5], n[6]).length()
  39474. , a = ee.set(n[8], n[9], n[10]).length();
  39475. this.determinant() < 0 && (r = -r),
  39476. e.x = n[12],
  39477. e.y = n[13],
  39478. e.z = n[14],
  39479. te.elements.set(this.elements);
  39480. var s = 1 / r
  39481. , l = 1 / o
  39482. , c = 1 / a;
  39483. return te.elements[0] *= s,
  39484. te.elements[1] *= s,
  39485. te.elements[2] *= s,
  39486. te.elements[4] *= l,
  39487. te.elements[5] *= l,
  39488. te.elements[6] *= l,
  39489. te.elements[8] *= c,
  39490. te.elements[9] *= c,
  39491. te.elements[10] *= c,
  39492. t.setFromRotationMatrix(te),
  39493. i.x = r,
  39494. i.y = o,
  39495. i.z = a,
  39496. this
  39497. },
  39498. makeFrustum: function(e, t, i, n, r, o) {
  39499. var a = this.elements
  39500. , s = 2 * r / (t - e)
  39501. , l = 2 * r / (n - i)
  39502. , c = (t + e) / (t - e)
  39503. , h = (n + i) / (n - i)
  39504. , u = -(o + r) / (o - r)
  39505. , d = -2 * o * r / (o - r);
  39506. return a[0] = s,
  39507. a[4] = 0,
  39508. a[8] = c,
  39509. a[12] = 0,
  39510. a[1] = 0,
  39511. a[5] = l,
  39512. a[9] = h,
  39513. a[13] = 0,
  39514. a[2] = 0,
  39515. a[6] = 0,
  39516. a[10] = u,
  39517. a[14] = d,
  39518. a[3] = 0,
  39519. a[7] = 0,
  39520. a[11] = -1,
  39521. a[15] = 0,
  39522. this
  39523. },
  39524. makePerspective: function(e, t, i, n) {
  39525. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39526. , o = -r
  39527. , a = o * t
  39528. , s = r * t;
  39529. return this.makeFrustum(a, s, o, r, i, n)
  39530. },
  39531. makeOrthographic: function(e, t, i, n, r, o) {
  39532. var a = this.elements
  39533. , s = 1 / (t - e)
  39534. , l = 1 / (i - n)
  39535. , c = 1 / (o - r)
  39536. , h = (t + e) * s
  39537. , u = (i + n) * l
  39538. , d = (o + r) * c;
  39539. return a[0] = 2 * s,
  39540. a[4] = 0,
  39541. a[8] = 0,
  39542. a[12] = -h,
  39543. a[1] = 0,
  39544. a[5] = 2 * l,
  39545. a[9] = 0,
  39546. a[13] = -u,
  39547. a[2] = 0,
  39548. a[6] = 0,
  39549. a[10] = -2 * c,
  39550. a[14] = -d,
  39551. a[3] = 0,
  39552. a[7] = 0,
  39553. a[11] = 0,
  39554. a[15] = 1,
  39555. this
  39556. },
  39557. equals: function(e) {
  39558. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39559. if (t[n] !== i[n])
  39560. return !1;
  39561. return !0
  39562. },
  39563. fromArray: function(e) {
  39564. return this.elements.set(e),
  39565. this
  39566. },
  39567. toArray: function() {
  39568. var e = this.elements;
  39569. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
  39570. }
  39571. },
  39572. Ci.Ray = function(e, t) {
  39573. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39574. this.direction = void 0 !== t ? t : new Ci.Vector3
  39575. }
  39576. ,
  39577. Ci.Ray.prototype = {
  39578. constructor: Ci.Ray,
  39579. set: function(e, t) {
  39580. return this.origin.copy(e),
  39581. this.direction.copy(t),
  39582. this
  39583. },
  39584. clone: function() {
  39585. return (new this.constructor).copy(this)
  39586. },
  39587. copy: function(e) {
  39588. return this.origin.copy(e.origin),
  39589. this.direction.copy(e.direction),
  39590. this
  39591. },
  39592. at: function(e, t) {
  39593. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39594. },
  39595. lookAt: function(e) {
  39596. this.direction.copy(e).sub(this.origin).normalize()
  39597. },
  39598. recast: ($ = new Ci.Vector3,
  39599. function(e) {
  39600. return this.origin.copy(this.at(e, $)),
  39601. this
  39602. }
  39603. ),
  39604. closestPointToPoint: function(e, t) {
  39605. var i = t || new Ci.Vector3;
  39606. i.subVectors(e, this.origin);
  39607. var n = i.dot(this.direction);
  39608. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39609. },
  39610. distanceToPoint: function(e) {
  39611. return Math.sqrt(this.distanceSqToPoint(e))
  39612. },
  39613. distanceSqToPoint: (J = new Ci.Vector3,
  39614. function(e) {
  39615. var t = J.subVectors(e, this.origin).dot(this.direction);
  39616. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39617. J.distanceToSquared(e))
  39618. }
  39619. ),
  39620. distanceSqToSegment: (Z = new Ci.Vector3,
  39621. K = new Ci.Vector3,
  39622. Q = new Ci.Vector3,
  39623. function(e, t, i, n) {
  39624. Z.copy(e).add(t).multiplyScalar(.5),
  39625. K.copy(t).sub(e).normalize(),
  39626. Q.copy(this.origin).sub(Z);
  39627. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  39628. if (0 < p)
  39629. if (o = c * h - u,
  39630. s = l * p,
  39631. 0 <= (r = c * u - h))
  39632. if (-s <= o)
  39633. if (o <= s) {
  39634. var f = 1 / p;
  39635. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39636. } else
  39637. o = l,
  39638. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39639. else
  39640. o = -l,
  39641. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39642. else
  39643. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  39644. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  39645. else
  39646. o = 0 < c ? -l : l,
  39647. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39648. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39649. n && n.copy(K).multiplyScalar(o).add(Z),
  39650. a
  39651. }
  39652. ),
  39653. intersectSphere: (X = new Ci.Vector3,
  39654. function(e, t) {
  39655. X.subVectors(e.center, this.origin);
  39656. var i = X.dot(this.direction)
  39657. , n = X.dot(X) - i * i
  39658. , r = e.radius * e.radius;
  39659. if (r < n)
  39660. return null;
  39661. var o = Math.sqrt(r - n)
  39662. , a = i - o
  39663. , s = i + o;
  39664. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39665. }
  39666. ),
  39667. intersectsSphere: function(e) {
  39668. return this.distanceToPoint(e.center) <= e.radius
  39669. },
  39670. distanceToPlane: function(e) {
  39671. var t = e.normal.dot(this.direction);
  39672. if (0 === t)
  39673. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  39674. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  39675. return 0 <= i ? i : null
  39676. },
  39677. intersectPlane: function(e, t) {
  39678. var i = this.distanceToPlane(e);
  39679. return null === i ? null : this.at(i, t)
  39680. },
  39681. intersectsPlane: function(e) {
  39682. var t = e.distanceToPoint(this.origin);
  39683. return 0 === t || e.normal.dot(this.direction) * t < 0
  39684. },
  39685. intersectBox: function(e, t) {
  39686. var i, n, r, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, h = 1 / this.direction.z, u = this.origin;
  39687. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  39688. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  39689. (e.min.x - u.x) * l),
  39690. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  39691. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  39692. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  39693. (o < n || n != n) && (n = o),
  39694. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  39695. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  39696. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  39697. (s < n || n != n) && (n = s),
  39698. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  39699. },
  39700. intersectsBox: (q = new Ci.Vector3,
  39701. function(e) {
  39702. return null !== this.intersectBox(e, q)
  39703. }
  39704. ),
  39705. intersectTriangle: (G = new Ci.Vector3,
  39706. W = new Ci.Vector3,
  39707. j = new Ci.Vector3,
  39708. Y = new Ci.Vector3,
  39709. function(e, t, i, n, r) {
  39710. W.subVectors(t, e),
  39711. j.subVectors(i, e),
  39712. Y.crossVectors(W, j);
  39713. var o, a = this.direction.dot(Y);
  39714. if (0 < a) {
  39715. if (n)
  39716. return null;
  39717. o = 1
  39718. } else {
  39719. if (!(a < 0))
  39720. return null;
  39721. o = -1,
  39722. a = -a
  39723. }
  39724. G.subVectors(this.origin, e);
  39725. var s = o * this.direction.dot(j.crossVectors(G, j));
  39726. if (s < 0)
  39727. return null;
  39728. var l = o * this.direction.dot(W.cross(G));
  39729. if (l < 0)
  39730. return null;
  39731. if (a < s + l)
  39732. return null;
  39733. var c = -o * G.dot(Y);
  39734. return c < 0 ? null : this.at(c / a, r)
  39735. }
  39736. ),
  39737. applyMatrix4: function(e) {
  39738. return this.direction.add(this.origin).applyMatrix4(e),
  39739. this.origin.applyMatrix4(e),
  39740. this.direction.sub(this.origin),
  39741. this.direction.normalize(),
  39742. this
  39743. },
  39744. equals: function(e) {
  39745. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  39746. }
  39747. },
  39748. Ci.Sphere = function(e, t) {
  39749. this.center = void 0 !== e ? e : new Ci.Vector3,
  39750. this.radius = void 0 !== t ? t : 0
  39751. }
  39752. ,
  39753. Ci.Sphere.prototype = {
  39754. constructor: Ci.Sphere,
  39755. set: function(e, t) {
  39756. return this.center.copy(e),
  39757. this.radius = t,
  39758. this
  39759. },
  39760. setFromPoints: (z = new Ci.Box3,
  39761. function(e, t) {
  39762. var i = this.center;
  39763. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  39764. for (var n = 0, r = 0, o = e.length; r < o; r++)
  39765. n = Math.max(n, i.distanceToSquared(e[r]));
  39766. return this.radius = Math.sqrt(n),
  39767. this
  39768. }
  39769. ),
  39770. clone: function() {
  39771. return (new this.constructor).copy(this)
  39772. },
  39773. copy: function(e) {
  39774. return this.center.copy(e.center),
  39775. this.radius = e.radius,
  39776. this
  39777. },
  39778. empty: function() {
  39779. return this.radius <= 0
  39780. },
  39781. containsPoint: function(e) {
  39782. return e.distanceToSquared(this.center) <= this.radius * this.radius
  39783. },
  39784. distanceToPoint: function(e) {
  39785. return e.distanceTo(this.center) - this.radius
  39786. },
  39787. intersectsSphere: function(e) {
  39788. var t = this.radius + e.radius;
  39789. return e.center.distanceToSquared(this.center) <= t * t
  39790. },
  39791. intersectsBox: function(e) {
  39792. return e.intersectsSphere(this)
  39793. },
  39794. intersectsPlane: function(e) {
  39795. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  39796. },
  39797. clampPoint: function(e, t) {
  39798. var i = this.center.distanceToSquared(e)
  39799. , n = t || new Ci.Vector3;
  39800. return n.copy(e),
  39801. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  39802. n.multiplyScalar(this.radius).add(this.center)),
  39803. n
  39804. },
  39805. getBoundingBox: function(e) {
  39806. var t = e || new Ci.Box3;
  39807. return t.set(this.center, this.center),
  39808. t.expandByScalar(this.radius),
  39809. t
  39810. },
  39811. applyMatrix4: function(e) {
  39812. return this.center.applyMatrix4(e),
  39813. this.radius = this.radius * e.getMaxScaleOnAxis(),
  39814. this
  39815. },
  39816. translate: function(e) {
  39817. return this.center.add(e),
  39818. this
  39819. },
  39820. equals: function(e) {
  39821. return e.center.equals(this.center) && e.radius === this.radius
  39822. }
  39823. },
  39824. Ci.Frustum = function(e, t, i, n, r, o) {
  39825. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  39826. }
  39827. ,
  39828. Ci.Frustum.prototype = {
  39829. constructor: Ci.Frustum,
  39830. set: function(e, t, i, n, r, o) {
  39831. var a = this.planes;
  39832. return a[0].copy(e),
  39833. a[1].copy(t),
  39834. a[2].copy(i),
  39835. a[3].copy(n),
  39836. a[4].copy(r),
  39837. a[5].copy(o),
  39838. this
  39839. },
  39840. clone: function() {
  39841. return (new this.constructor).copy(this)
  39842. },
  39843. copy: function(e) {
  39844. for (var t = this.planes, i = 0; i < 6; i++)
  39845. t[i].copy(e.planes[i]);
  39846. return this
  39847. },
  39848. setFromMatrix: function(e) {
  39849. var t = this.planes
  39850. , i = e.elements
  39851. , n = i[0]
  39852. , r = i[1]
  39853. , o = i[2]
  39854. , a = i[3]
  39855. , s = i[4]
  39856. , l = i[5]
  39857. , c = i[6]
  39858. , h = i[7]
  39859. , u = i[8]
  39860. , d = i[9]
  39861. , p = i[10]
  39862. , f = i[11]
  39863. , g = i[12]
  39864. , m = i[13]
  39865. , v = i[14]
  39866. , y = i[15];
  39867. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  39868. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  39869. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  39870. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  39871. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  39872. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  39873. this
  39874. },
  39875. intersectsObject: (H = new Ci.Sphere,
  39876. function(e) {
  39877. var t = e.geometry;
  39878. return null === t.boundingSphere && t.computeBoundingSphere(),
  39879. H.copy(t.boundingSphere),
  39880. H.applyMatrix4(e.matrixWorld),
  39881. this.intersectsSphere(H)
  39882. }
  39883. ),
  39884. intersectsSphere: function(e) {
  39885. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  39886. if (t[r].distanceToPoint(i) < n)
  39887. return !1
  39888. }
  39889. return !0
  39890. },
  39891. intersectsBox: (k = new Ci.Vector3,
  39892. U = new Ci.Vector3,
  39893. function(e) {
  39894. for (var t = this.planes, i = 0; i < 6; i++) {
  39895. var n = t[i];
  39896. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  39897. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  39898. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  39899. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  39900. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  39901. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  39902. var r = n.distanceToPoint(k)
  39903. , o = n.distanceToPoint(U);
  39904. if (r < 0 && o < 0)
  39905. return !1
  39906. }
  39907. return !0
  39908. }
  39909. ),
  39910. containsPoint: function(e) {
  39911. for (var t = this.planes, i = 0; i < 6; i++)
  39912. if (t[i].distanceToPoint(e) < 0)
  39913. return !1;
  39914. return !0
  39915. }
  39916. },
  39917. Ci.Plane = function(e, t) {
  39918. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  39919. this.constant = void 0 !== t ? t : 0
  39920. }
  39921. ,
  39922. Ci.Plane.prototype = {
  39923. constructor: Ci.Plane,
  39924. set: function(e, t) {
  39925. return this.normal.copy(e),
  39926. this.constant = t,
  39927. this
  39928. },
  39929. setComponents: function(e, t, i, n) {
  39930. return this.normal.set(e, t, i),
  39931. this.constant = n,
  39932. this
  39933. },
  39934. setFromNormalAndCoplanarPoint: function(e, t) {
  39935. return this.normal.copy(e),
  39936. this.constant = -t.dot(this.normal),
  39937. this
  39938. },
  39939. setFromCoplanarPoints: (B = new Ci.Vector3,
  39940. V = new Ci.Vector3,
  39941. function(e, t, i) {
  39942. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  39943. return this.setFromNormalAndCoplanarPoint(n, e),
  39944. this
  39945. }
  39946. ),
  39947. clone: function() {
  39948. return (new this.constructor).copy(this)
  39949. },
  39950. copy: function(e) {
  39951. return this.normal.copy(e.normal),
  39952. this.constant = e.constant,
  39953. this
  39954. },
  39955. normalize: function() {
  39956. var e = 1 / this.normal.length();
  39957. return this.normal.multiplyScalar(e),
  39958. this.constant *= e,
  39959. this
  39960. },
  39961. negate: function() {
  39962. return this.constant *= -1,
  39963. this.normal.negate(),
  39964. this
  39965. },
  39966. distanceToPoint: function(e) {
  39967. return this.normal.dot(e) + this.constant
  39968. },
  39969. distanceToSphere: function(e) {
  39970. return this.distanceToPoint(e.center) - e.radius
  39971. },
  39972. projectPoint: function(e, t) {
  39973. return this.orthoPoint(e, t).sub(e).negate()
  39974. },
  39975. orthoPoint: function(e, t) {
  39976. var i = this.distanceToPoint(e);
  39977. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  39978. },
  39979. intersectLine: (F = new Ci.Vector3,
  39980. function(e, t) {
  39981. var i = t || new Ci.Vector3
  39982. , n = e.delta(F)
  39983. , r = this.normal.dot(n);
  39984. if (0 !== r) {
  39985. var o = -(e.start.dot(this.normal) + this.constant) / r;
  39986. if (!(o < 0 || 1 < o))
  39987. return i.copy(n).multiplyScalar(o).add(e.start)
  39988. } else if (0 === this.distanceToPoint(e.start))
  39989. return i.copy(e.start)
  39990. }
  39991. ),
  39992. intersectsLine: function(e) {
  39993. var t = this.distanceToPoint(e.start)
  39994. , i = this.distanceToPoint(e.end);
  39995. return t < 0 && 0 < i || i < 0 && 0 < t
  39996. },
  39997. intersectsBox: function(e) {
  39998. return e.intersectsPlane(this)
  39999. },
  40000. intersectsSphere: function(e) {
  40001. return e.intersectsPlane(this)
  40002. },
  40003. coplanarPoint: function(e) {
  40004. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40005. },
  40006. applyMatrix4: (L = new Ci.Vector3,
  40007. D = new Ci.Vector3,
  40008. N = new Ci.Matrix3,
  40009. function(e, t) {
  40010. var i = t || N.getNormalMatrix(e)
  40011. , n = L.copy(this.normal).applyMatrix3(i)
  40012. , r = this.coplanarPoint(D);
  40013. return r.applyMatrix4(e),
  40014. this.setFromNormalAndCoplanarPoint(n, r),
  40015. this
  40016. }
  40017. ),
  40018. translate: function(e) {
  40019. return this.constant = this.constant - e.dot(this.normal),
  40020. this
  40021. },
  40022. equals: function(e) {
  40023. return e.normal.equals(this.normal) && e.constant === this.constant
  40024. }
  40025. },
  40026. Ci.Spherical = function(e, t, i) {
  40027. return this.radius = void 0 !== e ? e : 1,
  40028. this.phi = void 0 !== t ? t : 0,
  40029. this.theta = void 0 !== i ? i : 0,
  40030. this
  40031. }
  40032. ,
  40033. Ci.Spherical.prototype = {
  40034. constructor: Ci.Spherical,
  40035. set: function(e, t, i) {
  40036. this.radius = e,
  40037. this.phi = t,
  40038. this.theta = i
  40039. },
  40040. clone: function() {
  40041. return (new this.constructor).copy(this)
  40042. },
  40043. copy: function(e) {
  40044. return this.radius.copy(e.radius),
  40045. this.phi.copy(e.phi),
  40046. this.theta.copy(e.theta),
  40047. this
  40048. },
  40049. makeSafe: function() {
  40050. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40051. },
  40052. setFromVector3: function(e) {
  40053. return this.radius = e.length(),
  40054. 0 === this.radius ? (this.theta = 0,
  40055. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40056. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40057. this
  40058. }
  40059. },
  40060. Ci.Math = {
  40061. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40062. P = new Array(36),
  40063. O = 0,
  40064. function() {
  40065. for (var e = 0; e < 36; e++)
  40066. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40067. M = 15 & O,
  40068. O >>= 4,
  40069. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40070. return P.join("")
  40071. }
  40072. ),
  40073. clamp: function(e, t, i) {
  40074. return Math.max(t, Math.min(i, e))
  40075. },
  40076. euclideanModulo: function(e, t) {
  40077. return (e % t + t) % t
  40078. },
  40079. mapLinear: function(e, t, i, n, r) {
  40080. return n + (e - t) * (r - n) / (i - t)
  40081. },
  40082. smoothstep: function(e, t, i) {
  40083. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40084. },
  40085. smootherstep: function(e, t, i) {
  40086. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40087. },
  40088. random16: function() {
  40089. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40090. Math.random()
  40091. },
  40092. randInt: function(e, t) {
  40093. return e + Math.floor(Math.random() * (t - e + 1))
  40094. },
  40095. randFloat: function(e, t) {
  40096. return e + Math.random() * (t - e)
  40097. },
  40098. randFloatSpread: function(e) {
  40099. return e * (.5 - Math.random())
  40100. },
  40101. degToRad: (S = Math.PI / 180,
  40102. function(e) {
  40103. return e * S
  40104. }
  40105. ),
  40106. radToDeg: (x = 180 / Math.PI,
  40107. function(e) {
  40108. return e * x
  40109. }
  40110. ),
  40111. isPowerOfTwo: function(e) {
  40112. return 0 == (e & e - 1) && 0 !== e
  40113. },
  40114. nearestPowerOfTwo: function(e) {
  40115. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40116. },
  40117. nextPowerOfTwo: function(e) {
  40118. return e--,
  40119. e |= e >> 1,
  40120. e |= e >> 2,
  40121. e |= e >> 4,
  40122. e |= e >> 8,
  40123. e |= e >> 16,
  40124. ++e
  40125. }
  40126. },
  40127. Ci.Spline = function(e) {
  40128. function t(e, t, i, n, r, o, a) {
  40129. var s = .5 * (i - e)
  40130. , l = .5 * (n - t);
  40131. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40132. }
  40133. this.points = e;
  40134. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40135. x: 0,
  40136. y: 0,
  40137. z: 0
  40138. };
  40139. this.initFromArray = function(e) {
  40140. this.points = [];
  40141. for (var t = 0; t < e.length; t++)
  40142. this.points[t] = {
  40143. x: e[t][0],
  40144. y: e[t][1],
  40145. z: e[t][2]
  40146. }
  40147. }
  40148. ,
  40149. this.getPoint = function(e) {
  40150. return i = (this.points.length - 1) * e,
  40151. n = Math.floor(i),
  40152. r = i - n,
  40153. u[0] = 0 === n ? n : n - 1,
  40154. u[1] = n,
  40155. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40156. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40157. s = this.points[u[0]],
  40158. l = this.points[u[1]],
  40159. c = this.points[u[2]],
  40160. h = this.points[u[3]],
  40161. a = r * (o = r * r),
  40162. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40163. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40164. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40165. d
  40166. }
  40167. ,
  40168. this.getControlPointsArray = function() {
  40169. var e, t, i = this.points.length, n = [];
  40170. for (e = 0; e < i; e++)
  40171. t = this.points[e],
  40172. n[e] = [t.x, t.y, t.z];
  40173. return n
  40174. }
  40175. ,
  40176. this.getLength = function(e) {
  40177. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40178. for (h[0] = 0,
  40179. e = e || 100,
  40180. n = this.points.length * e,
  40181. l.copy(this.points[0]),
  40182. t = 1; t < n; t++)
  40183. i = t / n,
  40184. r = this.getPoint(i),
  40185. c.copy(r),
  40186. u += c.distanceTo(l),
  40187. l.copy(r),
  40188. o = (this.points.length - 1) * i,
  40189. (a = Math.floor(o)) !== s && (h[a] = u,
  40190. s = a);
  40191. return h[h.length] = u,
  40192. {
  40193. chunks: h,
  40194. total: u
  40195. }
  40196. }
  40197. ,
  40198. this.reparametrizeByArcLength = function(e) {
  40199. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40200. for (c.push(h.copy(this.points[0]).clone()),
  40201. t = 1; t < this.points.length; t++) {
  40202. for (a = u.chunks[t] - u.chunks[t - 1],
  40203. s = Math.ceil(e * a / u.total),
  40204. r = (t - 1) / (this.points.length - 1),
  40205. o = t / (this.points.length - 1),
  40206. i = 1; i < s - 1; i++)
  40207. n = r + i * (1 / s) * (o - r),
  40208. l = this.getPoint(n),
  40209. c.push(h.copy(l).clone());
  40210. c.push(h.copy(this.points[t]).clone())
  40211. }
  40212. this.points = c
  40213. }
  40214. }
  40215. ,
  40216. Ci.Triangle = function(e, t, i) {
  40217. this.a = void 0 !== e ? e : new Ci.Vector3,
  40218. this.b = void 0 !== t ? t : new Ci.Vector3,
  40219. this.c = void 0 !== i ? i : new Ci.Vector3
  40220. }
  40221. ,
  40222. Ci.Triangle.normal = (T = new Ci.Vector3,
  40223. function(e, t, i, n) {
  40224. var r = n || new Ci.Vector3;
  40225. r.subVectors(i, t),
  40226. T.subVectors(e, t),
  40227. r.cross(T);
  40228. var o = r.lengthSq();
  40229. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40230. }
  40231. ),
  40232. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40233. b = new Ci.Vector3,
  40234. w = new Ci.Vector3,
  40235. function(e, t, i, n, r) {
  40236. _.subVectors(n, t),
  40237. b.subVectors(i, t),
  40238. w.subVectors(e, t);
  40239. var o = _.dot(_)
  40240. , a = _.dot(b)
  40241. , s = _.dot(w)
  40242. , l = b.dot(b)
  40243. , c = b.dot(w)
  40244. , h = o * l - a * a
  40245. , u = r || new Ci.Vector3;
  40246. if (0 == h)
  40247. return u.set(-2, -1, -1);
  40248. var d = 1 / h
  40249. , p = (l * s - a * c) * d
  40250. , f = (o * c - a * s) * d;
  40251. return u.set(1 - p - f, f, p)
  40252. }
  40253. ),
  40254. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40255. function(e, t, i, n) {
  40256. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40257. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40258. }
  40259. ),
  40260. Ci.Triangle.prototype = {
  40261. constructor: Ci.Triangle,
  40262. set: function(e, t, i) {
  40263. return this.a.copy(e),
  40264. this.b.copy(t),
  40265. this.c.copy(i),
  40266. this
  40267. },
  40268. setFromPointsAndIndices: function(e, t, i, n) {
  40269. return this.a.copy(e[t]),
  40270. this.b.copy(e[i]),
  40271. this.c.copy(e[n]),
  40272. this
  40273. },
  40274. clone: function() {
  40275. return (new this.constructor).copy(this)
  40276. },
  40277. copy: function(e) {
  40278. return this.a.copy(e.a),
  40279. this.b.copy(e.b),
  40280. this.c.copy(e.c),
  40281. this
  40282. },
  40283. area: (C = new Ci.Vector3,
  40284. I = new Ci.Vector3,
  40285. function() {
  40286. return C.subVectors(this.c, this.b),
  40287. I.subVectors(this.a, this.b),
  40288. .5 * C.cross(I).length()
  40289. }
  40290. ),
  40291. midpoint: function(e) {
  40292. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40293. },
  40294. normal: function(e) {
  40295. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40296. },
  40297. plane: function(e) {
  40298. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40299. },
  40300. barycoordFromPoint: function(e, t) {
  40301. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40302. },
  40303. containsPoint: function(e) {
  40304. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40305. },
  40306. equals: function(e) {
  40307. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40308. }
  40309. },
  40310. Ci.Interpolant = function(e, t, i, n) {
  40311. this.parameterPositions = e,
  40312. this._cachedIndex = 0,
  40313. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40314. this.sampleValues = t,
  40315. this.valueSize = i
  40316. }
  40317. ,
  40318. Ci.Interpolant.prototype = {
  40319. constructor: Ci.Interpolant,
  40320. evaluate: function(e) {
  40321. var t = this.parameterPositions
  40322. , i = this._cachedIndex
  40323. , n = t[i]
  40324. , r = t[i - 1];
  40325. e: {
  40326. t: {
  40327. var o;
  40328. i: {
  40329. n: if (!(e < n)) {
  40330. for (var a = i + 2; ; ) {
  40331. if (void 0 === n) {
  40332. if (e < r)
  40333. break n;
  40334. return i = t.length,
  40335. this._cachedIndex = i,
  40336. this.afterEnd_(i - 1, e, r)
  40337. }
  40338. if (i === a)
  40339. break;
  40340. if (r = n,
  40341. e < (n = t[++i]))
  40342. break t
  40343. }
  40344. o = t.length;
  40345. break i
  40346. }
  40347. if (r <= e)
  40348. break e;
  40349. var s = t[1];
  40350. e < s && (i = 2,
  40351. r = s);
  40352. for (a = i - 2; ; ) {
  40353. if (void 0 === r)
  40354. return this._cachedIndex = 0,
  40355. this.beforeStart_(0, e, n);
  40356. if (i === a)
  40357. break;
  40358. if (n = r,
  40359. (r = t[--i - 1]) <= e)
  40360. break t
  40361. }
  40362. o = i,
  40363. i = 0
  40364. }
  40365. for (; i < o; ) {
  40366. var l = i + o >>> 1;
  40367. e < t[l] ? o = l : i = 1 + l
  40368. }
  40369. if (n = t[i],
  40370. void 0 === (r = t[i - 1]))
  40371. return this._cachedIndex = 0,
  40372. this.beforeStart_(0, e, n);
  40373. if (void 0 === n)
  40374. return i = t.length,
  40375. this._cachedIndex = i,
  40376. this.afterEnd_(i - 1, r, e)
  40377. }
  40378. this._cachedIndex = i,
  40379. this.intervalChanged_(i, r, n)
  40380. }
  40381. return this.interpolate_(i, r, e, n)
  40382. },
  40383. settings: null,
  40384. DefaultSettings_: {},
  40385. getSettings_: function() {
  40386. return this.settings || this.DefaultSettings_
  40387. },
  40388. copySampleValue_: function(e) {
  40389. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40390. t[o] = i[r + o];
  40391. return t
  40392. },
  40393. interpolate_: function(e, t, i, n) {
  40394. throw new Error("call to abstract method")
  40395. },
  40396. intervalChanged_: function(e, t, i) {}
  40397. },
  40398. Object.assign(Ci.Interpolant.prototype, {
  40399. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40400. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40401. }),
  40402. Ci.CubicInterpolant = function(e, t, i, n) {
  40403. Ci.Interpolant.call(this, e, t, i, n),
  40404. this._weightPrev = -0,
  40405. this._offsetPrev = -0,
  40406. this._weightNext = -0,
  40407. this._offsetNext = -0
  40408. }
  40409. ,
  40410. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40411. constructor: Ci.CubicInterpolant,
  40412. DefaultSettings_: {
  40413. endingStart: Ci.ZeroCurvatureEnding,
  40414. endingEnd: Ci.ZeroCurvatureEnding
  40415. },
  40416. intervalChanged_: function(e, t, i) {
  40417. var n = this.parameterPositions
  40418. , r = e - 2
  40419. , o = e + 1
  40420. , a = n[r]
  40421. , s = n[o];
  40422. if (void 0 === a)
  40423. switch (this.getSettings_().endingStart) {
  40424. case Ci.ZeroSlopeEnding:
  40425. r = e,
  40426. a = 2 * t - i;
  40427. break;
  40428. case Ci.WrapAroundEnding:
  40429. a = t + n[r = n.length - 2] - n[r + 1];
  40430. break;
  40431. default:
  40432. r = e,
  40433. a = i
  40434. }
  40435. if (void 0 === s)
  40436. switch (this.getSettings_().endingEnd) {
  40437. case Ci.ZeroSlopeEnding:
  40438. o = e,
  40439. s = 2 * i - t;
  40440. break;
  40441. case Ci.WrapAroundEnding:
  40442. s = i + n[o = 1] - n[0];
  40443. break;
  40444. default:
  40445. o = e - 1,
  40446. s = t
  40447. }
  40448. var l = .5 * (i - t)
  40449. , c = this.valueSize;
  40450. this._weightPrev = l / (t - a),
  40451. this._weightNext = l / (s - i),
  40452. this._offsetPrev = r * c,
  40453. this._offsetNext = o * c
  40454. },
  40455. interpolate_: function(e, t, i, n) {
  40456. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  40457. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40458. return r
  40459. }
  40460. }),
  40461. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40462. Ci.Interpolant.call(this, e, t, i, n)
  40463. }
  40464. ,
  40465. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40466. constructor: Ci.DiscreteInterpolant,
  40467. interpolate_: function(e, t, i, n) {
  40468. return this.copySampleValue_(e - 1)
  40469. }
  40470. }),
  40471. Ci.LinearInterpolant = function(e, t, i, n) {
  40472. Ci.Interpolant.call(this, e, t, i, n)
  40473. }
  40474. ,
  40475. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40476. constructor: Ci.LinearInterpolant,
  40477. interpolate_: function(e, t, i, n) {
  40478. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u)
  40479. r[u] = o[l + u] * h + o[s + u] * c;
  40480. return r
  40481. }
  40482. }),
  40483. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40484. Ci.Interpolant.call(this, e, t, i, n)
  40485. }
  40486. ,
  40487. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40488. constructor: Ci.QuaternionLinearInterpolant,
  40489. interpolate_: function(e, t, i, n) {
  40490. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  40491. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40492. return r
  40493. }
  40494. }),
  40495. Ci.Clock = function(e) {
  40496. this.autoStart = void 0 === e || e,
  40497. this.startTime = 0,
  40498. this.oldTime = 0,
  40499. this.elapsedTime = 0,
  40500. this.running = !1
  40501. }
  40502. ,
  40503. Ci.Clock.prototype = {
  40504. constructor: Ci.Clock,
  40505. start: function() {
  40506. this.startTime = performance.now(),
  40507. this.oldTime = this.startTime,
  40508. this.running = !0
  40509. },
  40510. stop: function() {
  40511. this.getElapsedTime(),
  40512. this.running = !1
  40513. },
  40514. getElapsedTime: function() {
  40515. return this.getDelta(),
  40516. this.elapsedTime
  40517. },
  40518. getDelta: function() {
  40519. var e = 0;
  40520. if (this.autoStart && !this.running && this.start(),
  40521. this.running) {
  40522. var t = performance.now();
  40523. e = .001 * (t - this.oldTime),
  40524. this.oldTime = t,
  40525. this.elapsedTime += e
  40526. }
  40527. return e
  40528. }
  40529. },
  40530. Ci.EventDispatcher = function() {}
  40531. ,
  40532. Ci.EventDispatcher.prototype = {
  40533. constructor: Ci.EventDispatcher,
  40534. apply: function(e) {
  40535. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40536. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40537. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40538. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40539. },
  40540. addEventListener: function(e, t) {
  40541. void 0 === this._listeners && (this._listeners = {});
  40542. var i = this._listeners;
  40543. void 0 === i[e] && (i[e] = []),
  40544. -1 === i[e].indexOf(t) && i[e].push(t)
  40545. },
  40546. hasEventListener: function(e, t) {
  40547. if (void 0 === this._listeners)
  40548. return !1;
  40549. var i = this._listeners;
  40550. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40551. },
  40552. removeEventListener: function(e, t) {
  40553. if (void 0 !== this._listeners) {
  40554. var i = this._listeners[e];
  40555. if (void 0 !== i) {
  40556. var n = i.indexOf(t);
  40557. -1 !== n && i.splice(n, 1)
  40558. }
  40559. }
  40560. },
  40561. dispatchEvent: function(e) {
  40562. if (void 0 !== this._listeners) {
  40563. var t = this._listeners[e.type];
  40564. if (void 0 !== t) {
  40565. e.target = this;
  40566. for (var i = [], n = t.length, r = 0; r < n; r++)
  40567. i[r] = t[r];
  40568. for (r = 0; r < n; r++)
  40569. i[r].call(this, e)
  40570. }
  40571. }
  40572. }
  40573. },
  40574. Ci.Layers = function() {
  40575. this.mask = 1
  40576. }
  40577. ,
  40578. Ci.Layers.prototype = {
  40579. constructor: Ci.Layers,
  40580. set: function(e) {
  40581. this.mask = 1 << e
  40582. },
  40583. enable: function(e) {
  40584. this.mask |= 1 << e
  40585. },
  40586. toggle: function(e) {
  40587. this.mask ^= 1 << e
  40588. },
  40589. disable: function(e) {
  40590. this.mask &= ~(1 << e)
  40591. },
  40592. test: function(e) {
  40593. return 0 != (this.mask & e.mask)
  40594. }
  40595. },
  40596. (A = Ci).Raycaster = function(e, t, i, n) {
  40597. this.ray = new A.Ray(e,t),
  40598. this.near = i || 0,
  40599. this.far = n || 1 / 0,
  40600. this.params = {
  40601. Mesh: {},
  40602. Line: {},
  40603. LOD: {},
  40604. Points: {
  40605. threshold: 1
  40606. },
  40607. Sprite: {}
  40608. },
  40609. Object.defineProperties(this.params, {
  40610. PointCloud: {
  40611. get: function() {
  40612. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40613. this.Points
  40614. }
  40615. }
  40616. })
  40617. }
  40618. ,
  40619. A.Raycaster.prototype = {
  40620. constructor: A.Raycaster,
  40621. linePrecision: 1,
  40622. set: function(e, t) {
  40623. this.ray.set(e, t)
  40624. },
  40625. setFromCamera: function(e, t) {
  40626. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40627. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  40628. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40629. },
  40630. intersectObject: function(e, t) {
  40631. var i = [];
  40632. return Ei(e, this, i, t),
  40633. i.sort(Ii),
  40634. i
  40635. },
  40636. intersectObjects: function(e, t) {
  40637. var i = [];
  40638. if (!1 === Array.isArray(e))
  40639. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40640. i;
  40641. for (var n = 0, r = e.length; n < r; n++)
  40642. Ei(e[n], this, i, t);
  40643. return i.sort(Ii),
  40644. i
  40645. }
  40646. },
  40647. Ci.Object3D = function() {
  40648. Object.defineProperty(this, "id", {
  40649. value: Ci.Object3DIdCount++
  40650. }),
  40651. this.uuid = Ci.Math.generateUUID(),
  40652. this.name = "",
  40653. this.type = "Object3D",
  40654. this.parent = null,
  40655. this.children = [],
  40656. this.up = Ci.Object3D.DefaultUp.clone();
  40657. var e = new Ci.Vector3
  40658. , t = new Ci.Euler
  40659. , i = new Ci.Quaternion
  40660. , n = new Ci.Vector3(1,1,1);
  40661. t.onChange(function() {
  40662. i.setFromEuler(t, !1)
  40663. }),
  40664. i.onChange(function() {
  40665. t.setFromQuaternion(i, void 0, !1)
  40666. }),
  40667. Object.defineProperties(this, {
  40668. position: {
  40669. enumerable: !0,
  40670. value: e
  40671. },
  40672. rotation: {
  40673. enumerable: !0,
  40674. value: t
  40675. },
  40676. quaternion: {
  40677. enumerable: !0,
  40678. value: i
  40679. },
  40680. scale: {
  40681. enumerable: !0,
  40682. value: n
  40683. },
  40684. modelViewMatrix: {
  40685. value: new Ci.Matrix4
  40686. },
  40687. normalMatrix: {
  40688. value: new Ci.Matrix3
  40689. }
  40690. }),
  40691. this.rotationAutoUpdate = !0,
  40692. this.matrix = new Ci.Matrix4,
  40693. this.matrixWorld = new Ci.Matrix4,
  40694. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  40695. this.matrixWorldNeedsUpdate = !1,
  40696. this.layers = new Ci.Layers,
  40697. this.visible = !0,
  40698. this.castShadow = !1,
  40699. this.receiveShadow = !1,
  40700. this.frustumCulled = !0,
  40701. this.renderOrder = 0,
  40702. this.userData = {}
  40703. }
  40704. ,
  40705. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  40706. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  40707. Ci.Object3D.prototype = {
  40708. constructor: Ci.Object3D,
  40709. applyMatrix: function(e) {
  40710. this.matrix.multiplyMatrices(e, this.matrix),
  40711. this.matrix.decompose(this.position, this.quaternion, this.scale)
  40712. },
  40713. setRotationFromAxisAngle: function(e, t) {
  40714. this.quaternion.setFromAxisAngle(e, t)
  40715. },
  40716. setRotationFromEuler: function(e) {
  40717. this.quaternion.setFromEuler(e, !0)
  40718. },
  40719. setRotationFromMatrix: function(e) {
  40720. this.quaternion.setFromRotationMatrix(e)
  40721. },
  40722. setRotationFromQuaternion: function(e) {
  40723. this.quaternion.copy(e)
  40724. },
  40725. rotateOnAxis: (y = new Ci.Quaternion,
  40726. function(e, t) {
  40727. return y.setFromAxisAngle(e, t),
  40728. this.quaternion.multiply(y),
  40729. this
  40730. }
  40731. ),
  40732. rotateX: (v = new Ci.Vector3(1,0,0),
  40733. function(e) {
  40734. return this.rotateOnAxis(v, e)
  40735. }
  40736. ),
  40737. rotateY: (m = new Ci.Vector3(0,1,0),
  40738. function(e) {
  40739. return this.rotateOnAxis(m, e)
  40740. }
  40741. ),
  40742. rotateZ: (g = new Ci.Vector3(0,0,1),
  40743. function(e) {
  40744. return this.rotateOnAxis(g, e)
  40745. }
  40746. ),
  40747. translateOnAxis: (f = new Ci.Vector3,
  40748. function(e, t) {
  40749. return f.copy(e).applyQuaternion(this.quaternion),
  40750. this.position.add(f.multiplyScalar(t)),
  40751. this
  40752. }
  40753. ),
  40754. translateX: (p = new Ci.Vector3(1,0,0),
  40755. function(e) {
  40756. return this.translateOnAxis(p, e)
  40757. }
  40758. ),
  40759. translateY: (d = new Ci.Vector3(0,1,0),
  40760. function(e) {
  40761. return this.translateOnAxis(d, e)
  40762. }
  40763. ),
  40764. translateZ: (u = new Ci.Vector3(0,0,1),
  40765. function(e) {
  40766. return this.translateOnAxis(u, e)
  40767. }
  40768. ),
  40769. localToWorld: function(e) {
  40770. return e.applyMatrix4(this.matrixWorld)
  40771. },
  40772. worldToLocal: (h = new Ci.Matrix4,
  40773. function(e) {
  40774. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  40775. }
  40776. ),
  40777. lookAt: (c = new Ci.Matrix4,
  40778. function(e) {
  40779. c.lookAt(e, this.position, this.up),
  40780. this.quaternion.setFromRotationMatrix(c)
  40781. }
  40782. ),
  40783. add: function(e) {
  40784. if (1 < arguments.length) {
  40785. for (var t = 0; t < arguments.length; t++)
  40786. this.add(arguments[t]);
  40787. return this
  40788. }
  40789. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  40790. e.parent = this,
  40791. e.dispatchEvent({
  40792. type: "added"
  40793. }),
  40794. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  40795. this
  40796. },
  40797. remove: function(e) {
  40798. if (1 < arguments.length)
  40799. for (var t = 0; t < arguments.length; t++)
  40800. this.remove(arguments[t]);
  40801. var i = this.children.indexOf(e);
  40802. -1 !== i && (e.parent = null,
  40803. e.dispatchEvent({
  40804. type: "removed"
  40805. }),
  40806. this.children.splice(i, 1))
  40807. },
  40808. getObjectById: function(e) {
  40809. return this.getObjectByProperty("id", e)
  40810. },
  40811. getObjectByName: function(e) {
  40812. return this.getObjectByProperty("name", e)
  40813. },
  40814. getObjectByProperty: function(e, t) {
  40815. if (this[e] === t)
  40816. return this;
  40817. for (var i = 0, n = this.children.length; i < n; i++) {
  40818. var r = this.children[i].getObjectByProperty(e, t);
  40819. if (void 0 !== r)
  40820. return r
  40821. }
  40822. },
  40823. getWorldPosition: function(e) {
  40824. var t = e || new Ci.Vector3;
  40825. return this.updateMatrixWorld(!0),
  40826. t.setFromMatrixPosition(this.matrixWorld)
  40827. },
  40828. getWorldQuaternion: (s = new Ci.Vector3,
  40829. l = new Ci.Vector3,
  40830. function(e) {
  40831. var t = e || new Ci.Quaternion;
  40832. return this.updateMatrixWorld(!0),
  40833. this.matrixWorld.decompose(s, t, l),
  40834. t
  40835. }
  40836. ),
  40837. getWorldRotation: (a = new Ci.Quaternion,
  40838. function(e) {
  40839. var t = e || new Ci.Euler;
  40840. return this.getWorldQuaternion(a),
  40841. t.setFromQuaternion(a, this.rotation.order, !1)
  40842. }
  40843. ),
  40844. getWorldScale: (r = new Ci.Vector3,
  40845. o = new Ci.Quaternion,
  40846. function(e) {
  40847. var t = e || new Ci.Vector3;
  40848. return this.updateMatrixWorld(!0),
  40849. this.matrixWorld.decompose(r, o, t),
  40850. t
  40851. }
  40852. ),
  40853. getWorldDirection: (n = new Ci.Quaternion,
  40854. function(e) {
  40855. var t = e || new Ci.Vector3;
  40856. return this.getWorldQuaternion(n),
  40857. t.set(0, 0, 1).applyQuaternion(n)
  40858. }
  40859. ),
  40860. raycast: function() {},
  40861. traverse: function(e) {
  40862. e(this);
  40863. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40864. t[i].traverse(e)
  40865. },
  40866. traverseVisible: function(e) {
  40867. if (!1 !== this.visible) {
  40868. e(this);
  40869. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40870. t[i].traverseVisible(e)
  40871. }
  40872. },
  40873. traverseAncestors: function(e) {
  40874. var t = this.parent;
  40875. null !== t && (e(t),
  40876. t.traverseAncestors(e))
  40877. },
  40878. updateMatrix: function() {
  40879. this.matrix.compose(this.position, this.quaternion, this.scale),
  40880. this.matrixWorldNeedsUpdate = !0
  40881. },
  40882. updateMatrixWorld: function(e) {
  40883. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  40884. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  40885. e = !(this.matrixWorldNeedsUpdate = !1));
  40886. for (var t = 0, i = this.children.length; t < i; t++)
  40887. this.children[t].updateMatrixWorld(e)
  40888. },
  40889. toJSON: function(e) {
  40890. function t(e) {
  40891. var t = [];
  40892. for (var i in e) {
  40893. var n = e[i];
  40894. delete n.metadata,
  40895. t.push(n)
  40896. }
  40897. return t
  40898. }
  40899. var i = void 0 === e
  40900. , n = {};
  40901. i && (e = {
  40902. geometries: {},
  40903. materials: {},
  40904. textures: {},
  40905. images: {}
  40906. },
  40907. n.metadata = {
  40908. version: 4.4,
  40909. type: "Object",
  40910. generator: "Object3D.toJSON"
  40911. });
  40912. var r = {};
  40913. if (r.uuid = this.uuid,
  40914. r.type = this.type,
  40915. "" !== this.name && (r.name = this.name),
  40916. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  40917. !0 === this.castShadow && (r.castShadow = !0),
  40918. !0 === this.receiveShadow && (r.receiveShadow = !0),
  40919. !1 === this.visible && (r.visible = !1),
  40920. r.matrix = this.matrix.toArray(),
  40921. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  40922. r.geometry = this.geometry.uuid),
  40923. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  40924. r.material = this.material.uuid),
  40925. 0 < this.children.length) {
  40926. r.children = [];
  40927. for (var o = 0; o < this.children.length; o++)
  40928. r.children.push(this.children[o].toJSON(e).object)
  40929. }
  40930. if (i) {
  40931. var a = t(e.geometries)
  40932. , s = t(e.materials)
  40933. , l = t(e.textures)
  40934. , c = t(e.images);
  40935. 0 < a.length && (n.geometries = a),
  40936. 0 < s.length && (n.materials = s),
  40937. 0 < l.length && (n.textures = l),
  40938. 0 < c.length && (n.images = c)
  40939. }
  40940. return n.object = r,
  40941. n
  40942. },
  40943. clone: function(e) {
  40944. return (new this.constructor).copy(this, e)
  40945. },
  40946. copy: function(e, t) {
  40947. if (void 0 === t && (t = !0),
  40948. this.name = e.name,
  40949. this.up.copy(e.up),
  40950. this.position.copy(e.position),
  40951. this.quaternion.copy(e.quaternion),
  40952. this.scale.copy(e.scale),
  40953. this.rotationAutoUpdate = e.rotationAutoUpdate,
  40954. this.matrix.copy(e.matrix),
  40955. this.matrixWorld.copy(e.matrixWorld),
  40956. this.matrixAutoUpdate = e.matrixAutoUpdate,
  40957. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  40958. this.visible = e.visible,
  40959. this.castShadow = e.castShadow,
  40960. this.receiveShadow = e.receiveShadow,
  40961. this.frustumCulled = e.frustumCulled,
  40962. this.renderOrder = e.renderOrder,
  40963. this.userData = JSON.parse(JSON.stringify(e.userData)),
  40964. !0 === t)
  40965. for (var i = 0; i < e.children.length; i++) {
  40966. var n = e.children[i];
  40967. this.add(n.clone())
  40968. }
  40969. return this
  40970. }
  40971. },
  40972. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  40973. Ci.Object3DIdCount = 0,
  40974. Ci.Face3 = function(e, t, i, n, r, o) {
  40975. this.a = e,
  40976. this.b = t,
  40977. this.c = i,
  40978. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  40979. this.vertexNormals = Array.isArray(n) ? n : [],
  40980. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  40981. this.vertexColors = Array.isArray(r) ? r : [],
  40982. this.materialIndex = void 0 !== o ? o : 0
  40983. }
  40984. ,
  40985. Ci.Face3.prototype = {
  40986. constructor: Ci.Face3,
  40987. clone: function() {
  40988. return (new this.constructor).copy(this)
  40989. },
  40990. copy: function(e) {
  40991. this.a = e.a,
  40992. this.b = e.b,
  40993. this.c = e.c,
  40994. this.normal.copy(e.normal),
  40995. this.color.copy(e.color),
  40996. this.materialIndex = e.materialIndex;
  40997. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  40998. this.vertexNormals[t] = e.vertexNormals[t].clone();
  40999. for (t = 0,
  41000. i = e.vertexColors.length; t < i; t++)
  41001. this.vertexColors[t] = e.vertexColors[t].clone();
  41002. return this
  41003. }
  41004. },
  41005. Ci.BufferAttribute = function(e, t) {
  41006. this.uuid = Ci.Math.generateUUID(),
  41007. this.array = e,
  41008. this.itemSize = t,
  41009. this.dynamic = !1,
  41010. this.updateRange = {
  41011. offset: 0,
  41012. count: -1
  41013. },
  41014. this.version = 0
  41015. }
  41016. ,
  41017. Ci.BufferAttribute.prototype = {
  41018. constructor: Ci.BufferAttribute,
  41019. get count() {
  41020. return this.array.length / this.itemSize
  41021. },
  41022. set needsUpdate(e) {
  41023. !0 === e && this.version++
  41024. },
  41025. setDynamic: function(e) {
  41026. return this.dynamic = e,
  41027. this
  41028. },
  41029. copy: function(e) {
  41030. return this.array = new e.array.constructor(e.array),
  41031. this.itemSize = e.itemSize,
  41032. this.dynamic = e.dynamic,
  41033. this
  41034. },
  41035. copyAt: function(e, t, i) {
  41036. e *= this.itemSize,
  41037. i *= t.itemSize;
  41038. for (var n = 0, r = this.itemSize; n < r; n++)
  41039. this.array[e + n] = t.array[i + n];
  41040. return this
  41041. },
  41042. copyArray: function(e) {
  41043. return this.array.set(e),
  41044. this
  41045. },
  41046. copyColorsArray: function(e) {
  41047. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41048. var o = e[n];
  41049. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41050. o = new Ci.Color),
  41051. t[i++] = o.r,
  41052. t[i++] = o.g,
  41053. t[i++] = o.b
  41054. }
  41055. return this
  41056. },
  41057. copyIndicesArray: function(e) {
  41058. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41059. var o = e[n];
  41060. t[i++] = o.a,
  41061. t[i++] = o.b,
  41062. t[i++] = o.c
  41063. }
  41064. return this
  41065. },
  41066. copyVector2sArray: function(e) {
  41067. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41068. var o = e[n];
  41069. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41070. o = new Ci.Vector2),
  41071. t[i++] = o.x,
  41072. t[i++] = o.y
  41073. }
  41074. return this
  41075. },
  41076. copyVector3sArray: function(e) {
  41077. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41078. var o = e[n];
  41079. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41080. o = new Ci.Vector3),
  41081. t[i++] = o.x,
  41082. t[i++] = o.y,
  41083. t[i++] = o.z
  41084. }
  41085. return this
  41086. },
  41087. copyVector4sArray: function(e) {
  41088. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41089. var o = e[n];
  41090. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41091. o = new Ci.Vector4),
  41092. t[i++] = o.x,
  41093. t[i++] = o.y,
  41094. t[i++] = o.z,
  41095. t[i++] = o.w
  41096. }
  41097. return this
  41098. },
  41099. set: function(e, t) {
  41100. return void 0 === t && (t = 0),
  41101. this.array.set(e, t),
  41102. this
  41103. },
  41104. getX: function(e) {
  41105. return this.array[e * this.itemSize]
  41106. },
  41107. setX: function(e, t) {
  41108. return this.array[e * this.itemSize] = t,
  41109. this
  41110. },
  41111. getY: function(e) {
  41112. return this.array[e * this.itemSize + 1]
  41113. },
  41114. setY: function(e, t) {
  41115. return this.array[e * this.itemSize + 1] = t,
  41116. this
  41117. },
  41118. getZ: function(e) {
  41119. return this.array[e * this.itemSize + 2]
  41120. },
  41121. setZ: function(e, t) {
  41122. return this.array[e * this.itemSize + 2] = t,
  41123. this
  41124. },
  41125. getW: function(e) {
  41126. return this.array[e * this.itemSize + 3]
  41127. },
  41128. setW: function(e, t) {
  41129. return this.array[e * this.itemSize + 3] = t,
  41130. this
  41131. },
  41132. setXY: function(e, t, i) {
  41133. return e *= this.itemSize,
  41134. this.array[e + 0] = t,
  41135. this.array[e + 1] = i,
  41136. this
  41137. },
  41138. setXYZ: function(e, t, i, n) {
  41139. return e *= this.itemSize,
  41140. this.array[e + 0] = t,
  41141. this.array[e + 1] = i,
  41142. this.array[e + 2] = n,
  41143. this
  41144. },
  41145. setXYZW: function(e, t, i, n, r) {
  41146. return e *= this.itemSize,
  41147. this.array[e + 0] = t,
  41148. this.array[e + 1] = i,
  41149. this.array[e + 2] = n,
  41150. this.array[e + 3] = r,
  41151. this
  41152. },
  41153. clone: function() {
  41154. return (new this.constructor).copy(this)
  41155. }
  41156. },
  41157. Ci.Int8Attribute = function(e, t) {
  41158. return new Ci.BufferAttribute(new Int8Array(e),t)
  41159. }
  41160. ,
  41161. Ci.Uint8Attribute = function(e, t) {
  41162. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41163. }
  41164. ,
  41165. Ci.Uint8ClampedAttribute = function(e, t) {
  41166. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41167. }
  41168. ,
  41169. Ci.Int16Attribute = function(e, t) {
  41170. return new Ci.BufferAttribute(new Int16Array(e),t)
  41171. }
  41172. ,
  41173. Ci.Uint16Attribute = function(e, t) {
  41174. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41175. }
  41176. ,
  41177. Ci.Int32Attribute = function(e, t) {
  41178. return new Ci.BufferAttribute(new Int32Array(e),t)
  41179. }
  41180. ,
  41181. Ci.Uint32Attribute = function(e, t) {
  41182. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41183. }
  41184. ,
  41185. Ci.Float32Attribute = function(e, t) {
  41186. return new Ci.BufferAttribute(new Float32Array(e),t)
  41187. }
  41188. ,
  41189. Ci.Float64Attribute = function(e, t) {
  41190. return new Ci.BufferAttribute(new Float64Array(e),t)
  41191. }
  41192. ,
  41193. Ci.DynamicBufferAttribute = function(e, t) {
  41194. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41195. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41196. }
  41197. ,
  41198. Ci.InstancedBufferAttribute = function(e, t, i) {
  41199. Ci.BufferAttribute.call(this, e, t),
  41200. this.meshPerAttribute = i || 1
  41201. }
  41202. ,
  41203. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41204. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41205. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41206. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41207. this.meshPerAttribute = e.meshPerAttribute,
  41208. this
  41209. }
  41210. ,
  41211. Ci.InterleavedBuffer = function(e, t) {
  41212. this.uuid = Ci.Math.generateUUID(),
  41213. this.array = e,
  41214. this.stride = t,
  41215. this.dynamic = !1,
  41216. this.updateRange = {
  41217. offset: 0,
  41218. count: -1
  41219. },
  41220. this.version = 0
  41221. }
  41222. ,
  41223. Ci.InterleavedBuffer.prototype = {
  41224. constructor: Ci.InterleavedBuffer,
  41225. get length() {
  41226. return this.array.length
  41227. },
  41228. get count() {
  41229. return this.array.length / this.stride
  41230. },
  41231. set needsUpdate(e) {
  41232. !0 === e && this.version++
  41233. },
  41234. setDynamic: function(e) {
  41235. return this.dynamic = e,
  41236. this
  41237. },
  41238. copy: function(e) {
  41239. return this.array = new e.array.constructor(e.array),
  41240. this.stride = e.stride,
  41241. this.dynamic = e.dynamic,
  41242. this
  41243. },
  41244. copyAt: function(e, t, i) {
  41245. e *= this.stride,
  41246. i *= t.stride;
  41247. for (var n = 0, r = this.stride; n < r; n++)
  41248. this.array[e + n] = t.array[i + n];
  41249. return this
  41250. },
  41251. set: function(e, t) {
  41252. return void 0 === t && (t = 0),
  41253. this.array.set(e, t),
  41254. this
  41255. },
  41256. clone: function() {
  41257. return (new this.constructor).copy(this)
  41258. }
  41259. },
  41260. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41261. Ci.InterleavedBuffer.call(this, e, t),
  41262. this.meshPerAttribute = i || 1
  41263. }
  41264. ,
  41265. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41266. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41267. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41268. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41269. this.meshPerAttribute = e.meshPerAttribute,
  41270. this
  41271. }
  41272. ,
  41273. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41274. this.uuid = Ci.Math.generateUUID(),
  41275. this.data = e,
  41276. this.itemSize = t,
  41277. this.offset = i
  41278. }
  41279. ,
  41280. Ci.InterleavedBufferAttribute.prototype = {
  41281. constructor: Ci.InterleavedBufferAttribute,
  41282. get length() {
  41283. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41284. this.array.length
  41285. },
  41286. get count() {
  41287. return this.data.count
  41288. },
  41289. setX: function(e, t) {
  41290. return this.data.array[e * this.data.stride + this.offset] = t,
  41291. this
  41292. },
  41293. setY: function(e, t) {
  41294. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41295. this
  41296. },
  41297. setZ: function(e, t) {
  41298. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41299. this
  41300. },
  41301. setW: function(e, t) {
  41302. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41303. this
  41304. },
  41305. getX: function(e) {
  41306. return this.data.array[e * this.data.stride + this.offset]
  41307. },
  41308. getY: function(e) {
  41309. return this.data.array[e * this.data.stride + this.offset + 1]
  41310. },
  41311. getZ: function(e) {
  41312. return this.data.array[e * this.data.stride + this.offset + 2]
  41313. },
  41314. getW: function(e) {
  41315. return this.data.array[e * this.data.stride + this.offset + 3]
  41316. },
  41317. setXY: function(e, t, i) {
  41318. return e = e * this.data.stride + this.offset,
  41319. this.data.array[e + 0] = t,
  41320. this.data.array[e + 1] = i,
  41321. this
  41322. },
  41323. setXYZ: function(e, t, i, n) {
  41324. return e = e * this.data.stride + this.offset,
  41325. this.data.array[e + 0] = t,
  41326. this.data.array[e + 1] = i,
  41327. this.data.array[e + 2] = n,
  41328. this
  41329. },
  41330. setXYZW: function(e, t, i, n, r) {
  41331. return e = e * this.data.stride + this.offset,
  41332. this.data.array[e + 0] = t,
  41333. this.data.array[e + 1] = i,
  41334. this.data.array[e + 2] = n,
  41335. this.data.array[e + 3] = r,
  41336. this
  41337. }
  41338. },
  41339. Ci.Geometry = function() {
  41340. Object.defineProperty(this, "id", {
  41341. value: Ci.GeometryIdCount++
  41342. }),
  41343. this.uuid = Ci.Math.generateUUID(),
  41344. this.name = "",
  41345. this.type = "Geometry",
  41346. this.vertices = [],
  41347. this.colors = [],
  41348. this.faces = [],
  41349. this.faceVertexUvs = [[]],
  41350. this.morphTargets = [],
  41351. this.morphNormals = [],
  41352. this.skinWeights = [],
  41353. this.skinIndices = [],
  41354. this.lineDistances = [],
  41355. this.boundingBox = null,
  41356. this.boundingSphere = null,
  41357. this.verticesNeedUpdate = !1,
  41358. this.elementsNeedUpdate = !1,
  41359. this.uvsNeedUpdate = !1,
  41360. this.normalsNeedUpdate = !1,
  41361. this.colorsNeedUpdate = !1,
  41362. this.lineDistancesNeedUpdate = !1,
  41363. this.groupsNeedUpdate = !1
  41364. }
  41365. ,
  41366. Ci.Geometry.prototype = {
  41367. constructor: Ci.Geometry,
  41368. applyMatrix: function(e) {
  41369. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41370. this.vertices[i].applyMatrix4(e)
  41371. }
  41372. for (i = 0,
  41373. n = this.faces.length; i < n; i++) {
  41374. var r = this.faces[i];
  41375. r.normal.applyMatrix3(t).normalize();
  41376. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41377. r.vertexNormals[o].applyMatrix3(t).normalize()
  41378. }
  41379. return null !== this.boundingBox && this.computeBoundingBox(),
  41380. null !== this.boundingSphere && this.computeBoundingSphere(),
  41381. this.verticesNeedUpdate = !0,
  41382. this.normalsNeedUpdate = !0,
  41383. this
  41384. },
  41385. rotateX: function(e) {
  41386. return void 0 === mt && (mt = new Ci.Matrix4),
  41387. mt.makeRotationX(e),
  41388. this.applyMatrix(mt),
  41389. this
  41390. },
  41391. rotateY: function(e) {
  41392. return void 0 === gt && (gt = new Ci.Matrix4),
  41393. gt.makeRotationY(e),
  41394. this.applyMatrix(gt),
  41395. this
  41396. },
  41397. rotateZ: function(e) {
  41398. return void 0 === ft && (ft = new Ci.Matrix4),
  41399. ft.makeRotationZ(e),
  41400. this.applyMatrix(ft),
  41401. this
  41402. },
  41403. translate: function(e, t, i) {
  41404. return void 0 === pt && (pt = new Ci.Matrix4),
  41405. pt.makeTranslation(e, t, i),
  41406. this.applyMatrix(pt),
  41407. this
  41408. },
  41409. scale: function(e, t, i) {
  41410. return void 0 === dt && (dt = new Ci.Matrix4),
  41411. dt.makeScale(e, t, i),
  41412. this.applyMatrix(dt),
  41413. this
  41414. },
  41415. lookAt: function(e) {
  41416. void 0 === ut && (ut = new Ci.Object3D),
  41417. ut.lookAt(e),
  41418. ut.updateMatrix(),
  41419. this.applyMatrix(ut.matrix)
  41420. },
  41421. fromBufferGeometry: function(e) {
  41422. function t(e, t, i, n) {
  41423. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41424. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41425. , a = new Ci.Face3(e,t,i,r,o,n);
  41426. s.faces.push(a),
  41427. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41428. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41429. }
  41430. var s = this
  41431. , i = null !== e.index ? e.index.array : void 0
  41432. , n = e.attributes
  41433. , r = n.position.array
  41434. , l = void 0 !== n.normal ? n.normal.array : void 0
  41435. , c = void 0 !== n.color ? n.color.array : void 0
  41436. , h = void 0 !== n.uv ? n.uv.array : void 0
  41437. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41438. void 0 !== u && (this.faceVertexUvs[1] = []);
  41439. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41440. a += 2)
  41441. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41442. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41443. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41444. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41445. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41446. if (void 0 !== i) {
  41447. var g = e.groups;
  41448. if (0 < g.length)
  41449. for (o = 0; o < g.length; o++)
  41450. for (var m = g[o], v = m.start, y = (a = v,
  41451. v + m.count); a < y; a += 3)
  41452. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41453. else
  41454. for (o = 0; o < i.length; o += 3)
  41455. t(i[o], i[o + 1], i[o + 2])
  41456. } else
  41457. for (o = 0; o < r.length / 3; o += 3)
  41458. t(o, o + 1, o + 2);
  41459. return this.computeFaceNormals(),
  41460. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41461. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41462. this
  41463. },
  41464. center: function() {
  41465. this.computeBoundingBox();
  41466. var e = this.boundingBox.center().negate();
  41467. return this.translate(e.x, e.y, e.z),
  41468. e
  41469. },
  41470. normalize: function() {
  41471. this.computeBoundingSphere();
  41472. var e = this.boundingSphere.center
  41473. , t = this.boundingSphere.radius
  41474. , i = 0 === t ? 1 : 1 / t
  41475. , n = new Ci.Matrix4;
  41476. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  41477. this.applyMatrix(n),
  41478. this
  41479. },
  41480. computeFaceNormals: function() {
  41481. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41482. var r = this.faces[i]
  41483. , o = this.vertices[r.a]
  41484. , a = this.vertices[r.b]
  41485. , s = this.vertices[r.c];
  41486. e.subVectors(s, a),
  41487. t.subVectors(o, a),
  41488. e.cross(t),
  41489. e.normalize(),
  41490. r.normal.copy(e)
  41491. }
  41492. },
  41493. computeVertexNormals: function(e) {
  41494. var t, i, n, r, o, a;
  41495. for (void 0 === e && (e = !0),
  41496. a = new Array(this.vertices.length),
  41497. t = 0,
  41498. i = this.vertices.length; t < i; t++)
  41499. a[t] = new Ci.Vector3;
  41500. if (e) {
  41501. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41502. for (n = 0,
  41503. r = this.faces.length; n < r; n++)
  41504. o = this.faces[n],
  41505. s = this.vertices[o.a],
  41506. l = this.vertices[o.b],
  41507. c = this.vertices[o.c],
  41508. h.subVectors(c, l),
  41509. u.subVectors(s, l),
  41510. h.cross(u),
  41511. a[o.a].add(h),
  41512. a[o.b].add(h),
  41513. a[o.c].add(h)
  41514. } else
  41515. for (n = 0,
  41516. r = this.faces.length; n < r; n++)
  41517. a[(o = this.faces[n]).a].add(o.normal),
  41518. a[o.b].add(o.normal),
  41519. a[o.c].add(o.normal);
  41520. for (t = 0,
  41521. i = this.vertices.length; t < i; t++)
  41522. a[t].normalize();
  41523. for (n = 0,
  41524. r = this.faces.length; n < r; n++) {
  41525. var d = (o = this.faces[n]).vertexNormals;
  41526. 3 === d.length ? (d[0].copy(a[o.a]),
  41527. d[1].copy(a[o.b]),
  41528. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41529. d[1] = a[o.b].clone(),
  41530. d[2] = a[o.c].clone())
  41531. }
  41532. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41533. },
  41534. computeMorphNormals: function() {
  41535. var e, t, i, n, r;
  41536. for (i = 0,
  41537. n = this.faces.length; i < n; i++)
  41538. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41539. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41540. e = 0,
  41541. t = r.vertexNormals.length; e < t; e++)
  41542. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41543. var o = new Ci.Geometry;
  41544. for (o.faces = this.faces,
  41545. e = 0,
  41546. t = this.morphTargets.length; e < t; e++) {
  41547. if (!this.morphNormals[e]) {
  41548. this.morphNormals[e] = {},
  41549. this.morphNormals[e].faceNormals = [],
  41550. this.morphNormals[e].vertexNormals = [];
  41551. var a = this.morphNormals[e].faceNormals
  41552. , s = this.morphNormals[e].vertexNormals;
  41553. for (i = 0,
  41554. n = this.faces.length; i < n; i++)
  41555. l = new Ci.Vector3,
  41556. c = {
  41557. a: new Ci.Vector3,
  41558. b: new Ci.Vector3,
  41559. c: new Ci.Vector3
  41560. },
  41561. a.push(l),
  41562. s.push(c)
  41563. }
  41564. var l, c, h = this.morphNormals[e];
  41565. for (o.vertices = this.morphTargets[e].vertices,
  41566. o.computeFaceNormals(),
  41567. o.computeVertexNormals(),
  41568. i = 0,
  41569. n = this.faces.length; i < n; i++)
  41570. r = this.faces[i],
  41571. l = h.faceNormals[i],
  41572. c = h.vertexNormals[i],
  41573. l.copy(r.normal),
  41574. c.a.copy(r.vertexNormals[0]),
  41575. c.b.copy(r.vertexNormals[1]),
  41576. c.c.copy(r.vertexNormals[2])
  41577. }
  41578. for (i = 0,
  41579. n = this.faces.length; i < n; i++)
  41580. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41581. r.vertexNormals = r.__originalVertexNormals
  41582. },
  41583. computeTangents: function() {
  41584. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41585. },
  41586. computeLineDistances: function() {
  41587. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41588. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41589. this.lineDistances[i] = e
  41590. },
  41591. computeBoundingBox: function() {
  41592. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41593. this.boundingBox.setFromPoints(this.vertices)
  41594. },
  41595. computeBoundingSphere: function() {
  41596. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41597. this.boundingSphere.setFromPoints(this.vertices)
  41598. },
  41599. merge: function(e, t, i) {
  41600. if (e instanceof Ci.Geometry != 0) {
  41601. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  41602. void 0 === i && (i = 0),
  41603. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41604. for (var u = 0, d = a.length; u < d; u++) {
  41605. var p = a[u].clone();
  41606. void 0 !== t && p.applyMatrix4(t),
  41607. o.push(p)
  41608. }
  41609. for (u = 0,
  41610. d = l.length; u < d; u++) {
  41611. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41612. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41613. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41614. for (var C = 0, I = y.length; C < I; C++)
  41615. g = y[C].clone(),
  41616. void 0 !== n && g.applyMatrix3(n).normalize(),
  41617. f.vertexNormals.push(g);
  41618. f.color.copy(v.color);
  41619. for (C = 0,
  41620. I = A.length; C < I; C++)
  41621. m = A[C],
  41622. f.vertexColors.push(m.clone());
  41623. f.materialIndex = v.materialIndex + i,
  41624. s.push(f)
  41625. }
  41626. for (u = 0,
  41627. d = h.length; u < d; u++) {
  41628. var E = h[u]
  41629. , _ = [];
  41630. if (void 0 !== E) {
  41631. for (C = 0,
  41632. I = E.length; C < I; C++)
  41633. _.push(E[C].clone());
  41634. c.push(_)
  41635. }
  41636. }
  41637. } else
  41638. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41639. },
  41640. mergeMesh: function(e) {
  41641. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41642. void this.merge(e.geometry, e.matrix))
  41643. },
  41644. mergeVertices: function() {
  41645. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41646. for (i = 0,
  41647. n = this.vertices.length; i < n; i++)
  41648. e = this.vertices[i],
  41649. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41650. c.push(this.vertices[i]),
  41651. h[i] = c.length - 1) : h[i] = h[l[t]];
  41652. var d = [];
  41653. for (i = 0,
  41654. n = this.faces.length; i < n; i++) {
  41655. (r = this.faces[i]).a = h[r.a],
  41656. r.b = h[r.b],
  41657. r.c = h[r.c],
  41658. o = [r.a, r.b, r.c];
  41659. for (var p = 0; p < 3; p++)
  41660. if (o[p] === o[(p + 1) % 3]) {
  41661. p,
  41662. d.push(i);
  41663. break
  41664. }
  41665. }
  41666. for (i = d.length - 1; 0 <= i; i--) {
  41667. var f = d[i];
  41668. for (this.faces.splice(f, 1),
  41669. a = 0,
  41670. s = this.faceVertexUvs.length; a < s; a++)
  41671. this.faceVertexUvs[a].splice(f, 1)
  41672. }
  41673. var g = this.vertices.length - c.length;
  41674. return this.vertices = c,
  41675. g
  41676. },
  41677. sortFacesByMaterialIndex: function() {
  41678. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  41679. e[i]._id = i;
  41680. e.sort(function(e, t) {
  41681. return e.materialIndex - t.materialIndex
  41682. });
  41683. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  41684. o && o.length === t && (n = []),
  41685. a && a.length === t && (r = []);
  41686. for (i = 0; i < t; i++) {
  41687. var s = e[i]._id;
  41688. n && n.push(o[s]),
  41689. r && r.push(a[s])
  41690. }
  41691. n && (this.faceVertexUvs[0] = n),
  41692. r && (this.faceVertexUvs[1] = r)
  41693. },
  41694. toJSON: function() {
  41695. function e(e, t, i) {
  41696. return i ? e | 1 << t : e & ~(1 << t)
  41697. }
  41698. function t(e) {
  41699. var t = e.x.toString() + e.y.toString() + e.z.toString();
  41700. return void 0 !== d[t] || (d[t] = u.length / 3,
  41701. u.push(e.x, e.y, e.z)),
  41702. d[t]
  41703. }
  41704. function i(e) {
  41705. var t = e.r.toString() + e.g.toString() + e.b.toString();
  41706. return void 0 !== f[t] || (f[t] = p.length,
  41707. p.push(e.getHex())),
  41708. f[t]
  41709. }
  41710. function n(e) {
  41711. var t = e.x.toString() + e.y.toString();
  41712. return void 0 !== m[t] || (m[t] = g.length / 2,
  41713. g.push(e.x, e.y)),
  41714. m[t]
  41715. }
  41716. var r = {
  41717. metadata: {
  41718. version: 4.4,
  41719. type: "Geometry",
  41720. generator: "Geometry.toJSON"
  41721. }
  41722. };
  41723. if (r.uuid = this.uuid,
  41724. r.type = this.type,
  41725. "" !== this.name && (r.name = this.name),
  41726. void 0 !== this.parameters) {
  41727. var o = this.parameters;
  41728. for (var a in o)
  41729. void 0 !== o[a] && (r[a] = o[a]);
  41730. return r
  41731. }
  41732. for (var s = [], l = 0; l < this.vertices.length; l++) {
  41733. var c = this.vertices[l];
  41734. s.push(c.x, c.y, c.z)
  41735. }
  41736. var h = []
  41737. , u = []
  41738. , d = {}
  41739. , p = []
  41740. , f = {}
  41741. , g = []
  41742. , m = {};
  41743. for (l = 0; l < this.faces.length; l++) {
  41744. var v = this.faces[l]
  41745. , y = void 0 !== this.faceVertexUvs[0][l]
  41746. , A = 0 < v.normal.length()
  41747. , C = 0 < v.vertexNormals.length
  41748. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  41749. , E = 0 < v.vertexColors.length
  41750. , _ = 0;
  41751. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  41752. h.push(_),
  41753. h.push(v.a, v.b, v.c),
  41754. h.push(v.materialIndex),
  41755. y) {
  41756. var b = this.faceVertexUvs[0][l];
  41757. h.push(n(b[0]), n(b[1]), n(b[2]))
  41758. }
  41759. if (A && h.push(t(v.normal)),
  41760. C) {
  41761. var w = v.vertexNormals;
  41762. h.push(t(w[0]), t(w[1]), t(w[2]))
  41763. }
  41764. if (I && h.push(i(v.color)),
  41765. E) {
  41766. var T = v.vertexColors;
  41767. h.push(i(T[0]), i(T[1]), i(T[2]))
  41768. }
  41769. }
  41770. return r.data = {},
  41771. r.data.vertices = s,
  41772. r.data.normals = u,
  41773. 0 < p.length && (r.data.colors = p),
  41774. 0 < g.length && (r.data.uvs = [g]),
  41775. r.data.faces = h,
  41776. r
  41777. },
  41778. clone: function() {
  41779. return (new Ci.Geometry).copy(this)
  41780. },
  41781. copy: function(e) {
  41782. this.vertices = [],
  41783. this.faces = [],
  41784. this.faceVertexUvs = [[]];
  41785. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  41786. this.vertices.push(t[i].clone());
  41787. var r = e.faces;
  41788. for (i = 0,
  41789. n = r.length; i < n; i++)
  41790. this.faces.push(r[i].clone());
  41791. for (i = 0,
  41792. n = e.faceVertexUvs.length; i < n; i++) {
  41793. var o = e.faceVertexUvs[i];
  41794. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  41795. for (var a = 0, s = o.length; a < s; a++) {
  41796. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  41797. var d = l[h];
  41798. c.push(d.clone())
  41799. }
  41800. this.faceVertexUvs[i].push(c)
  41801. }
  41802. }
  41803. return this
  41804. },
  41805. dispose: function() {
  41806. this.dispatchEvent({
  41807. type: "dispose"
  41808. })
  41809. }
  41810. },
  41811. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  41812. Ci.GeometryIdCount = 0,
  41813. Ci.DirectGeometry = function() {
  41814. Object.defineProperty(this, "id", {
  41815. value: Ci.GeometryIdCount++
  41816. }),
  41817. this.uuid = Ci.Math.generateUUID(),
  41818. this.name = "",
  41819. this.type = "DirectGeometry",
  41820. this.indices = [],
  41821. this.vertices = [],
  41822. this.normals = [],
  41823. this.colors = [],
  41824. this.uvs = [],
  41825. this.uvs2 = [],
  41826. this.groups = [],
  41827. this.morphTargets = {},
  41828. this.skinWeights = [],
  41829. this.skinIndices = [],
  41830. this.boundingBox = null,
  41831. this.boundingSphere = null,
  41832. this.verticesNeedUpdate = !1,
  41833. this.normalsNeedUpdate = !1,
  41834. this.colorsNeedUpdate = !1,
  41835. this.uvsNeedUpdate = !1,
  41836. this.groupsNeedUpdate = !1
  41837. }
  41838. ,
  41839. Ci.DirectGeometry.prototype = {
  41840. constructor: Ci.DirectGeometry,
  41841. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  41842. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  41843. computeFaceNormals: function() {
  41844. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  41845. },
  41846. computeVertexNormals: function() {
  41847. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  41848. },
  41849. computeGroups: function(e) {
  41850. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  41851. var a = r[o];
  41852. a.materialIndex !== i && (i = a.materialIndex,
  41853. void 0 !== t && (t.count = 3 * o - t.start,
  41854. n.push(t)),
  41855. t = {
  41856. start: 3 * o,
  41857. materialIndex: i
  41858. })
  41859. }
  41860. void 0 !== t && (t.count = 3 * o - t.start,
  41861. n.push(t)),
  41862. this.groups = n
  41863. },
  41864. fromGeometry: function(e) {
  41865. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  41866. if (0 < l) {
  41867. t = [];
  41868. for (var c = 0; c < l; c++)
  41869. t[c] = [];
  41870. this.morphTargets.position = t
  41871. }
  41872. var h, u = e.morphNormals, d = u.length;
  41873. if (0 < d) {
  41874. h = [];
  41875. for (c = 0; c < d; c++)
  41876. h[c] = [];
  41877. this.morphTargets.normal = h
  41878. }
  41879. var p = e.skinIndices
  41880. , f = e.skinWeights
  41881. , g = p.length === n.length
  41882. , m = f.length === n.length;
  41883. for (c = 0; c < i.length; c++) {
  41884. var v = i[c];
  41885. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  41886. var y = v.vertexNormals;
  41887. if (3 === y.length)
  41888. this.normals.push(y[0], y[1], y[2]);
  41889. else {
  41890. var A = v.normal;
  41891. this.normals.push(A, A, A)
  41892. }
  41893. var C, I = v.vertexColors;
  41894. if (3 === I.length)
  41895. this.colors.push(I[0], I[1], I[2]);
  41896. else {
  41897. var E = v.color;
  41898. this.colors.push(E, E, E)
  41899. }
  41900. if (!0 === o)
  41901. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  41902. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  41903. if (!0 === a)
  41904. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  41905. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  41906. for (var _ = 0; _ < l; _++) {
  41907. var b = s[_].vertices;
  41908. t[_].push(b[v.a], b[v.b], b[v.c])
  41909. }
  41910. for (_ = 0; _ < d; _++) {
  41911. var w = u[_].vertexNormals[c];
  41912. h[_].push(w.a, w.b, w.c)
  41913. }
  41914. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  41915. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  41916. }
  41917. return this.computeGroups(e),
  41918. this.verticesNeedUpdate = e.verticesNeedUpdate,
  41919. this.normalsNeedUpdate = e.normalsNeedUpdate,
  41920. this.colorsNeedUpdate = e.colorsNeedUpdate,
  41921. this.uvsNeedUpdate = e.uvsNeedUpdate,
  41922. this.groupsNeedUpdate = e.groupsNeedUpdate,
  41923. this
  41924. },
  41925. dispose: function() {
  41926. this.dispatchEvent({
  41927. type: "dispose"
  41928. })
  41929. }
  41930. },
  41931. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  41932. Ci.BufferGeometry = function() {
  41933. Object.defineProperty(this, "id", {
  41934. value: Ci.GeometryIdCount++
  41935. }),
  41936. this.uuid = Ci.Math.generateUUID(),
  41937. this.name = "",
  41938. this.type = "BufferGeometry",
  41939. this.index = null,
  41940. this.attributes = {},
  41941. this.morphAttributes = {},
  41942. this.groups = [],
  41943. this.boundingBox = null,
  41944. this.boundingSphere = null,
  41945. this.drawRange = {
  41946. start: 0,
  41947. count: 1 / 0
  41948. }
  41949. }
  41950. ,
  41951. Ci.BufferGeometry.prototype = {
  41952. constructor: Ci.BufferGeometry,
  41953. getIndex: function() {
  41954. return this.index
  41955. },
  41956. setIndex: function(e) {
  41957. this.index = e
  41958. },
  41959. addAttribute: function(e, t) {
  41960. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  41961. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  41962. void this.setIndex(t)) : (this.attributes[e] = t,
  41963. this)
  41964. },
  41965. getAttribute: function(e) {
  41966. return this.attributes[e]
  41967. },
  41968. removeAttribute: function(e) {
  41969. return delete this.attributes[e],
  41970. this
  41971. },
  41972. addGroup: function(e, t, i) {
  41973. this.groups.push({
  41974. start: e,
  41975. count: t,
  41976. materialIndex: void 0 !== i ? i : 0
  41977. })
  41978. },
  41979. clearGroups: function() {
  41980. this.groups = []
  41981. },
  41982. setDrawRange: function(e, t) {
  41983. this.drawRange.start = e,
  41984. this.drawRange.count = t
  41985. },
  41986. applyMatrix: function(e) {
  41987. var t = this.attributes.position;
  41988. void 0 !== t && (e.applyToVector3Array(t.array),
  41989. t.needsUpdate = !0);
  41990. var i = this.attributes.normal;
  41991. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  41992. i.needsUpdate = !0);
  41993. return null !== this.boundingBox && this.computeBoundingBox(),
  41994. null !== this.boundingSphere && this.computeBoundingSphere(),
  41995. this
  41996. },
  41997. rotateX: function(e) {
  41998. return void 0 === ht && (ht = new Ci.Matrix4),
  41999. ht.makeRotationX(e),
  42000. this.applyMatrix(ht),
  42001. this
  42002. },
  42003. rotateY: function(e) {
  42004. return void 0 === ct && (ct = new Ci.Matrix4),
  42005. ct.makeRotationY(e),
  42006. this.applyMatrix(ct),
  42007. this
  42008. },
  42009. rotateZ: function(e) {
  42010. return void 0 === lt && (lt = new Ci.Matrix4),
  42011. lt.makeRotationZ(e),
  42012. this.applyMatrix(lt),
  42013. this
  42014. },
  42015. translate: function(e, t, i) {
  42016. return void 0 === st && (st = new Ci.Matrix4),
  42017. st.makeTranslation(e, t, i),
  42018. this.applyMatrix(st),
  42019. this
  42020. },
  42021. scale: function(e, t, i) {
  42022. return void 0 === at && (at = new Ci.Matrix4),
  42023. at.makeScale(e, t, i),
  42024. this.applyMatrix(at),
  42025. this
  42026. },
  42027. lookAt: function(e) {
  42028. void 0 === ot && (ot = new Ci.Object3D),
  42029. ot.lookAt(e),
  42030. ot.updateMatrix(),
  42031. this.applyMatrix(ot.matrix)
  42032. },
  42033. center: function() {
  42034. this.computeBoundingBox();
  42035. var e = this.boundingBox.center().negate();
  42036. return this.translate(e.x, e.y, e.z),
  42037. e
  42038. },
  42039. setFromObject: function(e) {
  42040. var t = e.geometry;
  42041. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42042. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42043. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42044. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42045. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42046. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42047. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42048. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42049. }
  42050. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42051. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42052. } else
  42053. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42054. return this
  42055. },
  42056. updateFromObject: function(e) {
  42057. var t, i = e.geometry;
  42058. if (e instanceof Ci.Mesh) {
  42059. var n = i.__directGeometry;
  42060. if (void 0 === n)
  42061. return this.fromGeometry(i);
  42062. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42063. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42064. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42065. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42066. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42067. i.verticesNeedUpdate = !1,
  42068. i.normalsNeedUpdate = !1,
  42069. i.colorsNeedUpdate = !1,
  42070. i.uvsNeedUpdate = !1,
  42071. i.groupsNeedUpdate = !1,
  42072. i = n
  42073. }
  42074. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42075. t.needsUpdate = !0),
  42076. i.verticesNeedUpdate = !1);
  42077. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42078. t.needsUpdate = !0),
  42079. i.normalsNeedUpdate = !1);
  42080. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42081. t.needsUpdate = !0),
  42082. i.colorsNeedUpdate = !1);
  42083. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42084. t.needsUpdate = !0),
  42085. i.uvsNeedUpdate = !1);
  42086. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42087. t.needsUpdate = !0),
  42088. i.lineDistancesNeedUpdate = !1);
  42089. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42090. this.groups = i.groups,
  42091. i.groupsNeedUpdate = !1),
  42092. this
  42093. },
  42094. fromGeometry: function(e) {
  42095. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42096. this.fromDirectGeometry(e.__directGeometry)
  42097. },
  42098. fromDirectGeometry: function(e) {
  42099. var t = new Float32Array(3 * e.vertices.length);
  42100. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42101. 0 < e.normals.length) {
  42102. var i = new Float32Array(3 * e.normals.length);
  42103. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42104. }
  42105. if (0 < e.colors.length) {
  42106. var n = new Float32Array(3 * e.colors.length);
  42107. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42108. }
  42109. if (0 < e.uvs.length) {
  42110. var r = new Float32Array(2 * e.uvs.length);
  42111. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42112. }
  42113. if (0 < e.uvs2.length) {
  42114. var o = new Float32Array(2 * e.uvs2.length);
  42115. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42116. }
  42117. if (0 < e.indices.length) {
  42118. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42119. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42120. }
  42121. for (var s in this.groups = e.groups,
  42122. e.morphTargets) {
  42123. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42124. var d = c[h]
  42125. , p = new Ci.Float32Attribute(3 * d.length,3);
  42126. l.push(p.copyVector3sArray(d))
  42127. }
  42128. this.morphAttributes[s] = l
  42129. }
  42130. if (0 < e.skinIndices.length) {
  42131. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42132. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42133. }
  42134. if (0 < e.skinWeights.length) {
  42135. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42136. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42137. }
  42138. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42139. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42140. this
  42141. },
  42142. computeBoundingBox: (new Ci.Vector3,
  42143. function() {
  42144. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42145. var e = this.attributes.position.array;
  42146. e && this.boundingBox.setFromArray(e),
  42147. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42148. this.boundingBox.max.set(0, 0, 0)),
  42149. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  42150. }
  42151. ),
  42152. computeBoundingSphere: (nt = new Ci.Box3,
  42153. rt = new Ci.Vector3,
  42154. function() {
  42155. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42156. var e = this.attributes.position.array;
  42157. if (e) {
  42158. var t = this.boundingSphere.center;
  42159. nt.setFromArray(e),
  42160. nt.center(t);
  42161. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42162. rt.fromArray(e, n),
  42163. i = Math.max(i, t.distanceToSquared(rt));
  42164. this.boundingSphere.radius = Math.sqrt(i),
  42165. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42166. }
  42167. }
  42168. ),
  42169. computeFaceNormals: function() {},
  42170. computeVertexNormals: function() {
  42171. var e = this.index
  42172. , t = this.attributes
  42173. , i = this.groups;
  42174. if (t.position) {
  42175. var n = t.position.array;
  42176. if (void 0 === t.normal)
  42177. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42178. else
  42179. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42180. r[o] = 0;
  42181. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  42182. if (e) {
  42183. var m = e.array;
  42184. 0 === i.length && this.addGroup(0, m.length);
  42185. for (var v = 0, y = i.length; v < y; ++v) {
  42186. var A = i[v]
  42187. , C = A.start;
  42188. for (o = C,
  42189. a = C + A.count; o < a; o += 3)
  42190. s = 3 * m[o + 0],
  42191. l = 3 * m[o + 1],
  42192. c = 3 * m[o + 2],
  42193. u.fromArray(n, s),
  42194. d.fromArray(n, l),
  42195. p.fromArray(n, c),
  42196. f.subVectors(p, d),
  42197. g.subVectors(u, d),
  42198. f.cross(g),
  42199. h[s] += f.x,
  42200. h[1 + s] += f.y,
  42201. h[2 + s] += f.z,
  42202. h[l] += f.x,
  42203. h[1 + l] += f.y,
  42204. h[2 + l] += f.z,
  42205. h[c] += f.x,
  42206. h[1 + c] += f.y,
  42207. h[2 + c] += f.z
  42208. }
  42209. } else
  42210. for (o = 0,
  42211. a = n.length; o < a; o += 9)
  42212. u.fromArray(n, o),
  42213. d.fromArray(n, o + 3),
  42214. p.fromArray(n, o + 6),
  42215. f.subVectors(p, d),
  42216. g.subVectors(u, d),
  42217. f.cross(g),
  42218. h[o] = f.x,
  42219. h[o + 1] = f.y,
  42220. h[o + 2] = f.z,
  42221. h[o + 3] = f.x,
  42222. h[o + 4] = f.y,
  42223. h[o + 5] = f.z,
  42224. h[o + 6] = f.x,
  42225. h[o + 7] = f.y,
  42226. h[o + 8] = f.z;
  42227. this.normalizeNormals(),
  42228. t.normal.needsUpdate = !0
  42229. }
  42230. },
  42231. merge: function(e, t) {
  42232. if (e instanceof Ci.BufferGeometry != 0) {
  42233. void 0 === t && (t = 0);
  42234. var i = this.attributes;
  42235. for (var n in i)
  42236. if (void 0 !== e.attributes[n])
  42237. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42238. l++)
  42239. r[l] = a[s];
  42240. return this
  42241. }
  42242. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42243. },
  42244. normalizeNormals: function() {
  42245. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42246. e = r[o],
  42247. t = r[o + 1],
  42248. i = r[o + 2],
  42249. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42250. r[o] *= n,
  42251. r[o + 1] *= n,
  42252. r[o + 2] *= n
  42253. },
  42254. toNonIndexed: function() {
  42255. if (null === this.index)
  42256. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42257. this;
  42258. var e = new Ci.BufferGeometry
  42259. , t = this.index.array
  42260. , i = this.attributes;
  42261. for (var n in i) {
  42262. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  42263. l = t[h] * a;
  42264. for (var d = 0; d < a; d++)
  42265. s[c++] = o[l++]
  42266. }
  42267. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42268. }
  42269. return e
  42270. },
  42271. toJSON: function() {
  42272. var e = {
  42273. metadata: {
  42274. version: 4.4,
  42275. type: "BufferGeometry",
  42276. generator: "BufferGeometry.toJSON"
  42277. }
  42278. };
  42279. if (e.uuid = this.uuid,
  42280. e.type = this.type,
  42281. "" !== this.name && (e.name = this.name),
  42282. void 0 !== this.parameters) {
  42283. var t = this.parameters;
  42284. for (var i in t)
  42285. void 0 !== t[i] && (e[i] = t[i]);
  42286. return e
  42287. }
  42288. e.data = {
  42289. attributes: {}
  42290. };
  42291. var n = this.index;
  42292. if (null !== n) {
  42293. var r = Array.prototype.slice.call(n.array);
  42294. e.data.index = {
  42295. type: n.array.constructor.name,
  42296. array: r
  42297. }
  42298. }
  42299. var o = this.attributes;
  42300. for (var i in o) {
  42301. var a = o[i];
  42302. r = Array.prototype.slice.call(a.array);
  42303. e.data.attributes[i] = {
  42304. itemSize: a.itemSize,
  42305. type: a.array.constructor.name,
  42306. array: r
  42307. }
  42308. }
  42309. var s = this.groups;
  42310. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42311. var l = this.boundingSphere;
  42312. return null !== l && (e.data.boundingSphere = {
  42313. center: l.center.toArray(),
  42314. radius: l.radius
  42315. }),
  42316. e
  42317. },
  42318. clone: function() {
  42319. return (new Ci.BufferGeometry).copy(this)
  42320. },
  42321. copy: function(e) {
  42322. var t = e.index;
  42323. null !== t && this.setIndex(t.clone());
  42324. var i = e.attributes;
  42325. for (var n in i) {
  42326. var r = i[n];
  42327. this.addAttribute(n, r.clone())
  42328. }
  42329. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42330. var l = o[a];
  42331. this.addGroup(l.start, l.count)
  42332. }
  42333. return this
  42334. },
  42335. dispose: function() {
  42336. this.dispatchEvent({
  42337. type: "dispose"
  42338. })
  42339. }
  42340. },
  42341. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42342. Ci.BufferGeometry.MaxIndex = 65535,
  42343. Ci.InstancedBufferGeometry = function() {
  42344. Ci.BufferGeometry.call(this),
  42345. this.type = "InstancedBufferGeometry",
  42346. this.maxInstancedCount = void 0
  42347. }
  42348. ,
  42349. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42350. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42351. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42352. this.groups.push({
  42353. start: e,
  42354. count: t,
  42355. instances: i
  42356. })
  42357. }
  42358. ,
  42359. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42360. var t = e.index;
  42361. null !== t && this.setIndex(t.clone());
  42362. var i = e.attributes;
  42363. for (var n in i) {
  42364. var r = i[n];
  42365. this.addAttribute(n, r.clone())
  42366. }
  42367. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42368. var l = o[a];
  42369. this.addGroup(l.start, l.count, l.instances)
  42370. }
  42371. return this
  42372. }
  42373. ,
  42374. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42375. Ci.Uniform = function(e, t) {
  42376. this.type = e,
  42377. this.value = t,
  42378. this.dynamic = !1
  42379. }
  42380. ,
  42381. Ci.Uniform.prototype = {
  42382. constructor: Ci.Uniform,
  42383. onUpdate: function(e) {
  42384. return this.dynamic = !0,
  42385. this.onUpdateCallback = e,
  42386. this
  42387. }
  42388. },
  42389. Ci.AnimationClip = function(e, t, i) {
  42390. this.name = e || Ci.Math.generateUUID(),
  42391. this.tracks = i,
  42392. this.duration = void 0 !== t ? t : -1,
  42393. this.duration < 0 && this.resetDuration(),
  42394. this.trim(),
  42395. this.optimize()
  42396. }
  42397. ,
  42398. Ci.AnimationClip.prototype = {
  42399. constructor: Ci.AnimationClip,
  42400. resetDuration: function() {
  42401. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42402. var n = this.tracks[t];
  42403. e = Math.max(e, n.times[n.times.length - 1])
  42404. }
  42405. this.duration = e
  42406. },
  42407. trim: function() {
  42408. for (var e = 0; e < this.tracks.length; e++)
  42409. this.tracks[e].trim(0, this.duration);
  42410. return this
  42411. },
  42412. optimize: function() {
  42413. for (var e = 0; e < this.tracks.length; e++)
  42414. this.tracks[e].optimize();
  42415. return this
  42416. }
  42417. },
  42418. Object.assign(Ci.AnimationClip, {
  42419. parse: function(e) {
  42420. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42421. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42422. return new Ci.AnimationClip(e.name,e.duration,t)
  42423. },
  42424. toJSON: function(e) {
  42425. for (var t = [], i = e.tracks, n = {
  42426. name: e.name,
  42427. duration: e.duration,
  42428. tracks: t
  42429. }, r = 0, o = i.length; r !== o; ++r)
  42430. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42431. return n
  42432. },
  42433. CreateFromMorphTargetSequence: function(e, t, i) {
  42434. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42435. var a = []
  42436. , s = [];
  42437. a.push((o + n - 1) % n, o, (o + 1) % n),
  42438. s.push(0, 1, 0);
  42439. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42440. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42441. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42442. 0 === a[0] && (a.push(n),
  42443. s.push(s[0])),
  42444. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42445. }
  42446. return new Ci.AnimationClip(e,-1,r)
  42447. },
  42448. findByName: function(e, t) {
  42449. for (var i = 0; i < e.length; i++)
  42450. if (e[i].name === t)
  42451. return e[i];
  42452. return null
  42453. },
  42454. CreateClipsFromMorphTargetSequences: function(e, t) {
  42455. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42456. var a = e[r]
  42457. , s = a.name.match(n);
  42458. if (s && 1 < s.length) {
  42459. var l = i[h = s[1]];
  42460. l || (i[h] = l = []),
  42461. l.push(a)
  42462. }
  42463. }
  42464. var c = [];
  42465. for (var h in i)
  42466. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42467. return c
  42468. },
  42469. parseAnimation: function(e, t, i) {
  42470. if (!e)
  42471. return console.error(" no animation in JSONLoader data"),
  42472. null;
  42473. function n(e, t, i, n, r) {
  42474. if (0 !== i.length) {
  42475. var o = []
  42476. , a = [];
  42477. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42478. 0 !== o.length && r.push(new e(t,o,a))
  42479. }
  42480. }
  42481. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42482. var h = l[c].keys;
  42483. if (h && 0 != h.length)
  42484. if (h[0].morphTargets) {
  42485. for (var u = {}, d = 0; d < h.length; d++)
  42486. if (h[d].morphTargets)
  42487. for (var p = 0; p < h[d].morphTargets.length; p++)
  42488. u[h[d].morphTargets[p]] = -1;
  42489. for (var f in u) {
  42490. var g = []
  42491. , m = [];
  42492. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42493. var v = h[d];
  42494. g.push(v.time),
  42495. m.push(v.morphTarget === f ? 1 : 0)
  42496. }
  42497. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42498. }
  42499. a = u.length * (s || 1)
  42500. } else {
  42501. var y = ".bones[" + t[c].name + "]";
  42502. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42503. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42504. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42505. }
  42506. }
  42507. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42508. }
  42509. }),
  42510. Ci.AnimationMixer = function(e) {
  42511. this._root = e,
  42512. this._initMemoryManager(),
  42513. this._accuIndex = 0,
  42514. this.time = 0,
  42515. this.timeScale = 1
  42516. }
  42517. ,
  42518. Ci.AnimationMixer.prototype = {
  42519. constructor: Ci.AnimationMixer,
  42520. clipAction: function(e, t) {
  42521. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42522. if (void 0 !== a) {
  42523. var s = a.actionByRoot[n];
  42524. if (void 0 !== s)
  42525. return s;
  42526. if (o = (i = a.knownActions[0])._clip,
  42527. e !== r && e !== o)
  42528. throw new Error("Different clips with the same name detected!")
  42529. }
  42530. if (null === o)
  42531. return null;
  42532. var l = new Ci.AnimationMixer._Action(this,o,t);
  42533. return this._bindAction(l, i),
  42534. this._addInactiveAction(l, r, n),
  42535. l
  42536. },
  42537. existingAction: function(e, t) {
  42538. var i = (t || this._root).uuid
  42539. , n = "string" == typeof e ? e : e.name
  42540. , r = this._actionsByClip[n];
  42541. return void 0 !== r && r.actionByRoot[i] || null
  42542. },
  42543. stopAllAction: function() {
  42544. var e = this._actions
  42545. , t = this._nActiveActions
  42546. , i = this._bindings
  42547. , n = this._nActiveBindings;
  42548. this._nActiveActions = 0;
  42549. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42550. e[r].reset();
  42551. for (r = 0; r !== n; ++r)
  42552. i[r].useCount = 0;
  42553. return this
  42554. },
  42555. update: function(e) {
  42556. e *= this.timeScale;
  42557. for (var t = this._actions, i = this._nActiveActions, n = this.time += e, r = Math.sign(e), o = this._accuIndex ^= 1, a = 0; a !== i; ++a) {
  42558. var s = t[a];
  42559. s.enabled && s._update(n, e, r, o)
  42560. }
  42561. var l = this._bindings
  42562. , c = this._nActiveBindings;
  42563. for (a = 0; a !== c; ++a)
  42564. l[a].apply(o);
  42565. return this
  42566. },
  42567. getRoot: function() {
  42568. return this._root
  42569. },
  42570. uncacheClip: function(e) {
  42571. var t = this._actions
  42572. , i = e.name
  42573. , n = this._actionsByClip
  42574. , r = n[i];
  42575. if (void 0 !== r) {
  42576. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42577. var l = o[a];
  42578. this._deactivateAction(l);
  42579. var c = l._cacheIndex
  42580. , h = t[t.length - 1];
  42581. l._cacheIndex = null,
  42582. l._byClipCacheIndex = null,
  42583. t[h._cacheIndex = c] = h,
  42584. t.pop(),
  42585. this._removeInactiveBindingsForAction(l)
  42586. }
  42587. delete n[i]
  42588. }
  42589. },
  42590. uncacheRoot: function(e) {
  42591. var t = e.uuid
  42592. , i = this._actionsByClip;
  42593. for (var n in i) {
  42594. var r = i[n].actionByRoot[t];
  42595. void 0 !== r && (this._deactivateAction(r),
  42596. this._removeInactiveAction(r))
  42597. }
  42598. var o = this._bindingsByRootAndName[t];
  42599. if (void 0 !== o)
  42600. for (var a in o) {
  42601. var s = o[a];
  42602. s.restoreOriginalState(),
  42603. this._removeInactiveBinding(s)
  42604. }
  42605. },
  42606. uncacheAction: function(e, t) {
  42607. var i = this.existingAction(e, t);
  42608. null !== i && (this._deactivateAction(i),
  42609. this._removeInactiveAction(i))
  42610. }
  42611. },
  42612. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42613. Ci.AnimationMixer._Action = function(e, t, i) {
  42614. this._mixer = e,
  42615. this._clip = t,
  42616. this._localRoot = i || null;
  42617. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42618. endingStart: Ci.ZeroCurvatureEnding,
  42619. endingEnd: Ci.ZeroCurvatureEnding
  42620. }, s = 0; s !== r; ++s) {
  42621. var l = n[s].createInterpolant(null);
  42622. (o[s] = l).settings = a
  42623. }
  42624. this._interpolantSettings = a,
  42625. this._interpolants = o,
  42626. this._propertyBindings = new Array(r),
  42627. this._cacheIndex = null,
  42628. this._byClipCacheIndex = null,
  42629. this._timeScaleInterpolant = null,
  42630. this._weightInterpolant = null,
  42631. this.loop = Ci.LoopRepeat,
  42632. this._loopCount = -1,
  42633. this._startTime = null,
  42634. this.time = 0,
  42635. this.timeScale = 1,
  42636. this._effectiveTimeScale = 1,
  42637. this.weight = 1,
  42638. this._effectiveWeight = 1,
  42639. this.repetitions = 1 / 0,
  42640. this.paused = !1,
  42641. this.enabled = !0,
  42642. this.clampWhenFinished = !1,
  42643. this.zeroSlopeAtStart = !0,
  42644. this.zeroSlopeAtEnd = !0
  42645. }
  42646. ,
  42647. Ci.AnimationMixer._Action.prototype = {
  42648. constructor: Ci.AnimationMixer._Action,
  42649. play: function() {
  42650. return this._mixer._activateAction(this),
  42651. this
  42652. },
  42653. stop: function() {
  42654. return this._mixer._deactivateAction(this),
  42655. this.reset()
  42656. },
  42657. reset: function() {
  42658. return this.paused = !1,
  42659. this.enabled = !0,
  42660. this.time = 0,
  42661. this._loopCount = -1,
  42662. this._startTime = null,
  42663. this.stopFading().stopWarping()
  42664. },
  42665. isRunning: function() {
  42666. return this._startTime,
  42667. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42668. },
  42669. isScheduled: function() {
  42670. return this._mixer._isActiveAction(this)
  42671. },
  42672. startAt: function(e) {
  42673. return this._startTime = e,
  42674. this
  42675. },
  42676. setLoop: function(e, t) {
  42677. return this.loop = e,
  42678. this.repetitions = t,
  42679. this
  42680. },
  42681. setEffectiveWeight: function(e) {
  42682. return this.weight = e,
  42683. this._effectiveWeight = this.enabled ? e : 0,
  42684. this.stopFading()
  42685. },
  42686. getEffectiveWeight: function() {
  42687. return this._effectiveWeight
  42688. },
  42689. fadeIn: function(e) {
  42690. return this._scheduleFading(e, 0, 1)
  42691. },
  42692. fadeOut: function(e) {
  42693. return this._scheduleFading(e, 1, 0)
  42694. },
  42695. crossFadeFrom: function(e, t, i) {
  42696. if (this._mixer,
  42697. e.fadeOut(t),
  42698. this.fadeIn(t),
  42699. i) {
  42700. var n = this._clip.duration
  42701. , r = e._clip.duration
  42702. , o = r / n
  42703. , a = n / r;
  42704. e.warp(1, o, t),
  42705. this.warp(a, 1, t)
  42706. }
  42707. return this
  42708. },
  42709. crossFadeTo: function(e, t, i) {
  42710. return e.crossFadeFrom(this, t, i)
  42711. },
  42712. stopFading: function() {
  42713. var e = this._weightInterpolant;
  42714. return null !== e && (this._weightInterpolant = null,
  42715. this._mixer._takeBackControlInterpolant(e)),
  42716. this
  42717. },
  42718. setEffectiveTimeScale: function(e) {
  42719. return this.timeScale = e,
  42720. this._effectiveTimeScale = this.paused ? 0 : e,
  42721. this.stopWarping()
  42722. },
  42723. getEffectiveTimeScale: function() {
  42724. return this._effectiveTimeScale
  42725. },
  42726. setDuration: function(e) {
  42727. return this.timeScale = this._clip.duration / e,
  42728. this.stopWarping()
  42729. },
  42730. syncWith: function(e) {
  42731. return this.time = e.time,
  42732. this.timeScale = e.timeScale,
  42733. this.stopWarping()
  42734. },
  42735. halt: function(e) {
  42736. return this.warp(this._currentTimeScale, 0, e)
  42737. },
  42738. warp: function(e, t, i) {
  42739. var n = this._mixer
  42740. , r = n.time
  42741. , o = this._timeScaleInterpolant
  42742. , a = this.timeScale;
  42743. null === o && (o = n._lendControlInterpolant(),
  42744. this._timeScaleInterpolant = o);
  42745. var s = o.parameterPositions
  42746. , l = o.sampleValues;
  42747. return s[0] = r,
  42748. s[1] = r + i,
  42749. l[0] = e / a,
  42750. l[1] = t / a,
  42751. this
  42752. },
  42753. stopWarping: function() {
  42754. var e = this._timeScaleInterpolant;
  42755. return null !== e && (this._timeScaleInterpolant = null,
  42756. this._mixer._takeBackControlInterpolant(e)),
  42757. this
  42758. },
  42759. getMixer: function() {
  42760. return this._mixer
  42761. },
  42762. getClip: function() {
  42763. return this._clip
  42764. },
  42765. getRoot: function() {
  42766. return this._localRoot || this._mixer._root
  42767. },
  42768. _update: function(e, t, i, n) {
  42769. var r = this._startTime;
  42770. if (null !== r) {
  42771. var o = (e - r) * i;
  42772. if (o < 0 || 0 === i)
  42773. return;
  42774. this._startTime = null,
  42775. t = i * o
  42776. }
  42777. t *= this._updateTimeScale(e);
  42778. var a = this._updateTime(t)
  42779. , s = this._updateWeight(e);
  42780. if (0 < s)
  42781. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  42782. l[h].evaluate(a),
  42783. c[h].accumulate(n, s)
  42784. },
  42785. _updateWeight: function(e) {
  42786. var t = 0;
  42787. if (this.enabled) {
  42788. t = this.weight;
  42789. var i = this._weightInterpolant;
  42790. if (null !== i) {
  42791. var n = i.evaluate(e)[0];
  42792. t *= n,
  42793. e > i.parameterPositions[1] && (this.stopFading(),
  42794. 0 === n && (this.enabled = !1))
  42795. }
  42796. }
  42797. return this._effectiveWeight = t
  42798. },
  42799. _updateTimeScale: function(e) {
  42800. var t = 0;
  42801. if (!this.paused) {
  42802. t = this.timeScale;
  42803. var i = this._timeScaleInterpolant;
  42804. if (null !== i)
  42805. t *= i.evaluate(e)[0],
  42806. e > i.parameterPositions[1] && (this.stopWarping(),
  42807. 0 === t ? this.pause = !0 : this.timeScale = t)
  42808. }
  42809. return this._effectiveTimeScale = t
  42810. },
  42811. _updateTime: function(e) {
  42812. var t = this.time + e;
  42813. if (0 === e)
  42814. return t;
  42815. var i = this._clip.duration
  42816. , n = this.loop
  42817. , r = this._loopCount
  42818. , o = !1;
  42819. switch (n) {
  42820. case Ci.LoopOnce:
  42821. if (-1 === r && (this.loopCount = 0,
  42822. this._setEndings(!0, !0, !1)),
  42823. i <= t)
  42824. t = i;
  42825. else {
  42826. if (!(t < 0))
  42827. break;
  42828. t = 0
  42829. }
  42830. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  42831. this._mixer.dispatchEvent({
  42832. type: "finished",
  42833. action: this,
  42834. direction: e < 0 ? -1 : 1
  42835. });
  42836. break;
  42837. case Ci.LoopPingPong:
  42838. o = !0;
  42839. case Ci.LoopRepeat:
  42840. if (-1 === r && (0 < e ? (r = 0,
  42841. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  42842. i <= t || t < 0) {
  42843. var a = Math.floor(t / i);
  42844. t -= i * a,
  42845. r += Math.abs(a);
  42846. var s = this.repetitions - r;
  42847. if (s < 0) {
  42848. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  42849. t = 0 < e ? i : 0,
  42850. this._mixer.dispatchEvent({
  42851. type: "finished",
  42852. action: this,
  42853. direction: 0 < e ? 1 : -1
  42854. });
  42855. break
  42856. }
  42857. if (0 == s) {
  42858. var l = e < 0;
  42859. this._setEndings(l, !l, o)
  42860. } else
  42861. this._setEndings(!1, !1, o);
  42862. this._loopCount = r,
  42863. this._mixer.dispatchEvent({
  42864. type: "loop",
  42865. action: this,
  42866. loopDelta: a
  42867. })
  42868. }
  42869. if (n === Ci.LoopPingPong && 1 == (1 & r))
  42870. return i - (this.time = t)
  42871. }
  42872. return this.time = t
  42873. },
  42874. _setEndings: function(e, t, i) {
  42875. var n = this._interpolantSettings;
  42876. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  42877. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  42878. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  42879. },
  42880. _scheduleFading: function(e, t, i) {
  42881. var n = this._mixer
  42882. , r = n.time
  42883. , o = this._weightInterpolant;
  42884. null === o && (o = n._lendControlInterpolant(),
  42885. this._weightInterpolant = o);
  42886. var a = o.parameterPositions
  42887. , s = o.sampleValues;
  42888. return a[0] = r,
  42889. s[0] = t,
  42890. a[1] = r + e,
  42891. s[1] = i,
  42892. this
  42893. }
  42894. },
  42895. Object.assign(Ci.AnimationMixer.prototype, {
  42896. _bindAction: function(e, t) {
  42897. var i = e._localRoot || this._root
  42898. , n = e._clip.tracks
  42899. , r = n.length
  42900. , o = e._propertyBindings
  42901. , a = e._interpolants
  42902. , s = i.uuid
  42903. , l = this._bindingsByRootAndName
  42904. , c = l[s];
  42905. void 0 === c && (c = {},
  42906. l[s] = c);
  42907. for (var h = 0; h !== r; ++h) {
  42908. var u = n[h]
  42909. , d = u.name
  42910. , p = c[d];
  42911. if (void 0 !== p)
  42912. o[h] = p;
  42913. else {
  42914. if (void 0 !== (p = o[h])) {
  42915. null === p._cacheIndex && (++p.referenceCount,
  42916. this._addInactiveBinding(p, s, d));
  42917. continue
  42918. }
  42919. var f = t && t._propertyBindings[h].binding.parsedPath;
  42920. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  42921. this._addInactiveBinding(p, s, d),
  42922. o[h] = p
  42923. }
  42924. a[h].resultBuffer = p.buffer
  42925. }
  42926. },
  42927. _activateAction: function(e) {
  42928. if (!this._isActiveAction(e)) {
  42929. if (null === e._cacheIndex) {
  42930. var t = (e._localRoot || this._root).uuid
  42931. , i = e._clip.name
  42932. , n = this._actionsByClip[i];
  42933. this._bindAction(e, n && n.knownActions[0]),
  42934. this._addInactiveAction(e, i, t)
  42935. }
  42936. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  42937. var s = r[o];
  42938. 0 == s.useCount++ && (this._lendBinding(s),
  42939. s.saveOriginalState())
  42940. }
  42941. this._lendAction(e)
  42942. }
  42943. },
  42944. _deactivateAction: function(e) {
  42945. if (this._isActiveAction(e)) {
  42946. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  42947. var r = t[i];
  42948. 0 == --r.useCount && (r.restoreOriginalState(),
  42949. this._takeBackBinding(r))
  42950. }
  42951. this._takeBackAction(e)
  42952. }
  42953. },
  42954. _initMemoryManager: function() {
  42955. this._actions = [],
  42956. this._nActiveActions = 0,
  42957. this._actionsByClip = {},
  42958. this._bindings = [],
  42959. this._nActiveBindings = 0,
  42960. this._bindingsByRootAndName = {},
  42961. this._controlInterpolants = [],
  42962. this._nActiveControlInterpolants = 0;
  42963. var e = this;
  42964. this.stats = {
  42965. actions: {
  42966. get total() {
  42967. return e._actions.length
  42968. },
  42969. get inUse() {
  42970. return e._nActiveActions
  42971. }
  42972. },
  42973. bindings: {
  42974. get total() {
  42975. return e._bindings.length
  42976. },
  42977. get inUse() {
  42978. return e._nActiveBindings
  42979. }
  42980. },
  42981. controlInterpolants: {
  42982. get total() {
  42983. return e._controlInterpolants.length
  42984. },
  42985. get inUse() {
  42986. return e._nActiveControlInterpolants
  42987. }
  42988. }
  42989. }
  42990. },
  42991. _isActiveAction: function(e) {
  42992. var t = e._cacheIndex;
  42993. return null !== t && t < this._nActiveActions
  42994. },
  42995. _addInactiveAction: function(e, t, i) {
  42996. var n = this._actions
  42997. , r = this._actionsByClip
  42998. , o = r[t];
  42999. if (void 0 === o)
  43000. o = {
  43001. knownActions: [e],
  43002. actionByRoot: {}
  43003. },
  43004. e._byClipCacheIndex = 0,
  43005. r[t] = o;
  43006. else {
  43007. var a = o.knownActions;
  43008. e._byClipCacheIndex = a.length,
  43009. a.push(e)
  43010. }
  43011. e._cacheIndex = n.length,
  43012. n.push(e),
  43013. o.actionByRoot[i] = e
  43014. },
  43015. _removeInactiveAction: function(e) {
  43016. var t = this._actions
  43017. , i = t[t.length - 1]
  43018. , n = e._cacheIndex;
  43019. t[i._cacheIndex = n] = i,
  43020. t.pop(),
  43021. e._cacheIndex = null;
  43022. var r = e._clip.name
  43023. , o = this._actionsByClip
  43024. , a = o[r]
  43025. , s = a.knownActions
  43026. , l = s[s.length - 1]
  43027. , c = e._byClipCacheIndex;
  43028. s[l._byClipCacheIndex = c] = l,
  43029. s.pop(),
  43030. e._byClipCacheIndex = null,
  43031. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43032. 0 === s.length && delete o[r],
  43033. this._removeInactiveBindingsForAction(e)
  43034. },
  43035. _removeInactiveBindingsForAction: function(e) {
  43036. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43037. var r = t[i];
  43038. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43039. }
  43040. },
  43041. _lendAction: function(e) {
  43042. var t = this._actions
  43043. , i = e._cacheIndex
  43044. , n = this._nActiveActions++
  43045. , r = t[n];
  43046. t[e._cacheIndex = n] = e,
  43047. t[r._cacheIndex = i] = r
  43048. },
  43049. _takeBackAction: function(e) {
  43050. var t = this._actions
  43051. , i = e._cacheIndex
  43052. , n = --this._nActiveActions
  43053. , r = t[n];
  43054. t[e._cacheIndex = n] = e,
  43055. t[r._cacheIndex = i] = r
  43056. },
  43057. _addInactiveBinding: function(e, t, i) {
  43058. var n = this._bindingsByRootAndName
  43059. , r = n[t]
  43060. , o = this._bindings;
  43061. void 0 === r && (r = {},
  43062. n[t] = r),
  43063. (r[i] = e)._cacheIndex = o.length,
  43064. o.push(e)
  43065. },
  43066. _removeInactiveBinding: function(e) {
  43067. var t = this._bindings
  43068. , i = e.binding
  43069. , n = i.rootNode.uuid
  43070. , r = i.path
  43071. , o = this._bindingsByRootAndName
  43072. , a = o[n]
  43073. , s = t[t.length - 1]
  43074. , l = e._cacheIndex;
  43075. t[s._cacheIndex = l] = s,
  43076. t.pop(),
  43077. delete a[r];
  43078. e: {
  43079. for (var c in a)
  43080. break e;
  43081. delete o[n]
  43082. }
  43083. },
  43084. _lendBinding: function(e) {
  43085. var t = this._bindings
  43086. , i = e._cacheIndex
  43087. , n = this._nActiveBindings++
  43088. , r = t[n];
  43089. t[e._cacheIndex = n] = e,
  43090. t[r._cacheIndex = i] = r
  43091. },
  43092. _takeBackBinding: function(e) {
  43093. var t = this._bindings
  43094. , i = e._cacheIndex
  43095. , n = --this._nActiveBindings
  43096. , r = t[n];
  43097. t[e._cacheIndex = n] = e,
  43098. t[r._cacheIndex = i] = r
  43099. },
  43100. _lendControlInterpolant: function() {
  43101. var e = this._controlInterpolants
  43102. , t = this._nActiveControlInterpolants++
  43103. , i = e[t];
  43104. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43105. i
  43106. },
  43107. _takeBackControlInterpolant: function(e) {
  43108. var t = this._controlInterpolants
  43109. , i = e.__cacheIndex
  43110. , n = --this._nActiveControlInterpolants
  43111. , r = t[n];
  43112. t[e.__cacheIndex = n] = e,
  43113. t[r.__cacheIndex = i] = r
  43114. },
  43115. _controlInterpolantsResultBuffer: new Float32Array(1)
  43116. }),
  43117. Ci.AnimationObjectGroup = function(e) {
  43118. this.uuid = Ci.Math.generateUUID(),
  43119. this._objects = Array.prototype.slice.call(arguments),
  43120. this.nCachedObjects_ = 0;
  43121. var t = {};
  43122. this._indicesByUUID = t;
  43123. for (var i = 0, n = arguments.length; i !== n; ++i)
  43124. t[arguments[i].uuid] = i;
  43125. this._paths = [],
  43126. this._parsedPaths = [],
  43127. this._bindings = [],
  43128. this._bindingsIndicesByPath = {};
  43129. var r = this;
  43130. this.stats = {
  43131. objects: {
  43132. get total() {
  43133. return r._objects.length
  43134. },
  43135. get inUse() {
  43136. return this.total - r.nCachedObjects_
  43137. }
  43138. },
  43139. get bindingsPerObject() {
  43140. return r._bindings.length
  43141. }
  43142. }
  43143. }
  43144. ,
  43145. Ci.AnimationObjectGroup.prototype = {
  43146. constructor: Ci.AnimationObjectGroup,
  43147. add: function(e) {
  43148. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  43149. var u = arguments[c]
  43150. , d = u.uuid
  43151. , p = r[d];
  43152. if (void 0 === p) {
  43153. p = i++,
  43154. r[d] = p,
  43155. t.push(u);
  43156. for (var f = 0, g = l; f !== g; ++f)
  43157. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43158. } else if (p < n) {
  43159. var m = t[p]
  43160. , v = --n
  43161. , y = t[v];
  43162. t[r[y.uuid] = p] = y,
  43163. t[r[d] = v] = u;
  43164. for (f = 0,
  43165. g = l; f !== g; ++f) {
  43166. var A = s[f]
  43167. , C = A[v]
  43168. , I = A[p];
  43169. A[p] = C,
  43170. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43171. A[v] = I
  43172. }
  43173. } else
  43174. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43175. }
  43176. this.nCachedObjects_ = n
  43177. },
  43178. remove: function(e) {
  43179. for (var t = this._objects, i = (t.length,
  43180. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43181. var l = arguments[a]
  43182. , c = l.uuid
  43183. , h = n[c];
  43184. if (void 0 !== h && i <= h) {
  43185. var u = i++
  43186. , d = t[u];
  43187. t[n[d.uuid] = h] = d,
  43188. t[n[c] = u] = l;
  43189. for (var p = 0, f = o; p !== f; ++p) {
  43190. var g = r[p]
  43191. , m = g[u]
  43192. , v = g[h];
  43193. g[h] = m,
  43194. g[u] = v
  43195. }
  43196. }
  43197. }
  43198. this.nCachedObjects_ = i
  43199. },
  43200. uncache: function(e) {
  43201. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  43202. var c = arguments[s].uuid
  43203. , h = r[c];
  43204. if (void 0 !== h)
  43205. if (delete r[c],
  43206. h < n) {
  43207. var u = --n
  43208. , d = t[u]
  43209. , p = t[y = --i];
  43210. t[r[d.uuid] = h] = d,
  43211. t[r[p.uuid] = u] = p,
  43212. t.pop();
  43213. for (var f = 0, g = a; f !== g; ++f) {
  43214. var m = (A = o[f])[u]
  43215. , v = A[y];
  43216. A[h] = m,
  43217. A[u] = v,
  43218. A.pop()
  43219. }
  43220. } else {
  43221. var y;
  43222. t[r[(p = t[y = --i]).uuid] = h] = p,
  43223. t.pop();
  43224. for (f = 0,
  43225. g = a; f !== g; ++f) {
  43226. var A;
  43227. (A = o[f])[h] = A[y],
  43228. A.pop()
  43229. }
  43230. }
  43231. }
  43232. this.nCachedObjects_ = n
  43233. },
  43234. subscribe_: function(e, t) {
  43235. var i = this._bindingsIndicesByPath
  43236. , n = i[e]
  43237. , r = this._bindings;
  43238. if (void 0 !== n)
  43239. return r[n];
  43240. var o = this._paths
  43241. , a = this._parsedPaths
  43242. , s = this._objects
  43243. , l = s.length
  43244. , c = this.nCachedObjects_
  43245. , h = new Array(l);
  43246. n = r.length,
  43247. i[e] = n,
  43248. o.push(e),
  43249. a.push(t),
  43250. r.push(h);
  43251. for (var u = c, d = s.length; u !== d; ++u) {
  43252. var p = s[u];
  43253. h[u] = new Ci.PropertyBinding(p,e,t)
  43254. }
  43255. return h
  43256. },
  43257. unsubscribe_: function(e) {
  43258. var t = this._bindingsIndicesByPath
  43259. , i = t[e];
  43260. if (void 0 !== i) {
  43261. var n = this._paths
  43262. , r = this._parsedPaths
  43263. , o = this._bindings
  43264. , a = o.length - 1
  43265. , s = o[a];
  43266. o[t[e[a]] = i] = s,
  43267. o.pop(),
  43268. r[i] = r[a],
  43269. r.pop(),
  43270. n[i] = n[a],
  43271. n.pop()
  43272. }
  43273. }
  43274. },
  43275. Ci.AnimationUtils = {
  43276. arraySlice: function(e, t, i) {
  43277. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43278. },
  43279. convertArray: function(e, t, i) {
  43280. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43281. },
  43282. isTypedArray: function(e) {
  43283. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43284. },
  43285. getKeyframeOrder: function(i) {
  43286. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43287. t[n] = n;
  43288. return t.sort(function(e, t) {
  43289. return i[e] - i[t]
  43290. }),
  43291. t
  43292. },
  43293. sortedArray: function(e, t, i) {
  43294. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43295. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43296. r[a++] = e[s + l];
  43297. return r
  43298. },
  43299. flattenJSON: function(e, t, i, n) {
  43300. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43301. o = e[r++];
  43302. if (void 0 !== o) {
  43303. var a = o[n];
  43304. if (void 0 !== a)
  43305. if (Array.isArray(a))
  43306. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43307. i.push.apply(i, a)),
  43308. void 0 !== (o = e[r++]); )
  43309. ;
  43310. else if (void 0 !== a.toArray)
  43311. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43312. a.toArray(i, i.length)),
  43313. void 0 !== (o = e[r++]); )
  43314. ;
  43315. else
  43316. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43317. i.push(a)),
  43318. void 0 !== (o = e[r++]); )
  43319. ;
  43320. }
  43321. }
  43322. },
  43323. Ci.KeyframeTrack = function(e, t, i, n) {
  43324. if (void 0 === e)
  43325. throw new Error("track name is undefined");
  43326. if (void 0 === t || 0 === t.length)
  43327. throw new Error("no keyframes in track named " + e);
  43328. this.name = e,
  43329. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43330. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43331. this.setInterpolation(n || this.DefaultInterpolation),
  43332. this.validate(),
  43333. this.optimize()
  43334. }
  43335. ,
  43336. Ci.KeyframeTrack.prototype = {
  43337. constructor: Ci.KeyframeTrack,
  43338. TimeBufferType: Float32Array,
  43339. ValueBufferType: Float32Array,
  43340. DefaultInterpolation: Ci.InterpolateLinear,
  43341. InterpolantFactoryMethodDiscrete: function(e) {
  43342. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43343. },
  43344. InterpolantFactoryMethodLinear: function(e) {
  43345. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43346. },
  43347. InterpolantFactoryMethodSmooth: function(e) {
  43348. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43349. },
  43350. setInterpolation: function(e) {
  43351. var t = void 0;
  43352. switch (e) {
  43353. case Ci.InterpolateDiscrete:
  43354. t = this.InterpolantFactoryMethodDiscrete;
  43355. break;
  43356. case Ci.InterpolateLinear:
  43357. t = this.InterpolantFactoryMethodLinear;
  43358. break;
  43359. case Ci.InterpolateSmooth:
  43360. t = this.InterpolantFactoryMethodSmooth
  43361. }
  43362. if (void 0 !== t)
  43363. this.createInterpolant = t;
  43364. else {
  43365. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43366. if (void 0 === this.createInterpolant) {
  43367. if (e === this.DefaultInterpolation)
  43368. throw new Error(i);
  43369. this.setInterpolation(this.DefaultInterpolation)
  43370. }
  43371. console.warn(i)
  43372. }
  43373. },
  43374. getInterpolation: function() {
  43375. switch (this.createInterpolant) {
  43376. case this.InterpolantFactoryMethodDiscrete:
  43377. return Ci.InterpolateDiscrete;
  43378. case this.InterpolantFactoryMethodLinear:
  43379. return Ci.InterpolateLinear;
  43380. case this.InterpolantFactoryMethodSmooth:
  43381. return Ci.InterpolateSmooth
  43382. }
  43383. },
  43384. getValueSize: function() {
  43385. return this.values.length / this.times.length
  43386. },
  43387. shift: function(e) {
  43388. if (0 !== e)
  43389. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43390. t[i] += e;
  43391. return this
  43392. },
  43393. scale: function(e) {
  43394. if (1 !== e)
  43395. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43396. t[i] *= e;
  43397. return this
  43398. },
  43399. trim: function(e, t) {
  43400. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43401. ++r;
  43402. for (; -1 !== o && i[o] > t; )
  43403. --o;
  43404. if (++o,
  43405. 0 !== r || o !== n) {
  43406. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43407. var a = this.getValueSize();
  43408. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43409. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43410. }
  43411. return this
  43412. },
  43413. validate: function() {
  43414. var e = !0
  43415. , t = this.getValueSize();
  43416. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43417. e = !1);
  43418. var i = this.times
  43419. , n = this.values
  43420. , r = i.length;
  43421. 0 === r && (console.error("track is empty", this),
  43422. e = !1);
  43423. for (var o = null, a = 0; a !== r; a++) {
  43424. var s = i[a];
  43425. if ("number" == typeof s && isNaN(s)) {
  43426. console.error("time is not a valid number", this, a, s),
  43427. e = !1;
  43428. break
  43429. }
  43430. if (null !== o && s < o) {
  43431. console.error("out of order keys", this, a, s, o),
  43432. e = !1;
  43433. break
  43434. }
  43435. o = s
  43436. }
  43437. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43438. a = 0;
  43439. for (var l = n.length; a !== l; ++a) {
  43440. var c = n[a];
  43441. if (isNaN(c)) {
  43442. console.error("value is not a valid number", this, a, c),
  43443. e = !1;
  43444. break
  43445. }
  43446. }
  43447. }
  43448. return e
  43449. },
  43450. optimize: function() {
  43451. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43452. var a = !1
  43453. , s = e[r];
  43454. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43455. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43456. var d = t[l + u];
  43457. if (d !== t[c + u] || d !== t[h + u]) {
  43458. a = !0;
  43459. break
  43460. }
  43461. }
  43462. if (a) {
  43463. if (r !== n) {
  43464. e[n] = e[r];
  43465. var p = r * i
  43466. , f = n * i;
  43467. for (u = 0; u !== i; ++u)
  43468. t[f + u] = t[p + u]
  43469. }
  43470. ++n
  43471. }
  43472. }
  43473. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43474. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43475. this
  43476. }
  43477. },
  43478. Object.assign(Ci.KeyframeTrack, {
  43479. parse: function(e) {
  43480. if (void 0 === e.type)
  43481. throw new Error("track type undefined, can not parse");
  43482. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43483. if (void 0 === e.times) {
  43484. console.warn("legacy JSON format detected, converting");
  43485. var i = []
  43486. , n = [];
  43487. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43488. e.times = i,
  43489. e.values = n
  43490. }
  43491. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43492. },
  43493. toJSON: function(e) {
  43494. var t, i = e.constructor;
  43495. if (void 0 !== i.toJSON)
  43496. t = i.toJSON(e);
  43497. else {
  43498. t = {
  43499. name: e.name,
  43500. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43501. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43502. };
  43503. var n = e.getInterpolation();
  43504. n !== e.DefaultInterpolation && (t.interpolation = n)
  43505. }
  43506. return t.type = e.ValueTypeName,
  43507. t
  43508. },
  43509. _getTrackTypeForValueTypeName: function(e) {
  43510. switch (e.toLowerCase()) {
  43511. case "scalar":
  43512. case "double":
  43513. case "float":
  43514. case "number":
  43515. case "integer":
  43516. return Ci.NumberKeyframeTrack;
  43517. case "vector":
  43518. case "vector2":
  43519. case "vector3":
  43520. case "vector4":
  43521. return Ci.VectorKeyframeTrack;
  43522. case "color":
  43523. return Ci.ColorKeyframeTrack;
  43524. case "quaternion":
  43525. return Ci.QuaternionKeyframeTrack;
  43526. case "bool":
  43527. case "boolean":
  43528. return Ci.BooleanKeyframeTrack;
  43529. case "string":
  43530. return Ci.StringKeyframeTrack
  43531. }
  43532. throw new Error("Unsupported typeName: " + e)
  43533. }
  43534. }),
  43535. Ci.PropertyBinding = function(e, t, i) {
  43536. this.path = t,
  43537. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43538. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43539. this.rootNode = e
  43540. }
  43541. ,
  43542. Ci.PropertyBinding.prototype = {
  43543. constructor: Ci.PropertyBinding,
  43544. getValue: function(e, t) {
  43545. this.bind(),
  43546. this.getValue(e, t)
  43547. },
  43548. setValue: function(e, t) {
  43549. this.bind(),
  43550. this.setValue(e, t)
  43551. },
  43552. bind: function() {
  43553. var e = this.node
  43554. , t = this.parsedPath
  43555. , i = t.objectName
  43556. , n = t.propertyName
  43557. , r = t.propertyIndex;
  43558. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43559. this.node = e),
  43560. this.getValue = this._getValue_unavailable,
  43561. this.setValue = this._setValue_unavailable,
  43562. e) {
  43563. if (i) {
  43564. var o = t.objectIndex;
  43565. switch (i) {
  43566. case "materials":
  43567. if (!e.material)
  43568. return void console.error(" can not bind to material as node does not have a material", this);
  43569. if (!e.material.materials)
  43570. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43571. e = e.material.materials;
  43572. break;
  43573. case "bones":
  43574. if (!e.skeleton)
  43575. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43576. e = e.skeleton.bones;
  43577. for (var a = 0; a < e.length; a++)
  43578. if (e[a].name === o) {
  43579. o = a;
  43580. break
  43581. }
  43582. break;
  43583. default:
  43584. if (void 0 === e[i])
  43585. return void console.error(" can not bind to objectName of node, undefined", this);
  43586. e = e[i]
  43587. }
  43588. if (void 0 !== o) {
  43589. if (void 0 === e[o])
  43590. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43591. e = e[o]
  43592. }
  43593. }
  43594. var s = e[n];
  43595. if (s) {
  43596. var l = this.Versioning.None;
  43597. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43598. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43599. this.targetObject = e);
  43600. var c = this.BindingType.Direct;
  43601. if (void 0 !== r) {
  43602. if ("morphTargetInfluences" === n) {
  43603. if (!e.geometry)
  43604. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43605. if (!e.geometry.morphTargets)
  43606. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43607. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43608. if (e.geometry.morphTargets[a].name === r) {
  43609. r = a;
  43610. break
  43611. }
  43612. }
  43613. c = this.BindingType.ArrayElement,
  43614. this.resolvedProperty = s,
  43615. this.propertyIndex = r
  43616. } else
  43617. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43618. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43619. this.resolvedProperty = s) : this.propertyName = n;
  43620. this.getValue = this.GetterByBindingType[c],
  43621. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43622. } else {
  43623. var h = t.nodeName;
  43624. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43625. }
  43626. } else
  43627. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43628. },
  43629. unbind: function() {
  43630. this.node = null,
  43631. this.getValue = this._getValue_unbound,
  43632. this.setValue = this._setValue_unbound
  43633. }
  43634. },
  43635. Object.assign(Ci.PropertyBinding.prototype, {
  43636. _getValue_unavailable: function() {},
  43637. _setValue_unavailable: function() {},
  43638. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43639. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43640. BindingType: {
  43641. Direct: 0,
  43642. EntireArray: 1,
  43643. ArrayElement: 2,
  43644. HasFromToArray: 3
  43645. },
  43646. Versioning: {
  43647. None: 0,
  43648. NeedsUpdate: 1,
  43649. MatrixWorldNeedsUpdate: 2
  43650. },
  43651. GetterByBindingType: [function(e, t) {
  43652. e[t] = this.node[this.propertyName]
  43653. }
  43654. , function(e, t) {
  43655. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43656. e[t++] = i[n]
  43657. }
  43658. , function(e, t) {
  43659. e[t] = this.resolvedProperty[this.propertyIndex]
  43660. }
  43661. , function(e, t) {
  43662. this.resolvedProperty.toArray(e, t)
  43663. }
  43664. ],
  43665. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43666. this.node[this.propertyName] = e[t]
  43667. }
  43668. , function(e, t) {
  43669. this.node[this.propertyName] = e[t],
  43670. this.targetObject.needsUpdate = !0
  43671. }
  43672. , function(e, t) {
  43673. this.node[this.propertyName] = e[t],
  43674. this.targetObject.matrixWorldNeedsUpdate = !0
  43675. }
  43676. ], [function(e, t) {
  43677. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43678. i[n] = e[t++]
  43679. }
  43680. , function(e, t) {
  43681. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43682. i[n] = e[t++];
  43683. this.targetObject.needsUpdate = !0
  43684. }
  43685. , function(e, t) {
  43686. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43687. i[n] = e[t++];
  43688. this.targetObject.matrixWorldNeedsUpdate = !0
  43689. }
  43690. ], [function(e, t) {
  43691. this.resolvedProperty[this.propertyIndex] = e[t]
  43692. }
  43693. , function(e, t) {
  43694. this.resolvedProperty[this.propertyIndex] = e[t],
  43695. this.targetObject.needsUpdate = !0
  43696. }
  43697. , function(e, t) {
  43698. this.resolvedProperty[this.propertyIndex] = e[t],
  43699. this.targetObject.matrixWorldNeedsUpdate = !0
  43700. }
  43701. ], [function(e, t) {
  43702. this.resolvedProperty.fromArray(e, t)
  43703. }
  43704. , function(e, t) {
  43705. this.resolvedProperty.fromArray(e, t),
  43706. this.targetObject.needsUpdate = !0
  43707. }
  43708. , function(e, t) {
  43709. this.resolvedProperty.fromArray(e, t),
  43710. this.targetObject.matrixWorldNeedsUpdate = !0
  43711. }
  43712. ]]
  43713. }),
  43714. Ci.PropertyBinding.Composite = function(e, t, i) {
  43715. var n = i || Ci.PropertyBinding.parseTrackName(t);
  43716. this._targetGroup = e,
  43717. this._bindings = e.subscribe_(t, n)
  43718. }
  43719. ,
  43720. Ci.PropertyBinding.Composite.prototype = {
  43721. constructor: Ci.PropertyBinding.Composite,
  43722. getValue: function(e, t) {
  43723. this.bind();
  43724. var i = this._targetGroup.nCachedObjects_
  43725. , n = this._bindings[i];
  43726. void 0 !== n && n.getValue(e, t)
  43727. },
  43728. setValue: function(e, t) {
  43729. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  43730. i[n].setValue(e, t)
  43731. },
  43732. bind: function() {
  43733. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43734. e[t].bind()
  43735. },
  43736. unbind: function() {
  43737. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43738. e[t].unbind()
  43739. }
  43740. },
  43741. Ci.PropertyBinding.create = function(e, t, i) {
  43742. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  43743. }
  43744. ,
  43745. Ci.PropertyBinding.parseTrackName = function(e) {
  43746. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  43747. , i = t.exec(e);
  43748. if (!i)
  43749. throw new Error("cannot parse trackName at all: " + e);
  43750. i.index === t.lastIndex && t.lastIndex++;
  43751. var n = {
  43752. nodeName: i[3],
  43753. objectName: i[5],
  43754. objectIndex: i[7],
  43755. propertyName: i[9],
  43756. propertyIndex: i[11]
  43757. };
  43758. if (null === n.propertyName || 0 === n.propertyName.length)
  43759. throw new Error("can not parse propertyName from trackName: " + e);
  43760. return n
  43761. }
  43762. ,
  43763. Ci.PropertyBinding.findNode = function(e, r) {
  43764. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  43765. return e;
  43766. if (e.skeleton) {
  43767. var t = function(e) {
  43768. for (var t = 0; t < e.bones.length; t++) {
  43769. var i = e.bones[t];
  43770. if (i.name === r)
  43771. return i
  43772. }
  43773. return null
  43774. }(e.skeleton);
  43775. if (t)
  43776. return t
  43777. }
  43778. if (e.children) {
  43779. var o = function(e) {
  43780. for (var t = 0; t < e.length; t++) {
  43781. var i = e[t];
  43782. if (i.name === r || i.uuid === r)
  43783. return i;
  43784. var n = o(i.children);
  43785. if (n)
  43786. return n
  43787. }
  43788. return null
  43789. }
  43790. , i = o(e.children);
  43791. if (i)
  43792. return i
  43793. }
  43794. return null
  43795. }
  43796. ,
  43797. Ci.PropertyMixer = function(e, t, i) {
  43798. this.binding = e,
  43799. this.valueSize = i;
  43800. var n, r = Float64Array;
  43801. switch (t) {
  43802. case "quaternion":
  43803. n = this._slerp;
  43804. break;
  43805. case "string":
  43806. case "bool":
  43807. r = Array,
  43808. n = this._select;
  43809. break;
  43810. default:
  43811. n = this._lerp
  43812. }
  43813. this.buffer = new r(4 * i),
  43814. this._mixBufferRegion = n,
  43815. this.cumulativeWeight = 0,
  43816. this.useCount = 0,
  43817. this.referenceCount = 0
  43818. }
  43819. ,
  43820. Ci.PropertyMixer.prototype = {
  43821. constructor: Ci.PropertyMixer,
  43822. accumulate: function(e, t) {
  43823. var i = this.buffer
  43824. , n = this.valueSize
  43825. , r = e * n + n
  43826. , o = this.cumulativeWeight;
  43827. if (0 === o) {
  43828. for (var a = 0; a !== n; ++a)
  43829. i[r + a] = i[a];
  43830. o = t
  43831. } else {
  43832. var s = t / (o += t);
  43833. this._mixBufferRegion(i, r, 0, s, n)
  43834. }
  43835. this.cumulativeWeight = o
  43836. },
  43837. apply: function(e) {
  43838. var t = this.valueSize
  43839. , i = this.buffer
  43840. , n = e * t + t
  43841. , r = this.cumulativeWeight
  43842. , o = this.binding;
  43843. if (this.cumulativeWeight = 0,
  43844. r < 1) {
  43845. var a = 3 * t;
  43846. this._mixBufferRegion(i, n, a, 1 - r, t)
  43847. }
  43848. for (var s = t, l = t + t; s !== l; ++s)
  43849. if (i[s] !== i[s + t]) {
  43850. o.setValue(i, n);
  43851. break
  43852. }
  43853. },
  43854. saveOriginalState: function() {
  43855. var e = this.binding
  43856. , t = this.buffer
  43857. , i = this.valueSize
  43858. , n = 3 * i;
  43859. e.getValue(t, n);
  43860. for (var r = i, o = n; r !== o; ++r)
  43861. t[r] = t[n + r % i];
  43862. this.cumulativeWeight = 0
  43863. },
  43864. restoreOriginalState: function() {
  43865. var e = 3 * this.valueSize;
  43866. this.binding.setValue(this.buffer, e)
  43867. },
  43868. _select: function(e, t, i, n, r) {
  43869. if (.5 <= n)
  43870. for (var o = 0; o !== r; ++o)
  43871. e[t + o] = e[i + o]
  43872. },
  43873. _slerp: function(e, t, i, n, r) {
  43874. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  43875. },
  43876. _lerp: function(e, t, i, n, r) {
  43877. for (var o = 1 - n, a = 0; a !== r; ++a) {
  43878. var s = t + a;
  43879. e[s] = e[s] * o + e[i + a] * n
  43880. }
  43881. }
  43882. },
  43883. Ci.BooleanKeyframeTrack = function(e, t, i) {
  43884. Ci.KeyframeTrack.call(this, e, t, i)
  43885. }
  43886. ,
  43887. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43888. constructor: Ci.BooleanKeyframeTrack,
  43889. ValueTypeName: "bool",
  43890. ValueBufferType: Array,
  43891. DefaultInterpolation: Ci.IntepolateDiscrete,
  43892. InterpolantFactoryMethodLinear: void 0,
  43893. InterpolantFactoryMethodSmooth: void 0
  43894. }),
  43895. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  43896. Ci.KeyframeTrack.call(this, e, t, i, n)
  43897. }
  43898. ,
  43899. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43900. constructor: Ci.NumberKeyframeTrack,
  43901. ValueTypeName: "number"
  43902. }),
  43903. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  43904. Ci.KeyframeTrack.call(this, e, t, i, n)
  43905. }
  43906. ,
  43907. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43908. constructor: Ci.QuaternionKeyframeTrack,
  43909. ValueTypeName: "quaternion",
  43910. DefaultInterpolation: Ci.InterpolateLinear,
  43911. InterpolantFactoryMethodLinear: function(e) {
  43912. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43913. },
  43914. InterpolantFactoryMethodSmooth: void 0
  43915. }),
  43916. Ci.StringKeyframeTrack = function(e, t, i, n) {
  43917. Ci.KeyframeTrack.call(this, e, t, i, n)
  43918. }
  43919. ,
  43920. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43921. constructor: Ci.StringKeyframeTrack,
  43922. ValueTypeName: "string",
  43923. ValueBufferType: Array,
  43924. DefaultInterpolation: Ci.IntepolateDiscrete,
  43925. InterpolantFactoryMethodLinear: void 0,
  43926. InterpolantFactoryMethodSmooth: void 0
  43927. }),
  43928. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  43929. Ci.KeyframeTrack.call(this, e, t, i, n)
  43930. }
  43931. ,
  43932. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43933. constructor: Ci.VectorKeyframeTrack,
  43934. ValueTypeName: "vector"
  43935. }),
  43936. Ci.Audio = function(e) {
  43937. Ci.Object3D.call(this),
  43938. this.type = "Audio",
  43939. this.context = e.context,
  43940. this.source = this.context.createBufferSource(),
  43941. this.source.onended = this.onEnded.bind(this),
  43942. this.gain = this.context.createGain(),
  43943. this.gain.connect(e.getInput()),
  43944. this.autoplay = !1,
  43945. this.startTime = 0,
  43946. this.playbackRate = 1,
  43947. this.isPlaying = !1,
  43948. this.hasPlaybackControl = !0,
  43949. this.sourceType = "empty",
  43950. this.filter = null
  43951. }
  43952. ,
  43953. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  43954. Ci.Audio.prototype.constructor = Ci.Audio,
  43955. Ci.Audio.prototype.getOutput = function() {
  43956. return this.gain
  43957. }
  43958. ,
  43959. Ci.Audio.prototype.load = function(e) {
  43960. var t = new Ci.AudioBuffer(this.context);
  43961. return t.load(e),
  43962. this.setBuffer(t),
  43963. this
  43964. }
  43965. ,
  43966. Ci.Audio.prototype.setNodeSource = function(e) {
  43967. return this.hasPlaybackControl = !1,
  43968. this.sourceType = "audioNode",
  43969. this.source = e,
  43970. this.connect(),
  43971. this
  43972. }
  43973. ,
  43974. Ci.Audio.prototype.setBuffer = function(e) {
  43975. var t = this;
  43976. return e.onReady(function(e) {
  43977. t.source.buffer = e,
  43978. t.sourceType = "buffer",
  43979. t.autoplay && t.play()
  43980. }),
  43981. this
  43982. }
  43983. ,
  43984. Ci.Audio.prototype.play = function() {
  43985. if (!0 !== this.isPlaying)
  43986. if (!1 !== this.hasPlaybackControl) {
  43987. var e = this.context.createBufferSource();
  43988. e.buffer = this.source.buffer,
  43989. e.loop = this.source.loop,
  43990. e.onended = this.source.onended,
  43991. e.start(0, this.startTime),
  43992. e.playbackRate.value = this.playbackRate,
  43993. this.isPlaying = !0,
  43994. this.source = e,
  43995. this.connect()
  43996. } else
  43997. console.warn("THREE.Audio: this Audio has no playback control.");
  43998. else
  43999. console.warn("THREE.Audio: Audio is already playing.")
  44000. }
  44001. ,
  44002. Ci.Audio.prototype.pause = function() {
  44003. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44004. void (this.startTime = this.context.currentTime))
  44005. }
  44006. ,
  44007. Ci.Audio.prototype.stop = function() {
  44008. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44009. void (this.startTime = 0))
  44010. }
  44011. ,
  44012. Ci.Audio.prototype.connect = function() {
  44013. null !== this.filter ? (this.source.connect(this.filter),
  44014. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44015. }
  44016. ,
  44017. Ci.Audio.prototype.disconnect = function() {
  44018. null !== this.filter ? (this.source.disconnect(this.filter),
  44019. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44020. }
  44021. ,
  44022. Ci.Audio.prototype.getFilter = function() {
  44023. return this.filter
  44024. }
  44025. ,
  44026. Ci.Audio.prototype.setFilter = function(e) {
  44027. void 0 === e && (e = null),
  44028. !0 === this.isPlaying ? (this.disconnect(),
  44029. this.filter = e,
  44030. this.connect()) : this.filter = e
  44031. }
  44032. ,
  44033. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44034. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44035. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44036. }
  44037. ,
  44038. Ci.Audio.prototype.getPlaybackRate = function() {
  44039. return this.playbackRate
  44040. }
  44041. ,
  44042. Ci.Audio.prototype.onEnded = function() {
  44043. this.isPlaying = !1
  44044. }
  44045. ,
  44046. Ci.Audio.prototype.setLoop = function(e) {
  44047. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44048. }
  44049. ,
  44050. Ci.Audio.prototype.getLoop = function() {
  44051. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44052. !1) : this.source.loop
  44053. }
  44054. ,
  44055. Ci.Audio.prototype.setVolume = function(e) {
  44056. this.gain.gain.value = e
  44057. }
  44058. ,
  44059. Ci.Audio.prototype.getVolume = function() {
  44060. return this.gain.gain.value
  44061. }
  44062. ,
  44063. Ci.AudioAnalyser = function(e, t) {
  44064. this.analyser = e.context.createAnalyser(),
  44065. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44066. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44067. e.getOutput().connect(this.analyser)
  44068. }
  44069. ,
  44070. Ci.AudioAnalyser.prototype = {
  44071. constructor: Ci.AudioAnalyser,
  44072. getData: function() {
  44073. return this.analyser.getByteFrequencyData(this.data),
  44074. this.data
  44075. }
  44076. },
  44077. Ci.AudioBuffer = function(e) {
  44078. this.context = e,
  44079. this.ready = !1,
  44080. this.readyCallbacks = []
  44081. }
  44082. ,
  44083. Ci.AudioBuffer.prototype.load = function(e) {
  44084. var i = this
  44085. , t = new XMLHttpRequest;
  44086. return t.open("GET", e, !0),
  44087. t.responseType = "arraybuffer",
  44088. t.onload = function(e) {
  44089. i.context.decodeAudioData(this.response, function(e) {
  44090. i.buffer = e,
  44091. i.ready = !0;
  44092. for (var t = 0; t < i.readyCallbacks.length; t++)
  44093. i.readyCallbacks[t](i.buffer);
  44094. i.readyCallbacks = []
  44095. })
  44096. }
  44097. ,
  44098. t.send(),
  44099. this
  44100. }
  44101. ,
  44102. Ci.AudioBuffer.prototype.onReady = function(e) {
  44103. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44104. }
  44105. ,
  44106. Ci.PositionalAudio = function(e) {
  44107. Ci.Audio.call(this, e),
  44108. this.panner = this.context.createPanner(),
  44109. this.panner.connect(this.gain)
  44110. }
  44111. ,
  44112. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44113. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44114. Ci.PositionalAudio.prototype.getOutput = function() {
  44115. return this.panner
  44116. }
  44117. ,
  44118. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44119. this.panner.refDistance = e
  44120. }
  44121. ,
  44122. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44123. return this.panner.refDistance
  44124. }
  44125. ,
  44126. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44127. this.panner.rolloffFactor = e
  44128. }
  44129. ,
  44130. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44131. return this.panner.rolloffFactor
  44132. }
  44133. ,
  44134. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44135. this.panner.distanceModel = e
  44136. }
  44137. ,
  44138. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44139. return this.panner.distanceModel
  44140. }
  44141. ,
  44142. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44143. this.panner.maxDistance = e
  44144. }
  44145. ,
  44146. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44147. return this.panner.maxDistance
  44148. }
  44149. ,
  44150. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44151. function(e) {
  44152. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44153. it.setFromMatrixPosition(this.matrixWorld),
  44154. this.panner.setPosition(it.x, it.y, it.z)
  44155. }
  44156. ),
  44157. Ci.AudioListener = function() {
  44158. Ci.Object3D.call(this),
  44159. this.type = "AudioListener",
  44160. this.context = new (window.AudioContext || window.webkitAudioContext),
  44161. this.gain = this.context.createGain(),
  44162. this.gain.connect(this.context.destination),
  44163. this.filter = null
  44164. }
  44165. ,
  44166. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44167. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44168. Ci.AudioListener.prototype.getInput = function() {
  44169. return this.gain
  44170. }
  44171. ,
  44172. Ci.AudioListener.prototype.removeFilter = function() {
  44173. null !== this.filter && (this.gain.disconnect(this.filter),
  44174. this.filter.disconnect(this.context.destination),
  44175. this.gain.connect(this.context.destination),
  44176. this.filter = null)
  44177. }
  44178. ,
  44179. Ci.AudioListener.prototype.setFilter = function(e) {
  44180. null !== this.filter ? (this.gain.disconnect(this.filter),
  44181. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44182. this.filter = e,
  44183. this.gain.connect(this.filter),
  44184. this.filter.connect(this.context.destination)
  44185. }
  44186. ,
  44187. Ci.AudioListener.prototype.getFilter = function() {
  44188. return this.filter
  44189. }
  44190. ,
  44191. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44192. this.gain.gain.value = e
  44193. }
  44194. ,
  44195. Ci.AudioListener.prototype.getMasterVolume = function() {
  44196. return this.gain.gain.value
  44197. }
  44198. ,
  44199. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44200. $e = new Ci.Quaternion,
  44201. et = new Ci.Vector3,
  44202. tt = new Ci.Vector3,
  44203. function(e) {
  44204. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44205. var t = this.context.listener
  44206. , i = this.up;
  44207. this.matrixWorld.decompose(Je, $e, et),
  44208. tt.set(0, 0, -1).applyQuaternion($e),
  44209. t.setPosition(Je.x, Je.y, Je.z),
  44210. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44211. }
  44212. ),
  44213. Ci.Camera = function() {
  44214. Ci.Object3D.call(this),
  44215. this.type = "Camera",
  44216. this.matrixWorldInverse = new Ci.Matrix4,
  44217. this.projectionMatrix = new Ci.Matrix4
  44218. }
  44219. ,
  44220. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44221. Ci.Camera.prototype.constructor = Ci.Camera,
  44222. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44223. function(e) {
  44224. var t = e || new Ci.Vector3;
  44225. return this.getWorldQuaternion(Qe),
  44226. t.set(0, 0, -1).applyQuaternion(Qe)
  44227. }
  44228. ),
  44229. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44230. function(e) {
  44231. Ke.lookAt(this.position, e, this.up),
  44232. this.quaternion.setFromRotationMatrix(Ke)
  44233. }
  44234. ),
  44235. Ci.Camera.prototype.clone = function() {
  44236. return (new this.constructor).copy(this)
  44237. }
  44238. ,
  44239. Ci.Camera.prototype.copy = function(e) {
  44240. return Ci.Object3D.prototype.copy.call(this, e),
  44241. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44242. this.projectionMatrix.copy(e.projectionMatrix),
  44243. this
  44244. }
  44245. ,
  44246. Ci.CubeCamera = function(e, t, i) {
  44247. Ci.Object3D.call(this),
  44248. this.type = "CubeCamera";
  44249. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44250. r.up.set(0, -1, 0),
  44251. r.lookAt(new Ci.Vector3(1,0,0)),
  44252. this.add(r);
  44253. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44254. o.up.set(0, -1, 0),
  44255. o.lookAt(new Ci.Vector3(-1,0,0)),
  44256. this.add(o);
  44257. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44258. a.up.set(0, 0, 1),
  44259. a.lookAt(new Ci.Vector3(0,1,0)),
  44260. this.add(a);
  44261. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44262. s.up.set(0, 0, -1),
  44263. s.lookAt(new Ci.Vector3(0,-1,0)),
  44264. this.add(s);
  44265. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44266. l.up.set(0, -1, 0),
  44267. l.lookAt(new Ci.Vector3(0,0,1)),
  44268. this.add(l);
  44269. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44270. c.up.set(0, -1, 0),
  44271. c.lookAt(new Ci.Vector3(0,0,-1)),
  44272. this.add(c);
  44273. var n = {
  44274. format: Ci.RGBFormat,
  44275. magFilter: Ci.LinearFilter,
  44276. minFilter: Ci.LinearFilter
  44277. };
  44278. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44279. this.updateCubeMap = function(e, t) {
  44280. null === this.parent && this.updateMatrixWorld();
  44281. var i = this.renderTarget
  44282. , n = i.texture.generateMipmaps;
  44283. i.texture.generateMipmaps = !1,
  44284. i.activeCubeFace = 0,
  44285. e.render(t, r, i),
  44286. i.activeCubeFace = 1,
  44287. e.render(t, o, i),
  44288. i.activeCubeFace = 2,
  44289. e.render(t, a, i),
  44290. i.activeCubeFace = 3,
  44291. e.render(t, s, i),
  44292. i.activeCubeFace = 4,
  44293. e.render(t, l, i),
  44294. i.texture.generateMipmaps = n,
  44295. i.activeCubeFace = 5,
  44296. e.render(t, c, i),
  44297. e.setRenderTarget(null)
  44298. }
  44299. }
  44300. ,
  44301. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44302. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44303. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44304. Ci.Camera.call(this),
  44305. this.type = "OrthographicCamera",
  44306. this.zoom = 1,
  44307. this.left = e,
  44308. this.right = t,
  44309. this.top = i,
  44310. this.bottom = n,
  44311. this.near = void 0 !== r ? r : .1,
  44312. this.far = void 0 !== o ? o : 2e3,
  44313. this.updateProjectionMatrix()
  44314. }
  44315. ,
  44316. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44317. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44318. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44319. var e = (this.right - this.left) / (2 * this.zoom)
  44320. , t = (this.top - this.bottom) / (2 * this.zoom)
  44321. , i = (this.right + this.left) / 2
  44322. , n = (this.top + this.bottom) / 2;
  44323. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44324. }
  44325. ,
  44326. Ci.OrthographicCamera.prototype.copy = function(e) {
  44327. return Ci.Camera.prototype.copy.call(this, e),
  44328. this.left = e.left,
  44329. this.right = e.right,
  44330. this.top = e.top,
  44331. this.bottom = e.bottom,
  44332. this.near = e.near,
  44333. this.far = e.far,
  44334. this.zoom = e.zoom,
  44335. this
  44336. }
  44337. ,
  44338. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44339. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44340. return t.object.zoom = this.zoom,
  44341. t.object.left = this.left,
  44342. t.object.right = this.right,
  44343. t.object.top = this.top,
  44344. t.object.bottom = this.bottom,
  44345. t.object.near = this.near,
  44346. t.object.far = this.far,
  44347. t
  44348. }
  44349. ,
  44350. Ci.PerspectiveCamera = function(e, t, i, n) {
  44351. Ci.Camera.call(this),
  44352. this.type = "PerspectiveCamera",
  44353. this.focalLength = 10,
  44354. this.zoom = 1,
  44355. this.fov = void 0 !== e ? e : 50,
  44356. this.aspect = void 0 !== t ? t : 1,
  44357. this.near = void 0 !== i ? i : .1,
  44358. this.far = void 0 !== n ? n : 2e3,
  44359. this.updateProjectionMatrix()
  44360. }
  44361. ,
  44362. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44363. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44364. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44365. void 0 === t && (t = 24),
  44366. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44367. this.updateProjectionMatrix()
  44368. }
  44369. ,
  44370. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44371. this.fullWidth = e,
  44372. this.fullHeight = t,
  44373. this.x = i,
  44374. this.y = n,
  44375. this.width = r,
  44376. this.height = o,
  44377. this.updateProjectionMatrix()
  44378. }
  44379. ,
  44380. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44381. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44382. if (this.fullWidth) {
  44383. var t = this.fullWidth / this.fullHeight
  44384. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44385. , n = -i
  44386. , r = t * n
  44387. , o = t * i
  44388. , a = Math.abs(o - r)
  44389. , s = Math.abs(i - n);
  44390. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  44391. } else
  44392. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44393. }
  44394. ,
  44395. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44396. return Ci.Camera.prototype.copy.call(this, e),
  44397. this.focalLength = e.focalLength,
  44398. this.zoom = e.zoom,
  44399. this.fov = e.fov,
  44400. this.aspect = e.aspect,
  44401. this.near = e.near,
  44402. this.far = e.far,
  44403. this
  44404. }
  44405. ,
  44406. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44407. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44408. return t.object.focalLength = this.focalLength,
  44409. t.object.zoom = this.zoom,
  44410. t.object.fov = this.fov,
  44411. t.object.aspect = this.aspect,
  44412. t.object.near = this.near,
  44413. t.object.far = this.far,
  44414. t
  44415. }
  44416. ,
  44417. Ci.StereoCamera = function() {
  44418. this.type = "StereoCamera",
  44419. this.aspect = 1,
  44420. this.cameraL = new Ci.PerspectiveCamera,
  44421. this.cameraL.layers.enable(1),
  44422. this.cameraL.matrixAutoUpdate = !1,
  44423. this.cameraR = new Ci.PerspectiveCamera,
  44424. this.cameraR.layers.enable(2),
  44425. this.cameraR.matrixAutoUpdate = !1
  44426. }
  44427. ,
  44428. Ci.StereoCamera.prototype = {
  44429. constructor: Ci.StereoCamera,
  44430. update: (Xe = new Ci.Matrix4,
  44431. Ze = new Ci.Matrix4,
  44432. function(e) {
  44433. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44434. Ge = e.focalLength,
  44435. We = e.fov,
  44436. je = e.aspect * this.aspect,
  44437. Ye = e.near,
  44438. qe = e.far;
  44439. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44440. Ze.elements[12] = -.032,
  44441. Xe.elements[12] = .032,
  44442. t = -o * je + r,
  44443. i = o * je + r,
  44444. n.elements[0] = 2 * Ye / (i - t),
  44445. n.elements[8] = (i + t) / (i - t),
  44446. this.cameraL.projectionMatrix.copy(n),
  44447. t = -o * je - r,
  44448. i = o * je - r,
  44449. n.elements[0] = 2 * Ye / (i - t),
  44450. n.elements[8] = (i + t) / (i - t),
  44451. this.cameraR.projectionMatrix.copy(n)
  44452. }
  44453. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44454. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44455. }
  44456. )
  44457. },
  44458. Ci.Light = function(e, t) {
  44459. Ci.Object3D.call(this),
  44460. this.type = "Light",
  44461. this.color = new Ci.Color(e),
  44462. this.intensity = void 0 !== t ? t : 1,
  44463. this.receiveShadow = void 0
  44464. }
  44465. ,
  44466. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44467. Ci.Light.prototype.constructor = Ci.Light,
  44468. Ci.Light.prototype.copy = function(e) {
  44469. return Ci.Object3D.prototype.copy.call(this, e),
  44470. this.color.copy(e.color),
  44471. this.intensity = e.intensity,
  44472. this
  44473. }
  44474. ,
  44475. Ci.Light.prototype.toJSON = function(e) {
  44476. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44477. return t.object.color = this.color.getHex(),
  44478. t.object.intensity = this.intensity,
  44479. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44480. void 0 !== this.distance && (t.object.distance = this.distance),
  44481. void 0 !== this.angle && (t.object.angle = this.angle),
  44482. void 0 !== this.decay && (t.object.decay = this.decay),
  44483. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44484. t
  44485. }
  44486. ,
  44487. Ci.LightShadow = function(e) {
  44488. this.camera = e,
  44489. this.bias = 0,
  44490. this.radius = 1,
  44491. this.mapSize = new Ci.Vector2(512,512),
  44492. this.map = null,
  44493. this.matrix = new Ci.Matrix4
  44494. }
  44495. ,
  44496. Ci.LightShadow.prototype = {
  44497. constructor: Ci.LightShadow,
  44498. copy: function(e) {
  44499. return this.camera = e.camera.clone(),
  44500. this.bias = e.bias,
  44501. this.radius = e.radius,
  44502. this.mapSize.copy(e.mapSize),
  44503. this
  44504. },
  44505. clone: function() {
  44506. return (new this.constructor).copy(this)
  44507. }
  44508. },
  44509. Ci.AmbientLight = function(e, t) {
  44510. Ci.Light.call(this, e, t),
  44511. this.type = "AmbientLight",
  44512. this.castShadow = void 0
  44513. }
  44514. ,
  44515. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44516. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44517. Ci.DirectionalLight = function(e, t) {
  44518. Ci.Light.call(this, e, t),
  44519. this.type = "DirectionalLight",
  44520. this.position.set(0, 1, 0),
  44521. this.updateMatrix(),
  44522. this.target = new Ci.Object3D,
  44523. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44524. }
  44525. ,
  44526. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44527. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44528. Ci.DirectionalLight.prototype.copy = function(e) {
  44529. return Ci.Light.prototype.copy.call(this, e),
  44530. this.target = e.target.clone(),
  44531. this.shadow = e.shadow.clone(),
  44532. this
  44533. }
  44534. ,
  44535. Ci.HemisphereLight = function(e, t, i) {
  44536. Ci.Light.call(this, e, i),
  44537. this.type = "HemisphereLight",
  44538. this.castShadow = void 0,
  44539. this.position.set(0, 1, 0),
  44540. this.updateMatrix(),
  44541. this.groundColor = new Ci.Color(t)
  44542. }
  44543. ,
  44544. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44545. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44546. Ci.HemisphereLight.prototype.copy = function(e) {
  44547. return Ci.Light.prototype.copy.call(this, e),
  44548. this.groundColor.copy(e.groundColor),
  44549. this
  44550. }
  44551. ,
  44552. Ci.PointLight = function(e, t, i, n) {
  44553. Ci.Light.call(this, e, t),
  44554. this.type = "PointLight",
  44555. this.distance = void 0 !== i ? i : 0,
  44556. this.decay = void 0 !== n ? n : 1,
  44557. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44558. }
  44559. ,
  44560. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44561. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44562. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44563. get: function() {
  44564. return 4 * this.intensity * Math.PI
  44565. },
  44566. set: function(e) {
  44567. this.intensity = e / (4 * Math.PI)
  44568. }
  44569. }),
  44570. Ci.PointLight.prototype.copy = function(e) {
  44571. return Ci.Light.prototype.copy.call(this, e),
  44572. this.distance = e.distance,
  44573. this.decay = e.decay,
  44574. this.shadow = e.shadow.clone(),
  44575. this
  44576. }
  44577. ,
  44578. Ci.SpotLight = function(e, t, i, n, r, o) {
  44579. Ci.Light.call(this, e, t),
  44580. this.type = "SpotLight",
  44581. this.position.set(0, 1, 0),
  44582. this.updateMatrix(),
  44583. this.target = new Ci.Object3D,
  44584. this.distance = void 0 !== i ? i : 0,
  44585. this.angle = void 0 !== n ? n : Math.PI / 3,
  44586. this.penumbra = void 0 !== r ? r : 0,
  44587. this.decay = void 0 !== o ? o : 1,
  44588. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44589. }
  44590. ,
  44591. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44592. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44593. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44594. get: function() {
  44595. return this.intensity * Math.PI
  44596. },
  44597. set: function(e) {
  44598. this.intensity = e / Math.PI
  44599. }
  44600. }),
  44601. Ci.SpotLight.prototype.copy = function(e) {
  44602. return Ci.Light.prototype.copy.call(this, e),
  44603. this.distance = e.distance,
  44604. this.angle = e.angle,
  44605. this.penumbra = e.penumbra,
  44606. this.decay = e.decay,
  44607. this.target = e.target.clone(),
  44608. this.shadow = e.shadow.clone(),
  44609. this
  44610. }
  44611. ,
  44612. Ci.Cache = {
  44613. enabled: !1,
  44614. files: {},
  44615. add: function(e, t) {
  44616. !1 !== this.enabled && (this.files[e] = t)
  44617. },
  44618. get: function(e) {
  44619. if (!1 !== this.enabled)
  44620. return this.files[e]
  44621. },
  44622. remove: function(e) {
  44623. delete this.files[e]
  44624. },
  44625. clear: function() {
  44626. this.files = {}
  44627. }
  44628. },
  44629. Ci.Loader = function() {
  44630. this.onLoadStart = function() {}
  44631. ,
  44632. this.onLoadProgress = function() {}
  44633. ,
  44634. this.onLoadComplete = function() {}
  44635. }
  44636. ,
  44637. Ci.Loader.prototype = {
  44638. constructor: Ci.Loader,
  44639. crossOrigin: void 0,
  44640. extractUrlBase: function(e) {
  44641. var t = e.split("/");
  44642. return 1 === t.length ? "./" : (t.pop(),
  44643. t.join("/") + "/")
  44644. },
  44645. initMaterials: function(e, t, i) {
  44646. for (var n = [], r = 0; r < e.length; ++r)
  44647. n[r] = this.createMaterial(e[r], t, i);
  44648. return n
  44649. },
  44650. createMaterial: function(e, c, h) {
  44651. function t(e, t, i, n, r) {
  44652. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44653. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44654. He.load(a)),
  44655. void 0 !== t && (o.repeat.fromArray(t),
  44656. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44657. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44658. void 0 !== i && o.offset.fromArray(i),
  44659. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44660. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44661. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44662. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44663. void 0 !== r && (o.anisotropy = r);
  44664. var l = Ci.Math.generateUUID();
  44665. return u[l] = o,
  44666. l
  44667. }
  44668. void 0 === Ue && (Ue = new Ci.Color),
  44669. void 0 === He && (He = new Ci.TextureLoader),
  44670. void 0 === ze && (ze = new Ci.MaterialLoader);
  44671. var u = {}
  44672. , i = {
  44673. uuid: Ci.Math.generateUUID(),
  44674. type: "MeshLambertMaterial"
  44675. };
  44676. for (var n in e) {
  44677. var r = e[n];
  44678. switch (n) {
  44679. case "DbgColor":
  44680. case "DbgIndex":
  44681. case "opticalDensity":
  44682. case "illumination":
  44683. break;
  44684. case "DbgName":
  44685. i.name = r;
  44686. break;
  44687. case "blending":
  44688. i.blending = Ci[r];
  44689. break;
  44690. case "colorAmbient":
  44691. case "mapAmbient":
  44692. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  44693. break;
  44694. case "colorDiffuse":
  44695. i.color = Ue.fromArray(r).getHex();
  44696. break;
  44697. case "colorSpecular":
  44698. i.specular = Ue.fromArray(r).getHex();
  44699. break;
  44700. case "colorEmissive":
  44701. i.emissive = Ue.fromArray(r).getHex();
  44702. break;
  44703. case "specularCoef":
  44704. i.shininess = r;
  44705. break;
  44706. case "shading":
  44707. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  44708. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  44709. break;
  44710. case "mapDiffuse":
  44711. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  44712. break;
  44713. case "mapDiffuseRepeat":
  44714. case "mapDiffuseOffset":
  44715. case "mapDiffuseWrap":
  44716. case "mapDiffuseAnisotropy":
  44717. break;
  44718. case "mapLight":
  44719. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  44720. break;
  44721. case "mapLightRepeat":
  44722. case "mapLightOffset":
  44723. case "mapLightWrap":
  44724. case "mapLightAnisotropy":
  44725. break;
  44726. case "mapAO":
  44727. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  44728. break;
  44729. case "mapAORepeat":
  44730. case "mapAOOffset":
  44731. case "mapAOWrap":
  44732. case "mapAOAnisotropy":
  44733. break;
  44734. case "mapBump":
  44735. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  44736. break;
  44737. case "mapBumpScale":
  44738. i.bumpScale = r;
  44739. break;
  44740. case "mapBumpRepeat":
  44741. case "mapBumpOffset":
  44742. case "mapBumpWrap":
  44743. case "mapBumpAnisotropy":
  44744. break;
  44745. case "mapNormal":
  44746. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  44747. break;
  44748. case "mapNormalFactor":
  44749. i.normalScale = [r, r];
  44750. break;
  44751. case "mapNormalRepeat":
  44752. case "mapNormalOffset":
  44753. case "mapNormalWrap":
  44754. case "mapNormalAnisotropy":
  44755. break;
  44756. case "mapSpecular":
  44757. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  44758. break;
  44759. case "mapSpecularRepeat":
  44760. case "mapSpecularOffset":
  44761. case "mapSpecularWrap":
  44762. case "mapSpecularAnisotropy":
  44763. break;
  44764. case "mapAlpha":
  44765. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  44766. break;
  44767. case "mapAlphaRepeat":
  44768. case "mapAlphaOffset":
  44769. case "mapAlphaWrap":
  44770. case "mapAlphaAnisotropy":
  44771. break;
  44772. case "flipSided":
  44773. i.side = Ci.BackSide;
  44774. break;
  44775. case "doubleSided":
  44776. i.side = Ci.DoubleSide;
  44777. break;
  44778. case "transparency":
  44779. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  44780. i.opacity = r;
  44781. break;
  44782. case "depthTest":
  44783. case "depthWrite":
  44784. case "colorWrite":
  44785. case "opacity":
  44786. case "reflectivity":
  44787. case "transparent":
  44788. case "visible":
  44789. case "wireframe":
  44790. i[n] = r;
  44791. break;
  44792. case "vertexColors":
  44793. !0 === r && (i.vertexColors = Ci.VertexColors),
  44794. "face" === r && (i.vertexColors = Ci.FaceColors);
  44795. break;
  44796. default:
  44797. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  44798. }
  44799. }
  44800. return "MeshBasicMaterial" === i.type && delete i.emissive,
  44801. "MeshPhongMaterial" !== i.type && delete i.specular,
  44802. i.opacity < 1 && (i.transparent = !0),
  44803. ze.setTextures(u),
  44804. ze.parse(i)
  44805. }
  44806. },
  44807. Ci.Loader.Handlers = {
  44808. handlers: [],
  44809. add: function(e, t) {
  44810. this.handlers.push(e, t)
  44811. },
  44812. get: function(e) {
  44813. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  44814. var r = t[i]
  44815. , o = t[i + 1];
  44816. if (r.test(e))
  44817. return o
  44818. }
  44819. return null
  44820. }
  44821. },
  44822. Ci.XHRLoader = function(e) {
  44823. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44824. }
  44825. ,
  44826. Ci.XHRLoader.prototype = {
  44827. constructor: Ci.XHRLoader,
  44828. load: function(i, n, t, r) {
  44829. void 0 !== this.path && (i = this.path + i);
  44830. var o = this
  44831. , e = Ci.Cache.get(i);
  44832. if (void 0 !== e)
  44833. return n && setTimeout(function() {
  44834. n(e)
  44835. }, 0),
  44836. e;
  44837. var a = new XMLHttpRequest;
  44838. return a.overrideMimeType("text/plain"),
  44839. a.open("GET", i, !0),
  44840. a.addEventListener("load", function(e) {
  44841. var t = e.target.response;
  44842. Ci.Cache.add(i, t),
  44843. 200 === this.status ? (n && n(t),
  44844. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  44845. n && n(t),
  44846. o.manager.itemEnd(i)) : (r && r(e),
  44847. o.manager.itemError(i))
  44848. }, !1),
  44849. void 0 !== t && a.addEventListener("progress", function(e) {
  44850. t(e)
  44851. }, !1),
  44852. a.addEventListener("error", function(e) {
  44853. r && r(e),
  44854. o.manager.itemError(i)
  44855. }, !1),
  44856. void 0 !== this.responseType && (a.responseType = this.responseType),
  44857. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  44858. a.send(null),
  44859. o.manager.itemStart(i),
  44860. a
  44861. },
  44862. setPath: function(e) {
  44863. this.path = e
  44864. },
  44865. setResponseType: function(e) {
  44866. this.responseType = e
  44867. },
  44868. setWithCredentials: function(e) {
  44869. this.withCredentials = e
  44870. }
  44871. },
  44872. Ci.FontLoader = function(e) {
  44873. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44874. }
  44875. ,
  44876. Ci.FontLoader.prototype = {
  44877. constructor: Ci.FontLoader,
  44878. load: function(e, t, i, n) {
  44879. new Ci.XHRLoader(this.manager).load(e, function(e) {
  44880. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  44881. }, i, n)
  44882. }
  44883. },
  44884. Ci.ImageLoader = function(e) {
  44885. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44886. }
  44887. ,
  44888. Ci.ImageLoader.prototype = {
  44889. constructor: Ci.ImageLoader,
  44890. load: function(t, i, n, r) {
  44891. void 0 !== this.path && (t = this.path + t);
  44892. var o = this
  44893. , e = Ci.Cache.get(t);
  44894. if (void 0 !== e)
  44895. return o.manager.itemStart(t),
  44896. i ? setTimeout(function() {
  44897. i(e),
  44898. o.manager.itemEnd(t)
  44899. }, 0) : o.manager.itemEnd(t),
  44900. e;
  44901. var a = document.createElement("img");
  44902. return a.addEventListener("load", function(e) {
  44903. Ci.Cache.add(t, this),
  44904. i && i(this),
  44905. o.manager.itemEnd(t)
  44906. }, !1),
  44907. void 0 !== n && a.addEventListener("progress", function(e) {
  44908. n(e)
  44909. }, !1),
  44910. a.addEventListener("error", function(e) {
  44911. r && r(e),
  44912. o.manager.itemError(t)
  44913. }, !1),
  44914. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  44915. o.manager.itemStart(t),
  44916. a.src = t,
  44917. a
  44918. },
  44919. setCrossOrigin: function(e) {
  44920. this.crossOrigin = e
  44921. },
  44922. setPath: function(e) {
  44923. this.path = e
  44924. }
  44925. },
  44926. Ci.JSONLoader = function(e) {
  44927. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  44928. e = void 0),
  44929. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  44930. this.withCredentials = !1
  44931. }
  44932. ,
  44933. Ci.JSONLoader.prototype = {
  44934. constructor: Ci.JSONLoader,
  44935. get statusDomElement() {
  44936. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  44937. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  44938. this._statusDomElement
  44939. },
  44940. load: function(o, a, e, t) {
  44941. var s = this
  44942. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  44943. , i = new Ci.XHRLoader(this.manager);
  44944. i.setWithCredentials(this.withCredentials),
  44945. i.load(o, function(e) {
  44946. var t = JSON.parse(e)
  44947. , i = t.metadata;
  44948. if (void 0 !== i) {
  44949. var n = i.type;
  44950. if (void 0 !== n) {
  44951. if ("object" === n.toLowerCase())
  44952. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  44953. if ("scene" === n.toLowerCase())
  44954. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  44955. }
  44956. }
  44957. var r = s.parse(t, l);
  44958. a(r.geometry, r.materials)
  44959. }, e, t)
  44960. },
  44961. setTexturePath: function(e) {
  44962. this.texturePath = e
  44963. },
  44964. parse: function(D, e) {
  44965. var N = new Ci.Geometry
  44966. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  44967. if (function(e) {
  44968. function t(e, t) {
  44969. return e & 1 << t
  44970. }
  44971. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  44972. if (void 0 !== D.uvs) {
  44973. for (i = 0; i < D.uvs.length; i++)
  44974. D.uvs[i].length && L++;
  44975. for (i = 0; i < L; i++)
  44976. N.faceVertexUvs[i] = []
  44977. }
  44978. for (o = 0,
  44979. a = R.length; o < a; )
  44980. (A = new Ci.Vector3).x = R[o++] * e,
  44981. A.y = R[o++] * e,
  44982. A.z = R[o++] * e,
  44983. N.vertices.push(A);
  44984. for (o = 0,
  44985. a = M.length; o < a; )
  44986. if (d = t(u = M[o++], 0),
  44987. p = t(u, 1),
  44988. f = t(u, 3),
  44989. g = t(u, 4),
  44990. m = t(u, 5),
  44991. v = t(u, 6),
  44992. y = t(u, 7),
  44993. d) {
  44994. if ((I = new Ci.Face3).a = M[o],
  44995. I.b = M[o + 1],
  44996. I.c = M[o + 3],
  44997. (E = new Ci.Face3).a = M[o + 1],
  44998. E.b = M[o + 2],
  44999. E.c = M[o + 3],
  45000. o += 4,
  45001. p && (h = M[o++],
  45002. I.materialIndex = h,
  45003. E.materialIndex = h),
  45004. r = N.faces.length,
  45005. f)
  45006. for (i = 0; i < L; i++)
  45007. for (w = D.uvs[i],
  45008. N.faceVertexUvs[i][r] = [],
  45009. N.faceVertexUvs[i][r + 1] = [],
  45010. n = 0; n < 4; n++)
  45011. x = w[2 * (c = M[o++])],
  45012. S = w[2 * c + 1],
  45013. T = new Ci.Vector2(x,S),
  45014. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45015. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45016. if (g && (l = 3 * M[o++],
  45017. I.normal.set(P[l++], P[l++], P[l]),
  45018. E.normal.copy(I.normal)),
  45019. m)
  45020. for (i = 0; i < 4; i++)
  45021. l = 3 * M[o++],
  45022. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45023. 2 !== i && I.vertexNormals.push(b),
  45024. 0 !== i && E.vertexNormals.push(b);
  45025. if (v && (_ = O[s = M[o++]],
  45026. I.color.setHex(_),
  45027. E.color.setHex(_)),
  45028. y)
  45029. for (i = 0; i < 4; i++)
  45030. _ = O[s = M[o++]],
  45031. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45032. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45033. N.faces.push(I),
  45034. N.faces.push(E)
  45035. } else {
  45036. if ((C = new Ci.Face3).a = M[o++],
  45037. C.b = M[o++],
  45038. C.c = M[o++],
  45039. p && (h = M[o++],
  45040. C.materialIndex = h),
  45041. r = N.faces.length,
  45042. f)
  45043. for (i = 0; i < L; i++)
  45044. for (w = D.uvs[i],
  45045. N.faceVertexUvs[i][r] = [],
  45046. n = 0; n < 3; n++)
  45047. x = w[2 * (c = M[o++])],
  45048. S = w[2 * c + 1],
  45049. T = new Ci.Vector2(x,S),
  45050. N.faceVertexUvs[i][r].push(T);
  45051. if (g && (l = 3 * M[o++],
  45052. C.normal.set(P[l++], P[l++], P[l])),
  45053. m)
  45054. for (i = 0; i < 3; i++)
  45055. l = 3 * M[o++],
  45056. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45057. C.vertexNormals.push(b);
  45058. if (v && (s = M[o++],
  45059. C.color.setHex(O[s])),
  45060. y)
  45061. for (i = 0; i < 3; i++)
  45062. s = M[o++],
  45063. C.vertexColors.push(new Ci.Color(O[s]));
  45064. N.faces.push(C)
  45065. }
  45066. }(t),
  45067. function() {
  45068. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45069. if (D.skinWeights)
  45070. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45071. var n = D.skinWeights[t]
  45072. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45073. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45074. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45075. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45076. }
  45077. if (D.skinIndices)
  45078. for (t = 0,
  45079. i = D.skinIndices.length; t < i; t += e) {
  45080. var s = D.skinIndices[t]
  45081. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45082. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45083. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45084. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45085. }
  45086. N.bones = D.bones,
  45087. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  45088. }(),
  45089. function(e) {
  45090. if (void 0 !== D.morphTargets)
  45091. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45092. N.morphTargets[t] = {},
  45093. N.morphTargets[t].name = D.morphTargets[t].name,
  45094. N.morphTargets[t].vertices = [];
  45095. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45096. var s = new Ci.Vector3;
  45097. s.x = r[o] * e,
  45098. s.y = r[o + 1] * e,
  45099. s.z = r[o + 2] * e,
  45100. n.push(s)
  45101. }
  45102. }
  45103. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45104. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45105. var l = N.faces
  45106. , c = D.morphColors[0].colors;
  45107. for (t = 0,
  45108. i = l.length; t < i; t++)
  45109. l[t].color.fromArray(c, 3 * t)
  45110. }
  45111. }(t),
  45112. function() {
  45113. var e = []
  45114. , t = [];
  45115. void 0 !== D.animation && t.push(D.animation),
  45116. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45117. for (var i = 0; i < t.length; i++) {
  45118. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45119. n && e.push(n)
  45120. }
  45121. if (N.morphTargets) {
  45122. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45123. e = e.concat(r)
  45124. }
  45125. 0 < e.length && (N.animations = e)
  45126. }(),
  45127. N.computeFaceNormals(),
  45128. N.computeBoundingSphere(),
  45129. void 0 === D.materials || 0 === D.materials.length)
  45130. return {
  45131. geometry: N
  45132. };
  45133. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45134. return {
  45135. geometry: N,
  45136. materials: i
  45137. }
  45138. }
  45139. },
  45140. Ci.LoadingManager = function(e, t, i) {
  45141. var n = this
  45142. , r = !1
  45143. , o = 0
  45144. , a = 0;
  45145. this.onStart = void 0,
  45146. this.onLoad = e,
  45147. this.onProgress = t,
  45148. this.onError = i,
  45149. this.itemStart = function(e) {
  45150. a++,
  45151. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45152. r = !0
  45153. }
  45154. ,
  45155. this.itemEnd = function(e) {
  45156. o++,
  45157. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45158. o === a && (r = !1,
  45159. void 0 !== n.onLoad && n.onLoad())
  45160. }
  45161. ,
  45162. this.itemError = function(e) {
  45163. void 0 !== n.onError && n.onError(e)
  45164. }
  45165. }
  45166. ,
  45167. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45168. Ci.BufferGeometryLoader = function(e) {
  45169. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45170. }
  45171. ,
  45172. Ci.BufferGeometryLoader.prototype = {
  45173. constructor: Ci.BufferGeometryLoader,
  45174. load: function(e, t, i, n) {
  45175. var r = this;
  45176. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45177. t(r.parse(JSON.parse(e)))
  45178. }, i, n)
  45179. },
  45180. parse: function(e) {
  45181. var t = new Ci.BufferGeometry
  45182. , i = e.data.index
  45183. , n = {
  45184. Int8Array: Int8Array,
  45185. Uint8Array: Uint8Array,
  45186. Uint8ClampedArray: Uint8ClampedArray,
  45187. Int16Array: Int16Array,
  45188. Uint16Array: Uint16Array,
  45189. Int32Array: Int32Array,
  45190. Uint32Array: Uint32Array,
  45191. Float32Array: Float32Array,
  45192. Float64Array: Float64Array
  45193. };
  45194. if (void 0 !== i) {
  45195. var r = new n[i.type](i.array);
  45196. t.setIndex(new Ci.BufferAttribute(r,1))
  45197. }
  45198. var o = e.data.attributes;
  45199. for (var a in o) {
  45200. var s = o[a];
  45201. r = new n[s.type](s.array);
  45202. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45203. }
  45204. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45205. if (void 0 !== l)
  45206. for (var c = 0, h = l.length; c !== h; ++c) {
  45207. var u = l[c];
  45208. t.addGroup(u.start, u.count, u.materialIndex)
  45209. }
  45210. var d = e.data.boundingSphere;
  45211. if (void 0 !== d) {
  45212. var p = new Ci.Vector3;
  45213. void 0 !== d.center && p.fromArray(d.center),
  45214. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45215. }
  45216. return t
  45217. }
  45218. },
  45219. Ci.MaterialLoader = function(e) {
  45220. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45221. this.textures = {}
  45222. }
  45223. ,
  45224. Ci.MaterialLoader.prototype = {
  45225. constructor: Ci.MaterialLoader,
  45226. load: function(e, t, i, n) {
  45227. var r = this;
  45228. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45229. t(r.parse(JSON.parse(e)))
  45230. }, i, n)
  45231. },
  45232. setTextures: function(e) {
  45233. this.textures = e
  45234. },
  45235. getTexture: function(e) {
  45236. var t = this.textures;
  45237. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45238. t[e]
  45239. },
  45240. parse: function(e) {
  45241. var t = new Ci[e.type];
  45242. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45243. void 0 !== e.name && (t.name = e.name),
  45244. void 0 !== e.color && t.color.setHex(e.color),
  45245. void 0 !== e.roughness && (t.roughness = e.roughness),
  45246. void 0 !== e.metalness && (t.metalness = e.metalness),
  45247. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45248. void 0 !== e.specular && t.specular.setHex(e.specular),
  45249. void 0 !== e.shininess && (t.shininess = e.shininess),
  45250. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45251. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45252. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45253. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45254. void 0 !== e.shading && (t.shading = e.shading),
  45255. void 0 !== e.blending && (t.blending = e.blending),
  45256. void 0 !== e.side && (t.side = e.side),
  45257. void 0 !== e.opacity && (t.opacity = e.opacity),
  45258. void 0 !== e.transparent && (t.transparent = e.transparent),
  45259. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45260. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45261. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45262. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45263. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45264. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45265. void 0 !== e.size && (t.size = e.size),
  45266. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45267. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45268. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45269. t.transparent = !0),
  45270. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45271. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45272. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45273. void 0 !== e.normalScale) {
  45274. var i = e.normalScale;
  45275. !1 === Array.isArray(i) && (i = [i, i]),
  45276. t.normalScale = (new Ci.Vector2).fromArray(i)
  45277. }
  45278. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45279. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45280. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45281. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45282. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45283. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45284. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45285. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45286. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45287. t.combine = Ci.MultiplyOperation),
  45288. e.reflectivity && (t.reflectivity = e.reflectivity),
  45289. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45290. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45291. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45292. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45293. void 0 !== e.materials)
  45294. for (var n = 0, r = e.materials.length; n < r; n++)
  45295. t.materials.push(this.parse(e.materials[n]));
  45296. return t
  45297. }
  45298. },
  45299. Ci.ObjectLoader = function(e) {
  45300. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45301. this.texturePath = ""
  45302. }
  45303. ,
  45304. Ci.ObjectLoader.prototype = {
  45305. constructor: Ci.ObjectLoader,
  45306. load: function(e, t, i, n) {
  45307. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45308. var r = this;
  45309. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45310. r.parse(JSON.parse(e), t)
  45311. }, i, n)
  45312. },
  45313. setTexturePath: function(e) {
  45314. this.texturePath = e
  45315. },
  45316. setCrossOrigin: function(e) {
  45317. this.crossOrigin = e
  45318. },
  45319. parse: function(e, t) {
  45320. var i = this.parseGeometries(e.geometries)
  45321. , n = this.parseImages(e.images, function() {
  45322. void 0 !== t && t(a)
  45323. })
  45324. , r = this.parseTextures(e.textures, n)
  45325. , o = this.parseMaterials(e.materials, r)
  45326. , a = this.parseObject(e.object, i, o);
  45327. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45328. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45329. a
  45330. },
  45331. parseGeometries: function(e) {
  45332. var t = {};
  45333. if (void 0 !== e)
  45334. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45335. var a, s = e[r];
  45336. switch (s.type) {
  45337. case "PlaneGeometry":
  45338. case "PlaneBufferGeometry":
  45339. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45340. break;
  45341. case "BoxGeometry":
  45342. case "BoxBufferGeometry":
  45343. case "CubeGeometry":
  45344. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45345. break;
  45346. case "CircleGeometry":
  45347. case "CircleBufferGeometry":
  45348. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45349. break;
  45350. case "CylinderGeometry":
  45351. case "CylinderBufferGeometry":
  45352. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45353. break;
  45354. case "SphereGeometry":
  45355. case "SphereBufferGeometry":
  45356. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45357. break;
  45358. case "DodecahedronGeometry":
  45359. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45360. break;
  45361. case "IcosahedronGeometry":
  45362. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45363. break;
  45364. case "OctahedronGeometry":
  45365. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45366. break;
  45367. case "TetrahedronGeometry":
  45368. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45369. break;
  45370. case "RingGeometry":
  45371. case "RingBufferGeometry":
  45372. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45373. break;
  45374. case "TorusGeometry":
  45375. case "TorusBufferGeometry":
  45376. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45377. break;
  45378. case "TorusKnotGeometry":
  45379. case "TorusKnotBufferGeometry":
  45380. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45381. break;
  45382. case "LatheGeometry":
  45383. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45384. break;
  45385. case "BufferGeometry":
  45386. a = n.parse(s);
  45387. break;
  45388. case "Geometry":
  45389. a = i.parse(s.data, this.texturePath).geometry;
  45390. break;
  45391. default:
  45392. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45393. continue
  45394. }
  45395. a.uuid = s.uuid,
  45396. void 0 !== s.name && (a.name = s.name),
  45397. t[s.uuid] = a
  45398. }
  45399. return t
  45400. },
  45401. parseMaterials: function(e, t) {
  45402. var i = {};
  45403. if (void 0 !== e) {
  45404. var n = new Ci.MaterialLoader;
  45405. n.setTextures(t);
  45406. for (var r = 0, o = e.length; r < o; r++) {
  45407. var a = n.parse(e[r]);
  45408. i[a.uuid] = a
  45409. }
  45410. }
  45411. return i
  45412. },
  45413. parseAnimations: function(e) {
  45414. for (var t = [], i = 0; i < e.length; i++) {
  45415. var n = Ci.AnimationClip.parse(e[i]);
  45416. t.push(n)
  45417. }
  45418. return t
  45419. },
  45420. parseImages: function(e, t) {
  45421. function i(e) {
  45422. return n.manager.itemStart(e),
  45423. a.load(e, function() {
  45424. n.manager.itemEnd(e)
  45425. })
  45426. }
  45427. var n = this
  45428. , r = {};
  45429. if (void 0 !== e && 0 < e.length) {
  45430. var o = new Ci.LoadingManager(t)
  45431. , a = new Ci.ImageLoader(o);
  45432. a.setCrossOrigin(this.crossOrigin);
  45433. for (var s = 0, l = e.length; s < l; s++) {
  45434. var c = e[s]
  45435. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45436. r[c.uuid] = i(h)
  45437. }
  45438. }
  45439. return r
  45440. },
  45441. parseTextures: function(e, t) {
  45442. function i(e) {
  45443. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45444. Ci[e])
  45445. }
  45446. var n = {};
  45447. if (void 0 !== e)
  45448. for (var r = 0, o = e.length; r < o; r++) {
  45449. var a = e[r];
  45450. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45451. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45452. var s = new Ci.Texture(t[a.image]);
  45453. s.needsUpdate = !0,
  45454. s.uuid = a.uuid,
  45455. void 0 !== a.name && (s.name = a.name),
  45456. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45457. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45458. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45459. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45460. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45461. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45462. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45463. s.wrapT = i(a.wrap[1])),
  45464. n[a.uuid] = s
  45465. }
  45466. return n
  45467. },
  45468. parseObject: (ke = new Ci.Matrix4,
  45469. function(e, t, i) {
  45470. function n(e) {
  45471. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45472. t[e]
  45473. }
  45474. function r(e) {
  45475. if (void 0 !== e)
  45476. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45477. i[e]
  45478. }
  45479. var o;
  45480. switch (e.type) {
  45481. case "Scene":
  45482. o = new Ci.Scene;
  45483. break;
  45484. case "PerspectiveCamera":
  45485. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45486. break;
  45487. case "OrthographicCamera":
  45488. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45489. break;
  45490. case "AmbientLight":
  45491. o = new Ci.AmbientLight(e.color,e.intensity);
  45492. break;
  45493. case "DirectionalLight":
  45494. o = new Ci.DirectionalLight(e.color,e.intensity);
  45495. break;
  45496. case "PointLight":
  45497. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45498. break;
  45499. case "SpotLight":
  45500. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45501. break;
  45502. case "HemisphereLight":
  45503. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45504. break;
  45505. case "Mesh":
  45506. var a = n(e.geometry)
  45507. , s = r(e.material);
  45508. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45509. break;
  45510. case "LOD":
  45511. o = new Ci.LOD;
  45512. break;
  45513. case "Line":
  45514. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45515. break;
  45516. case "PointCloud":
  45517. case "Points":
  45518. o = new Ci.Points(n(e.geometry),r(e.material));
  45519. break;
  45520. case "Sprite":
  45521. o = new Ci.Sprite(r(e.material));
  45522. break;
  45523. case "Group":
  45524. o = new Ci.Group;
  45525. break;
  45526. default:
  45527. o = new Ci.Object3D
  45528. }
  45529. if (o.uuid = e.uuid,
  45530. void 0 !== e.name && (o.name = e.name),
  45531. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45532. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45533. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45534. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45535. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45536. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45537. void 0 !== e.visible && (o.visible = e.visible),
  45538. void 0 !== e.userData && (o.userData = e.userData),
  45539. void 0 !== e.children)
  45540. for (var l in e.children)
  45541. o.add(this.parseObject(e.children[l], t, i));
  45542. if ("LOD" === e.type)
  45543. for (var c = e.levels, h = 0; h < c.length; h++) {
  45544. var u = c[h];
  45545. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45546. }
  45547. return o
  45548. }
  45549. )
  45550. },
  45551. Ci.TextureLoader = function(e) {
  45552. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45553. }
  45554. ,
  45555. Ci.TextureLoader.prototype = {
  45556. constructor: Ci.TextureLoader,
  45557. load: function(e, t, i, n) {
  45558. var r = new Ci.Texture
  45559. , o = new Ci.ImageLoader(this.manager);
  45560. return o.setCrossOrigin(this.crossOrigin),
  45561. o.setPath(this.path),
  45562. o.load(e, function(e) {
  45563. r.image = e,
  45564. r.needsUpdate = !0,
  45565. void 0 !== t && t(r)
  45566. }, i, n),
  45567. r
  45568. },
  45569. setCrossOrigin: function(e) {
  45570. this.crossOrigin = e
  45571. },
  45572. setPath: function(e) {
  45573. this.path = e
  45574. }
  45575. },
  45576. Ci.CubeTextureLoader = function(e) {
  45577. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45578. }
  45579. ,
  45580. Ci.CubeTextureLoader.prototype = {
  45581. constructor: Ci.CubeTextureLoader,
  45582. load: function(e, i, t, n) {
  45583. function r(t) {
  45584. a.load(e[t], function(e) {
  45585. o.images[t] = e,
  45586. 6 === ++s && (o.needsUpdate = !0,
  45587. i && i(o))
  45588. }, void 0, n)
  45589. }
  45590. var o = new Ci.CubeTexture
  45591. , a = new Ci.ImageLoader(this.manager);
  45592. a.setCrossOrigin(this.crossOrigin),
  45593. a.setPath(this.path);
  45594. for (var s = 0, l = 0; l < e.length; ++l)
  45595. r(l);
  45596. return o
  45597. },
  45598. setCrossOrigin: function(e) {
  45599. this.crossOrigin = e
  45600. },
  45601. setPath: function(e) {
  45602. this.path = e
  45603. }
  45604. },
  45605. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45606. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45607. this._parser = null
  45608. }
  45609. ,
  45610. Ci.BinaryTextureLoader.prototype = {
  45611. constructor: Ci.BinaryTextureLoader,
  45612. load: function(e, i, t, n) {
  45613. var r = this
  45614. , o = new Ci.DataTexture
  45615. , a = new Ci.XHRLoader(this.manager);
  45616. return a.setResponseType("arraybuffer"),
  45617. a.load(e, function(e) {
  45618. var t = r._parser(e);
  45619. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45620. o.image.height = t.height,
  45621. o.image.data = t.data),
  45622. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45623. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45624. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45625. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45626. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45627. void 0 !== t.format && (o.format = t.format),
  45628. void 0 !== t.type && (o.type = t.type),
  45629. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45630. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45631. o.needsUpdate = !0,
  45632. i && i(o, t))
  45633. }, t, n),
  45634. o
  45635. }
  45636. },
  45637. Ci.CompressedTextureLoader = function(e) {
  45638. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45639. this._parser = null
  45640. }
  45641. ,
  45642. Ci.CompressedTextureLoader.prototype = {
  45643. constructor: Ci.CompressedTextureLoader,
  45644. load: function(e, o, t, n) {
  45645. function i(i) {
  45646. r.load(e[i], function(e) {
  45647. var t = a._parser(e, !0);
  45648. s[i] = {
  45649. width: t.width,
  45650. height: t.height,
  45651. format: t.format,
  45652. mipmaps: t.mipmaps
  45653. },
  45654. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45655. l.format = t.format,
  45656. l.needsUpdate = !0,
  45657. o && o(l))
  45658. }, t, n)
  45659. }
  45660. var a = this
  45661. , s = []
  45662. , l = new Ci.CompressedTexture;
  45663. l.image = s;
  45664. var r = new Ci.XHRLoader(this.manager);
  45665. if (r.setPath(this.path),
  45666. r.setResponseType("arraybuffer"),
  45667. Array.isArray(e))
  45668. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45669. i(h);
  45670. else
  45671. r.load(e, function(e) {
  45672. var t = a._parser(e, !0);
  45673. if (t.isCubemap)
  45674. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  45675. s[n] = {
  45676. mipmaps: []
  45677. };
  45678. for (var r = 0; r < t.mipmapCount; r++)
  45679. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  45680. s[n].format = t.format,
  45681. s[n].width = t.width,
  45682. s[n].height = t.height
  45683. }
  45684. else
  45685. l.image.width = t.width,
  45686. l.image.height = t.height,
  45687. l.mipmaps = t.mipmaps;
  45688. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45689. l.format = t.format,
  45690. l.needsUpdate = !0,
  45691. o && o(l)
  45692. }, t, n);
  45693. return l
  45694. },
  45695. setPath: function(e) {
  45696. this.path = e
  45697. }
  45698. },
  45699. Ci.Material = function() {
  45700. Object.defineProperty(this, "id", {
  45701. value: Ci.MaterialIdCount++
  45702. }),
  45703. this.uuid = Ci.Math.generateUUID(),
  45704. this.name = "",
  45705. this.type = "Material",
  45706. this.side = Ci.FrontSide,
  45707. this.opacity = 1,
  45708. this.transparent = !1,
  45709. this.blending = Ci.NormalBlending,
  45710. this.blendSrc = Ci.SrcAlphaFactor,
  45711. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  45712. this.blendEquation = Ci.AddEquation,
  45713. this.blendSrcAlpha = null,
  45714. this.blendDstAlpha = null,
  45715. this.blendEquationAlpha = null,
  45716. this.depthFunc = Ci.LessEqualDepth,
  45717. this.depthTest = !0,
  45718. this.depthWrite = !0,
  45719. this.colorWrite = !0,
  45720. this.precision = null,
  45721. this.polygonOffset = !1,
  45722. this.polygonOffsetFactor = 0,
  45723. this.polygonOffsetUnits = 0,
  45724. this.alphaTest = 0,
  45725. this.premultipliedAlpha = !1,
  45726. this.overdraw = 0,
  45727. this.visible = !0,
  45728. this._needsUpdate = !0
  45729. }
  45730. ,
  45731. Ci.Material.prototype = {
  45732. constructor: Ci.Material,
  45733. get needsUpdate() {
  45734. return this._needsUpdate
  45735. },
  45736. set needsUpdate(e) {
  45737. !0 === e && this.update(),
  45738. this._needsUpdate = e
  45739. },
  45740. setValues: function(e) {
  45741. if (void 0 !== e)
  45742. for (var t in e) {
  45743. var i = e[t];
  45744. if (void 0 !== i) {
  45745. var n = this[t];
  45746. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  45747. } else
  45748. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  45749. }
  45750. },
  45751. toJSON: function(e) {
  45752. function t(e) {
  45753. var t = [];
  45754. for (var i in e) {
  45755. var n = e[i];
  45756. delete n.metadata,
  45757. t.push(n)
  45758. }
  45759. return t
  45760. }
  45761. var i = void 0 === e;
  45762. i && (e = {
  45763. textures: {},
  45764. images: {}
  45765. });
  45766. var n = {
  45767. metadata: {
  45768. version: 4.4,
  45769. type: "Material",
  45770. generator: "Material.toJSON"
  45771. }
  45772. };
  45773. if (n.uuid = this.uuid,
  45774. n.type = this.type,
  45775. "" !== this.name && (n.name = this.name),
  45776. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  45777. .5 !== this.roughness && (n.roughness = this.roughness),
  45778. .5 !== this.metalness && (n.metalness = this.metalness),
  45779. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  45780. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  45781. void 0 !== this.shininess && (n.shininess = this.shininess),
  45782. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  45783. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  45784. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  45785. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  45786. n.bumpScale = this.bumpScale),
  45787. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  45788. n.normalScale = this.normalScale.toArray()),
  45789. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  45790. n.displacementScale = this.displacementScale,
  45791. n.displacementBias = this.displacementBias),
  45792. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  45793. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  45794. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  45795. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  45796. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  45797. n.reflectivity = this.reflectivity),
  45798. void 0 !== this.size && (n.size = this.size),
  45799. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  45800. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  45801. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  45802. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  45803. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  45804. this.opacity < 1 && (n.opacity = this.opacity),
  45805. !0 === this.transparent && (n.transparent = this.transparent),
  45806. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  45807. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  45808. !0 === this.wireframe && (n.wireframe = this.wireframe),
  45809. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  45810. i) {
  45811. var r = t(e.textures)
  45812. , o = t(e.images);
  45813. 0 < r.length && (n.textures = r),
  45814. 0 < o.length && (n.images = o)
  45815. }
  45816. return n
  45817. },
  45818. clone: function() {
  45819. return (new this.constructor).copy(this)
  45820. },
  45821. copy: function(e) {
  45822. return this.name = e.name,
  45823. this.side = e.side,
  45824. this.opacity = e.opacity,
  45825. this.transparent = e.transparent,
  45826. this.blending = e.blending,
  45827. this.blendSrc = e.blendSrc,
  45828. this.blendDst = e.blendDst,
  45829. this.blendEquation = e.blendEquation,
  45830. this.blendSrcAlpha = e.blendSrcAlpha,
  45831. this.blendDstAlpha = e.blendDstAlpha,
  45832. this.blendEquationAlpha = e.blendEquationAlpha,
  45833. this.depthFunc = e.depthFunc,
  45834. this.depthTest = e.depthTest,
  45835. this.depthWrite = e.depthWrite,
  45836. this.colorWrite = e.colorWrite,
  45837. this.precision = e.precision,
  45838. this.polygonOffset = e.polygonOffset,
  45839. this.polygonOffsetFactor = e.polygonOffsetFactor,
  45840. this.polygonOffsetUnits = e.polygonOffsetUnits,
  45841. this.alphaTest = e.alphaTest,
  45842. this.premultipliedAlpha = e.premultipliedAlpha,
  45843. this.overdraw = e.overdraw,
  45844. this.visible = e.visible,
  45845. this
  45846. },
  45847. update: function() {
  45848. this.dispatchEvent({
  45849. type: "update"
  45850. })
  45851. },
  45852. dispose: function() {
  45853. this.dispatchEvent({
  45854. type: "dispose"
  45855. })
  45856. }
  45857. },
  45858. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  45859. Ci.MaterialIdCount = 0,
  45860. Ci.LineBasicMaterial = function(e) {
  45861. Ci.Material.call(this),
  45862. this.type = "LineBasicMaterial",
  45863. this.color = new Ci.Color(16777215),
  45864. this.linewidth = 1,
  45865. this.linecap = "round",
  45866. this.linejoin = "round",
  45867. this.blending = Ci.NormalBlending,
  45868. this.vertexColors = Ci.NoColors,
  45869. this.fog = !0,
  45870. this.setValues(e)
  45871. }
  45872. ,
  45873. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  45874. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  45875. Ci.LineBasicMaterial.prototype.copy = function(e) {
  45876. return Ci.Material.prototype.copy.call(this, e),
  45877. this.color.copy(e.color),
  45878. this.linewidth = e.linewidth,
  45879. this.linecap = e.linecap,
  45880. this.linejoin = e.linejoin,
  45881. this.vertexColors = e.vertexColors,
  45882. this.fog = e.fog,
  45883. this
  45884. }
  45885. ,
  45886. Ci.LineDashedMaterial = function(e) {
  45887. Ci.Material.call(this),
  45888. this.type = "LineDashedMaterial",
  45889. this.color = new Ci.Color(16777215),
  45890. this.linewidth = 1,
  45891. this.scale = 1,
  45892. this.dashSize = 3,
  45893. this.gapSize = 1,
  45894. this.blending = Ci.NormalBlending,
  45895. this.vertexColors = Ci.NoColors,
  45896. this.fog = !0,
  45897. this.setValues(e)
  45898. }
  45899. ,
  45900. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  45901. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  45902. Ci.LineDashedMaterial.prototype.copy = function(e) {
  45903. return Ci.Material.prototype.copy.call(this, e),
  45904. this.color.copy(e.color),
  45905. this.linewidth = e.linewidth,
  45906. this.scale = e.scale,
  45907. this.dashSize = e.dashSize,
  45908. this.gapSize = e.gapSize,
  45909. this.vertexColors = e.vertexColors,
  45910. this.fog = e.fog,
  45911. this
  45912. }
  45913. ,
  45914. Ci.MeshBasicMaterial = function(e) {
  45915. Ci.Material.call(this),
  45916. this.type = "MeshBasicMaterial",
  45917. this.color = new Ci.Color(16777215),
  45918. this.map = null,
  45919. this.aoMap = null,
  45920. this.aoMapIntensity = 1,
  45921. this.specularMap = null,
  45922. this.alphaMap = null,
  45923. this.envMap = null,
  45924. this.combine = Ci.MultiplyOperation,
  45925. this.reflectivity = 1,
  45926. this.refractionRatio = .98,
  45927. this.fog = !0,
  45928. this.shading = Ci.SmoothShading,
  45929. this.blending = Ci.NormalBlending,
  45930. this.wireframe = !1,
  45931. this.wireframeLinewidth = 1,
  45932. this.wireframeLinecap = "round",
  45933. this.wireframeLinejoin = "round",
  45934. this.vertexColors = Ci.NoColors,
  45935. this.skinning = !1,
  45936. this.morphTargets = !1,
  45937. this.setValues(e)
  45938. }
  45939. ,
  45940. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  45941. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  45942. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  45943. return Ci.Material.prototype.copy.call(this, e),
  45944. this.color.copy(e.color),
  45945. this.map = e.map,
  45946. this.aoMap = e.aoMap,
  45947. this.aoMapIntensity = e.aoMapIntensity,
  45948. this.specularMap = e.specularMap,
  45949. this.alphaMap = e.alphaMap,
  45950. this.envMap = e.envMap,
  45951. this.combine = e.combine,
  45952. this.reflectivity = e.reflectivity,
  45953. this.refractionRatio = e.refractionRatio,
  45954. this.fog = e.fog,
  45955. this.shading = e.shading,
  45956. this.wireframe = e.wireframe,
  45957. this.wireframeLinewidth = e.wireframeLinewidth,
  45958. this.wireframeLinecap = e.wireframeLinecap,
  45959. this.wireframeLinejoin = e.wireframeLinejoin,
  45960. this.vertexColors = e.vertexColors,
  45961. this.skinning = e.skinning,
  45962. this.morphTargets = e.morphTargets,
  45963. this
  45964. }
  45965. ,
  45966. Ci.MeshLambertMaterial = function(e) {
  45967. Ci.Material.call(this),
  45968. this.type = "MeshLambertMaterial",
  45969. this.color = new Ci.Color(16777215),
  45970. this.map = null,
  45971. this.lightMap = null,
  45972. this.lightMapIntensity = 1,
  45973. this.aoMap = null,
  45974. this.aoMapIntensity = 1,
  45975. this.emissive = new Ci.Color(0),
  45976. this.emissiveIntensity = 1,
  45977. this.emissiveMap = null,
  45978. this.specularMap = null,
  45979. this.alphaMap = null,
  45980. this.envMap = null,
  45981. this.combine = Ci.MultiplyOperation,
  45982. this.reflectivity = 1,
  45983. this.refractionRatio = .98,
  45984. this.fog = !0,
  45985. this.blending = Ci.NormalBlending,
  45986. this.wireframe = !1,
  45987. this.wireframeLinewidth = 1,
  45988. this.wireframeLinecap = "round",
  45989. this.wireframeLinejoin = "round",
  45990. this.vertexColors = Ci.NoColors,
  45991. this.skinning = !1,
  45992. this.morphTargets = !1,
  45993. this.morphNormals = !1,
  45994. this.setValues(e)
  45995. }
  45996. ,
  45997. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  45998. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  45999. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46000. return Ci.Material.prototype.copy.call(this, e),
  46001. this.color.copy(e.color),
  46002. this.map = e.map,
  46003. this.lightMap = e.lightMap,
  46004. this.lightMapIntensity = e.lightMapIntensity,
  46005. this.aoMap = e.aoMap,
  46006. this.aoMapIntensity = e.aoMapIntensity,
  46007. this.emissive.copy(e.emissive),
  46008. this.emissiveMap = e.emissiveMap,
  46009. this.emissiveIntensity = e.emissiveIntensity,
  46010. this.specularMap = e.specularMap,
  46011. this.alphaMap = e.alphaMap,
  46012. this.envMap = e.envMap,
  46013. this.combine = e.combine,
  46014. this.reflectivity = e.reflectivity,
  46015. this.refractionRatio = e.refractionRatio,
  46016. this.fog = e.fog,
  46017. this.wireframe = e.wireframe,
  46018. this.wireframeLinewidth = e.wireframeLinewidth,
  46019. this.wireframeLinecap = e.wireframeLinecap,
  46020. this.wireframeLinejoin = e.wireframeLinejoin,
  46021. this.vertexColors = e.vertexColors,
  46022. this.skinning = e.skinning,
  46023. this.morphTargets = e.morphTargets,
  46024. this.morphNormals = e.morphNormals,
  46025. this
  46026. }
  46027. ,
  46028. Ci.MeshPhongMaterial = function(e) {
  46029. Ci.Material.call(this),
  46030. this.type = "MeshPhongMaterial",
  46031. this.color = new Ci.Color(16777215),
  46032. this.specular = new Ci.Color(1118481),
  46033. this.shininess = 30,
  46034. this.map = null,
  46035. this.lightMap = null,
  46036. this.lightMapIntensity = 1,
  46037. this.aoMap = null,
  46038. this.aoMapIntensity = 1,
  46039. this.emissive = new Ci.Color(0),
  46040. this.emissiveIntensity = 1,
  46041. this.emissiveMap = null,
  46042. this.bumpMap = null,
  46043. this.bumpScale = 1,
  46044. this.normalMap = null,
  46045. this.normalScale = new Ci.Vector2(1,1),
  46046. this.displacementMap = null,
  46047. this.displacementScale = 1,
  46048. this.displacementBias = 0,
  46049. this.specularMap = null,
  46050. this.alphaMap = null,
  46051. this.envMap = null,
  46052. this.combine = Ci.MultiplyOperation,
  46053. this.reflectivity = 1,
  46054. this.refractionRatio = .98,
  46055. this.fog = !0,
  46056. this.shading = Ci.SmoothShading,
  46057. this.blending = Ci.NormalBlending,
  46058. this.wireframe = !1,
  46059. this.wireframeLinewidth = 1,
  46060. this.wireframeLinecap = "round",
  46061. this.wireframeLinejoin = "round",
  46062. this.vertexColors = Ci.NoColors,
  46063. this.skinning = !1,
  46064. this.morphTargets = !1,
  46065. this.morphNormals = !1,
  46066. this.setValues(e)
  46067. }
  46068. ,
  46069. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46070. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46071. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46072. return Ci.Material.prototype.copy.call(this, e),
  46073. this.color.copy(e.color),
  46074. this.specular.copy(e.specular),
  46075. this.shininess = e.shininess,
  46076. this.map = e.map,
  46077. this.lightMap = e.lightMap,
  46078. this.lightMapIntensity = e.lightMapIntensity,
  46079. this.aoMap = e.aoMap,
  46080. this.aoMapIntensity = e.aoMapIntensity,
  46081. this.emissive.copy(e.emissive),
  46082. this.emissiveMap = e.emissiveMap,
  46083. this.emissiveIntensity = e.emissiveIntensity,
  46084. this.bumpMap = e.bumpMap,
  46085. this.bumpScale = e.bumpScale,
  46086. this.normalMap = e.normalMap,
  46087. this.normalScale.copy(e.normalScale),
  46088. this.displacementMap = e.displacementMap,
  46089. this.displacementScale = e.displacementScale,
  46090. this.displacementBias = e.displacementBias,
  46091. this.specularMap = e.specularMap,
  46092. this.alphaMap = e.alphaMap,
  46093. this.envMap = e.envMap,
  46094. this.combine = e.combine,
  46095. this.reflectivity = e.reflectivity,
  46096. this.refractionRatio = e.refractionRatio,
  46097. this.fog = e.fog,
  46098. this.shading = e.shading,
  46099. this.wireframe = e.wireframe,
  46100. this.wireframeLinewidth = e.wireframeLinewidth,
  46101. this.wireframeLinecap = e.wireframeLinecap,
  46102. this.wireframeLinejoin = e.wireframeLinejoin,
  46103. this.vertexColors = e.vertexColors,
  46104. this.skinning = e.skinning,
  46105. this.morphTargets = e.morphTargets,
  46106. this.morphNormals = e.morphNormals,
  46107. this
  46108. }
  46109. ,
  46110. Ci.MeshStandardMaterial = function(e) {
  46111. Ci.Material.call(this),
  46112. this.type = "MeshStandardMaterial",
  46113. this.color = new Ci.Color(16777215),
  46114. this.roughness = .5,
  46115. this.metalness = .5,
  46116. this.map = null,
  46117. this.lightMap = null,
  46118. this.lightMapIntensity = 1,
  46119. this.aoMap = null,
  46120. this.aoMapIntensity = 1,
  46121. this.emissive = new Ci.Color(0),
  46122. this.emissiveIntensity = 1,
  46123. this.emissiveMap = null,
  46124. this.bumpMap = null,
  46125. this.bumpScale = 1,
  46126. this.normalMap = null,
  46127. this.normalScale = new Ci.Vector2(1,1),
  46128. this.displacementMap = null,
  46129. this.displacementScale = 1,
  46130. this.displacementBias = 0,
  46131. this.roughnessMap = null,
  46132. this.metalnessMap = null,
  46133. this.alphaMap = null,
  46134. this.envMap = null,
  46135. this.envMapIntensity = 1,
  46136. this.refractionRatio = .98,
  46137. this.fog = !0,
  46138. this.shading = Ci.SmoothShading,
  46139. this.blending = Ci.NormalBlending,
  46140. this.wireframe = !1,
  46141. this.wireframeLinewidth = 1,
  46142. this.wireframeLinecap = "round",
  46143. this.wireframeLinejoin = "round",
  46144. this.vertexColors = Ci.NoColors,
  46145. this.skinning = !1,
  46146. this.morphTargets = !1,
  46147. this.morphNormals = !1,
  46148. this.setValues(e)
  46149. }
  46150. ,
  46151. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46152. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46153. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46154. return Ci.Material.prototype.copy.call(this, e),
  46155. this.color.copy(e.color),
  46156. this.roughness = e.roughness,
  46157. this.metalness = e.metalness,
  46158. this.map = e.map,
  46159. this.lightMap = e.lightMap,
  46160. this.lightMapIntensity = e.lightMapIntensity,
  46161. this.aoMap = e.aoMap,
  46162. this.aoMapIntensity = e.aoMapIntensity,
  46163. this.emissive.copy(e.emissive),
  46164. this.emissiveMap = e.emissiveMap,
  46165. this.emissiveIntensity = e.emissiveIntensity,
  46166. this.bumpMap = e.bumpMap,
  46167. this.bumpScale = e.bumpScale,
  46168. this.normalMap = e.normalMap,
  46169. this.normalScale.copy(e.normalScale),
  46170. this.displacementMap = e.displacementMap,
  46171. this.displacementScale = e.displacementScale,
  46172. this.displacementBias = e.displacementBias,
  46173. this.roughnessMap = e.roughnessMap,
  46174. this.metalnessMap = e.metalnessMap,
  46175. this.alphaMap = e.alphaMap,
  46176. this.envMap = e.envMap,
  46177. this.envMapIntensity = e.envMapIntensity,
  46178. this.refractionRatio = e.refractionRatio,
  46179. this.fog = e.fog,
  46180. this.shading = e.shading,
  46181. this.wireframe = e.wireframe,
  46182. this.wireframeLinewidth = e.wireframeLinewidth,
  46183. this.wireframeLinecap = e.wireframeLinecap,
  46184. this.wireframeLinejoin = e.wireframeLinejoin,
  46185. this.vertexColors = e.vertexColors,
  46186. this.skinning = e.skinning,
  46187. this.morphTargets = e.morphTargets,
  46188. this.morphNormals = e.morphNormals,
  46189. this
  46190. }
  46191. ,
  46192. Ci.MeshDepthMaterial = function(e) {
  46193. Ci.Material.call(this),
  46194. this.type = "MeshDepthMaterial",
  46195. this.morphTargets = !1,
  46196. this.wireframe = !1,
  46197. this.wireframeLinewidth = 1,
  46198. this.setValues(e)
  46199. }
  46200. ,
  46201. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46202. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46203. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46204. return Ci.Material.prototype.copy.call(this, e),
  46205. this.wireframe = e.wireframe,
  46206. this.wireframeLinewidth = e.wireframeLinewidth,
  46207. this
  46208. }
  46209. ,
  46210. Ci.MeshNormalMaterial = function(e) {
  46211. Ci.Material.call(this, e),
  46212. this.type = "MeshNormalMaterial",
  46213. this.wireframe = !1,
  46214. this.wireframeLinewidth = 1,
  46215. this.morphTargets = !1,
  46216. this.setValues(e)
  46217. }
  46218. ,
  46219. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46220. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46221. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46222. return Ci.Material.prototype.copy.call(this, e),
  46223. this.wireframe = e.wireframe,
  46224. this.wireframeLinewidth = e.wireframeLinewidth,
  46225. this
  46226. }
  46227. ,
  46228. Ci.MultiMaterial = function(e) {
  46229. this.uuid = Ci.Math.generateUUID(),
  46230. this.type = "MultiMaterial",
  46231. this.materials = e instanceof Array ? e : [],
  46232. this.visible = !0
  46233. }
  46234. ,
  46235. Ci.MultiMaterial.prototype = {
  46236. constructor: Ci.MultiMaterial,
  46237. toJSON: function(e) {
  46238. for (var t = {
  46239. metadata: {
  46240. version: 4.2,
  46241. type: "material",
  46242. generator: "MaterialExporter"
  46243. },
  46244. uuid: this.uuid,
  46245. type: this.type,
  46246. materials: []
  46247. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46248. var o = i[n].toJSON(e);
  46249. delete o.metadata,
  46250. t.materials.push(o)
  46251. }
  46252. return t.visible = this.visible,
  46253. t
  46254. },
  46255. clone: function() {
  46256. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46257. e.materials.push(this.materials[t].clone());
  46258. return e.visible = this.visible,
  46259. e
  46260. }
  46261. },
  46262. Ci.PointsMaterial = function(e) {
  46263. Ci.Material.call(this),
  46264. this.type = "PointsMaterial",
  46265. this.color = new Ci.Color(16777215),
  46266. this.map = null,
  46267. this.size = 1,
  46268. this.sizeAttenuation = !0,
  46269. this.blending = Ci.NormalBlending,
  46270. this.vertexColors = Ci.NoColors,
  46271. this.fog = !0,
  46272. this.setValues(e)
  46273. }
  46274. ,
  46275. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46276. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46277. Ci.PointsMaterial.prototype.copy = function(e) {
  46278. return Ci.Material.prototype.copy.call(this, e),
  46279. this.color.copy(e.color),
  46280. this.map = e.map,
  46281. this.size = e.size,
  46282. this.sizeAttenuation = e.sizeAttenuation,
  46283. this.vertexColors = e.vertexColors,
  46284. this.fog = e.fog,
  46285. this
  46286. }
  46287. ,
  46288. Ci.ShaderMaterial = function(e) {
  46289. Ci.Material.call(this),
  46290. this.type = "ShaderMaterial",
  46291. this.defines = {},
  46292. this.uniforms = {},
  46293. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46294. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46295. this.shading = Ci.SmoothShading,
  46296. this.linewidth = 1,
  46297. this.wireframe = !1,
  46298. this.wireframeLinewidth = 1,
  46299. this.fog = !1,
  46300. this.lights = !1,
  46301. this.vertexColors = Ci.NoColors,
  46302. this.skinning = !1,
  46303. this.morphTargets = !1,
  46304. this.morphNormals = !1,
  46305. this.extensions = {
  46306. derivatives: !1,
  46307. fragDepth: !1,
  46308. drawBuffers: !1,
  46309. shaderTextureLOD: !1
  46310. },
  46311. this.defaultAttributeValues = {
  46312. color: [1, 1, 1],
  46313. uv: [0, 0],
  46314. uv2: [0, 0]
  46315. },
  46316. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46317. this.setValues(e))
  46318. }
  46319. ,
  46320. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46321. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46322. Ci.ShaderMaterial.prototype.copy = function(e) {
  46323. return Ci.Material.prototype.copy.call(this, e),
  46324. this.fragmentShader = e.fragmentShader,
  46325. this.vertexShader = e.vertexShader,
  46326. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46327. this.defines = e.defines,
  46328. this.shading = e.shading,
  46329. this.wireframe = e.wireframe,
  46330. this.wireframeLinewidth = e.wireframeLinewidth,
  46331. this.fog = e.fog,
  46332. this.lights = e.lights,
  46333. this.vertexColors = e.vertexColors,
  46334. this.skinning = e.skinning,
  46335. this.morphTargets = e.morphTargets,
  46336. this.morphNormals = e.morphNormals,
  46337. this.extensions = e.extensions,
  46338. this
  46339. }
  46340. ,
  46341. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46342. var t = Ci.Material.prototype.toJSON.call(this, e);
  46343. return t.uniforms = this.uniforms,
  46344. t.vertexShader = this.vertexShader,
  46345. t.fragmentShader = this.fragmentShader,
  46346. t
  46347. }
  46348. ,
  46349. Ci.RawShaderMaterial = function(e) {
  46350. Ci.ShaderMaterial.call(this, e),
  46351. this.type = "RawShaderMaterial"
  46352. }
  46353. ,
  46354. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46355. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46356. Ci.SpriteMaterial = function(e) {
  46357. Ci.Material.call(this),
  46358. this.type = "SpriteMaterial",
  46359. this.color = new Ci.Color(16777215),
  46360. this.map = null,
  46361. this.rotation = 0,
  46362. this.fog = !1,
  46363. this.setValues(e)
  46364. }
  46365. ,
  46366. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46367. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46368. Ci.SpriteMaterial.prototype.copy = function(e) {
  46369. return Ci.Material.prototype.copy.call(this, e),
  46370. this.color.copy(e.color),
  46371. this.map = e.map,
  46372. this.rotation = e.rotation,
  46373. this.fog = e.fog,
  46374. this
  46375. }
  46376. ,
  46377. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46378. Object.defineProperty(this, "id", {
  46379. value: Ci.TextureIdCount++
  46380. }),
  46381. this.uuid = Ci.Math.generateUUID(),
  46382. this.name = "",
  46383. this.sourceFile = "",
  46384. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46385. this.mipmaps = [],
  46386. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46387. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46388. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46389. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46390. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46391. this.anisotropy = void 0 !== l ? l : 1,
  46392. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46393. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46394. this.offset = new Ci.Vector2(0,0),
  46395. this.repeat = new Ci.Vector2(1,1),
  46396. this.generateMipmaps = !0,
  46397. this.premultiplyAlpha = !1,
  46398. this.flipY = !0,
  46399. this.unpackAlignment = 4,
  46400. this.encoding = Ci.LinearEncoding,
  46401. this.version = 0,
  46402. this.onUpdate = null
  46403. }
  46404. ,
  46405. Ci.Texture.DEFAULT_IMAGE = void 0,
  46406. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46407. Ci.Texture.prototype = {
  46408. constructor: Ci.Texture,
  46409. set needsUpdate(e) {
  46410. !0 === e && this.version++
  46411. },
  46412. clone: function() {
  46413. return (new this.constructor).copy(this)
  46414. },
  46415. copy: function(e) {
  46416. return this.image = e.image,
  46417. this.mipmaps = e.mipmaps.slice(0),
  46418. this.mapping = e.mapping,
  46419. this.wrapS = e.wrapS,
  46420. this.wrapT = e.wrapT,
  46421. this.magFilter = e.magFilter,
  46422. this.minFilter = e.minFilter,
  46423. this.anisotropy = e.anisotropy,
  46424. this.format = e.format,
  46425. this.type = e.type,
  46426. this.offset.copy(e.offset),
  46427. this.repeat.copy(e.repeat),
  46428. this.generateMipmaps = e.generateMipmaps,
  46429. this.premultiplyAlpha = e.premultiplyAlpha,
  46430. this.flipY = e.flipY,
  46431. this.unpackAlignment = e.unpackAlignment,
  46432. this.encoding = e.encoding,
  46433. this
  46434. },
  46435. toJSON: function(e) {
  46436. if (void 0 !== e.textures[this.uuid])
  46437. return e.textures[this.uuid];
  46438. var t, i, n = {
  46439. metadata: {
  46440. version: 4.4,
  46441. type: "Texture",
  46442. generator: "Texture.toJSON"
  46443. },
  46444. uuid: this.uuid,
  46445. name: this.name,
  46446. mapping: this.mapping,
  46447. repeat: [this.repeat.x, this.repeat.y],
  46448. offset: [this.offset.x, this.offset.y],
  46449. wrap: [this.wrapS, this.wrapT],
  46450. minFilter: this.minFilter,
  46451. magFilter: this.magFilter,
  46452. anisotropy: this.anisotropy
  46453. };
  46454. if (void 0 !== this.image) {
  46455. var r = this.image;
  46456. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46457. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46458. uuid: r.uuid,
  46459. url: (t = r,
  46460. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46461. i.height = t.height,
  46462. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46463. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46464. }),
  46465. n.image = r.uuid
  46466. }
  46467. return e.textures[this.uuid] = n
  46468. },
  46469. dispose: function() {
  46470. this.dispatchEvent({
  46471. type: "dispose"
  46472. })
  46473. },
  46474. transformUv: function(e) {
  46475. if (this.mapping === Ci.UVMapping) {
  46476. if (e.multiply(this.repeat),
  46477. e.add(this.offset),
  46478. e.x < 0 || 1 < e.x)
  46479. switch (this.wrapS) {
  46480. case Ci.RepeatWrapping:
  46481. e.x = e.x - Math.floor(e.x);
  46482. break;
  46483. case Ci.ClampToEdgeWrapping:
  46484. e.x = e.x < 0 ? 0 : 1;
  46485. break;
  46486. case Ci.MirroredRepeatWrapping:
  46487. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46488. }
  46489. if (e.y < 0 || 1 < e.y)
  46490. switch (this.wrapT) {
  46491. case Ci.RepeatWrapping:
  46492. e.y = e.y - Math.floor(e.y);
  46493. break;
  46494. case Ci.ClampToEdgeWrapping:
  46495. e.y = e.y < 0 ? 0 : 1;
  46496. break;
  46497. case Ci.MirroredRepeatWrapping:
  46498. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46499. }
  46500. this.flipY && (e.y = 1 - e.y)
  46501. }
  46502. }
  46503. },
  46504. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46505. Ci.TextureIdCount = 0,
  46506. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46507. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46508. this.needsUpdate = !0
  46509. }
  46510. ,
  46511. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46512. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46513. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46514. e = void 0 !== e ? e : [],
  46515. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46516. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46517. this.flipY = !1
  46518. }
  46519. ,
  46520. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46521. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46522. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46523. get: function() {
  46524. return this.image
  46525. },
  46526. set: function(e) {
  46527. this.image = e
  46528. }
  46529. }),
  46530. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46531. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46532. this.image = {
  46533. width: t,
  46534. height: i
  46535. },
  46536. this.mipmaps = e,
  46537. this.flipY = !1,
  46538. this.generateMipmaps = !1
  46539. }
  46540. ,
  46541. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46542. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46543. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46544. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46545. this.image = {
  46546. data: e,
  46547. width: t,
  46548. height: i
  46549. },
  46550. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46551. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46552. this.flipY = !1,
  46553. this.generateMipmaps = !1
  46554. }
  46555. ,
  46556. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46557. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46558. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46559. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46560. this.generateMipmaps = !1;
  46561. var c = this;
  46562. !function e() {
  46563. requestAnimationFrame(e),
  46564. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46565. }()
  46566. }
  46567. ,
  46568. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46569. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46570. Ci.Group = function() {
  46571. Ci.Object3D.call(this),
  46572. this.type = "Group"
  46573. }
  46574. ,
  46575. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46576. Ci.Group.prototype.constructor = Ci.Group,
  46577. Ci.Points = function(e, t) {
  46578. Ci.Object3D.call(this),
  46579. this.type = "Points",
  46580. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46581. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46582. color: 16777215 * Math.random()
  46583. })
  46584. }
  46585. ,
  46586. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46587. Ci.Points.prototype.constructor = Ci.Points,
  46588. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46589. jt = new Ci.Ray,
  46590. Yt = new Ci.Sphere,
  46591. function(o, a) {
  46592. function e(e, t) {
  46593. var i = jt.distanceSqToPoint(e);
  46594. if (i < c) {
  46595. var n = jt.closestPointToPoint(e);
  46596. n.applyMatrix4(l);
  46597. var r = o.ray.origin.distanceTo(n);
  46598. if (r < o.near || r > o.far)
  46599. return;
  46600. a.push({
  46601. distance: r,
  46602. distanceToRay: Math.sqrt(i),
  46603. point: n.clone(),
  46604. index: t,
  46605. face: null,
  46606. object: s
  46607. })
  46608. }
  46609. }
  46610. var s = this
  46611. , t = this.geometry
  46612. , l = this.matrixWorld
  46613. , i = o.params.Points.threshold;
  46614. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46615. Yt.copy(t.boundingSphere),
  46616. Yt.applyMatrix4(l),
  46617. !1 !== o.ray.intersectsSphere(Yt)) {
  46618. Wt.getInverse(l),
  46619. jt.copy(o.ray).applyMatrix4(Wt);
  46620. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46621. , c = n * n
  46622. , r = new Ci.Vector3;
  46623. if (t instanceof Ci.BufferGeometry) {
  46624. var h = t.index
  46625. , u = t.attributes.position.array;
  46626. if (null !== h)
  46627. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46628. var g = d[p];
  46629. r.fromArray(u, 3 * g),
  46630. e(r, g)
  46631. }
  46632. else {
  46633. p = 0;
  46634. for (var m = u.length / 3; p < m; p++)
  46635. r.fromArray(u, 3 * p),
  46636. e(r, p)
  46637. }
  46638. } else {
  46639. var v = t.vertices;
  46640. for (p = 0,
  46641. m = v.length; p < m; p++)
  46642. e(v[p], p)
  46643. }
  46644. }
  46645. }
  46646. ),
  46647. Ci.Points.prototype.clone = function() {
  46648. return new this.constructor(this.geometry,this.material).copy(this)
  46649. }
  46650. ,
  46651. Ci.Line = function(e, t, i) {
  46652. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46653. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46654. this.type = "Line",
  46655. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46656. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46657. color: 16777215 * Math.random()
  46658. })))
  46659. }
  46660. ,
  46661. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46662. Ci.Line.prototype.constructor = Ci.Line,
  46663. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46664. zt = new Ci.Ray,
  46665. Gt = new Ci.Sphere,
  46666. function(e, t) {
  46667. var i = e.linePrecision
  46668. , n = i * i
  46669. , r = this.geometry
  46670. , o = this.matrixWorld;
  46671. if (null === r.boundingSphere && r.computeBoundingSphere(),
  46672. Gt.copy(r.boundingSphere),
  46673. Gt.applyMatrix4(o),
  46674. !1 !== e.ray.intersectsSphere(Gt)) {
  46675. Ht.getInverse(o),
  46676. zt.copy(e.ray).applyMatrix4(Ht);
  46677. var a = new Ci.Vector3
  46678. , s = new Ci.Vector3
  46679. , l = new Ci.Vector3
  46680. , c = new Ci.Vector3
  46681. , h = this instanceof Ci.LineSegments ? 2 : 1;
  46682. if (r instanceof Ci.BufferGeometry) {
  46683. var u = r.index
  46684. , d = r.attributes.position.array;
  46685. if (null !== u)
  46686. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  46687. var m = p[f]
  46688. , v = p[f + 1];
  46689. a.fromArray(d, 3 * m),
  46690. s.fromArray(d, 3 * v),
  46691. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46692. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46693. distance: C,
  46694. point: l.clone().applyMatrix4(this.matrixWorld),
  46695. index: f,
  46696. face: null,
  46697. faceIndex: null,
  46698. object: this
  46699. }))
  46700. }
  46701. else
  46702. for (f = 0,
  46703. g = d.length / 3 - 1; f < g; f += h)
  46704. a.fromArray(d, 3 * f),
  46705. s.fromArray(d, 3 * f + 3),
  46706. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46707. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46708. distance: C,
  46709. point: l.clone().applyMatrix4(this.matrixWorld),
  46710. index: f,
  46711. face: null,
  46712. faceIndex: null,
  46713. object: this
  46714. }))
  46715. } else if (r instanceof Ci.Geometry) {
  46716. var y = r.vertices
  46717. , A = y.length;
  46718. for (f = 0; f < A - 1; f += h) {
  46719. var C;
  46720. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  46721. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46722. distance: C,
  46723. point: l.clone().applyMatrix4(this.matrixWorld),
  46724. index: f,
  46725. face: null,
  46726. faceIndex: null,
  46727. object: this
  46728. }))
  46729. }
  46730. }
  46731. }
  46732. }
  46733. ),
  46734. Ci.Line.prototype.clone = function() {
  46735. return new this.constructor(this.geometry,this.material).copy(this)
  46736. }
  46737. ,
  46738. Ci.LineStrip = 0,
  46739. Ci.LinePieces = 1,
  46740. Ci.LineSegments = function(e, t) {
  46741. Ci.Line.call(this, e, t),
  46742. this.type = "LineSegments"
  46743. }
  46744. ,
  46745. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  46746. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  46747. Ci.Mesh = function(e, t) {
  46748. Ci.Object3D.call(this),
  46749. this.type = "Mesh",
  46750. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46751. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  46752. color: 16777215 * Math.random()
  46753. }),
  46754. this.drawMode = Ci.TrianglesDrawMode,
  46755. this.updateMorphTargets()
  46756. }
  46757. ,
  46758. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  46759. Ci.Mesh.prototype.constructor = Ci.Mesh,
  46760. Ci.Mesh.prototype.setDrawMode = function(e) {
  46761. this.drawMode = e
  46762. }
  46763. ,
  46764. Ci.Mesh.prototype.updateMorphTargets = function() {
  46765. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  46766. this.morphTargetBase = -1,
  46767. this.morphTargetInfluences = [],
  46768. this.morphTargetDictionary = {};
  46769. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  46770. this.morphTargetInfluences.push(0),
  46771. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  46772. }
  46773. }
  46774. ,
  46775. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  46776. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  46777. 0)
  46778. }
  46779. ,
  46780. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  46781. xt = new Ci.Ray,
  46782. St = new Ci.Sphere,
  46783. Mt = new Ci.Vector3,
  46784. Rt = new Ci.Vector3,
  46785. Pt = new Ci.Vector3,
  46786. Ot = new Ci.Vector3,
  46787. Lt = new Ci.Vector3,
  46788. Dt = new Ci.Vector3,
  46789. Nt = new Ci.Vector2,
  46790. Ft = new Ci.Vector2,
  46791. Bt = new Ci.Vector2,
  46792. Vt = new Ci.Vector3,
  46793. kt = new Ci.Vector3,
  46794. Ut = new Ci.Vector3,
  46795. function(e, t) {
  46796. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  46797. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  46798. St.copy(r.boundingSphere),
  46799. St.applyMatrix4(a),
  46800. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  46801. xt.copy(e.ray).applyMatrix4(Tt),
  46802. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  46803. if (r instanceof Ci.BufferGeometry) {
  46804. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  46805. if (void 0 !== u.uv && (i = u.uv.array),
  46806. null !== h)
  46807. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  46808. s = p[f],
  46809. l = p[f + 1],
  46810. c = p[f + 2],
  46811. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  46812. t.push(n));
  46813. else
  46814. for (f = 0,
  46815. g = d.length; f < g; f += 9)
  46816. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  46817. t.push(n))
  46818. } else if (r instanceof Ci.Geometry) {
  46819. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  46820. 0 < _.length && (i = _);
  46821. for (var b = 0, w = E.length; b < w; b++) {
  46822. var T = E[b]
  46823. , x = 1 == A ? C[T.materialIndex] : o;
  46824. if (void 0 !== x) {
  46825. if (m = I[T.a],
  46826. v = I[T.b],
  46827. y = I[T.c],
  46828. !0 === x.morphTargets) {
  46829. var S = r.morphTargets
  46830. , M = this.morphTargetInfluences;
  46831. Mt.set(0, 0, 0),
  46832. Rt.set(0, 0, 0),
  46833. Pt.set(0, 0, 0);
  46834. for (var R = 0, P = S.length; R < P; R++) {
  46835. var O = M[R];
  46836. if (0 !== O) {
  46837. var L = S[R].vertices;
  46838. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  46839. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  46840. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  46841. }
  46842. }
  46843. Mt.add(m),
  46844. Rt.add(v),
  46845. Pt.add(y),
  46846. m = Mt,
  46847. v = Rt,
  46848. y = Pt
  46849. }
  46850. if (n = wi(this, e, xt, m, v, y, kt)) {
  46851. if (i) {
  46852. var D = i[b];
  46853. Nt.copy(D[0]),
  46854. Ft.copy(D[1]),
  46855. Bt.copy(D[2]),
  46856. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  46857. }
  46858. n.face = T,
  46859. n.faceIndex = b,
  46860. t.push(n)
  46861. }
  46862. }
  46863. }
  46864. }
  46865. }
  46866. ),
  46867. Ci.Mesh.prototype.clone = function() {
  46868. return new this.constructor(this.geometry,this.material).copy(this)
  46869. }
  46870. ,
  46871. Ci.Bone = function(e) {
  46872. Ci.Object3D.call(this),
  46873. this.type = "Bone",
  46874. this.skin = e
  46875. }
  46876. ,
  46877. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  46878. Ci.Bone.prototype.constructor = Ci.Bone,
  46879. Ci.Bone.prototype.copy = function(e) {
  46880. return Ci.Object3D.prototype.copy.call(this, e),
  46881. this.skin = e.skin,
  46882. this
  46883. }
  46884. ,
  46885. Ci.Skeleton = function(e, t, i) {
  46886. if (this.useVertexTexture = void 0 === i || i,
  46887. this.identityMatrix = new Ci.Matrix4,
  46888. e = e || [],
  46889. this.bones = e.slice(0),
  46890. this.useVertexTexture) {
  46891. var n = Math.sqrt(4 * this.bones.length);
  46892. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  46893. n = Math.max(n, 4),
  46894. this.boneTextureWidth = n,
  46895. this.boneTextureHeight = n,
  46896. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  46897. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  46898. } else
  46899. this.boneMatrices = new Float32Array(16 * this.bones.length);
  46900. if (void 0 === t)
  46901. this.calculateInverses();
  46902. else if (this.bones.length === t.length)
  46903. this.boneInverses = t.slice(0);
  46904. else {
  46905. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  46906. this.boneInverses = [];
  46907. for (var r = 0, o = this.bones.length; r < o; r++)
  46908. this.boneInverses.push(new Ci.Matrix4)
  46909. }
  46910. }
  46911. ,
  46912. Ci.Skeleton.prototype.calculateInverses = function() {
  46913. this.boneInverses = [];
  46914. for (var e = 0, t = this.bones.length; e < t; e++) {
  46915. var i = new Ci.Matrix4;
  46916. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  46917. this.boneInverses.push(i)
  46918. }
  46919. }
  46920. ,
  46921. Ci.Skeleton.prototype.pose = function() {
  46922. for (var e, t = 0, i = this.bones.length; t < i; t++)
  46923. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  46924. for (t = 0,
  46925. i = this.bones.length; t < i; t++)
  46926. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  46927. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  46928. e.matrix.decompose(e.position, e.quaternion, e.scale))
  46929. }
  46930. ,
  46931. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  46932. function() {
  46933. for (var e = 0, t = this.bones.length; e < t; e++) {
  46934. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  46935. wt.multiplyMatrices(i, this.boneInverses[e]),
  46936. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  46937. }
  46938. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  46939. }
  46940. ),
  46941. Ci.Skeleton.prototype.clone = function() {
  46942. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  46943. }
  46944. ,
  46945. Ci.SkinnedMesh = function(e, t, i) {
  46946. Ci.Mesh.call(this, e, t),
  46947. this.type = "SkinnedMesh",
  46948. this.bindMode = "attached",
  46949. this.bindMatrix = new Ci.Matrix4,
  46950. this.bindMatrixInverse = new Ci.Matrix4;
  46951. var n = [];
  46952. if (this.geometry && void 0 !== this.geometry.bones) {
  46953. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  46954. o = this.geometry.bones[a],
  46955. r = new Ci.Bone(this),
  46956. n.push(r),
  46957. r.name = o.name,
  46958. r.position.fromArray(o.pos),
  46959. r.quaternion.fromArray(o.rotq),
  46960. void 0 !== o.scl && r.scale.fromArray(o.scl);
  46961. for (a = 0,
  46962. s = this.geometry.bones.length; a < s; ++a)
  46963. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  46964. }
  46965. this.normalizeSkinWeights(),
  46966. this.updateMatrixWorld(!0),
  46967. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  46968. }
  46969. ,
  46970. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  46971. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  46972. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  46973. this.skeleton = e,
  46974. void 0 === t && (this.updateMatrixWorld(!0),
  46975. this.skeleton.calculateInverses(),
  46976. t = this.matrixWorld),
  46977. this.bindMatrix.copy(t),
  46978. this.bindMatrixInverse.getInverse(t)
  46979. }
  46980. ,
  46981. Ci.SkinnedMesh.prototype.pose = function() {
  46982. this.skeleton.pose()
  46983. }
  46984. ,
  46985. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  46986. if (this.geometry instanceof Ci.Geometry)
  46987. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  46988. var t = this.geometry.skinWeights[e];
  46989. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  46990. }
  46991. else if (this.geometry instanceof Ci.BufferGeometry) {
  46992. var i = new Ci.Vector4
  46993. , n = this.geometry.attributes.skinWeight;
  46994. for (e = 0; e < n.count; e++) {
  46995. var r;
  46996. i.x = n.getX(e),
  46997. i.y = n.getY(e),
  46998. i.z = n.getZ(e),
  46999. i.w = n.getW(e),
  47000. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47001. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47002. }
  47003. }
  47004. }
  47005. ,
  47006. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47007. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47008. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47009. }
  47010. ,
  47011. Ci.SkinnedMesh.prototype.clone = function() {
  47012. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47013. }
  47014. ,
  47015. Ci.LOD = function() {
  47016. Ci.Object3D.call(this),
  47017. this.type = "LOD",
  47018. Object.defineProperties(this, {
  47019. levels: {
  47020. enumerable: !0,
  47021. value: []
  47022. },
  47023. objects: {
  47024. get: function() {
  47025. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47026. this.levels
  47027. }
  47028. }
  47029. })
  47030. }
  47031. ,
  47032. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47033. Ci.LOD.prototype.constructor = Ci.LOD,
  47034. Ci.LOD.prototype.addLevel = function(e, t) {
  47035. void 0 === t && (t = 0),
  47036. t = Math.abs(t);
  47037. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47038. ;
  47039. i.splice(n, 0, {
  47040. distance: t,
  47041. object: e
  47042. }),
  47043. this.add(e)
  47044. }
  47045. ,
  47046. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47047. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47048. ;
  47049. return t[i - 1].object
  47050. }
  47051. ,
  47052. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47053. function(e, t) {
  47054. bt.setFromMatrixPosition(this.matrixWorld);
  47055. var i = e.ray.origin.distanceTo(bt);
  47056. this.getObjectForDistance(i).raycast(e, t)
  47057. }
  47058. ),
  47059. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47060. _t = new Ci.Vector3,
  47061. function(e) {
  47062. var t = this.levels;
  47063. if (1 < t.length) {
  47064. Et.setFromMatrixPosition(e.matrixWorld),
  47065. _t.setFromMatrixPosition(this.matrixWorld);
  47066. var i = Et.distanceTo(_t);
  47067. t[0].object.visible = !0;
  47068. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47069. t[n - 1].object.visible = !1,
  47070. t[n].object.visible = !0;
  47071. for (; n < r; n++)
  47072. t[n].object.visible = !1
  47073. }
  47074. }
  47075. ),
  47076. Ci.LOD.prototype.copy = function(e) {
  47077. Ci.Object3D.prototype.copy.call(this, e, !1);
  47078. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47079. var r = t[i];
  47080. this.addLevel(r.object.clone(), r.distance)
  47081. }
  47082. return this
  47083. }
  47084. ,
  47085. Ci.LOD.prototype.toJSON = function(e) {
  47086. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47087. t.object.levels = [];
  47088. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47089. var o = i[n];
  47090. t.object.levels.push({
  47091. object: o.object.uuid,
  47092. distance: o.distance
  47093. })
  47094. }
  47095. return t
  47096. }
  47097. ,
  47098. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47099. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47100. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47101. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47102. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47103. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47104. function(e) {
  47105. Ci.Object3D.call(this),
  47106. this.type = "Sprite",
  47107. this.geometry = It,
  47108. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47109. }
  47110. ),
  47111. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47112. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47113. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47114. function(e, t) {
  47115. vt.setFromMatrixPosition(this.matrixWorld);
  47116. var i = e.ray.distanceSqToPoint(vt);
  47117. this.scale.x * this.scale.y < i || t.push({
  47118. distance: Math.sqrt(i),
  47119. point: this.position,
  47120. face: null,
  47121. object: this
  47122. })
  47123. }
  47124. ),
  47125. Ci.Sprite.prototype.clone = function() {
  47126. return new this.constructor(this.material).copy(this)
  47127. }
  47128. ,
  47129. Ci.Particle = Ci.Sprite,
  47130. Ci.LensFlare = function(e, t, i, n, r) {
  47131. Ci.Object3D.call(this),
  47132. this.lensFlares = [],
  47133. this.positionScreen = new Ci.Vector3,
  47134. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47135. }
  47136. ,
  47137. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47138. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47139. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47140. void 0 === t && (t = -1),
  47141. void 0 === i && (i = 0),
  47142. void 0 === o && (o = 1),
  47143. void 0 === r && (r = new Ci.Color(16777215)),
  47144. void 0 === n && (n = Ci.NormalBlending),
  47145. i = Math.min(i, Math.max(0, i)),
  47146. this.lensFlares.push({
  47147. texture: e,
  47148. size: t,
  47149. distance: i,
  47150. x: 0,
  47151. y: 0,
  47152. z: 0,
  47153. scale: 1,
  47154. rotation: 0,
  47155. opacity: o,
  47156. color: r,
  47157. blending: n
  47158. })
  47159. }
  47160. ,
  47161. Ci.LensFlare.prototype.updateLensFlares = function() {
  47162. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47163. for (e = 0; e < i; e++)
  47164. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47165. t.y = this.positionScreen.y + r * t.distance,
  47166. t.wantedRotation = t.x * Math.PI * .25,
  47167. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47168. }
  47169. ,
  47170. Ci.LensFlare.prototype.copy = function(e) {
  47171. Ci.Object3D.prototype.copy.call(this, e),
  47172. this.positionScreen.copy(e.positionScreen),
  47173. this.customUpdateCallback = e.customUpdateCallback;
  47174. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47175. this.lensFlares.push(e.lensFlares[t]);
  47176. return this
  47177. }
  47178. ,
  47179. Ci.Scene = function() {
  47180. Ci.Object3D.call(this),
  47181. this.type = "Scene",
  47182. this.fog = null,
  47183. this.overrideMaterial = null,
  47184. this.autoUpdate = !0
  47185. }
  47186. ,
  47187. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47188. Ci.Scene.prototype.constructor = Ci.Scene,
  47189. Ci.Scene.prototype.copy = function(e, t) {
  47190. return Ci.Object3D.prototype.copy.call(this, e, t),
  47191. null !== e.fog && (this.fog = e.fog.clone()),
  47192. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47193. this.autoUpdate = e.autoUpdate,
  47194. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47195. this
  47196. }
  47197. ,
  47198. Ci.Fog = function(e, t, i) {
  47199. this.name = "",
  47200. this.color = new Ci.Color(e),
  47201. this.near = void 0 !== t ? t : 1,
  47202. this.far = void 0 !== i ? i : 1e3
  47203. }
  47204. ,
  47205. Ci.Fog.prototype.clone = function() {
  47206. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47207. }
  47208. ,
  47209. Ci.FogExp2 = function(e, t) {
  47210. this.name = "",
  47211. this.color = new Ci.Color(e),
  47212. this.density = void 0 !== t ? t : 25e-5
  47213. }
  47214. ,
  47215. Ci.FogExp2.prototype.clone = function() {
  47216. return new Ci.FogExp2(this.color.getHex(),this.density)
  47217. }
  47218. ,
  47219. Ci.ShaderChunk = {},
  47220. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47221. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47222. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47223. Ci.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  47224. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47225. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47226. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47227. Ci.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  47228. Ci.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  47229. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47230. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47231. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47232. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47233. Ci.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  47234. Ci.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  47235. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47236. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47237. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47238. Ci.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  47239. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47240. Ci.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  47241. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47242. Ci.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  47243. Ci.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  47244. Ci.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  47245. Ci.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  47246. Ci.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  47247. Ci.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  47248. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47249. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47250. Ci.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  47251. Ci.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  47252. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47253. Ci.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  47254. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47255. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47256. Ci.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  47257. Ci.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  47258. Ci.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  47259. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47260. Ci.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  47261. Ci.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  47262. Ci.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  47263. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47264. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47265. Ci.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  47266. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47267. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47268. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47269. Ci.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  47270. Ci.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",
  47271. Ci.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",
  47272. Ci.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  47273. Ci.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  47274. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47275. Ci.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  47276. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47277. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47278. Ci.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  47279. Ci.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  47280. Ci.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  47281. Ci.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  47282. Ci.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  47283. Ci.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  47284. Ci.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  47285. Ci.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  47286. Ci.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  47287. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47288. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47289. Ci.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  47290. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47291. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47292. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47293. Ci.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  47294. Ci.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  47295. Ci.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  47296. Ci.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  47297. Ci.UniformsUtils = {
  47298. merge: function(e) {
  47299. for (var t = {}, i = 0; i < e.length; i++) {
  47300. var n = this.clone(e[i]);
  47301. for (var r in n)
  47302. t[r] = n[r]
  47303. }
  47304. return t
  47305. },
  47306. clone: function(e) {
  47307. var t = {};
  47308. for (var i in e)
  47309. for (var n in t[i] = {},
  47310. e[i]) {
  47311. var r = e[i][n];
  47312. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  47313. }
  47314. return t
  47315. }
  47316. },
  47317. Ci.UniformsLib = {
  47318. common: {
  47319. diffuse: {
  47320. type: "c",
  47321. value: new Ci.Color(15658734)
  47322. },
  47323. opacity: {
  47324. type: "f",
  47325. value: 1
  47326. },
  47327. map: {
  47328. type: "t",
  47329. value: null
  47330. },
  47331. offsetRepeat: {
  47332. type: "v4",
  47333. value: new Ci.Vector4(0,0,1,1)
  47334. },
  47335. specularMap: {
  47336. type: "t",
  47337. value: null
  47338. },
  47339. alphaMap: {
  47340. type: "t",
  47341. value: null
  47342. },
  47343. envMap: {
  47344. type: "t",
  47345. value: null
  47346. },
  47347. flipEnvMap: {
  47348. type: "f",
  47349. value: -1
  47350. },
  47351. reflectivity: {
  47352. type: "f",
  47353. value: 1
  47354. },
  47355. refractionRatio: {
  47356. type: "f",
  47357. value: .98
  47358. }
  47359. },
  47360. aomap: {
  47361. aoMap: {
  47362. type: "t",
  47363. value: null
  47364. },
  47365. aoMapIntensity: {
  47366. type: "f",
  47367. value: 1
  47368. }
  47369. },
  47370. lightmap: {
  47371. lightMap: {
  47372. type: "t",
  47373. value: null
  47374. },
  47375. lightMapIntensity: {
  47376. type: "f",
  47377. value: 1
  47378. }
  47379. },
  47380. emissivemap: {
  47381. emissiveMap: {
  47382. type: "t",
  47383. value: null
  47384. }
  47385. },
  47386. bumpmap: {
  47387. bumpMap: {
  47388. type: "t",
  47389. value: null
  47390. },
  47391. bumpScale: {
  47392. type: "f",
  47393. value: 1
  47394. }
  47395. },
  47396. normalmap: {
  47397. normalMap: {
  47398. type: "t",
  47399. value: null
  47400. },
  47401. normalScale: {
  47402. type: "v2",
  47403. value: new Ci.Vector2(1,1)
  47404. }
  47405. },
  47406. displacementmap: {
  47407. displacementMap: {
  47408. type: "t",
  47409. value: null
  47410. },
  47411. displacementScale: {
  47412. type: "f",
  47413. value: 1
  47414. },
  47415. displacementBias: {
  47416. type: "f",
  47417. value: 0
  47418. }
  47419. },
  47420. roughnessmap: {
  47421. roughnessMap: {
  47422. type: "t",
  47423. value: null
  47424. }
  47425. },
  47426. metalnessmap: {
  47427. metalnessMap: {
  47428. type: "t",
  47429. value: null
  47430. }
  47431. },
  47432. fog: {
  47433. fogDensity: {
  47434. type: "f",
  47435. value: 25e-5
  47436. },
  47437. fogNear: {
  47438. type: "f",
  47439. value: 1
  47440. },
  47441. fogFar: {
  47442. type: "f",
  47443. value: 2e3
  47444. },
  47445. fogColor: {
  47446. type: "c",
  47447. value: new Ci.Color(16777215)
  47448. }
  47449. },
  47450. lights: {
  47451. ambientLightColor: {
  47452. type: "fv",
  47453. value: []
  47454. },
  47455. directionalLights: {
  47456. type: "sa",
  47457. value: [],
  47458. properties: {
  47459. direction: {
  47460. type: "v3"
  47461. },
  47462. color: {
  47463. type: "c"
  47464. },
  47465. shadow: {
  47466. type: "i"
  47467. },
  47468. shadowBias: {
  47469. type: "f"
  47470. },
  47471. shadowRadius: {
  47472. type: "f"
  47473. },
  47474. shadowMapSize: {
  47475. type: "v2"
  47476. }
  47477. }
  47478. },
  47479. directionalShadowMap: {
  47480. type: "tv",
  47481. value: []
  47482. },
  47483. directionalShadowMatrix: {
  47484. type: "m4v",
  47485. value: []
  47486. },
  47487. spotLights: {
  47488. type: "sa",
  47489. value: [],
  47490. properties: {
  47491. color: {
  47492. type: "c"
  47493. },
  47494. position: {
  47495. type: "v3"
  47496. },
  47497. direction: {
  47498. type: "v3"
  47499. },
  47500. distance: {
  47501. type: "f"
  47502. },
  47503. coneCos: {
  47504. type: "f"
  47505. },
  47506. penumbraCos: {
  47507. type: "f"
  47508. },
  47509. decay: {
  47510. type: "f"
  47511. },
  47512. shadow: {
  47513. type: "i"
  47514. },
  47515. shadowBias: {
  47516. type: "f"
  47517. },
  47518. shadowRadius: {
  47519. type: "f"
  47520. },
  47521. shadowMapSize: {
  47522. type: "v2"
  47523. }
  47524. }
  47525. },
  47526. spotShadowMap: {
  47527. type: "tv",
  47528. value: []
  47529. },
  47530. spotShadowMatrix: {
  47531. type: "m4v",
  47532. value: []
  47533. },
  47534. pointLights: {
  47535. type: "sa",
  47536. value: [],
  47537. properties: {
  47538. color: {
  47539. type: "c"
  47540. },
  47541. position: {
  47542. type: "v3"
  47543. },
  47544. decay: {
  47545. type: "f"
  47546. },
  47547. distance: {
  47548. type: "f"
  47549. },
  47550. shadow: {
  47551. type: "i"
  47552. },
  47553. shadowBias: {
  47554. type: "f"
  47555. },
  47556. shadowRadius: {
  47557. type: "f"
  47558. },
  47559. shadowMapSize: {
  47560. type: "v2"
  47561. }
  47562. }
  47563. },
  47564. pointShadowMap: {
  47565. type: "tv",
  47566. value: []
  47567. },
  47568. pointShadowMatrix: {
  47569. type: "m4v",
  47570. value: []
  47571. },
  47572. hemisphereLights: {
  47573. type: "sa",
  47574. value: [],
  47575. properties: {
  47576. direction: {
  47577. type: "v3"
  47578. },
  47579. skyColor: {
  47580. type: "c"
  47581. },
  47582. groundColor: {
  47583. type: "c"
  47584. }
  47585. }
  47586. }
  47587. },
  47588. points: {
  47589. diffuse: {
  47590. type: "c",
  47591. value: new Ci.Color(15658734)
  47592. },
  47593. opacity: {
  47594. type: "f",
  47595. value: 1
  47596. },
  47597. size: {
  47598. type: "f",
  47599. value: 1
  47600. },
  47601. scale: {
  47602. type: "f",
  47603. value: 1
  47604. },
  47605. map: {
  47606. type: "t",
  47607. value: null
  47608. },
  47609. offsetRepeat: {
  47610. type: "v4",
  47611. value: new Ci.Vector4(0,0,1,1)
  47612. }
  47613. }
  47614. },
  47615. Ci.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  47616. Ci.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  47617. Ci.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  47618. Ci.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47619. Ci.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  47620. Ci.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47621. Ci.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  47622. Ci.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  47623. Ci.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  47624. Ci.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  47625. Ci.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47626. Ci.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  47627. Ci.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47628. Ci.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  47629. Ci.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47630. Ci.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47631. Ci.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47632. Ci.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47633. Ci.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47634. Ci.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47635. Ci.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  47636. Ci.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  47637. Ci.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  47638. Ci.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  47639. Ci.ShaderLib = {
  47640. basic: {
  47641. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47642. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47643. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47644. },
  47645. lambert: {
  47646. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47647. emissive: {
  47648. type: "c",
  47649. value: new Ci.Color(0)
  47650. }
  47651. }]),
  47652. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47653. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47654. },
  47655. phong: {
  47656. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47657. emissive: {
  47658. type: "c",
  47659. value: new Ci.Color(0)
  47660. },
  47661. specular: {
  47662. type: "c",
  47663. value: new Ci.Color(1118481)
  47664. },
  47665. shininess: {
  47666. type: "f",
  47667. value: 30
  47668. }
  47669. }]),
  47670. vertexShader: Ci.ShaderChunk.meshphong_vert,
  47671. fragmentShader: Ci.ShaderChunk.meshphong_frag
  47672. },
  47673. standard: {
  47674. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47675. emissive: {
  47676. type: "c",
  47677. value: new Ci.Color(0)
  47678. },
  47679. roughness: {
  47680. type: "f",
  47681. value: .5
  47682. },
  47683. metalness: {
  47684. type: "f",
  47685. value: 0
  47686. },
  47687. envMapIntensity: {
  47688. type: "f",
  47689. value: 1
  47690. }
  47691. }]),
  47692. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  47693. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  47694. },
  47695. points: {
  47696. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  47697. vertexShader: Ci.ShaderChunk.points_vert,
  47698. fragmentShader: Ci.ShaderChunk.points_frag
  47699. },
  47700. dashed: {
  47701. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  47702. scale: {
  47703. type: "f",
  47704. value: 1
  47705. },
  47706. dashSize: {
  47707. type: "f",
  47708. value: 1
  47709. },
  47710. totalSize: {
  47711. type: "f",
  47712. value: 2
  47713. }
  47714. }]),
  47715. vertexShader: Ci.ShaderChunk.linedashed_vert,
  47716. fragmentShader: Ci.ShaderChunk.linedashed_frag
  47717. },
  47718. depth: {
  47719. uniforms: {
  47720. mNear: {
  47721. type: "f",
  47722. value: 1
  47723. },
  47724. mFar: {
  47725. type: "f",
  47726. value: 2e3
  47727. },
  47728. opacity: {
  47729. type: "f",
  47730. value: 1
  47731. }
  47732. },
  47733. vertexShader: Ci.ShaderChunk.depth_vert,
  47734. fragmentShader: Ci.ShaderChunk.depth_frag
  47735. },
  47736. normal: {
  47737. uniforms: {
  47738. opacity: {
  47739. type: "f",
  47740. value: 1
  47741. }
  47742. },
  47743. vertexShader: Ci.ShaderChunk.normal_vert,
  47744. fragmentShader: Ci.ShaderChunk.normal_frag
  47745. },
  47746. cube: {
  47747. uniforms: {
  47748. tCube: {
  47749. type: "t",
  47750. value: null
  47751. },
  47752. tFlip: {
  47753. type: "f",
  47754. value: -1
  47755. }
  47756. },
  47757. vertexShader: Ci.ShaderChunk.cube_vert,
  47758. fragmentShader: Ci.ShaderChunk.cube_frag
  47759. },
  47760. equirect: {
  47761. uniforms: {
  47762. tEquirect: {
  47763. type: "t",
  47764. value: null
  47765. },
  47766. tFlip: {
  47767. type: "f",
  47768. value: -1
  47769. }
  47770. },
  47771. vertexShader: Ci.ShaderChunk.equirect_vert,
  47772. fragmentShader: Ci.ShaderChunk.equirect_frag
  47773. },
  47774. depthRGBA: {
  47775. uniforms: {},
  47776. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  47777. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  47778. },
  47779. distanceRGBA: {
  47780. uniforms: {
  47781. lightPos: {
  47782. type: "v3",
  47783. value: new Ci.Vector3(0,0,0)
  47784. }
  47785. },
  47786. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  47787. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  47788. }
  47789. },
  47790. Ci.WebGLRenderer = function(e) {
  47791. function S() {
  47792. return null === Q ? he : 1
  47793. }
  47794. function i(e, t, i, n) {
  47795. !0 === V && (e *= n,
  47796. t *= n,
  47797. i *= n),
  47798. _e.clearColor(e, t, i, n)
  47799. }
  47800. function t() {
  47801. _e.init(),
  47802. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  47803. _e.viewport(re.copy(pe).multiplyScalar(he)),
  47804. i(ae.r, ae.g, ae.b, se)
  47805. }
  47806. function n() {
  47807. te = K = null,
  47808. ee = "",
  47809. $ = -1,
  47810. _e.reset()
  47811. }
  47812. function r(e) {
  47813. e.preventDefault(),
  47814. n(),
  47815. t(),
  47816. be.clear()
  47817. }
  47818. function f(e) {
  47819. var t = e.target;
  47820. t.removeEventListener("dispose", f),
  47821. function(e) {
  47822. var t = be.get(e);
  47823. if (e.image && t.__image__webglTextureCube)
  47824. X.deleteTexture(t.__image__webglTextureCube);
  47825. else {
  47826. if (void 0 === t.__webglInit)
  47827. return;
  47828. X.deleteTexture(t.__webglTexture)
  47829. }
  47830. be.delete(e)
  47831. }(t),
  47832. ye.textures--
  47833. }
  47834. function a(e) {
  47835. var t = e.target;
  47836. t.removeEventListener("dispose", a),
  47837. function(e) {
  47838. var t = be.get(e)
  47839. , i = be.get(e.texture);
  47840. if (e && void 0 !== i.__webglTexture) {
  47841. if (X.deleteTexture(i.__webglTexture),
  47842. e instanceof Ci.WebGLRenderTargetCube)
  47843. for (var n = 0; n < 6; n++)
  47844. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  47845. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  47846. else
  47847. X.deleteFramebuffer(t.__webglFramebuffer),
  47848. X.deleteRenderbuffer(t.__webglDepthbuffer);
  47849. be.delete(e.texture),
  47850. be.delete(e)
  47851. }
  47852. }(t),
  47853. ye.textures--
  47854. }
  47855. function v(e) {
  47856. var t = e.target;
  47857. t.removeEventListener("dispose", v),
  47858. function(e) {
  47859. y(e),
  47860. be.delete(e)
  47861. }(t)
  47862. }
  47863. function y(e) {
  47864. var t = be.get(e).program;
  47865. (e.program = void 0) !== t && Te.releaseProgram(t)
  47866. }
  47867. function M(e, t) {
  47868. return Math.abs(t[0]) - Math.abs(e[0])
  47869. }
  47870. function s(e, t) {
  47871. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
  47872. }
  47873. function l(e, t) {
  47874. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  47875. }
  47876. function d(e, t, i, n, r) {
  47877. var o, a;
  47878. a = i.transparent ? (o = G,
  47879. ++W) : (o = H,
  47880. ++z);
  47881. var s = o[a];
  47882. void 0 !== s ? (s.id = e.id,
  47883. s.object = e,
  47884. s.geometry = t,
  47885. s.material = i,
  47886. s.z = me.z,
  47887. s.group = r) : (s = {
  47888. id: e.id,
  47889. object: e,
  47890. geometry: t,
  47891. material: i,
  47892. z: me.z,
  47893. group: r
  47894. },
  47895. o.push(s))
  47896. }
  47897. function c(e, t, i, n) {
  47898. for (var r = 0, o = e.length; r < o; r++) {
  47899. var a = e[r]
  47900. , s = a.object
  47901. , l = a.geometry
  47902. , c = void 0 === n ? a.material : n
  47903. , h = a.group;
  47904. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  47905. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  47906. s instanceof Ci.ImmediateRenderObject) {
  47907. R(c);
  47908. var u = P(t, i, c, s);
  47909. ee = "",
  47910. s.render(function(e) {
  47911. Z.renderBufferImmediate(e, u, c)
  47912. })
  47913. } else
  47914. Z.renderBufferDirect(t, i, l, c, s, h)
  47915. }
  47916. }
  47917. function R(e) {
  47918. (function(e) {
  47919. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  47920. _e.setFlipSided(e.side === Ci.BackSide)
  47921. }
  47922. )(e),
  47923. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  47924. _e.setDepthFunc(e.depthFunc),
  47925. _e.setDepthTest(e.depthTest),
  47926. _e.setDepthWrite(e.depthWrite),
  47927. _e.setColorWrite(e.colorWrite),
  47928. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  47929. }
  47930. function P(e, t, i, n) {
  47931. oe = 0;
  47932. var r = be.get(i);
  47933. void 0 === r.program && (i.needsUpdate = !0),
  47934. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  47935. i.needsUpdate && (function(e, t, i) {
  47936. var n = be.get(e)
  47937. , r = Te.getParameters(e, ve, t, i)
  47938. , o = Te.getProgramCode(e, r)
  47939. , a = n.program
  47940. , s = !0;
  47941. if (void 0 === a)
  47942. e.addEventListener("dispose", v);
  47943. else if (a.code !== o)
  47944. y(e);
  47945. else {
  47946. if (void 0 !== r.shaderID)
  47947. return;
  47948. s = !1
  47949. }
  47950. if (s) {
  47951. if (r.shaderID) {
  47952. var l = Ci.ShaderLib[r.shaderID];
  47953. n.__webglShader = {
  47954. name: e.type,
  47955. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  47956. vertexShader: l.vertexShader,
  47957. fragmentShader: l.fragmentShader
  47958. }
  47959. } else
  47960. n.__webglShader = {
  47961. name: e.type,
  47962. uniforms: e.uniforms,
  47963. vertexShader: e.vertexShader,
  47964. fragmentShader: e.fragmentShader
  47965. };
  47966. e.__webglShader = n.__webglShader,
  47967. a = Te.acquireProgram(e, r, o),
  47968. n.program = a,
  47969. e.program = a
  47970. }
  47971. var c = a.getAttributes();
  47972. if (e.morphTargets)
  47973. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  47974. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  47975. if (e.morphNormals)
  47976. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  47977. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  47978. n.uniformsList = [];
  47979. var u = n.__webglShader.uniforms
  47980. , d = n.program.getUniforms();
  47981. for (var p in u) {
  47982. var f = d[p];
  47983. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  47984. }
  47985. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  47986. u.ambientLightColor.value = ve.ambient,
  47987. u.directionalLights.value = ve.directional,
  47988. u.spotLights.value = ve.spot,
  47989. u.pointLights.value = ve.point,
  47990. u.hemisphereLights.value = ve.hemi,
  47991. u.directionalShadowMap.value = ve.directionalShadowMap,
  47992. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  47993. u.spotShadowMap.value = ve.spotShadowMap,
  47994. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  47995. u.pointShadowMap.value = ve.pointShadowMap,
  47996. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  47997. n.hasDynamicUniforms = !1;
  47998. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  47999. if (!0 === n.uniformsList[g][0].dynamic) {
  48000. n.hasDynamicUniforms = !0;
  48001. break
  48002. }
  48003. }
  48004. }(i, t, n),
  48005. i.needsUpdate = !1);
  48006. var o = !1
  48007. , a = !1
  48008. , s = !1
  48009. , l = r.program
  48010. , c = l.getUniforms()
  48011. , h = r.__webglShader.uniforms;
  48012. if (l.id !== K && (X.useProgram(l.program),
  48013. K = l.id,
  48014. s = a = o = !0),
  48015. i.id !== $ && ($ = i.id,
  48016. a = !0),
  48017. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48018. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48019. e !== te && (te = e,
  48020. s = a = !0),
  48021. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48022. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48023. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48024. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48025. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48026. i.skinning)
  48027. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48028. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48029. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48030. if (void 0 !== c.boneTexture) {
  48031. var u = A();
  48032. X.uniform1i(c.boneTexture, u),
  48033. Z.setTexture(n.skeleton.boneTexture, u)
  48034. }
  48035. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48036. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48037. } else
  48038. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48039. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48040. e.ambientLightColor.needsUpdate = t,
  48041. e.directionalLights.needsUpdate = t,
  48042. e.pointLights.needsUpdate = t,
  48043. e.spotLights.needsUpdate = t,
  48044. e.hemisphereLights.needsUpdate = t
  48045. }(h, s),
  48046. t && i.fog && function(e, t) {
  48047. e.fogColor.value = t.color,
  48048. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48049. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48050. }(h, t),
  48051. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48052. var i;
  48053. if (e.opacity.value = t.opacity,
  48054. e.diffuse.value = t.color,
  48055. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48056. e.map.value = t.map,
  48057. e.specularMap.value = t.specularMap,
  48058. e.alphaMap.value = t.alphaMap,
  48059. t.aoMap && (e.aoMap.value = t.aoMap,
  48060. e.aoMapIntensity.value = t.aoMapIntensity),
  48061. t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  48062. void 0 !== i) {
  48063. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48064. var n = i.offset
  48065. , r = i.repeat;
  48066. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48067. }
  48068. e.envMap.value = t.envMap,
  48069. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48070. e.reflectivity.value = t.reflectivity,
  48071. e.refractionRatio.value = t.refractionRatio
  48072. }(h, i),
  48073. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48074. function(e, t) {
  48075. e.dashSize.value = t.dashSize,
  48076. e.totalSize.value = t.dashSize + t.gapSize,
  48077. e.scale.value = t.scale
  48078. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48079. if (e.diffuse.value = t.color,
  48080. e.opacity.value = t.opacity,
  48081. e.size.value = t.size * he,
  48082. e.scale.value = O.clientHeight / 2,
  48083. e.map.value = t.map,
  48084. null !== t.map) {
  48085. var i = t.map.offset
  48086. , n = t.map.repeat;
  48087. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48088. }
  48089. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48090. t.lightMap && (e.lightMap.value = t.lightMap,
  48091. e.lightMapIntensity.value = t.lightMapIntensity),
  48092. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48093. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48094. e.specular.value = t.specular,
  48095. e.shininess.value = Math.max(t.shininess, 1e-4),
  48096. t.lightMap && (e.lightMap.value = t.lightMap,
  48097. e.lightMapIntensity.value = t.lightMapIntensity),
  48098. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48099. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48100. e.bumpScale.value = t.bumpScale),
  48101. t.normalMap && (e.normalMap.value = t.normalMap,
  48102. e.normalScale.value.copy(t.normalScale)),
  48103. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48104. e.displacementScale.value = t.displacementScale,
  48105. e.displacementBias.value = t.displacementBias)
  48106. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48107. e.roughness.value = t.roughness,
  48108. e.metalness.value = t.metalness,
  48109. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48110. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48111. t.lightMap && (e.lightMap.value = t.lightMap,
  48112. e.lightMapIntensity.value = t.lightMapIntensity),
  48113. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48114. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48115. e.bumpScale.value = t.bumpScale),
  48116. t.normalMap && (e.normalMap.value = t.normalMap,
  48117. e.normalScale.value.copy(t.normalScale)),
  48118. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48119. e.displacementScale.value = t.displacementScale,
  48120. e.displacementBias.value = t.displacementBias),
  48121. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48122. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48123. h.mFar.value = e.far,
  48124. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48125. g(r.uniformsList)),
  48126. function(e, t) {
  48127. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48128. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48129. }(c, n),
  48130. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48131. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48132. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48133. var a = e[r][0]
  48134. , s = a.onUpdateCallback;
  48135. void 0 !== s && (s.bind(a)(t, i),
  48136. n.push(e[r]))
  48137. }
  48138. g(n)
  48139. }(r.uniformsList, n, e),
  48140. l
  48141. }
  48142. function p(e, t) {
  48143. e.diffuse.value = t.color,
  48144. e.opacity.value = t.opacity
  48145. }
  48146. function A() {
  48147. var e = oe;
  48148. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48149. oe += 1,
  48150. e
  48151. }
  48152. function C(e, t, i, n) {
  48153. var r, o;
  48154. if ("1i" === t)
  48155. X.uniform1i(i, n);
  48156. else if ("1f" === t)
  48157. X.uniform1f(i, n);
  48158. else if ("2f" === t)
  48159. X.uniform2f(i, n[0], n[1]);
  48160. else if ("3f" === t)
  48161. X.uniform3f(i, n[0], n[1], n[2]);
  48162. else if ("4f" === t)
  48163. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48164. else if ("1iv" === t)
  48165. X.uniform1iv(i, n);
  48166. else if ("3iv" === t)
  48167. X.uniform3iv(i, n);
  48168. else if ("1fv" === t)
  48169. X.uniform1fv(i, n);
  48170. else if ("2fv" === t)
  48171. X.uniform2fv(i, n);
  48172. else if ("3fv" === t)
  48173. X.uniform3fv(i, n);
  48174. else if ("4fv" === t)
  48175. X.uniform4fv(i, n);
  48176. else if ("Matrix2fv" === t)
  48177. X.uniformMatrix2fv(i, !1, n);
  48178. else if ("Matrix3fv" === t)
  48179. X.uniformMatrix3fv(i, !1, n);
  48180. else if ("Matrix4fv" === t)
  48181. X.uniformMatrix4fv(i, !1, n);
  48182. else if ("i" === t)
  48183. X.uniform1i(i, n);
  48184. else if ("f" === t)
  48185. X.uniform1f(i, n);
  48186. else if ("v2" === t)
  48187. X.uniform2f(i, n.x, n.y);
  48188. else if ("v3" === t)
  48189. X.uniform3f(i, n.x, n.y, n.z);
  48190. else if ("v4" === t)
  48191. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48192. else if ("c" === t)
  48193. X.uniform3f(i, n.r, n.g, n.b);
  48194. else if ("s" === t) {
  48195. var a = e.properties;
  48196. for (var s in a) {
  48197. var l = a[s]
  48198. , c = i[s]
  48199. , h = n[s];
  48200. C(l, l.type, c, h)
  48201. }
  48202. } else if ("sa" === t) {
  48203. a = e.properties;
  48204. for (var u = 0, d = n.length; u < d; u++)
  48205. for (var s in a) {
  48206. l = a[s],
  48207. c = i[u][s],
  48208. h = n[u][s];
  48209. C(l, l.type, c, h)
  48210. }
  48211. } else if ("iv1" === t)
  48212. X.uniform1iv(i, n);
  48213. else if ("iv" === t)
  48214. X.uniform3iv(i, n);
  48215. else if ("fv1" === t)
  48216. X.uniform1fv(i, n);
  48217. else if ("fv" === t)
  48218. X.uniform3fv(i, n);
  48219. else if ("v2v" === t) {
  48220. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48221. u = 0;
  48222. for (var p = 0, f = n.length; u < f; u++,
  48223. p += 2)
  48224. e._array[p + 0] = n[u].x,
  48225. e._array[p + 1] = n[u].y;
  48226. X.uniform2fv(i, e._array)
  48227. } else if ("v3v" === t) {
  48228. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48229. u = 0;
  48230. var g = 0;
  48231. for (f = n.length; u < f; u++,
  48232. g += 3)
  48233. e._array[g + 0] = n[u].x,
  48234. e._array[g + 1] = n[u].y,
  48235. e._array[g + 2] = n[u].z;
  48236. X.uniform3fv(i, e._array)
  48237. } else if ("v4v" === t) {
  48238. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48239. u = 0;
  48240. var m = 0;
  48241. for (f = n.length; u < f; u++,
  48242. m += 4)
  48243. e._array[m + 0] = n[u].x,
  48244. e._array[m + 1] = n[u].y,
  48245. e._array[m + 2] = n[u].z,
  48246. e._array[m + 3] = n[u].w;
  48247. X.uniform4fv(i, e._array)
  48248. } else if ("m2" === t)
  48249. X.uniformMatrix2fv(i, !1, n.elements);
  48250. else if ("m3" === t)
  48251. X.uniformMatrix3fv(i, !1, n.elements);
  48252. else if ("m3v" === t) {
  48253. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48254. for (u = 0,
  48255. f = n.length; u < f; u++)
  48256. n[u].flattenToArrayOffset(e._array, 9 * u);
  48257. X.uniformMatrix3fv(i, !1, e._array)
  48258. } else if ("m4" === t)
  48259. X.uniformMatrix4fv(i, !1, n.elements);
  48260. else if ("m4v" === t) {
  48261. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48262. for (u = 0,
  48263. f = n.length; u < f; u++)
  48264. n[u].flattenToArrayOffset(e._array, 16 * u);
  48265. X.uniformMatrix4fv(i, !1, e._array)
  48266. } else if ("t" === t) {
  48267. if (r = n,
  48268. o = A(),
  48269. X.uniform1i(i, o),
  48270. !r)
  48271. return;
  48272. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  48273. } else if ("tv" === t) {
  48274. void 0 === e._array && (e._array = []);
  48275. for (u = 0,
  48276. f = e.value.length; u < f; u++)
  48277. e._array[u] = A();
  48278. X.uniform1iv(i, e._array);
  48279. for (u = 0,
  48280. f = e.value.length; u < f; u++)
  48281. r = e.value[u],
  48282. o = e._array[u],
  48283. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  48284. } else
  48285. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48286. }
  48287. function g(e) {
  48288. for (var t = 0, i = e.length; t < i; t++) {
  48289. var n = e[t][0];
  48290. if (!1 !== n.needsUpdate)
  48291. C(n, n.type, e[t][1], n.value)
  48292. }
  48293. }
  48294. function m(e, t, i) {
  48295. var n;
  48296. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48297. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48298. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48299. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48300. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48301. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  48302. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48303. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48304. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  48305. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48306. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48307. return;
  48308. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48309. return;
  48310. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48311. be.get(t).__currentAnisotropy = t.anisotropy)
  48312. }
  48313. }
  48314. function o(e, t, i) {
  48315. void 0 === e.__webglInit && (e.__webglInit = !0,
  48316. t.addEventListener("dispose", f),
  48317. e.__webglTexture = X.createTexture(),
  48318. ye.textures++),
  48319. _e.activeTexture(X.TEXTURE0 + i),
  48320. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48321. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48322. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48323. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48324. var n = I(t.image, Ee.maxTextureSize);
  48325. !function(e) {
  48326. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48327. }(t) || !1 !== E(n) || (n = function(e) {
  48328. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48329. var t = document.createElement("canvas");
  48330. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48331. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48332. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48333. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48334. t
  48335. }
  48336. return e
  48337. }(n));
  48338. var r = E(n)
  48339. , o = x(t.format)
  48340. , a = x(t.type);
  48341. m(X.TEXTURE_2D, t, r);
  48342. var s, l = t.mipmaps;
  48343. if (t instanceof Ci.DataTexture)
  48344. if (0 < l.length && r) {
  48345. for (var c = 0, h = l.length; c < h; c++)
  48346. s = l[c],
  48347. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48348. t.generateMipmaps = !1
  48349. } else
  48350. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48351. else if (t instanceof Ci.CompressedTexture)
  48352. for (c = 0,
  48353. h = l.length; c < h; c++)
  48354. s = l[c],
  48355. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48356. else if (0 < l.length && r) {
  48357. for (c = 0,
  48358. h = l.length; c < h; c++)
  48359. s = l[c],
  48360. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48361. t.generateMipmaps = !1
  48362. } else
  48363. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48364. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48365. e.__version = t.version,
  48366. t.onUpdate && t.onUpdate(t)
  48367. }
  48368. function I(e, t) {
  48369. if (e.width > t || e.height > t) {
  48370. var i = t / Math.max(e.width, e.height)
  48371. , n = document.createElement("canvas");
  48372. return n.width = Math.floor(e.width * i),
  48373. n.height = Math.floor(e.height * i),
  48374. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48375. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48376. n
  48377. }
  48378. return e
  48379. }
  48380. function E(e) {
  48381. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48382. }
  48383. function _(e, t) {
  48384. var i = be.get(e);
  48385. if (6 === e.image.length)
  48386. if (0 < e.version && i.__version !== e.version) {
  48387. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48388. i.__image__webglTextureCube = X.createTexture(),
  48389. ye.textures++),
  48390. _e.activeTexture(X.TEXTURE0 + t),
  48391. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48392. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48393. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48394. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48395. var s = E(o[0])
  48396. , l = x(e.format)
  48397. , c = x(e.type);
  48398. m(X.TEXTURE_CUBE_MAP, e, s);
  48399. for (a = 0; a < 6; a++)
  48400. if (n)
  48401. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48402. h = u[d],
  48403. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  48404. else
  48405. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  48406. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48407. i.__version = e.version,
  48408. e.onUpdate && e.onUpdate(e)
  48409. } else
  48410. _e.activeTexture(X.TEXTURE0 + t),
  48411. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48412. }
  48413. function b(e, t) {
  48414. _e.activeTexture(X.TEXTURE0 + t),
  48415. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48416. }
  48417. function h(e, t, i, n) {
  48418. var r = x(t.texture.format)
  48419. , o = x(t.texture.type);
  48420. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48421. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48422. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48423. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48424. }
  48425. function u(e, t) {
  48426. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48427. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48428. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  48429. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48430. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48431. }
  48432. function w(e) {
  48433. var t = be.get(e)
  48434. , i = be.get(e.texture);
  48435. e.addEventListener("dispose", a),
  48436. i.__webglTexture = X.createTexture(),
  48437. ye.textures++;
  48438. var n = e instanceof Ci.WebGLRenderTargetCube
  48439. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48440. if (n) {
  48441. t.__webglFramebuffer = [];
  48442. for (var o = 0; o < 6; o++)
  48443. t.__webglFramebuffer[o] = X.createFramebuffer()
  48444. } else
  48445. t.__webglFramebuffer = X.createFramebuffer();
  48446. if (n) {
  48447. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48448. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48449. for (o = 0; o < 6; o++)
  48450. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48451. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48452. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48453. } else
  48454. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48455. m(X.TEXTURE_2D, e.texture, r),
  48456. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48457. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48458. _e.bindTexture(X.TEXTURE_2D, null);
  48459. e.depthBuffer && function(e) {
  48460. var t = be.get(e);
  48461. if (e instanceof Ci.WebGLRenderTargetCube) {
  48462. t.__webglDepthbuffer = [];
  48463. for (var i = 0; i < 6; i++)
  48464. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48465. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48466. u(t.__webglDepthbuffer[i], e)
  48467. } else
  48468. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48469. t.__webglDepthbuffer = X.createRenderbuffer(),
  48470. u(t.__webglDepthbuffer, e);
  48471. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48472. }(e)
  48473. }
  48474. function T(e) {
  48475. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48476. }
  48477. function x(e) {
  48478. var t;
  48479. if (e === Ci.RepeatWrapping)
  48480. return X.REPEAT;
  48481. if (e === Ci.ClampToEdgeWrapping)
  48482. return X.CLAMP_TO_EDGE;
  48483. if (e === Ci.MirroredRepeatWrapping)
  48484. return X.MIRRORED_REPEAT;
  48485. if (e === Ci.NearestFilter)
  48486. return X.NEAREST;
  48487. if (e === Ci.NearestMipMapNearestFilter)
  48488. return X.NEAREST_MIPMAP_NEAREST;
  48489. if (e === Ci.NearestMipMapLinearFilter)
  48490. return X.NEAREST_MIPMAP_LINEAR;
  48491. if (e === Ci.LinearFilter)
  48492. return X.LINEAR;
  48493. if (e === Ci.LinearMipMapNearestFilter)
  48494. return X.LINEAR_MIPMAP_NEAREST;
  48495. if (e === Ci.LinearMipMapLinearFilter)
  48496. return X.LINEAR_MIPMAP_LINEAR;
  48497. if (e === Ci.UnsignedByteType)
  48498. return X.UNSIGNED_BYTE;
  48499. if (e === Ci.UnsignedShort4444Type)
  48500. return X.UNSIGNED_SHORT_4_4_4_4;
  48501. if (e === Ci.UnsignedShort5551Type)
  48502. return X.UNSIGNED_SHORT_5_5_5_1;
  48503. if (e === Ci.UnsignedShort565Type)
  48504. return X.UNSIGNED_SHORT_5_6_5;
  48505. if (e === Ci.ByteType)
  48506. return X.BYTE;
  48507. if (e === Ci.ShortType)
  48508. return X.SHORT;
  48509. if (e === Ci.UnsignedShortType)
  48510. return X.UNSIGNED_SHORT;
  48511. if (e === Ci.IntType)
  48512. return X.INT;
  48513. if (e === Ci.UnsignedIntType)
  48514. return X.UNSIGNED_INT;
  48515. if (e === Ci.FloatType)
  48516. return X.FLOAT;
  48517. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48518. return t.HALF_FLOAT_OES;
  48519. if (e === Ci.AlphaFormat)
  48520. return X.ALPHA;
  48521. if (e === Ci.RGBFormat)
  48522. return X.RGB;
  48523. if (e === Ci.RGBAFormat)
  48524. return X.RGBA;
  48525. if (e === Ci.LuminanceFormat)
  48526. return X.LUMINANCE;
  48527. if (e === Ci.LuminanceAlphaFormat)
  48528. return X.LUMINANCE_ALPHA;
  48529. if (e === Ci.AddEquation)
  48530. return X.FUNC_ADD;
  48531. if (e === Ci.SubtractEquation)
  48532. return X.FUNC_SUBTRACT;
  48533. if (e === Ci.ReverseSubtractEquation)
  48534. return X.FUNC_REVERSE_SUBTRACT;
  48535. if (e === Ci.ZeroFactor)
  48536. return X.ZERO;
  48537. if (e === Ci.OneFactor)
  48538. return X.ONE;
  48539. if (e === Ci.SrcColorFactor)
  48540. return X.SRC_COLOR;
  48541. if (e === Ci.OneMinusSrcColorFactor)
  48542. return X.ONE_MINUS_SRC_COLOR;
  48543. if (e === Ci.SrcAlphaFactor)
  48544. return X.SRC_ALPHA;
  48545. if (e === Ci.OneMinusSrcAlphaFactor)
  48546. return X.ONE_MINUS_SRC_ALPHA;
  48547. if (e === Ci.DstAlphaFactor)
  48548. return X.DST_ALPHA;
  48549. if (e === Ci.OneMinusDstAlphaFactor)
  48550. return X.ONE_MINUS_DST_ALPHA;
  48551. if (e === Ci.DstColorFactor)
  48552. return X.DST_COLOR;
  48553. if (e === Ci.OneMinusDstColorFactor)
  48554. return X.ONE_MINUS_DST_COLOR;
  48555. if (e === Ci.SrcAlphaSaturateFactor)
  48556. return X.SRC_ALPHA_SATURATE;
  48557. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48558. if (e === Ci.RGB_S3TC_DXT1_Format)
  48559. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48560. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48561. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48562. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48563. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48564. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48565. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48566. }
  48567. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48568. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48569. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48570. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48571. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48572. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48573. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48574. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48575. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48576. }
  48577. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48578. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48579. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48580. if (e === Ci.MinEquation)
  48581. return t.MIN_EXT;
  48582. if (e === Ci.MaxEquation)
  48583. return t.MAX_EXT
  48584. }
  48585. return 0
  48586. }
  48587. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48588. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48589. , L = void 0 !== e.context ? e.context : null
  48590. , D = void 0 !== e.alpha && e.alpha
  48591. , N = void 0 === e.depth || e.depth
  48592. , F = void 0 === e.stencil || e.stencil
  48593. , B = void 0 !== e.antialias && e.antialias
  48594. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48595. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48596. , U = []
  48597. , H = []
  48598. , z = -1
  48599. , G = []
  48600. , W = -1
  48601. , j = new Float32Array(8)
  48602. , Y = []
  48603. , q = [];
  48604. this.domElement = O,
  48605. this.context = null,
  48606. this.autoClear = !0,
  48607. this.autoClearColor = !0,
  48608. this.autoClearDepth = !0,
  48609. this.autoClearStencil = !0,
  48610. this.sortObjects = !0,
  48611. this.gammaFactor = 2,
  48612. this.gammaInput = !1,
  48613. this.gammaOutput = !1,
  48614. this.physicallyCorrectLights = !1,
  48615. this.toneMapping = Ci.LinearToneMapping,
  48616. this.toneMappingExposure = 1,
  48617. this.toneMappingWhitePoint = 1,
  48618. this.maxMorphTargets = 8,
  48619. this.maxMorphNormals = 4,
  48620. this.autoScaleCubemaps = !0;
  48621. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  48622. hash: "",
  48623. ambient: [0, 0, 0],
  48624. directional: [],
  48625. directionalShadowMap: [],
  48626. directionalShadowMatrix: [],
  48627. spot: [],
  48628. spotShadowMap: [],
  48629. spotShadowMatrix: [],
  48630. point: [],
  48631. pointShadowMap: [],
  48632. pointShadowMatrix: [],
  48633. hemi: [],
  48634. shadows: [],
  48635. shadowsPointLight: 0
  48636. }, ye = {
  48637. geometries: 0,
  48638. textures: 0
  48639. }, Ae = {
  48640. calls: 0,
  48641. vertices: 0,
  48642. faces: 0,
  48643. points: 0
  48644. };
  48645. this.info = {
  48646. render: Ae,
  48647. memory: ye,
  48648. programs: null
  48649. };
  48650. try {
  48651. var Ce = {
  48652. alpha: D,
  48653. depth: N,
  48654. stencil: F,
  48655. antialias: B,
  48656. premultipliedAlpha: V,
  48657. preserveDrawingBuffer: k
  48658. };
  48659. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48660. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48661. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48662. return {
  48663. rangeMin: 1,
  48664. rangeMax: 1,
  48665. precision: 1
  48666. }
  48667. }
  48668. ),
  48669. O.addEventListener("webglcontextlost", r, !1)
  48670. } catch (e) {
  48671. console.error("THREE.WebGLRenderer: " + e)
  48672. }
  48673. var Ie = new Ci.WebGLExtensions(X);
  48674. Ie.get("OES_texture_float"),
  48675. Ie.get("OES_texture_float_linear"),
  48676. Ie.get("OES_texture_half_float"),
  48677. Ie.get("OES_texture_half_float_linear"),
  48678. Ie.get("OES_standard_derivatives"),
  48679. Ie.get("ANGLE_instanced_arrays"),
  48680. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  48681. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  48682. , _e = new Ci.WebGLState(X,Ie,x)
  48683. , be = new Ci.WebGLProperties
  48684. , we = new Ci.WebGLObjects(X,be,this.info)
  48685. , Te = new Ci.WebGLPrograms(this,Ee)
  48686. , xe = new Ci.WebGLLights;
  48687. this.info.programs = Te.programs;
  48688. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  48689. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  48690. t(),
  48691. this.context = X,
  48692. this.capabilities = Ee,
  48693. this.extensions = Ie,
  48694. this.properties = be,
  48695. this.state = _e;
  48696. var Re = new Ci.WebGLShadowMap(this,ve,we);
  48697. this.shadowMap = Re;
  48698. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  48699. this.getContext = function() {
  48700. return X
  48701. }
  48702. ,
  48703. this.getContextAttributes = function() {
  48704. return X.getContextAttributes()
  48705. }
  48706. ,
  48707. this.forceContextLoss = function() {
  48708. Ie.get("WEBGL_lose_context").loseContext()
  48709. }
  48710. ,
  48711. this.getMaxAnisotropy = function() {
  48712. if (void 0 !== Pe)
  48713. return Pe;
  48714. var e = Ie.get("EXT_texture_filter_anisotropic");
  48715. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  48716. }
  48717. ,
  48718. this.getPrecision = function() {
  48719. return Ee.precision
  48720. }
  48721. ,
  48722. this.getPixelRatio = function() {
  48723. return he
  48724. }
  48725. ,
  48726. this.setPixelRatio = function(e) {
  48727. void 0 !== e && (he = e,
  48728. this.setSize(pe.z, pe.w, !1))
  48729. }
  48730. ,
  48731. this.getSize = function() {
  48732. return {
  48733. width: le,
  48734. height: ce
  48735. }
  48736. }
  48737. ,
  48738. this.setSize = function(e, t, i, n) {
  48739. null != n && (he = n),
  48740. le = e,
  48741. ce = t,
  48742. O.width = e * he,
  48743. O.height = t * he,
  48744. !1 !== i && (O.style.width = e + "px",
  48745. O.style.height = t + "px"),
  48746. this.setViewport(0, 0, e, t)
  48747. }
  48748. ,
  48749. this.setViewport = function(e, t, i, n) {
  48750. _e.viewport(pe.set(e, t, i, n))
  48751. }
  48752. ,
  48753. this.setScissor = function(e, t, i, n) {
  48754. _e.scissor(ue.set(e, t, i, n))
  48755. }
  48756. ,
  48757. this.setScissorTest = function(e) {
  48758. _e.setScissorTest(de = e)
  48759. }
  48760. ,
  48761. this.getClearColor = function() {
  48762. return ae
  48763. }
  48764. ,
  48765. this.setClearColor = function(e, t) {
  48766. ae.set(e),
  48767. se = void 0 !== t ? t : 1,
  48768. i(ae.r, ae.g, ae.b, se)
  48769. }
  48770. ,
  48771. this.getClearAlpha = function() {
  48772. return se
  48773. }
  48774. ,
  48775. this.setClearAlpha = function(e) {
  48776. se = e,
  48777. i(ae.r, ae.g, ae.b, se)
  48778. }
  48779. ,
  48780. this.clear = function(e, t, i) {
  48781. var n = 0;
  48782. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  48783. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  48784. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  48785. X.clear(n)
  48786. }
  48787. ,
  48788. this.clearColor = function() {
  48789. this.clear(!0, !1, !1)
  48790. }
  48791. ,
  48792. this.clearDepth = function() {
  48793. this.clear(!1, !0, !1)
  48794. }
  48795. ,
  48796. this.clearStencil = function() {
  48797. this.clear(!1, !1, !0)
  48798. }
  48799. ,
  48800. this.clearTarget = function(e, t, i, n) {
  48801. this.setRenderTarget(e),
  48802. this.clear(t, i, n)
  48803. }
  48804. ,
  48805. this.resetGLState = n,
  48806. this.dispose = function() {
  48807. O.removeEventListener("webglcontextlost", r, !1)
  48808. }
  48809. ,
  48810. this.renderBufferImmediate = function(e, t, i) {
  48811. _e.initAttributes();
  48812. var n = be.get(e);
  48813. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  48814. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  48815. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  48816. e.hasColors && !n.color && (n.color = X.createBuffer());
  48817. var r = t.getAttributes();
  48818. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  48819. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  48820. _e.enableAttribute(r.position),
  48821. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  48822. e.hasNormals) {
  48823. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  48824. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  48825. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  48826. var s = e.normalArray
  48827. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  48828. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  48829. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  48830. s[o + 0] = l,
  48831. s[o + 1] = c,
  48832. s[o + 2] = h,
  48833. s[o + 3] = l,
  48834. s[o + 4] = c,
  48835. s[o + 5] = h,
  48836. s[o + 6] = l,
  48837. s[o + 7] = c,
  48838. s[o + 8] = h
  48839. }
  48840. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  48841. _e.enableAttribute(r.normal),
  48842. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  48843. }
  48844. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  48845. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  48846. _e.enableAttribute(r.uv),
  48847. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  48848. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  48849. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  48850. _e.enableAttribute(r.color),
  48851. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  48852. _e.disableUnusedAttributes(),
  48853. X.drawArrays(X.TRIANGLES, 0, e.count),
  48854. e.count = 0
  48855. }
  48856. ,
  48857. this.renderBufferDirect = function(e, t, i, n, r, o) {
  48858. R(n);
  48859. var a = P(e, t, n, r)
  48860. , s = !1
  48861. , l = i.id + "_" + a.id + "_" + n.wireframe;
  48862. l !== ee && (ee = l,
  48863. s = !0);
  48864. var c = r.morphTargetInfluences;
  48865. if (void 0 !== c) {
  48866. for (var h = [], u = 0, d = c.length; u < d; u++) {
  48867. var p = c[u];
  48868. h.push([p, u])
  48869. }
  48870. h.sort(M),
  48871. 8 < h.length && (h.length = 8);
  48872. var f = i.morphAttributes;
  48873. for (u = 0,
  48874. d = h.length; u < d; u++) {
  48875. p = h[u];
  48876. if (j[u] = p[0],
  48877. 0 !== p[0]) {
  48878. var g = p[1];
  48879. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  48880. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  48881. } else
  48882. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  48883. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  48884. }
  48885. var m = a.getUniforms();
  48886. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  48887. s = !0
  48888. }
  48889. g = i.index;
  48890. var v, y = i.attributes.position;
  48891. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  48892. null !== g ? (v = Me).setIndex(g) : v = Se,
  48893. s && (function(e, t, i, n) {
  48894. var r;
  48895. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  48896. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48897. else {
  48898. void 0 === n && (n = 0),
  48899. _e.initAttributes();
  48900. var o = i.attributes
  48901. , a = t.getAttributes()
  48902. , s = e.defaultAttributeValues;
  48903. for (var l in a) {
  48904. var c = a[l];
  48905. if (0 <= c) {
  48906. var h = o[l];
  48907. if (void 0 !== h) {
  48908. var u = h.itemSize
  48909. , d = we.getAttributeBuffer(h);
  48910. if (h instanceof Ci.InterleavedBufferAttribute) {
  48911. var p = h.data
  48912. , f = p.stride
  48913. , g = h.offset;
  48914. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  48915. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  48916. X.bindBuffer(X.ARRAY_BUFFER, d),
  48917. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  48918. } else
  48919. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  48920. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  48921. X.bindBuffer(X.ARRAY_BUFFER, d),
  48922. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  48923. } else if (void 0 !== s) {
  48924. var m = s[l];
  48925. if (void 0 !== m)
  48926. switch (m.length) {
  48927. case 2:
  48928. X.vertexAttrib2fv(c, m);
  48929. break;
  48930. case 3:
  48931. X.vertexAttrib3fv(c, m);
  48932. break;
  48933. case 4:
  48934. X.vertexAttrib4fv(c, m);
  48935. break;
  48936. default:
  48937. X.vertexAttrib1fv(c, m)
  48938. }
  48939. }
  48940. }
  48941. }
  48942. _e.disableUnusedAttributes()
  48943. }
  48944. }(n, a, i),
  48945. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  48946. var A = 1 / 0;
  48947. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  48948. var C = i.drawRange.start
  48949. , I = i.drawRange.count
  48950. , E = null !== o ? o.start : 0
  48951. , _ = null !== o ? o.count : 1 / 0
  48952. , b = Math.max(0, C, E)
  48953. , w = Math.min(0 + A, C + I, E + _) - 1
  48954. , T = Math.max(0, w - b + 1);
  48955. if (r instanceof Ci.Mesh)
  48956. if (!0 === n.wireframe)
  48957. _e.setLineWidth(n.wireframeLinewidth * S()),
  48958. v.setMode(X.LINES);
  48959. else
  48960. switch (r.drawMode) {
  48961. case Ci.TrianglesDrawMode:
  48962. v.setMode(X.TRIANGLES);
  48963. break;
  48964. case Ci.TriangleStripDrawMode:
  48965. v.setMode(X.TRIANGLE_STRIP);
  48966. break;
  48967. case Ci.TriangleFanDrawMode:
  48968. v.setMode(X.TRIANGLE_FAN)
  48969. }
  48970. else if (r instanceof Ci.Line) {
  48971. var x = n.linewidth;
  48972. void 0 === x && (x = 1),
  48973. _e.setLineWidth(x * S()),
  48974. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  48975. } else
  48976. r instanceof Ci.Points && v.setMode(X.POINTS);
  48977. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  48978. }
  48979. ,
  48980. this.render = function(e, t, i, n) {
  48981. if (t instanceof Ci.Camera != 0) {
  48982. var r = e.fog;
  48983. if (ee = "",
  48984. $ = -1,
  48985. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  48986. null === t.parent && t.updateMatrixWorld(),
  48987. t.matrixWorldInverse.getInverse(t.matrixWorld),
  48988. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  48989. fe.setFromMatrix(ge),
  48990. U.length = 0,
  48991. W = z = -1,
  48992. Y.length = 0,
  48993. q.length = 0,
  48994. function e(t, i) {
  48995. if (!1 !== t.visible) {
  48996. if (t.layers.test(i.layers))
  48997. if (t instanceof Ci.Light)
  48998. U.push(t);
  48999. else if (t instanceof Ci.Sprite)
  49000. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49001. else if (t instanceof Ci.LensFlare)
  49002. q.push(t);
  49003. else if (t instanceof Ci.ImmediateRenderObject)
  49004. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49005. me.applyProjection(ge)),
  49006. d(t, null, t.material, me.z, null);
  49007. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49008. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49009. var n = t.material;
  49010. if (!0 === n.visible) {
  49011. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49012. me.applyProjection(ge));
  49013. var r = we.update(t);
  49014. if (n instanceof Ci.MultiMaterial)
  49015. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49016. var c = o[s]
  49017. , h = a[c.materialIndex];
  49018. !0 === h.visible && d(t, r, h, me.z, c)
  49019. }
  49020. else
  49021. d(t, r, n, me.z, null)
  49022. }
  49023. }
  49024. var u = t.children;
  49025. for (s = 0,
  49026. l = u.length; s < l; s++)
  49027. e(u[s], i)
  49028. }
  49029. }(e, t),
  49030. H.length = z + 1,
  49031. G.length = W + 1,
  49032. !0 === Z.sortObjects && (H.sort(s),
  49033. G.sort(l)),
  49034. function(e, t) {
  49035. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49036. for (i = ve.shadowsPointLight = 0,
  49037. n = e.length; i < n; i++)
  49038. if (o = (r = e[i]).color,
  49039. a = r.intensity,
  49040. s = r.distance,
  49041. r instanceof Ci.AmbientLight)
  49042. l += o.r * a,
  49043. c += o.g * a,
  49044. h += o.b * a;
  49045. else if (r instanceof Ci.DirectionalLight) {
  49046. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49047. v.direction.setFromMatrixPosition(r.matrixWorld),
  49048. me.setFromMatrixPosition(r.target.matrixWorld),
  49049. v.direction.sub(me),
  49050. v.direction.transformDirection(u),
  49051. v.shadow = r.castShadow,
  49052. r.castShadow && (v.shadowBias = r.shadow.bias,
  49053. v.shadowRadius = r.shadow.radius,
  49054. v.shadowMapSize = r.shadow.mapSize,
  49055. ve.shadows[m++] = r),
  49056. ve.directionalShadowMap[d] = r.shadow.map,
  49057. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49058. ve.directional[d++] = v
  49059. } else if (r instanceof Ci.SpotLight) {
  49060. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49061. v.position.applyMatrix4(u),
  49062. v.color.copy(o).multiplyScalar(a),
  49063. v.distance = s,
  49064. v.direction.setFromMatrixPosition(r.matrixWorld),
  49065. me.setFromMatrixPosition(r.target.matrixWorld),
  49066. v.direction.sub(me),
  49067. v.direction.transformDirection(u),
  49068. v.coneCos = Math.cos(r.angle),
  49069. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49070. v.decay = 0 === r.distance ? 0 : r.decay,
  49071. v.shadow = r.castShadow,
  49072. r.castShadow && (v.shadowBias = r.shadow.bias,
  49073. v.shadowRadius = r.shadow.radius,
  49074. v.shadowMapSize = r.shadow.mapSize,
  49075. ve.shadows[m++] = r),
  49076. ve.spotShadowMap[f] = r.shadow.map,
  49077. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49078. ve.spot[f++] = v
  49079. } else if (r instanceof Ci.PointLight) {
  49080. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49081. v.position.applyMatrix4(u),
  49082. v.color.copy(r.color).multiplyScalar(r.intensity),
  49083. v.distance = r.distance,
  49084. v.decay = 0 === r.distance ? 0 : r.decay,
  49085. v.shadow = r.castShadow,
  49086. r.castShadow && (v.shadowBias = r.shadow.bias,
  49087. v.shadowRadius = r.shadow.radius,
  49088. v.shadowMapSize = r.shadow.mapSize,
  49089. ve.shadows[m++] = r),
  49090. ve.pointShadowMap[p] = r.shadow.map,
  49091. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49092. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49093. ve.pointShadowMatrix[p].identity().setPosition(me),
  49094. ve.point[p++] = v
  49095. } else if (r instanceof Ci.HemisphereLight) {
  49096. var v;
  49097. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49098. v.direction.transformDirection(u),
  49099. v.direction.normalize(),
  49100. v.skyColor.copy(r.color).multiplyScalar(a),
  49101. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49102. ve.hemi[g++] = v
  49103. }
  49104. ve.ambient[0] = l,
  49105. ve.ambient[1] = c,
  49106. ve.ambient[2] = h,
  49107. ve.directional.length = d,
  49108. ve.spot.length = f,
  49109. ve.point.length = p,
  49110. ve.hemi.length = g,
  49111. ve.shadows.length = m,
  49112. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49113. }(U, t),
  49114. Re.render(e, t),
  49115. Ae.calls = 0,
  49116. Ae.vertices = 0,
  49117. Ae.faces = 0,
  49118. void (Ae.points = 0) === i && (i = null),
  49119. this.setRenderTarget(i),
  49120. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49121. e.overrideMaterial) {
  49122. var o = e.overrideMaterial;
  49123. c(H, t, r, o),
  49124. c(G, t, r, o)
  49125. } else
  49126. _e.setBlending(Ci.NoBlending),
  49127. c(H, t, r),
  49128. c(G, t, r);
  49129. if (Oe.render(e, t),
  49130. Le.render(e, t, re),
  49131. i) {
  49132. var a = i.texture;
  49133. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49134. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49135. , i = be.get(e.texture).__webglTexture;
  49136. _e.bindTexture(t, i),
  49137. X.generateMipmap(t),
  49138. _e.bindTexture(t, null)
  49139. }(i)
  49140. }
  49141. _e.setDepthTest(!0),
  49142. _e.setDepthWrite(!0),
  49143. _e.setColorWrite(!0)
  49144. } else
  49145. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49146. }
  49147. ,
  49148. this.setFaceCulling = function(e, t) {
  49149. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49150. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49151. _e.enable(X.CULL_FACE))
  49152. }
  49153. ,
  49154. this.setTexture = function(e, t) {
  49155. var i = be.get(e);
  49156. if (0 < e.version && i.__version !== e.version) {
  49157. var n = e.image;
  49158. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  49159. }
  49160. _e.activeTexture(X.TEXTURE0 + t),
  49161. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49162. }
  49163. ,
  49164. this.getCurrentRenderTarget = function() {
  49165. return Q
  49166. }
  49167. ,
  49168. this.setRenderTarget = function(e) {
  49169. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49170. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49171. if (e) {
  49172. var n = be.get(e);
  49173. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49174. ie.copy(e.scissor),
  49175. ne = e.scissorTest,
  49176. re.copy(e.viewport)
  49177. } else
  49178. t = null,
  49179. ie.copy(ue).multiplyScalar(he),
  49180. ne = de,
  49181. re.copy(pe).multiplyScalar(he);
  49182. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49183. J = t),
  49184. _e.scissor(ie),
  49185. _e.setScissorTest(ne),
  49186. _e.viewport(re),
  49187. i) {
  49188. var r = be.get(e.texture);
  49189. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49190. }
  49191. }
  49192. ,
  49193. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49194. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49195. var a = be.get(e).__webglFramebuffer;
  49196. if (a) {
  49197. var s = !1;
  49198. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49199. s = !0);
  49200. try {
  49201. var l = e.texture;
  49202. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49203. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49204. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  49205. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49206. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49207. } finally {
  49208. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49209. }
  49210. }
  49211. } else
  49212. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49213. }
  49214. }
  49215. ,
  49216. Ci.WebGLRenderTarget = function(e, t, i) {
  49217. this.uuid = Ci.Math.generateUUID(),
  49218. this.width = e,
  49219. this.height = t,
  49220. this.scissor = new Ci.Vector4(0,0,e,t),
  49221. this.scissorTest = !1,
  49222. this.viewport = new Ci.Vector4(0,0,e,t),
  49223. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49224. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49225. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49226. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49227. }
  49228. ,
  49229. Ci.WebGLRenderTarget.prototype = {
  49230. constructor: Ci.WebGLRenderTarget,
  49231. setSize: function(e, t) {
  49232. this.width === e && this.height === t || (this.width = e,
  49233. this.height = t,
  49234. this.dispose()),
  49235. this.viewport.set(0, 0, e, t),
  49236. this.scissor.set(0, 0, e, t)
  49237. },
  49238. clone: function() {
  49239. return (new this.constructor).copy(this)
  49240. },
  49241. copy: function(e) {
  49242. return this.width = e.width,
  49243. this.height = e.height,
  49244. this.viewport.copy(e.viewport),
  49245. this.texture = e.texture.clone(),
  49246. this.depthBuffer = e.depthBuffer,
  49247. this.stencilBuffer = e.stencilBuffer,
  49248. this
  49249. },
  49250. dispose: function() {
  49251. this.dispatchEvent({
  49252. type: "dispose"
  49253. })
  49254. }
  49255. },
  49256. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49257. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49258. Ci.WebGLRenderTarget.call(this, e, t, i),
  49259. this.activeCubeFace = 0,
  49260. this.activeMipMapLevel = 0
  49261. }
  49262. ,
  49263. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49264. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49265. Ci.WebGLBufferRenderer = function(r, o, a) {
  49266. var s;
  49267. this.setMode = function(e) {
  49268. s = e
  49269. }
  49270. ,
  49271. this.render = function(e, t) {
  49272. r.drawArrays(s, e, t),
  49273. a.calls++,
  49274. a.vertices += t,
  49275. s === r.TRIANGLES && (a.faces += t / 3)
  49276. }
  49277. ,
  49278. this.renderInstances = function(e) {
  49279. var t = o.get("ANGLE_instanced_arrays");
  49280. if (null !== t) {
  49281. var i = e.attributes.position
  49282. , n = 0;
  49283. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49284. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49285. a.calls++,
  49286. a.vertices += n * e.maxInstancedCount,
  49287. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49288. } else
  49289. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49290. }
  49291. }
  49292. ,
  49293. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49294. var s, l, c;
  49295. this.setMode = function(e) {
  49296. s = e
  49297. }
  49298. ,
  49299. this.setIndex = function(e) {
  49300. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49301. 4) : (l = r.UNSIGNED_SHORT,
  49302. 2)
  49303. }
  49304. ,
  49305. this.render = function(e, t) {
  49306. r.drawElements(s, t, l, e * c),
  49307. a.calls++,
  49308. a.vertices += t,
  49309. s === r.TRIANGLES && (a.faces += t / 3)
  49310. }
  49311. ,
  49312. this.renderInstances = function(e, t, i) {
  49313. var n = o.get("ANGLE_instanced_arrays");
  49314. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  49315. a.calls++,
  49316. a.vertices += i * e.maxInstancedCount,
  49317. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49318. }
  49319. }
  49320. ,
  49321. Ci.WebGLExtensions = function(i) {
  49322. var n = {};
  49323. this.get = function(e) {
  49324. if (void 0 !== n[e])
  49325. return n[e];
  49326. var t;
  49327. switch (e) {
  49328. case "EXT_texture_filter_anisotropic":
  49329. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49330. break;
  49331. case "WEBGL_compressed_texture_s3tc":
  49332. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49333. break;
  49334. case "WEBGL_compressed_texture_pvrtc":
  49335. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49336. break;
  49337. case "WEBGL_compressed_texture_etc1":
  49338. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49339. break;
  49340. default:
  49341. t = i.getExtension(e)
  49342. }
  49343. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49344. n[e] = t
  49345. }
  49346. }
  49347. ,
  49348. Ci.WebGLCapabilities = function(t, e, i) {
  49349. function n(e) {
  49350. if ("highp" === e) {
  49351. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49352. return "highp";
  49353. e = "mediump"
  49354. }
  49355. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  49356. }
  49357. this.getMaxPrecision = n,
  49358. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49359. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49360. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49361. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49362. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49363. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49364. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49365. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49366. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49367. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49368. this.vertexTextures = 0 < this.maxVertexTextures,
  49369. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49370. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49371. var r = n(this.precision);
  49372. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49373. this.precision = r),
  49374. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49375. }
  49376. ,
  49377. Ci.WebGLGeometries = function(i, o, a) {
  49378. function s(e) {
  49379. var t = e.target
  49380. , i = c[t.id];
  49381. null !== i.index && l(i.index),
  49382. function(e) {
  49383. for (var t in e)
  49384. l(e[t])
  49385. }(i.attributes),
  49386. t.removeEventListener("dispose", s),
  49387. delete c[t.id];
  49388. var n = o.get(t);
  49389. n.wireframe && l(n.wireframe),
  49390. o.delete(t);
  49391. var r = o.get(i);
  49392. r.wireframe && l(r.wireframe),
  49393. o.delete(i),
  49394. a.memory.geometries--
  49395. }
  49396. function l(e) {
  49397. var t = function(e) {
  49398. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49399. }(e);
  49400. void 0 !== t && (i.deleteBuffer(t),
  49401. function(e) {
  49402. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49403. }(e))
  49404. }
  49405. var c = {};
  49406. this.get = function(e) {
  49407. var t, i = e.geometry;
  49408. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49409. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49410. t = i._bufferGeometry),
  49411. c[i.id] = t,
  49412. a.memory.geometries++,
  49413. t)
  49414. }
  49415. }
  49416. ,
  49417. Ci.WebGLLights = function() {
  49418. var i = {};
  49419. this.get = function(e) {
  49420. if (void 0 !== i[e.id])
  49421. return i[e.id];
  49422. var t;
  49423. switch (e.type) {
  49424. case "DirectionalLight":
  49425. t = {
  49426. direction: new Ci.Vector3,
  49427. color: new Ci.Color,
  49428. shadow: !1,
  49429. shadowBias: 0,
  49430. shadowRadius: 1,
  49431. shadowMapSize: new Ci.Vector2
  49432. };
  49433. break;
  49434. case "SpotLight":
  49435. t = {
  49436. position: new Ci.Vector3,
  49437. direction: new Ci.Vector3,
  49438. color: new Ci.Color,
  49439. distance: 0,
  49440. coneCos: 0,
  49441. penumbraCos: 0,
  49442. decay: 0,
  49443. shadow: !1,
  49444. shadowBias: 0,
  49445. shadowRadius: 1,
  49446. shadowMapSize: new Ci.Vector2
  49447. };
  49448. break;
  49449. case "PointLight":
  49450. t = {
  49451. position: new Ci.Vector3,
  49452. color: new Ci.Color,
  49453. distance: 0,
  49454. decay: 0,
  49455. shadow: !1,
  49456. shadowBias: 0,
  49457. shadowRadius: 1,
  49458. shadowMapSize: new Ci.Vector2
  49459. };
  49460. break;
  49461. case "HemisphereLight":
  49462. t = {
  49463. direction: new Ci.Vector3,
  49464. skyColor: new Ci.Color,
  49465. groundColor: new Ci.Color
  49466. }
  49467. }
  49468. return i[e.id] = t
  49469. }
  49470. }
  49471. ,
  49472. Ci.WebGLObjects = function(g, m, e) {
  49473. function v(e, t) {
  49474. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49475. , n = m.get(i);
  49476. void 0 === n.__webglBuffer ? function(e, t, i) {
  49477. e.__webglBuffer = g.createBuffer(),
  49478. g.bindBuffer(i, e.__webglBuffer);
  49479. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49480. g.bufferData(i, t.array, n),
  49481. e.version = t.version
  49482. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49483. g.bindBuffer(i, e.__webglBuffer),
  49484. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  49485. t.updateRange.count = 0),
  49486. e.version = t.version
  49487. }(n, i, t)
  49488. }
  49489. function y(e, t, i) {
  49490. if (i < t) {
  49491. var n = t;
  49492. t = i,
  49493. i = n
  49494. }
  49495. var r = e[t];
  49496. return void 0 === r ? (e[t] = [i],
  49497. !0) : -1 === r.indexOf(i) && (r.push(i),
  49498. !0)
  49499. }
  49500. var c = new Ci.WebGLGeometries(g,m,e);
  49501. this.getAttributeBuffer = function(e) {
  49502. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49503. }
  49504. ,
  49505. this.getWireframeAttribute = function(e) {
  49506. var t = m.get(e);
  49507. if (void 0 !== t.wireframe)
  49508. return t.wireframe;
  49509. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49510. if (null !== r)
  49511. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49512. var h = i[l + 0]
  49513. , u = i[l + 1]
  49514. , d = i[l + 2];
  49515. y(s, h, u) && n.push(h, u),
  49516. y(s, u, d) && n.push(u, d),
  49517. y(s, d, h) && n.push(d, h)
  49518. }
  49519. else
  49520. for (l = 0,
  49521. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49522. h = l + 0,
  49523. u = l + 1,
  49524. d = l + 2;
  49525. n.push(h, u, u, d, d, h)
  49526. }
  49527. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49528. , f = new Ci.BufferAttribute(new p(n),1);
  49529. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49530. t.wireframe = f
  49531. }
  49532. ,
  49533. this.update = function(e) {
  49534. var t = c.get(e);
  49535. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49536. var i = t.index
  49537. , n = t.attributes;
  49538. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49539. n)
  49540. v(n[r], g.ARRAY_BUFFER);
  49541. var o = t.morphAttributes;
  49542. for (var r in o)
  49543. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49544. v(a[s], g.ARRAY_BUFFER);
  49545. return t
  49546. }
  49547. }
  49548. ,
  49549. Ci.WebGLProgram = (Qt = 0,
  49550. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49551. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49552. ei = /^([\w\d_]+)\[0\]$/,
  49553. function(e, t, i, n) {
  49554. var r = e.context
  49555. , o = i.extensions
  49556. , a = i.defines
  49557. , s = i.__webglShader.vertexShader
  49558. , l = i.__webglShader.fragmentShader
  49559. , c = "SHADOWMAP_TYPE_BASIC";
  49560. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49561. var h = "ENVMAP_TYPE_CUBE"
  49562. , u = "ENVMAP_MODE_REFLECTION"
  49563. , d = "ENVMAP_BLENDING_MULTIPLY";
  49564. if (n.envMap) {
  49565. switch (i.envMap.mapping) {
  49566. case Ci.CubeReflectionMapping:
  49567. case Ci.CubeRefractionMapping:
  49568. h = "ENVMAP_TYPE_CUBE";
  49569. break;
  49570. case Ci.CubeUVReflectionMapping:
  49571. case Ci.CubeUVRefractionMapping:
  49572. h = "ENVMAP_TYPE_CUBE_UV";
  49573. break;
  49574. case Ci.EquirectangularReflectionMapping:
  49575. case Ci.EquirectangularRefractionMapping:
  49576. h = "ENVMAP_TYPE_EQUIREC";
  49577. break;
  49578. case Ci.SphericalReflectionMapping:
  49579. h = "ENVMAP_TYPE_SPHERE"
  49580. }
  49581. switch (i.envMap.mapping) {
  49582. case Ci.CubeRefractionMapping:
  49583. case Ci.EquirectangularRefractionMapping:
  49584. u = "ENVMAP_MODE_REFRACTION"
  49585. }
  49586. switch (i.combine) {
  49587. case Ci.MultiplyOperation:
  49588. d = "ENVMAP_BLENDING_MULTIPLY";
  49589. break;
  49590. case Ci.MixOperation:
  49591. d = "ENVMAP_BLENDING_MIX";
  49592. break;
  49593. case Ci.AddOperation:
  49594. d = "ENVMAP_BLENDING_ADD"
  49595. }
  49596. }
  49597. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49598. return [(e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(Pi).join("\n")
  49599. }(o, n, e.extensions), v = function(e) {
  49600. var t = [];
  49601. for (var i in e) {
  49602. var n = e[i];
  49603. !1 !== n && t.push("#define " + i + " " + n)
  49604. }
  49605. return t.join("\n")
  49606. }(a), y = r.createProgram();
  49607. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(Pi).join("\n"),
  49608. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  49609. var i;
  49610. switch (t) {
  49611. case Ci.LinearToneMapping:
  49612. i = "Linear";
  49613. break;
  49614. case Ci.ReinhardToneMapping:
  49615. i = "Reinhard";
  49616. break;
  49617. case Ci.Uncharted2ToneMapping:
  49618. i = "Uncharted2";
  49619. break;
  49620. case Ci.CineonToneMapping:
  49621. i = "OptimizedCineon";
  49622. break;
  49623. default:
  49624. throw new Error("unsupported toneMapping: " + t)
  49625. }
  49626. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49627. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  49628. var i = Mi(t);
  49629. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49630. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49631. s = Oi(s = Li(s), n),
  49632. l = Oi(l = Li(l), n),
  49633. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49634. l = Di(l));
  49635. var A = p + s
  49636. , C = f + l
  49637. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49638. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49639. r.attachShader(y, I),
  49640. r.attachShader(y, E),
  49641. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49642. r.linkProgram(y);
  49643. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49644. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49645. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  49646. M && (this.diagnostics = {
  49647. runnable: S,
  49648. material: i,
  49649. programLog: w,
  49650. vertexShader: {
  49651. log: T,
  49652. prefix: p
  49653. },
  49654. fragmentShader: {
  49655. log: x,
  49656. prefix: f
  49657. }
  49658. }),
  49659. r.deleteShader(I),
  49660. r.deleteShader(E),
  49661. this.getUniforms = function() {
  49662. return void 0 === _ && (_ = function(e, t) {
  49663. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49664. var o = e.getActiveUniform(t, r).name
  49665. , a = e.getUniformLocation(t, o)
  49666. , s = Jt.exec(o);
  49667. if (s) {
  49668. var l = s[1]
  49669. , c = s[2]
  49670. , h = i[l];
  49671. (h = h || (i[l] = {}))[c] = a
  49672. } else if (s = $t.exec(o)) {
  49673. var u = s[1]
  49674. , d = s[2]
  49675. , p = s[3]
  49676. , f = i[u]
  49677. , g = (f = f || (i[u] = []))[d];
  49678. (g = g || (f[d] = {}))[p] = a
  49679. } else
  49680. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  49681. }
  49682. return i
  49683. }(r, y)),
  49684. _
  49685. }
  49686. ,
  49687. this.getAttributes = function() {
  49688. return void 0 === b && (b = function(e, t) {
  49689. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  49690. var o = e.getActiveAttrib(t, r).name;
  49691. i[o] = e.getAttribLocation(t, o)
  49692. }
  49693. return i
  49694. }(r, y)),
  49695. b
  49696. }
  49697. ,
  49698. this.destroy = function() {
  49699. r.deleteProgram(y),
  49700. this.program = void 0
  49701. }
  49702. ,
  49703. Object.defineProperties(this, {
  49704. uniforms: {
  49705. get: function() {
  49706. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  49707. this.getUniforms()
  49708. }
  49709. },
  49710. attributes: {
  49711. get: function() {
  49712. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  49713. this.getAttributes()
  49714. }
  49715. }
  49716. }),
  49717. this.id = Qt++,
  49718. this.code = t,
  49719. this.usedTimes = 1,
  49720. this.program = y,
  49721. this.vertexShader = I,
  49722. this.fragmentShader = E,
  49723. this
  49724. }
  49725. ),
  49726. Ci.WebGLPrograms = function(s, l) {
  49727. function c(e, t) {
  49728. var i;
  49729. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  49730. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  49731. i
  49732. }
  49733. var h = []
  49734. , u = {
  49735. MeshDepthMaterial: "depth",
  49736. MeshNormalMaterial: "normal",
  49737. MeshBasicMaterial: "basic",
  49738. MeshLambertMaterial: "lambert",
  49739. MeshPhongMaterial: "phong",
  49740. MeshStandardMaterial: "standard",
  49741. LineBasicMaterial: "basic",
  49742. LineDashedMaterial: "dashed",
  49743. PointsMaterial: "points"
  49744. }
  49745. , a = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  49746. this.getParameters = function(e, t, i, n) {
  49747. var r = u[e.type]
  49748. , o = function(e) {
  49749. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  49750. return 1024;
  49751. var t = l.maxVertexUniforms
  49752. , i = Math.floor((t - 20) / 4);
  49753. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  49754. i
  49755. }(n)
  49756. , a = s.getPrecision();
  49757. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  49758. {
  49759. shaderID: r,
  49760. precision: a,
  49761. supportsVertexTextures: l.vertexTextures,
  49762. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  49763. map: !!e.map,
  49764. mapEncoding: c(e.map, s.gammaInput),
  49765. envMap: !!e.envMap,
  49766. envMapMode: e.envMap && e.envMap.mapping,
  49767. envMapEncoding: c(e.envMap, s.gammaInput),
  49768. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  49769. lightMap: !!e.lightMap,
  49770. aoMap: !!e.aoMap,
  49771. emissiveMap: !!e.emissiveMap,
  49772. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  49773. bumpMap: !!e.bumpMap,
  49774. normalMap: !!e.normalMap,
  49775. displacementMap: !!e.displacementMap,
  49776. roughnessMap: !!e.roughnessMap,
  49777. metalnessMap: !!e.metalnessMap,
  49778. specularMap: !!e.specularMap,
  49779. alphaMap: !!e.alphaMap,
  49780. combine: e.combine,
  49781. vertexColors: e.vertexColors,
  49782. fog: i,
  49783. useFog: e.fog,
  49784. fogExp: i instanceof Ci.FogExp2,
  49785. flatShading: e.shading === Ci.FlatShading,
  49786. sizeAttenuation: e.sizeAttenuation,
  49787. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  49788. skinning: e.skinning,
  49789. maxBones: o,
  49790. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  49791. morphTargets: e.morphTargets,
  49792. morphNormals: e.morphNormals,
  49793. maxMorphTargets: s.maxMorphTargets,
  49794. maxMorphNormals: s.maxMorphNormals,
  49795. numDirLights: t.directional.length,
  49796. numPointLights: t.point.length,
  49797. numSpotLights: t.spot.length,
  49798. numHemiLights: t.hemi.length,
  49799. pointLightShadows: t.shadowsPointLight,
  49800. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  49801. shadowMapType: s.shadowMap.type,
  49802. toneMapping: s.toneMapping,
  49803. physicallyCorrectLights: s.physicallyCorrectLights,
  49804. premultipliedAlpha: e.premultipliedAlpha,
  49805. alphaTest: e.alphaTest,
  49806. doubleSided: e.side === Ci.DoubleSide,
  49807. flipSided: e.side === Ci.BackSide
  49808. }
  49809. }
  49810. ,
  49811. this.getProgramCode = function(e, t) {
  49812. var i = [];
  49813. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  49814. i.push(e.vertexShader)),
  49815. void 0 !== e.defines)
  49816. for (var n in e.defines)
  49817. i.push(n),
  49818. i.push(e.defines[n]);
  49819. for (var r = 0; r < a.length; r++) {
  49820. var o = a[r];
  49821. i.push(o),
  49822. i.push(t[o])
  49823. }
  49824. return i.join()
  49825. }
  49826. ,
  49827. this.acquireProgram = function(e, t, i) {
  49828. for (var n, r = 0, o = h.length; r < o; r++) {
  49829. var a = h[r];
  49830. if (a.code === i) {
  49831. ++(n = a).usedTimes;
  49832. break
  49833. }
  49834. }
  49835. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  49836. h.push(n)),
  49837. n
  49838. }
  49839. ,
  49840. this.releaseProgram = function(e) {
  49841. if (0 == --e.usedTimes) {
  49842. var t = h.indexOf(e);
  49843. h[t] = h[h.length - 1],
  49844. h.pop(),
  49845. e.destroy()
  49846. }
  49847. }
  49848. ,
  49849. this.programs = h
  49850. }
  49851. ,
  49852. Ci.WebGLProperties = function() {
  49853. var n = {};
  49854. this.get = function(e) {
  49855. var t = e.uuid
  49856. , i = n[t];
  49857. return void 0 === i && (i = {},
  49858. n[t] = i),
  49859. i
  49860. }
  49861. ,
  49862. this.delete = function(e) {
  49863. delete n[e.uuid]
  49864. }
  49865. ,
  49866. this.clear = function() {
  49867. n = {}
  49868. }
  49869. }
  49870. ,
  49871. Ci.WebGLShader = function(e, t, i) {
  49872. var n = e.createShader(t);
  49873. return e.shaderSource(n, i),
  49874. e.compileShader(n),
  49875. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  49876. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  49877. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  49878. t[i] = i + 1 + ": " + t[i];
  49879. return t.join("\n")
  49880. }(i)),
  49881. n
  49882. }
  49883. ,
  49884. Ci.WebGLShadowMap = function(P, O, L) {
  49885. function D(e, t, i, n) {
  49886. var r = e.geometry
  49887. , o = null
  49888. , a = p
  49889. , s = e.customDepthMaterial;
  49890. if (i && (a = f,
  49891. s = e.customDistanceMaterial),
  49892. s)
  49893. o = s;
  49894. else {
  49895. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  49896. , c = e instanceof Ci.SkinnedMesh && t.skinning
  49897. , h = 0;
  49898. l && (h |= u),
  49899. c && (h |= d),
  49900. o = a[h]
  49901. }
  49902. return o.visible = t.visible,
  49903. o.wireframe = t.wireframe,
  49904. o.wireframeLinewidth = t.wireframeLinewidth,
  49905. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  49906. o
  49907. }
  49908. function N(e, t, i) {
  49909. if (!1 !== e.visible) {
  49910. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  49911. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  49912. G.push(e));
  49913. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  49914. N(n[r], t, i)
  49915. }
  49916. }
  49917. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  49918. var a = 0 != (o & u)
  49919. , s = 0 != (o & d)
  49920. , l = new Ci.ShaderMaterial({
  49921. uniforms: i,
  49922. vertexShader: t.vertexShader,
  49923. fragmentShader: t.fragmentShader,
  49924. morphTargets: a,
  49925. skinning: s
  49926. });
  49927. p[o] = l;
  49928. var c = new Ci.ShaderMaterial({
  49929. defines: {
  49930. USE_SHADOWMAP: ""
  49931. },
  49932. uniforms: r,
  49933. vertexShader: n.vertexShader,
  49934. fragmentShader: n.fragmentShader,
  49935. morphTargets: a,
  49936. skinning: s
  49937. });
  49938. f[o] = c
  49939. }
  49940. var q = this;
  49941. this.enabled = !1,
  49942. this.autoUpdate = !0,
  49943. this.needsUpdate = !1,
  49944. this.type = Ci.PCFShadowMap,
  49945. this.cullFace = Ci.CullFaceFront,
  49946. this.render = function(e, t) {
  49947. var i, n, r = O.shadows;
  49948. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  49949. B.clearColor(1, 1, 1, 1),
  49950. B.disable(F.BLEND),
  49951. B.enable(F.CULL_FACE),
  49952. F.frontFace(F.CCW),
  49953. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  49954. B.setDepthTest(!0),
  49955. B.setScissorTest(!1);
  49956. for (var o = 0, a = r.length; o < a; o++) {
  49957. var s = r[o]
  49958. , l = s.shadow
  49959. , c = l.camera;
  49960. if (U.copy(l.mapSize),
  49961. s instanceof Ci.PointLight) {
  49962. i = 6,
  49963. n = !0;
  49964. var h = U.x
  49965. , u = U.y;
  49966. Y[0].set(2 * h, u, h, u),
  49967. Y[1].set(0, u, h, u),
  49968. Y[2].set(3 * h, u, h, u),
  49969. Y[3].set(h, u, h, u),
  49970. Y[4].set(3 * h, 0, h, u),
  49971. Y[5].set(h, 0, h, u),
  49972. U.x *= 4,
  49973. U.y *= 2
  49974. } else
  49975. n = !(i = 1);
  49976. if (null === l.map) {
  49977. var d = {
  49978. minFilter: Ci.NearestFilter,
  49979. magFilter: Ci.NearestFilter,
  49980. format: Ci.RGBAFormat
  49981. };
  49982. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  49983. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  49984. c.updateProjectionMatrix()
  49985. }
  49986. var p = l.map
  49987. , f = l.matrix;
  49988. z.setFromMatrixPosition(s.matrixWorld),
  49989. c.position.copy(z),
  49990. P.setRenderTarget(p),
  49991. P.clear();
  49992. for (var g = 0; g < i; g++) {
  49993. if (n) {
  49994. H.copy(c.position),
  49995. H.add(W[g]),
  49996. c.up.copy(j[g]),
  49997. c.lookAt(H);
  49998. var m = Y[g];
  49999. B.viewport(m)
  50000. } else
  50001. H.setFromMatrixPosition(s.target.matrixWorld),
  50002. c.lookAt(H);
  50003. c.updateMatrixWorld(),
  50004. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50005. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50006. f.multiply(c.projectionMatrix),
  50007. f.multiply(c.matrixWorldInverse),
  50008. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50009. V.setFromMatrix(k),
  50010. G.length = 0,
  50011. N(e, t, c);
  50012. for (var v = 0, y = G.length; v < y; v++) {
  50013. var A = G[v]
  50014. , C = L.update(A)
  50015. , I = A.material;
  50016. if (I instanceof Ci.MultiMaterial)
  50017. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50018. var T = E[b]
  50019. , x = _[T.materialIndex];
  50020. if (!0 === x.visible) {
  50021. var S = D(A, x, n, z);
  50022. P.renderBufferDirect(c, null, C, S, A, T)
  50023. }
  50024. }
  50025. else {
  50026. S = D(A, I, n, z);
  50027. P.renderBufferDirect(c, null, C, S, A, null)
  50028. }
  50029. }
  50030. }
  50031. }
  50032. var M = P.getClearColor()
  50033. , R = P.getClearAlpha();
  50034. P.setClearColor(M, R),
  50035. B.enable(F.BLEND),
  50036. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50037. q.needsUpdate = !1
  50038. }
  50039. }
  50040. }
  50041. ,
  50042. Ci.WebGLState = function(l, i, c) {
  50043. var n = this
  50044. , r = new Ci.Vector4
  50045. , o = new Uint8Array(16)
  50046. , a = new Uint8Array(16)
  50047. , s = new Uint8Array(16)
  50048. , t = {}
  50049. , h = null
  50050. , u = null
  50051. , d = null
  50052. , p = null
  50053. , f = null
  50054. , g = null
  50055. , m = null
  50056. , v = null
  50057. , y = !1
  50058. , A = null
  50059. , C = null
  50060. , I = null
  50061. , E = null
  50062. , _ = null
  50063. , b = null
  50064. , w = null
  50065. , T = null
  50066. , x = null
  50067. , S = null
  50068. , M = null
  50069. , R = null
  50070. , P = null
  50071. , O = null
  50072. , L = null
  50073. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50074. , N = void 0
  50075. , F = {}
  50076. , B = new Ci.Vector4
  50077. , V = null
  50078. , k = null
  50079. , U = new Ci.Vector4
  50080. , H = new Ci.Vector4
  50081. , z = l.createTexture();
  50082. l.bindTexture(l.TEXTURE_2D, z),
  50083. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50084. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50085. this.init = function() {
  50086. this.clearColor(0, 0, 0, 1),
  50087. this.clearDepth(1),
  50088. this.clearStencil(0),
  50089. this.enable(l.DEPTH_TEST),
  50090. l.depthFunc(l.LEQUAL),
  50091. l.frontFace(l.CCW),
  50092. l.cullFace(l.BACK),
  50093. this.enable(l.CULL_FACE),
  50094. this.enable(l.BLEND),
  50095. l.blendEquation(l.FUNC_ADD),
  50096. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50097. }
  50098. ,
  50099. this.initAttributes = function() {
  50100. for (var e = 0, t = o.length; e < t; e++)
  50101. o[e] = 0
  50102. }
  50103. ,
  50104. this.enableAttribute = function(e) {
  50105. o[e] = 1,
  50106. 0 === a[e] && (l.enableVertexAttribArray(e),
  50107. a[e] = 1),
  50108. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50109. s[e] = 0)
  50110. }
  50111. ,
  50112. this.enableAttributeAndDivisor = function(e, t, i) {
  50113. o[e] = 1,
  50114. 0 === a[e] && (l.enableVertexAttribArray(e),
  50115. a[e] = 1),
  50116. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50117. s[e] = t)
  50118. }
  50119. ,
  50120. this.disableUnusedAttributes = function() {
  50121. for (var e = 0, t = a.length; e < t; e++)
  50122. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50123. a[e] = 0)
  50124. }
  50125. ,
  50126. this.enable = function(e) {
  50127. !0 !== t[e] && (l.enable(e),
  50128. t[e] = !0)
  50129. }
  50130. ,
  50131. this.disable = function(e) {
  50132. !1 !== t[e] && (l.disable(e),
  50133. t[e] = !1)
  50134. }
  50135. ,
  50136. this.getCompressedTextureFormats = function() {
  50137. if (null === h && (h = [],
  50138. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50139. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50140. h.push(e[t]);
  50141. return h
  50142. }
  50143. ,
  50144. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50145. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50146. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50147. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50148. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50149. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50150. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50151. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50152. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50153. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50154. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50155. u = e,
  50156. y = s),
  50157. e === Ci.CustomBlending ? (r = r || t,
  50158. o = o || i,
  50159. a = a || n,
  50160. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50161. d = t,
  50162. g = r),
  50163. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50164. p = i,
  50165. f = n,
  50166. m = o,
  50167. v = a)) : v = m = g = f = p = d = null
  50168. }
  50169. ,
  50170. this.setDepthFunc = function(e) {
  50171. if (A !== e) {
  50172. if (e)
  50173. switch (e) {
  50174. case Ci.NeverDepth:
  50175. l.depthFunc(l.NEVER);
  50176. break;
  50177. case Ci.AlwaysDepth:
  50178. l.depthFunc(l.ALWAYS);
  50179. break;
  50180. case Ci.LessDepth:
  50181. l.depthFunc(l.LESS);
  50182. break;
  50183. case Ci.LessEqualDepth:
  50184. l.depthFunc(l.LEQUAL);
  50185. break;
  50186. case Ci.EqualDepth:
  50187. l.depthFunc(l.EQUAL);
  50188. break;
  50189. case Ci.GreaterEqualDepth:
  50190. l.depthFunc(l.GEQUAL);
  50191. break;
  50192. case Ci.GreaterDepth:
  50193. l.depthFunc(l.GREATER);
  50194. break;
  50195. case Ci.NotEqualDepth:
  50196. l.depthFunc(l.NOTEQUAL);
  50197. break;
  50198. default:
  50199. l.depthFunc(l.LEQUAL)
  50200. }
  50201. else
  50202. l.depthFunc(l.LEQUAL);
  50203. A = e
  50204. }
  50205. }
  50206. ,
  50207. this.setDepthTest = function(e) {
  50208. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50209. }
  50210. ,
  50211. this.setDepthWrite = function(e) {
  50212. C !== e && (l.depthMask(e),
  50213. C = e)
  50214. }
  50215. ,
  50216. this.setColorWrite = function(e) {
  50217. I !== e && (l.colorMask(e, e, e, e),
  50218. I = e)
  50219. }
  50220. ,
  50221. this.setStencilFunc = function(e, t, i) {
  50222. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50223. _ = e,
  50224. b = t,
  50225. w = i)
  50226. }
  50227. ,
  50228. this.setStencilOp = function(e, t, i) {
  50229. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50230. T = e,
  50231. x = t,
  50232. S = i)
  50233. }
  50234. ,
  50235. this.setStencilTest = function(e) {
  50236. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50237. }
  50238. ,
  50239. this.setStencilWrite = function(e) {
  50240. E !== e && (l.stencilMask(e),
  50241. E = e)
  50242. }
  50243. ,
  50244. this.setFlipSided = function(e) {
  50245. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50246. M = e)
  50247. }
  50248. ,
  50249. this.setLineWidth = function(e) {
  50250. e !== R && (l.lineWidth(e),
  50251. R = e)
  50252. }
  50253. ,
  50254. this.setPolygonOffset = function(e, t, i) {
  50255. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50256. !e || P === t && O === i || (l.polygonOffset(t, i),
  50257. P = t,
  50258. O = i)
  50259. }
  50260. ,
  50261. this.getScissorTest = function() {
  50262. return L
  50263. }
  50264. ,
  50265. this.setScissorTest = function(e) {
  50266. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50267. }
  50268. ,
  50269. this.activeTexture = function(e) {
  50270. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50271. N !== e && (l.activeTexture(e),
  50272. N = e)
  50273. }
  50274. ,
  50275. this.bindTexture = function(e, t) {
  50276. void 0 === N && n.activeTexture();
  50277. var i = F[N];
  50278. void 0 === i && (i = {
  50279. type: void 0,
  50280. texture: void 0
  50281. },
  50282. F[N] = i),
  50283. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50284. i.type = e,
  50285. i.texture = t)
  50286. }
  50287. ,
  50288. this.compressedTexImage2D = function() {
  50289. try {
  50290. l.compressedTexImage2D.apply(l, arguments)
  50291. } catch (e) {
  50292. console.error(e)
  50293. }
  50294. }
  50295. ,
  50296. this.texImage2D = function() {
  50297. try {
  50298. l.texImage2D.apply(l, arguments)
  50299. } catch (e) {
  50300. console.error(e)
  50301. }
  50302. }
  50303. ,
  50304. this.clearColor = function(e, t, i, n) {
  50305. r.set(e, t, i, n),
  50306. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50307. B.copy(r))
  50308. }
  50309. ,
  50310. this.clearDepth = function(e) {
  50311. V !== e && (l.clearDepth(e),
  50312. V = e)
  50313. }
  50314. ,
  50315. this.clearStencil = function(e) {
  50316. k !== e && (l.clearStencil(e),
  50317. k = e)
  50318. }
  50319. ,
  50320. this.scissor = function(e) {
  50321. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50322. U.copy(e))
  50323. }
  50324. ,
  50325. this.viewport = function(e) {
  50326. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50327. H.copy(e))
  50328. }
  50329. ,
  50330. this.reset = function() {
  50331. for (var e = 0; e < a.length; e++)
  50332. 1 === a[e] && (l.disableVertexAttribArray(e),
  50333. a[e] = 0);
  50334. t = {},
  50335. N = void 0,
  50336. F = {},
  50337. M = E = C = I = u = h = null
  50338. }
  50339. }
  50340. ,
  50341. Ci.LensFlarePlugin = function(v, y) {
  50342. function A() {
  50343. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50344. C = S.createBuffer(),
  50345. I = S.createBuffer(),
  50346. S.bindBuffer(S.ARRAY_BUFFER, C),
  50347. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50348. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50349. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50350. T = S.createTexture(),
  50351. x = S.createTexture(),
  50352. M.bindTexture(S.TEXTURE_2D, T),
  50353. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50354. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50355. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50356. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50357. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50358. M.bindTexture(S.TEXTURE_2D, x),
  50359. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50360. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50361. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50362. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50363. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50364. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50365. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "uniform sampler2D occlusionMap;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", "vVisibility = visibility.r / 9.0;", "vVisibility *= 1.0 - visibility.g / 9.0;", "vVisibility *= visibility.b / 9.0;", "vVisibility *= 1.0 - visibility.a / 9.0;", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  50366. fragmentShader: ["uniform lowp int renderType;", "uniform sampler2D map;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * vVisibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  50367. } : {
  50368. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  50369. fragmentShader: ["precision mediump float;", "uniform lowp int renderType;", "uniform sampler2D map;", "uniform sampler2D occlusionMap;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", "visibility = ( 1.0 - visibility / 4.0 );", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * visibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  50370. },
  50371. E = function(e) {
  50372. var t = S.createProgram()
  50373. , i = S.createShader(S.FRAGMENT_SHADER)
  50374. , n = S.createShader(S.VERTEX_SHADER)
  50375. , r = "precision " + v.getPrecision() + " float;\n";
  50376. return S.shaderSource(i, r + e.fragmentShader),
  50377. S.shaderSource(n, r + e.vertexShader),
  50378. S.compileShader(i),
  50379. S.compileShader(n),
  50380. S.attachShader(t, i),
  50381. S.attachShader(t, n),
  50382. S.linkProgram(t),
  50383. t
  50384. }(e),
  50385. _ = {
  50386. vertex: S.getAttribLocation(E, "position"),
  50387. uv: S.getAttribLocation(E, "uv")
  50388. },
  50389. b = {
  50390. renderType: S.getUniformLocation(E, "renderType"),
  50391. map: S.getUniformLocation(E, "map"),
  50392. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50393. opacity: S.getUniformLocation(E, "opacity"),
  50394. color: S.getUniformLocation(E, "color"),
  50395. scale: S.getUniformLocation(E, "scale"),
  50396. rotation: S.getUniformLocation(E, "rotation"),
  50397. screenPosition: S.getUniformLocation(E, "screenPosition")
  50398. }
  50399. }
  50400. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50401. this.render = function(e, t, i) {
  50402. if (0 !== y.length) {
  50403. var n = new Ci.Vector3
  50404. , r = i.w / i.z
  50405. , o = .5 * i.z
  50406. , a = .5 * i.w
  50407. , s = 16 / i.w
  50408. , l = new Ci.Vector2(s * r,s)
  50409. , c = new Ci.Vector3(1,1,0)
  50410. , h = new Ci.Vector2(1,1);
  50411. void 0 === E && A(),
  50412. S.useProgram(E),
  50413. M.initAttributes(),
  50414. M.enableAttribute(_.vertex),
  50415. M.enableAttribute(_.uv),
  50416. M.disableUnusedAttributes(),
  50417. S.uniform1i(b.occlusionMap, 0),
  50418. S.uniform1i(b.map, 1),
  50419. S.bindBuffer(S.ARRAY_BUFFER, C),
  50420. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50421. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50422. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50423. M.disable(S.CULL_FACE),
  50424. M.setDepthWrite(!1);
  50425. for (var u = 0, d = y.length; u < d; u++) {
  50426. s = 16 / i.w,
  50427. l.set(s * r, s);
  50428. var p = y[u];
  50429. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50430. n.applyMatrix4(t.matrixWorldInverse),
  50431. n.applyProjection(t.projectionMatrix),
  50432. c.copy(n),
  50433. h.x = c.x * o + o,
  50434. h.y = c.y * a + a,
  50435. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50436. M.activeTexture(S.TEXTURE0),
  50437. M.bindTexture(S.TEXTURE_2D, null),
  50438. M.activeTexture(S.TEXTURE1),
  50439. M.bindTexture(S.TEXTURE_2D, T),
  50440. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50441. S.uniform1i(b.renderType, 0),
  50442. S.uniform2f(b.scale, l.x, l.y),
  50443. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50444. M.disable(S.BLEND),
  50445. M.enable(S.DEPTH_TEST),
  50446. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50447. M.activeTexture(S.TEXTURE0),
  50448. M.bindTexture(S.TEXTURE_2D, x),
  50449. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50450. S.uniform1i(b.renderType, 1),
  50451. M.disable(S.DEPTH_TEST),
  50452. M.activeTexture(S.TEXTURE1),
  50453. M.bindTexture(S.TEXTURE_2D, T),
  50454. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50455. p.positionScreen.copy(c),
  50456. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50457. S.uniform1i(b.renderType, 2),
  50458. M.enable(S.BLEND);
  50459. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50460. var m = p.lensFlares[f];
  50461. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50462. c.y = m.y,
  50463. c.z = m.z,
  50464. s = m.size * m.scale / i.w,
  50465. l.x = s * r,
  50466. l.y = s,
  50467. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50468. S.uniform2f(b.scale, l.x, l.y),
  50469. S.uniform1f(b.rotation, m.rotation),
  50470. S.uniform1f(b.opacity, m.opacity),
  50471. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50472. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50473. v.setTexture(m.texture, 1),
  50474. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50475. }
  50476. }
  50477. }
  50478. M.enable(S.CULL_FACE),
  50479. M.enable(S.DEPTH_TEST),
  50480. M.setDepthWrite(!0),
  50481. v.resetGLState()
  50482. }
  50483. }
  50484. }
  50485. ,
  50486. Ci.SpritePlugin = function(u, d) {
  50487. function p() {
  50488. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50489. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50490. g = I.createBuffer(),
  50491. m = I.createBuffer(),
  50492. I.bindBuffer(I.ARRAY_BUFFER, g),
  50493. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50494. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50495. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50496. v = function() {
  50497. var e = I.createProgram()
  50498. , t = I.createShader(I.VERTEX_SHADER)
  50499. , i = I.createShader(I.FRAGMENT_SHADER);
  50500. return I.shaderSource(t, ["precision " + u.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  50501. I.shaderSource(i, ["precision " + u.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  50502. I.compileShader(t),
  50503. I.compileShader(i),
  50504. I.attachShader(e, t),
  50505. I.attachShader(e, i),
  50506. I.linkProgram(e),
  50507. e
  50508. }(),
  50509. y = {
  50510. position: I.getAttribLocation(v, "position"),
  50511. uv: I.getAttribLocation(v, "uv")
  50512. },
  50513. A = {
  50514. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50515. uvScale: I.getUniformLocation(v, "uvScale"),
  50516. rotation: I.getUniformLocation(v, "rotation"),
  50517. scale: I.getUniformLocation(v, "scale"),
  50518. color: I.getUniformLocation(v, "color"),
  50519. map: I.getUniformLocation(v, "map"),
  50520. opacity: I.getUniformLocation(v, "opacity"),
  50521. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50522. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50523. fogType: I.getUniformLocation(v, "fogType"),
  50524. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50525. fogNear: I.getUniformLocation(v, "fogNear"),
  50526. fogFar: I.getUniformLocation(v, "fogFar"),
  50527. fogColor: I.getUniformLocation(v, "fogColor"),
  50528. alphaTest: I.getUniformLocation(v, "alphaTest")
  50529. };
  50530. var i = document.createElement("canvas");
  50531. i.width = 8,
  50532. i.height = 8;
  50533. var n = i.getContext("2d");
  50534. n.fillStyle = "white",
  50535. n.fillRect(0, 0, 8, 8),
  50536. (C = new Ci.Texture(i)).needsUpdate = !0
  50537. }
  50538. function f(e, t) {
  50539. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50540. }
  50541. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50542. this.render = function(e, t) {
  50543. if (0 !== d.length) {
  50544. void 0 === v && p(),
  50545. I.useProgram(v),
  50546. E.initAttributes(),
  50547. E.enableAttribute(y.position),
  50548. E.enableAttribute(y.uv),
  50549. E.disableUnusedAttributes(),
  50550. E.disable(I.CULL_FACE),
  50551. E.enable(I.BLEND),
  50552. I.bindBuffer(I.ARRAY_BUFFER, g),
  50553. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50554. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50555. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50556. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50557. E.activeTexture(I.TEXTURE0),
  50558. I.uniform1i(A.map, 0);
  50559. var i = 0
  50560. , n = 0
  50561. , r = e.fog;
  50562. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50563. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50564. I.uniform1f(A.fogFar, r.far),
  50565. I.uniform1i(A.fogType, 1),
  50566. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50567. I.uniform1i(A.fogType, 2),
  50568. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50569. n = i = 0);
  50570. for (var o = 0, a = d.length; o < a; o++) {
  50571. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50572. l.z = -l.modelViewMatrix.elements[14]
  50573. }
  50574. d.sort(f);
  50575. var s = [];
  50576. for (o = 0,
  50577. a = d.length; o < a; o++) {
  50578. var l, c = (l = d[o]).material;
  50579. I.uniform1f(A.alphaTest, c.alphaTest),
  50580. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50581. l.matrixWorld.decompose(_, b, w),
  50582. s[0] = w.x,
  50583. s[1] = w.y;
  50584. var h = 0;
  50585. e.fog && c.fog && (h = n),
  50586. i !== h && (I.uniform1i(A.fogType, h),
  50587. i = h),
  50588. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50589. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50590. I.uniform2f(A.uvScale, 1, 1)),
  50591. I.uniform1f(A.opacity, c.opacity),
  50592. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50593. I.uniform1f(A.rotation, c.rotation),
  50594. I.uniform2fv(A.scale, s),
  50595. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50596. E.setDepthTest(c.depthTest),
  50597. E.setDepthWrite(c.depthWrite),
  50598. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50599. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50600. }
  50601. E.enable(I.CULL_FACE),
  50602. u.resetGLState()
  50603. }
  50604. }
  50605. }
  50606. ,
  50607. Object.defineProperties(Ci.Box2.prototype, {
  50608. empty: {
  50609. value: function() {
  50610. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50611. this.isEmpty()
  50612. }
  50613. },
  50614. isIntersectionBox: {
  50615. value: function(e) {
  50616. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50617. this.intersectsBox(e)
  50618. }
  50619. }
  50620. }),
  50621. Object.defineProperties(Ci.Box3.prototype, {
  50622. empty: {
  50623. value: function() {
  50624. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50625. this.isEmpty()
  50626. }
  50627. },
  50628. isIntersectionBox: {
  50629. value: function(e) {
  50630. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50631. this.intersectsBox(e)
  50632. }
  50633. },
  50634. isIntersectionSphere: {
  50635. value: function(e) {
  50636. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50637. this.intersectsSphere(e)
  50638. }
  50639. }
  50640. }),
  50641. Object.defineProperties(Ci.Matrix3.prototype, {
  50642. multiplyVector3: {
  50643. value: function(e) {
  50644. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50645. e.applyMatrix3(this)
  50646. }
  50647. },
  50648. multiplyVector3Array: {
  50649. value: function(e) {
  50650. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50651. this.applyToVector3Array(e)
  50652. }
  50653. }
  50654. }),
  50655. Object.defineProperties(Ci.Matrix4.prototype, {
  50656. extractPosition: {
  50657. value: function(e) {
  50658. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50659. this.copyPosition(e)
  50660. }
  50661. },
  50662. setRotationFromQuaternion: {
  50663. value: function(e) {
  50664. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50665. this.makeRotationFromQuaternion(e)
  50666. }
  50667. },
  50668. multiplyVector3: {
  50669. value: function(e) {
  50670. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  50671. e.applyProjection(this)
  50672. }
  50673. },
  50674. multiplyVector4: {
  50675. value: function(e) {
  50676. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50677. e.applyMatrix4(this)
  50678. }
  50679. },
  50680. multiplyVector3Array: {
  50681. value: function(e) {
  50682. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50683. this.applyToVector3Array(e)
  50684. }
  50685. },
  50686. rotateAxis: {
  50687. value: function(e) {
  50688. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  50689. e.transformDirection(this)
  50690. }
  50691. },
  50692. crossVector: {
  50693. value: function(e) {
  50694. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50695. e.applyMatrix4(this)
  50696. }
  50697. },
  50698. translate: {
  50699. value: function(e) {
  50700. console.error("THREE.Matrix4: .translate() has been removed.")
  50701. }
  50702. },
  50703. rotateX: {
  50704. value: function(e) {
  50705. console.error("THREE.Matrix4: .rotateX() has been removed.")
  50706. }
  50707. },
  50708. rotateY: {
  50709. value: function(e) {
  50710. console.error("THREE.Matrix4: .rotateY() has been removed.")
  50711. }
  50712. },
  50713. rotateZ: {
  50714. value: function(e) {
  50715. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  50716. }
  50717. },
  50718. rotateByAxis: {
  50719. value: function(e, t) {
  50720. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  50721. }
  50722. }
  50723. }),
  50724. Object.defineProperties(Ci.Plane.prototype, {
  50725. isIntersectionLine: {
  50726. value: function(e) {
  50727. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  50728. this.intersectsLine(e)
  50729. }
  50730. }
  50731. }),
  50732. Object.defineProperties(Ci.Quaternion.prototype, {
  50733. multiplyVector3: {
  50734. value: function(e) {
  50735. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  50736. e.applyQuaternion(this)
  50737. }
  50738. }
  50739. }),
  50740. Object.defineProperties(Ci.Ray.prototype, {
  50741. isIntersectionBox: {
  50742. value: function(e) {
  50743. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50744. this.intersectsBox(e)
  50745. }
  50746. },
  50747. isIntersectionPlane: {
  50748. value: function(e) {
  50749. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  50750. this.intersectsPlane(e)
  50751. }
  50752. },
  50753. isIntersectionSphere: {
  50754. value: function(e) {
  50755. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50756. this.intersectsSphere(e)
  50757. }
  50758. }
  50759. }),
  50760. Object.defineProperties(Ci.Vector3.prototype, {
  50761. setEulerFromRotationMatrix: {
  50762. value: function() {
  50763. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  50764. }
  50765. },
  50766. setEulerFromQuaternion: {
  50767. value: function() {
  50768. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  50769. }
  50770. },
  50771. getPositionFromMatrix: {
  50772. value: function(e) {
  50773. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  50774. this.setFromMatrixPosition(e)
  50775. }
  50776. },
  50777. getScaleFromMatrix: {
  50778. value: function(e) {
  50779. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  50780. this.setFromMatrixScale(e)
  50781. }
  50782. },
  50783. getColumnFromMatrix: {
  50784. value: function(e, t) {
  50785. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  50786. this.setFromMatrixColumn(e, t)
  50787. }
  50788. }
  50789. }),
  50790. Ci.Face4 = function(e, t, i, n, r, o, a) {
  50791. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  50792. new Ci.Face3(e,t,i,r,o,a)
  50793. }
  50794. ,
  50795. Ci.Vertex = function(e, t, i) {
  50796. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  50797. new Ci.Vector3(e,t,i)
  50798. }
  50799. ,
  50800. Object.defineProperties(Ci.Object3D.prototype, {
  50801. eulerOrder: {
  50802. get: function() {
  50803. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50804. this.rotation.order
  50805. },
  50806. set: function(e) {
  50807. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50808. this.rotation.order = e
  50809. }
  50810. },
  50811. getChildByName: {
  50812. value: function(e) {
  50813. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  50814. this.getObjectByName(e)
  50815. }
  50816. },
  50817. renderDepth: {
  50818. set: function(e) {
  50819. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  50820. }
  50821. },
  50822. translate: {
  50823. value: function(e, t) {
  50824. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  50825. this.translateOnAxis(t, e)
  50826. }
  50827. },
  50828. useQuaternion: {
  50829. get: function() {
  50830. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50831. },
  50832. set: function(e) {
  50833. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50834. }
  50835. }
  50836. }),
  50837. Object.defineProperties(Ci, {
  50838. PointCloud: {
  50839. value: function(e, t) {
  50840. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  50841. new Ci.Points(e,t)
  50842. }
  50843. },
  50844. ParticleSystem: {
  50845. value: function(e, t) {
  50846. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  50847. new Ci.Points(e,t)
  50848. }
  50849. }
  50850. }),
  50851. Object.defineProperties(Ci.Light.prototype, {
  50852. onlyShadow: {
  50853. set: function(e) {
  50854. console.warn("THREE.Light: .onlyShadow has been removed.")
  50855. }
  50856. },
  50857. shadowCameraFov: {
  50858. set: function(e) {
  50859. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  50860. this.shadow.camera.fov = e
  50861. }
  50862. },
  50863. shadowCameraLeft: {
  50864. set: function(e) {
  50865. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  50866. this.shadow.camera.left = e
  50867. }
  50868. },
  50869. shadowCameraRight: {
  50870. set: function(e) {
  50871. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  50872. this.shadow.camera.right = e
  50873. }
  50874. },
  50875. shadowCameraTop: {
  50876. set: function(e) {
  50877. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  50878. this.shadow.camera.top = e
  50879. }
  50880. },
  50881. shadowCameraBottom: {
  50882. set: function(e) {
  50883. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  50884. this.shadow.camera.bottom = e
  50885. }
  50886. },
  50887. shadowCameraNear: {
  50888. set: function(e) {
  50889. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  50890. this.shadow.camera.near = e
  50891. }
  50892. },
  50893. shadowCameraFar: {
  50894. set: function(e) {
  50895. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  50896. this.shadow.camera.far = e
  50897. }
  50898. },
  50899. shadowCameraVisible: {
  50900. set: function(e) {
  50901. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  50902. }
  50903. },
  50904. shadowBias: {
  50905. set: function(e) {
  50906. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  50907. this.shadow.bias = e
  50908. }
  50909. },
  50910. shadowDarkness: {
  50911. set: function(e) {
  50912. console.warn("THREE.Light: .shadowDarkness has been removed.")
  50913. }
  50914. },
  50915. shadowMapWidth: {
  50916. set: function(e) {
  50917. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  50918. this.shadow.mapSize.width = e
  50919. }
  50920. },
  50921. shadowMapHeight: {
  50922. set: function(e) {
  50923. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  50924. this.shadow.mapSize.height = e
  50925. }
  50926. }
  50927. }),
  50928. Object.defineProperties(Ci.BufferAttribute.prototype, {
  50929. length: {
  50930. get: function() {
  50931. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  50932. this.array.length
  50933. }
  50934. }
  50935. }),
  50936. Object.defineProperties(Ci.BufferGeometry.prototype, {
  50937. drawcalls: {
  50938. get: function() {
  50939. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  50940. this.groups
  50941. }
  50942. },
  50943. offsets: {
  50944. get: function() {
  50945. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  50946. this.groups
  50947. }
  50948. },
  50949. addIndex: {
  50950. value: function(e) {
  50951. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  50952. this.setIndex(e)
  50953. }
  50954. },
  50955. addDrawCall: {
  50956. value: function(e, t, i) {
  50957. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  50958. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  50959. this.addGroup(e, t)
  50960. }
  50961. },
  50962. clearDrawCalls: {
  50963. value: function() {
  50964. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  50965. this.clearGroups()
  50966. }
  50967. },
  50968. computeTangents: {
  50969. value: function() {
  50970. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  50971. }
  50972. },
  50973. computeOffsets: {
  50974. value: function() {
  50975. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  50976. }
  50977. }
  50978. }),
  50979. Object.defineProperties(Ci.Material.prototype, {
  50980. wrapAround: {
  50981. get: function() {
  50982. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  50983. },
  50984. set: function(e) {
  50985. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  50986. }
  50987. },
  50988. wrapRGB: {
  50989. get: function() {
  50990. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  50991. new Ci.Color
  50992. }
  50993. }
  50994. }),
  50995. Object.defineProperties(Ci, {
  50996. PointCloudMaterial: {
  50997. value: function(e) {
  50998. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  50999. new Ci.PointsMaterial(e)
  51000. }
  51001. },
  51002. ParticleBasicMaterial: {
  51003. value: function(e) {
  51004. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51005. new Ci.PointsMaterial(e)
  51006. }
  51007. },
  51008. ParticleSystemMaterial: {
  51009. value: function(e) {
  51010. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51011. new Ci.PointsMaterial(e)
  51012. }
  51013. }
  51014. }),
  51015. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51016. metal: {
  51017. get: function() {
  51018. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51019. !1
  51020. },
  51021. set: function(e) {
  51022. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51023. }
  51024. }
  51025. }),
  51026. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51027. derivatives: {
  51028. get: function() {
  51029. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51030. this.extensions.derivatives
  51031. },
  51032. set: function(e) {
  51033. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51034. this.extensions.derivatives = e
  51035. }
  51036. }
  51037. }),
  51038. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51039. supportsFloatTextures: {
  51040. value: function() {
  51041. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51042. this.extensions.get("OES_texture_float")
  51043. }
  51044. },
  51045. supportsHalfFloatTextures: {
  51046. value: function() {
  51047. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51048. this.extensions.get("OES_texture_half_float")
  51049. }
  51050. },
  51051. supportsStandardDerivatives: {
  51052. value: function() {
  51053. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51054. this.extensions.get("OES_standard_derivatives")
  51055. }
  51056. },
  51057. supportsCompressedTextureS3TC: {
  51058. value: function() {
  51059. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51060. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51061. }
  51062. },
  51063. supportsCompressedTexturePVRTC: {
  51064. value: function() {
  51065. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51066. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51067. }
  51068. },
  51069. supportsBlendMinMax: {
  51070. value: function() {
  51071. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51072. this.extensions.get("EXT_blend_minmax")
  51073. }
  51074. },
  51075. supportsVertexTextures: {
  51076. value: function() {
  51077. return this.capabilities.vertexTextures
  51078. }
  51079. },
  51080. supportsInstancedArrays: {
  51081. value: function() {
  51082. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51083. this.extensions.get("ANGLE_instanced_arrays")
  51084. }
  51085. },
  51086. enableScissorTest: {
  51087. value: function(e) {
  51088. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51089. this.setScissorTest(e)
  51090. }
  51091. },
  51092. initMaterial: {
  51093. value: function() {
  51094. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51095. }
  51096. },
  51097. addPrePlugin: {
  51098. value: function() {
  51099. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51100. }
  51101. },
  51102. addPostPlugin: {
  51103. value: function() {
  51104. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51105. }
  51106. },
  51107. updateShadowMap: {
  51108. value: function() {
  51109. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51110. }
  51111. },
  51112. shadowMapEnabled: {
  51113. get: function() {
  51114. return this.shadowMap.enabled
  51115. },
  51116. set: function(e) {
  51117. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51118. this.shadowMap.enabled = e
  51119. }
  51120. },
  51121. shadowMapType: {
  51122. get: function() {
  51123. return this.shadowMap.type
  51124. },
  51125. set: function(e) {
  51126. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51127. this.shadowMap.type = e
  51128. }
  51129. },
  51130. shadowMapCullFace: {
  51131. get: function() {
  51132. return this.shadowMap.cullFace
  51133. },
  51134. set: function(e) {
  51135. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51136. this.shadowMap.cullFace = e
  51137. }
  51138. }
  51139. }),
  51140. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51141. wrapS: {
  51142. get: function() {
  51143. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51144. this.texture.wrapS
  51145. },
  51146. set: function(e) {
  51147. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51148. this.texture.wrapS = e
  51149. }
  51150. },
  51151. wrapT: {
  51152. get: function() {
  51153. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51154. this.texture.wrapT
  51155. },
  51156. set: function(e) {
  51157. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51158. this.texture.wrapT = e
  51159. }
  51160. },
  51161. magFilter: {
  51162. get: function() {
  51163. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51164. this.texture.magFilter
  51165. },
  51166. set: function(e) {
  51167. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51168. this.texture.magFilter = e
  51169. }
  51170. },
  51171. minFilter: {
  51172. get: function() {
  51173. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51174. this.texture.minFilter
  51175. },
  51176. set: function(e) {
  51177. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51178. this.texture.minFilter = e
  51179. }
  51180. },
  51181. anisotropy: {
  51182. get: function() {
  51183. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51184. this.texture.anisotropy
  51185. },
  51186. set: function(e) {
  51187. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51188. this.texture.anisotropy = e
  51189. }
  51190. },
  51191. offset: {
  51192. get: function() {
  51193. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51194. this.texture.offset
  51195. },
  51196. set: function(e) {
  51197. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51198. this.texture.offset = e
  51199. }
  51200. },
  51201. repeat: {
  51202. get: function() {
  51203. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51204. this.texture.repeat
  51205. },
  51206. set: function(e) {
  51207. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51208. this.texture.repeat = e
  51209. }
  51210. },
  51211. format: {
  51212. get: function() {
  51213. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51214. this.texture.format
  51215. },
  51216. set: function(e) {
  51217. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51218. this.texture.format = e
  51219. }
  51220. },
  51221. type: {
  51222. get: function() {
  51223. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51224. this.texture.type
  51225. },
  51226. set: function(e) {
  51227. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51228. this.texture.type = e
  51229. }
  51230. },
  51231. generateMipmaps: {
  51232. get: function() {
  51233. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51234. this.texture.generateMipmaps
  51235. },
  51236. set: function(e) {
  51237. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51238. this.texture.generateMipmaps = e
  51239. }
  51240. }
  51241. }),
  51242. Ci.GeometryUtils = {
  51243. merge: function(e, t, i) {
  51244. var n;
  51245. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51246. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51247. n = t.matrix,
  51248. t = t.geometry),
  51249. e.merge(t, n, i)
  51250. },
  51251. center: function(e) {
  51252. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51253. e.center()
  51254. }
  51255. },
  51256. Ci.ImageUtils = {
  51257. crossOrigin: void 0,
  51258. loadTexture: function(e, t, i, n) {
  51259. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51260. var r = new Ci.TextureLoader;
  51261. r.setCrossOrigin(this.crossOrigin);
  51262. var o = r.load(e, i, void 0, n);
  51263. return t && (o.mapping = t),
  51264. o
  51265. },
  51266. loadTextureCube: function(e, t, i, n) {
  51267. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51268. var r = new Ci.CubeTextureLoader;
  51269. r.setCrossOrigin(this.crossOrigin);
  51270. var o = r.load(e, i, void 0, n);
  51271. return t && (o.mapping = t),
  51272. o
  51273. },
  51274. loadCompressedTexture: function() {
  51275. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51276. },
  51277. loadCompressedTextureCube: function() {
  51278. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51279. }
  51280. },
  51281. Ci.Projector = function() {
  51282. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51283. this.projectVector = function(e, t) {
  51284. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51285. e.project(t)
  51286. }
  51287. ,
  51288. this.unprojectVector = function(e, t) {
  51289. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51290. e.unproject(t)
  51291. }
  51292. ,
  51293. this.pickingRay = function(e, t) {
  51294. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51295. }
  51296. }
  51297. ,
  51298. Ci.CanvasRenderer = function() {
  51299. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51300. this.domElement = document.createElement("canvas"),
  51301. this.clear = function() {}
  51302. ,
  51303. this.render = function() {}
  51304. ,
  51305. this.setClearColor = function() {}
  51306. ,
  51307. this.setSize = function() {}
  51308. }
  51309. ,
  51310. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51311. Ci.CurveUtils = {
  51312. tangentQuadraticBezier: function(e, t, i, n) {
  51313. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51314. },
  51315. tangentCubicBezier: function(e, t, i, n, r) {
  51316. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  51317. },
  51318. tangentSpline: function(e, t, i, n, r) {
  51319. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51320. },
  51321. interpolate: function(e, t, i, n, r) {
  51322. var o = .5 * (i - e)
  51323. , a = .5 * (n - t)
  51324. , s = r * r;
  51325. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51326. }
  51327. },
  51328. Ci.SceneUtils = {
  51329. createMultiMaterialObject: function(e, t) {
  51330. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51331. i.add(new Ci.Mesh(e,t[n]));
  51332. return i
  51333. },
  51334. detach: function(e, t, i) {
  51335. e.applyMatrix(t.matrixWorld),
  51336. t.remove(e),
  51337. i.add(e)
  51338. },
  51339. attach: function(e, t, i) {
  51340. var n = new Ci.Matrix4;
  51341. n.getInverse(i.matrixWorld),
  51342. e.applyMatrix(n),
  51343. t.remove(e),
  51344. i.add(e)
  51345. }
  51346. },
  51347. Ci.ShapeUtils = {
  51348. area: function(e) {
  51349. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51350. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51351. return .5 * i
  51352. },
  51353. triangulate: function(e, t) {
  51354. var i = e.length;
  51355. if (i < 3)
  51356. return null;
  51357. var n, r, o, a = [], s = [], l = [];
  51358. if (0 < Ci.ShapeUtils.area(e))
  51359. for (r = 0; r < i; r++)
  51360. s[r] = r;
  51361. else
  51362. for (r = 0; r < i; r++)
  51363. s[r] = i - 1 - r;
  51364. var c = i
  51365. , h = 2 * c;
  51366. for (r = c - 1; 2 < c; ) {
  51367. if (h-- <= 0)
  51368. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51369. t ? l : a;
  51370. if (c <= (n = r) && (n = 0),
  51371. c <= (r = n + 1) && (r = 0),
  51372. c <= (o = r + 1) && (o = 0),
  51373. Si(e, n, r, o, c, s)) {
  51374. var u, d, p, f, g;
  51375. for (u = s[n],
  51376. d = s[r],
  51377. p = s[o],
  51378. a.push([e[u], e[d], e[p]]),
  51379. l.push([s[n], s[r], s[o]]),
  51380. g = (f = r) + 1; g < c; f++,
  51381. g++)
  51382. s[f] = s[g];
  51383. h = 2 * --c
  51384. }
  51385. }
  51386. return t ? l : a
  51387. },
  51388. triangulateShape: function(e, t) {
  51389. function w(e, t, i) {
  51390. return e.x !== t.x ? e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  51391. }
  51392. function b(e, t, i, n, r) {
  51393. var o = t.x - e.x
  51394. , a = t.y - e.y
  51395. , s = n.x - i.x
  51396. , l = n.y - i.y
  51397. , c = e.x - i.x
  51398. , h = e.y - i.y
  51399. , u = a * s - o * l
  51400. , d = a * c - o * h;
  51401. if (Math.abs(u) > Number.EPSILON) {
  51402. var p;
  51403. if (0 < u) {
  51404. if (d < 0 || u < d)
  51405. return [];
  51406. if ((p = l * c - s * h) < 0 || u < p)
  51407. return []
  51408. } else {
  51409. if (0 < d || d < u)
  51410. return [];
  51411. if (0 < (p = l * c - s * h) || p < u)
  51412. return []
  51413. }
  51414. if (0 === p)
  51415. return !r || 0 != d && d != u ? [e] : [];
  51416. if (p === u)
  51417. return !r || 0 != d && d != u ? [t] : [];
  51418. if (0 == d)
  51419. return [i];
  51420. if (d == u)
  51421. return [n];
  51422. var f = p / u;
  51423. return [{
  51424. x: e.x + f * o,
  51425. y: e.y + f * a
  51426. }]
  51427. }
  51428. if (0 != d || l * c != s * h)
  51429. return [];
  51430. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51431. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  51432. (m = t).x) : (v = (g = t).x,
  51433. (m = e).x),
  51434. i.x < n.x ? (I = (A = i).x,
  51435. (C = n).x) : (I = (A = n).x,
  51436. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51437. (m = t).y) : (v = (g = t).y,
  51438. (m = e).y),
  51439. i.y < n.y ? (I = (A = i).y,
  51440. (C = n).y) : (I = (A = n).y,
  51441. (C = i).y)),
  51442. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  51443. }
  51444. function T(e, t, i, n) {
  51445. var r = t.x - e.x
  51446. , o = t.y - e.y
  51447. , a = i.x - e.x
  51448. , s = i.y - e.y
  51449. , l = n.x - e.x
  51450. , c = n.y - e.y
  51451. , h = r * s - o * a
  51452. , u = r * c - o * l;
  51453. if (Math.abs(h) > Number.EPSILON) {
  51454. var d = l * s - c * a;
  51455. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51456. }
  51457. return 0 < u
  51458. }
  51459. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51460. Array.prototype.push.apply(c, t[h]);
  51461. for (i = 0,
  51462. n = c.length; i < n; i++)
  51463. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51464. l[a] = i;
  51465. var d = function(e, a) {
  51466. function t(e, t) {
  51467. var i = m.length - 1
  51468. , n = e - 1;
  51469. n < 0 && (n = i);
  51470. var r = e + 1;
  51471. i < r && (r = 0);
  51472. var o = T(m[e], m[n], m[r], c[t]);
  51473. if (!o)
  51474. return !1;
  51475. var a = c.length - 1
  51476. , s = t - 1;
  51477. s < 0 && (s = a);
  51478. var l = t + 1;
  51479. return a < l && (l = 0),
  51480. !!(o = T(c[t], c[s], c[l], m[e]))
  51481. }
  51482. function i(e, t) {
  51483. var i, n;
  51484. for (i = 0; i < m.length; i++)
  51485. if (n = i + 1,
  51486. n %= m.length,
  51487. 0 < b(e, t, m[i], m[n], !0).length)
  51488. return !0;
  51489. return !1
  51490. }
  51491. function n(e, t) {
  51492. var i, n, r, o;
  51493. for (i = 0; i < v.length; i++)
  51494. for (n = a[v[i]],
  51495. r = 0; r < n.length; r++)
  51496. if (o = r + 1,
  51497. o %= n.length,
  51498. 0 < b(e, t, n[r], n[o], !0).length)
  51499. return !0;
  51500. return !1
  51501. }
  51502. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  51503. v.push(A);
  51504. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51505. if (--E < 0) {
  51506. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51507. break
  51508. }
  51509. for (o = I; o < m.length; o++) {
  51510. s = m[o],
  51511. r = -1;
  51512. for (A = 0; A < v.length; A++)
  51513. if (h = v[A],
  51514. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51515. c = a[h];
  51516. for (var _ = 0; _ < c.length; _++)
  51517. if (l = c[_],
  51518. t(o, _) && !i(s, l) && !n(s, l)) {
  51519. r = _,
  51520. v.splice(A, 1),
  51521. d = m.slice(0, o + 1),
  51522. p = m.slice(o),
  51523. f = c.slice(r),
  51524. g = c.slice(0, r + 1),
  51525. m = d.concat(f).concat(g).concat(p),
  51526. I = o;
  51527. break
  51528. }
  51529. if (0 <= r)
  51530. break;
  51531. y[u] = !0
  51532. }
  51533. if (0 <= r)
  51534. break
  51535. }
  51536. }
  51537. return m
  51538. }(e, t)
  51539. , p = Ci.ShapeUtils.triangulate(d, !1);
  51540. for (i = 0,
  51541. n = p.length; i < n; i++)
  51542. for (o = p[i],
  51543. r = 0; r < 3; r++)
  51544. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51545. return p.concat()
  51546. },
  51547. isClockWise: function(e) {
  51548. return Ci.ShapeUtils.area(e) < 0
  51549. },
  51550. b2: function(e, t, i, n) {
  51551. return function(e, t) {
  51552. var i = 1 - e;
  51553. return i * i * t
  51554. }(e, t) + function(e, t) {
  51555. return 2 * (1 - e) * e * t
  51556. }(e, i) + function(e, t) {
  51557. return e * e * t
  51558. }(e, n)
  51559. },
  51560. b3: function(e, t, i, n, r) {
  51561. return function(e, t) {
  51562. var i = 1 - e;
  51563. return i * i * i * t
  51564. }(e, t) + function(e, t) {
  51565. var i = 1 - e;
  51566. return 3 * i * i * e * t
  51567. }(e, i) + function(e, t) {
  51568. return 3 * (1 - e) * e * e * t
  51569. }(e, n) + function(e, t) {
  51570. return e * e * e * t
  51571. }(e, r)
  51572. }
  51573. },
  51574. Ci.Curve = function() {}
  51575. ,
  51576. Ci.Curve.prototype = {
  51577. constructor: Ci.Curve,
  51578. getPoint: function(e) {
  51579. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51580. null
  51581. },
  51582. getPointAt: function(e) {
  51583. var t = this.getUtoTmapping(e);
  51584. return this.getPoint(t)
  51585. },
  51586. getPoints: function(e) {
  51587. e = e || 5;
  51588. var t, i = [];
  51589. for (t = 0; t <= e; t++)
  51590. i.push(this.getPoint(t / e));
  51591. return i
  51592. },
  51593. getSpacedPoints: function(e) {
  51594. e = e || 5;
  51595. var t, i = [];
  51596. for (t = 0; t <= e; t++)
  51597. i.push(this.getPointAt(t / e));
  51598. return i
  51599. },
  51600. getLength: function() {
  51601. var e = this.getLengths();
  51602. return e[e.length - 1]
  51603. },
  51604. getLengths: function(e) {
  51605. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51606. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51607. return this.cacheArcLengths;
  51608. this.needsUpdate = !1;
  51609. var t, i, n = [], r = this.getPoint(0), o = 0;
  51610. for (n.push(0),
  51611. i = 1; i <= e; i++)
  51612. o += (t = this.getPoint(i / e)).distanceTo(r),
  51613. n.push(o),
  51614. r = t;
  51615. return this.cacheArcLengths = n
  51616. },
  51617. updateArcLengths: function() {
  51618. this.needsUpdate = !0,
  51619. this.getLengths()
  51620. },
  51621. getUtoTmapping: function(e, t) {
  51622. var i, n = this.getLengths(), r = 0, o = n.length;
  51623. i = t || e * n[o - 1];
  51624. for (var a, s = 0, l = o - 1; s <= l; )
  51625. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51626. s = r + 1;
  51627. else {
  51628. if (!(0 < a)) {
  51629. l = r;
  51630. break
  51631. }
  51632. l = r - 1
  51633. }
  51634. if (n[r = l] === i)
  51635. return r / (o - 1);
  51636. var c = n[r];
  51637. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51638. },
  51639. getTangent: function(e) {
  51640. var t = e - 1e-4
  51641. , i = e + 1e-4;
  51642. t < 0 && (t = 0),
  51643. 1 < i && (i = 1);
  51644. var n = this.getPoint(t);
  51645. return this.getPoint(i).clone().sub(n).normalize()
  51646. },
  51647. getTangentAt: function(e) {
  51648. var t = this.getUtoTmapping(e);
  51649. return this.getTangent(t)
  51650. }
  51651. },
  51652. Ci.Curve.create = function(e, t) {
  51653. return e.prototype = Object.create(Ci.Curve.prototype),
  51654. (e.prototype.constructor = e).prototype.getPoint = t,
  51655. e
  51656. }
  51657. ,
  51658. Ci.CurvePath = function() {
  51659. this.curves = [],
  51660. this.autoClose = !1
  51661. }
  51662. ,
  51663. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51664. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51665. Ci.CurvePath.prototype.add = function(e) {
  51666. this.curves.push(e)
  51667. }
  51668. ,
  51669. Ci.CurvePath.prototype.closePath = function() {
  51670. var e = this.curves[0].getPoint(0)
  51671. , t = this.curves[this.curves.length - 1].getPoint(1);
  51672. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  51673. }
  51674. ,
  51675. Ci.CurvePath.prototype.getPoint = function(e) {
  51676. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51677. if (i[n] >= t) {
  51678. var r = i[n] - t
  51679. , o = this.curves[n]
  51680. , a = 1 - r / o.getLength();
  51681. return o.getPointAt(a)
  51682. }
  51683. n++
  51684. }
  51685. return null
  51686. }
  51687. ,
  51688. Ci.CurvePath.prototype.getLength = function() {
  51689. var e = this.getCurveLengths();
  51690. return e[e.length - 1]
  51691. }
  51692. ,
  51693. Ci.CurvePath.prototype.getCurveLengths = function() {
  51694. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  51695. return this.cacheLengths;
  51696. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  51697. t += this.curves[i].getLength(),
  51698. e.push(t);
  51699. return this.cacheLengths = e
  51700. }
  51701. ,
  51702. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  51703. var t = this.getPoints(e);
  51704. return this.createGeometry(t)
  51705. }
  51706. ,
  51707. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  51708. var t = this.getSpacedPoints(e);
  51709. return this.createGeometry(t)
  51710. }
  51711. ,
  51712. Ci.CurvePath.prototype.createGeometry = function(e) {
  51713. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  51714. var r = e[i];
  51715. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  51716. }
  51717. return t
  51718. }
  51719. ,
  51720. Ci.Font = function(e) {
  51721. this.data = e
  51722. }
  51723. ,
  51724. Ci.Font.prototype = {
  51725. constructor: Ci.Font,
  51726. generateShapes: function(e, s, b) {
  51727. function l(e, t, i) {
  51728. var n = w.glyphs[e] || w.glyphs["?"];
  51729. if (n) {
  51730. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  51731. if (n.o)
  51732. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  51733. switch (A[C++]) {
  51734. case "m":
  51735. r = A[C++] * t + i,
  51736. o = A[C++] * t,
  51737. g.moveTo(r, o);
  51738. break;
  51739. case "l":
  51740. r = A[C++] * t + i,
  51741. o = A[C++] * t,
  51742. g.lineTo(r, o);
  51743. break;
  51744. case "q":
  51745. if (a = A[C++] * t + i,
  51746. s = A[C++] * t,
  51747. h = A[C++] * t + i,
  51748. u = A[C++] * t,
  51749. g.quadraticCurveTo(h, u, a, s),
  51750. f = m[m.length - 1]) {
  51751. l = f.x,
  51752. c = f.y;
  51753. for (var E = 1; E <= b; E++) {
  51754. v(_ = E / b, l, h, a),
  51755. v(_, c, u, s)
  51756. }
  51757. }
  51758. break;
  51759. case "b":
  51760. if (a = A[C++] * t + i,
  51761. s = A[C++] * t,
  51762. h = A[C++] * t + i,
  51763. u = A[C++] * t,
  51764. d = A[C++] * t + i,
  51765. p = A[C++] * t,
  51766. g.bezierCurveTo(h, u, d, p, a, s),
  51767. f = m[m.length - 1]) {
  51768. l = f.x,
  51769. c = f.y;
  51770. for (E = 1; E <= b; E++) {
  51771. var _;
  51772. y(_ = E / b, l, h, d, a),
  51773. y(_, c, u, p, s)
  51774. }
  51775. }
  51776. }
  51777. }
  51778. return {
  51779. offset: n.ha * t,
  51780. path: g
  51781. }
  51782. }
  51783. }
  51784. void 0 === s && (s = 100),
  51785. void 0 === b && (b = 4);
  51786. for (var w = this.data, t = function(e) {
  51787. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  51788. var a = l(t[o], i, n);
  51789. n += a.offset,
  51790. r.push(a.path)
  51791. }
  51792. return r
  51793. }(e), i = [], n = 0, r = t.length; n < r; n++)
  51794. Array.prototype.push.apply(i, t[n].toShapes());
  51795. return i
  51796. }
  51797. },
  51798. Ci.Path = function(e) {
  51799. Ci.CurvePath.call(this),
  51800. this.actions = [],
  51801. e && this.fromPoints(e)
  51802. }
  51803. ,
  51804. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  51805. Ci.Path.prototype.constructor = Ci.Path,
  51806. Ci.Path.prototype.fromPoints = function(e) {
  51807. this.moveTo(e[0].x, e[0].y);
  51808. for (var t = 1, i = e.length; t < i; t++)
  51809. this.lineTo(e[t].x, e[t].y)
  51810. }
  51811. ,
  51812. Ci.Path.prototype.moveTo = function(e, t) {
  51813. this.actions.push({
  51814. action: "moveTo",
  51815. args: [e, t]
  51816. })
  51817. }
  51818. ,
  51819. Ci.Path.prototype.lineTo = function(e, t) {
  51820. var i = this.actions[this.actions.length - 1].args
  51821. , n = i[i.length - 2]
  51822. , r = i[i.length - 1]
  51823. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  51824. this.curves.push(o),
  51825. this.actions.push({
  51826. action: "lineTo",
  51827. args: [e, t]
  51828. })
  51829. }
  51830. ,
  51831. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  51832. var r = this.actions[this.actions.length - 1].args
  51833. , o = r[r.length - 2]
  51834. , a = r[r.length - 1]
  51835. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  51836. this.curves.push(s),
  51837. this.actions.push({
  51838. action: "quadraticCurveTo",
  51839. args: [e, t, i, n]
  51840. })
  51841. }
  51842. ,
  51843. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  51844. var a = this.actions[this.actions.length - 1].args
  51845. , s = a[a.length - 2]
  51846. , l = a[a.length - 1]
  51847. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  51848. this.curves.push(c),
  51849. this.actions.push({
  51850. action: "bezierCurveTo",
  51851. args: [e, t, i, n, r, o]
  51852. })
  51853. }
  51854. ,
  51855. Ci.Path.prototype.splineThru = function(e) {
  51856. var t = Array.prototype.slice.call(arguments)
  51857. , i = this.actions[this.actions.length - 1].args
  51858. , n = i[i.length - 2]
  51859. , r = i[i.length - 1]
  51860. , o = [new Ci.Vector2(n,r)];
  51861. Array.prototype.push.apply(o, e);
  51862. var a = new Ci.SplineCurve(o);
  51863. this.curves.push(a),
  51864. this.actions.push({
  51865. action: "splineThru",
  51866. args: t
  51867. })
  51868. }
  51869. ,
  51870. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  51871. var a = this.actions[this.actions.length - 1].args
  51872. , s = a[a.length - 2]
  51873. , l = a[a.length - 1];
  51874. this.absarc(e + s, t + l, i, n, r, o)
  51875. }
  51876. ,
  51877. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  51878. this.absellipse(e, t, i, i, n, r, o)
  51879. }
  51880. ,
  51881. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  51882. var l = this.actions[this.actions.length - 1].args
  51883. , c = l[l.length - 2]
  51884. , h = l[l.length - 1];
  51885. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  51886. }
  51887. ,
  51888. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  51889. var l = [e, t, i, n, r, o, a, s || 0]
  51890. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  51891. this.curves.push(c);
  51892. var h = c.getPoint(1);
  51893. l.push(h.x),
  51894. l.push(h.y),
  51895. this.actions.push({
  51896. action: "ellipse",
  51897. args: l
  51898. })
  51899. }
  51900. ,
  51901. Ci.Path.prototype.getSpacedPoints = function(e) {
  51902. e = e || 40;
  51903. for (var t = [], i = 0; i < e; i++)
  51904. t.push(this.getPoint(i / e));
  51905. return this.autoClose && t.push(t[0]),
  51906. t
  51907. }
  51908. ,
  51909. Ci.Path.prototype.getPoints = function(e) {
  51910. e = e || 12;
  51911. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  51912. var v = this.actions[g]
  51913. , y = v.action
  51914. , A = v.args;
  51915. switch (y) {
  51916. case "moveTo":
  51917. case "lineTo":
  51918. f.push(new Ci.Vector2(A[0],A[1]));
  51919. break;
  51920. case "quadraticCurveTo":
  51921. t = A[2],
  51922. i = A[3],
  51923. o = A[0],
  51924. a = A[1],
  51925. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  51926. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  51927. c[c.length - 1]);
  51928. for (var C = 1; C <= e; C++) {
  51929. h = d(O = C / e, s, o, t),
  51930. u = d(O, l, a, i),
  51931. f.push(new Ci.Vector2(h,u))
  51932. }
  51933. break;
  51934. case "bezierCurveTo":
  51935. t = A[4],
  51936. i = A[5],
  51937. o = A[0],
  51938. a = A[1],
  51939. n = A[2],
  51940. r = A[3],
  51941. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  51942. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  51943. c[c.length - 1]);
  51944. for (C = 1; C <= e; C++) {
  51945. h = p(O = C / e, s, o, n, t),
  51946. u = p(O, l, a, r, i),
  51947. f.push(new Ci.Vector2(h,u))
  51948. }
  51949. break;
  51950. case "splineThru":
  51951. c = this.actions[g - 1].args;
  51952. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  51953. , E = e * A[0].length;
  51954. I = I.concat(A[0]);
  51955. var _ = new Ci.SplineCurve(I);
  51956. for (C = 1; C <= E; C++)
  51957. f.push(_.getPointAt(C / E));
  51958. break;
  51959. case "arc":
  51960. var b = A[0]
  51961. , w = A[1]
  51962. , T = A[2]
  51963. , x = A[3]
  51964. , S = A[4]
  51965. , M = !!A[5]
  51966. , R = S - x
  51967. , P = 2 * e;
  51968. for (C = 1; C <= P; C++) {
  51969. var O = C / P;
  51970. M || (O = 1 - O),
  51971. L = x + O * R,
  51972. h = b + T * Math.cos(L),
  51973. u = w + T * Math.sin(L),
  51974. f.push(new Ci.Vector2(h,u))
  51975. }
  51976. break;
  51977. case "ellipse":
  51978. b = A[0],
  51979. w = A[1];
  51980. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  51981. S = A[5],
  51982. M = !!A[6],
  51983. A[7]);
  51984. R = S - x,
  51985. P = 2 * e;
  51986. 0 !== V && (D = Math.cos(V),
  51987. N = Math.sin(V));
  51988. for (C = 1; C <= P; C++) {
  51989. O = C / P;
  51990. if (M || (O = 1 - O),
  51991. L = x + O * R,
  51992. h = b + F * Math.cos(L),
  51993. u = w + B * Math.sin(L),
  51994. 0 !== V) {
  51995. var k = h;
  51996. h = (k - b) * D - (u - w) * N + b,
  51997. u = (k - b) * N + (u - w) * D + w
  51998. }
  51999. f.push(new Ci.Vector2(h,u))
  52000. }
  52001. }
  52002. }
  52003. var U = f[f.length - 1];
  52004. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52005. this.autoClose && f.push(f[0]),
  52006. f
  52007. }
  52008. ,
  52009. Ci.Path.prototype.toShapes = function(e, t) {
  52010. function i(e) {
  52011. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52012. var r = e[i]
  52013. , o = new Ci.Shape;
  52014. o.actions = r.actions,
  52015. o.curves = r.curves,
  52016. t.push(o)
  52017. }
  52018. return t
  52019. }
  52020. function n(e, t) {
  52021. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52022. var a = t[r]
  52023. , s = t[o]
  52024. , l = s.x - a.x
  52025. , c = s.y - a.y;
  52026. if (Math.abs(c) > Number.EPSILON) {
  52027. if (c < 0 && (a = t[o],
  52028. l = -l,
  52029. s = t[r],
  52030. c = -c),
  52031. e.y < a.y || e.y > s.y)
  52032. continue;
  52033. if (e.y === a.y) {
  52034. if (e.x === a.x)
  52035. return !0
  52036. } else {
  52037. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52038. if (0 == h)
  52039. return !0;
  52040. if (h < 0)
  52041. continue;
  52042. n = !n
  52043. }
  52044. } else {
  52045. if (e.y !== a.y)
  52046. continue;
  52047. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52048. return !0
  52049. }
  52050. }
  52051. return n
  52052. }
  52053. var r = Ci.ShapeUtils.isClockWise
  52054. , o = function(e) {
  52055. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52056. var o = e[n]
  52057. , a = o.args
  52058. , s = o.action;
  52059. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52060. i = new Ci.Path),
  52061. i[s].apply(i, a)
  52062. }
  52063. return 0 !== i.actions.length && t.push(i),
  52064. t
  52065. }(this.actions);
  52066. if (0 === o.length)
  52067. return [];
  52068. if (!0 === t)
  52069. return i(o);
  52070. var a, s, l, c = [];
  52071. if (1 === o.length)
  52072. return s = o[0],
  52073. (l = new Ci.Shape).actions = s.actions,
  52074. l.curves = s.curves,
  52075. c.push(l),
  52076. c;
  52077. var h = !r(o[0].getPoints());
  52078. h = e ? !h : h;
  52079. var u, d = [], p = [], f = [], g = 0;
  52080. p[g] = void 0,
  52081. f[g] = [];
  52082. for (var m = 0, v = o.length; m < v; m++)
  52083. a = r(u = (s = o[m]).getPoints()),
  52084. (a = e ? !a : a) ? (!h && p[g] && g++,
  52085. p[g] = {
  52086. s: new Ci.Shape,
  52087. p: u
  52088. },
  52089. p[g].s.actions = s.actions,
  52090. p[g].s.curves = s.curves,
  52091. h && g++,
  52092. f[g] = []) : f[g].push({
  52093. h: s,
  52094. p: u[0]
  52095. });
  52096. if (!p[0])
  52097. return i(o);
  52098. if (1 < p.length) {
  52099. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52100. d[C] = [];
  52101. for (C = 0,
  52102. I = p.length; C < I; C++)
  52103. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52104. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52105. n(b.p, p[T].p) && (C !== T && A.push({
  52106. froms: C,
  52107. tos: T,
  52108. hole: _
  52109. }),
  52110. w ? (w = !1,
  52111. d[T].push(b)) : y = !0);
  52112. w && d[C].push(b)
  52113. }
  52114. 0 < A.length && (y || (f = d))
  52115. }
  52116. m = 0;
  52117. for (var x, S = p.length; m < S; m++) {
  52118. l = p[m].s,
  52119. c.push(l);
  52120. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52121. l.holes.push(x[M].h)
  52122. }
  52123. return c
  52124. }
  52125. ,
  52126. Ci.Shape = function() {
  52127. Ci.Path.apply(this, arguments),
  52128. this.holes = []
  52129. }
  52130. ,
  52131. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52132. Ci.Shape.prototype.constructor = Ci.Shape,
  52133. Ci.Shape.prototype.extrude = function(e) {
  52134. return new Ci.ExtrudeGeometry(this,e)
  52135. }
  52136. ,
  52137. Ci.Shape.prototype.makeGeometry = function(e) {
  52138. return new Ci.ShapeGeometry(this,e)
  52139. }
  52140. ,
  52141. Ci.Shape.prototype.getPointsHoles = function(e) {
  52142. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52143. t[i] = this.holes[i].getPoints(e);
  52144. return t
  52145. }
  52146. ,
  52147. Ci.Shape.prototype.extractAllPoints = function(e) {
  52148. return {
  52149. shape: this.getPoints(e),
  52150. holes: this.getPointsHoles(e)
  52151. }
  52152. }
  52153. ,
  52154. Ci.Shape.prototype.extractPoints = function(e) {
  52155. return this.extractAllPoints(e)
  52156. }
  52157. ,
  52158. Ci.LineCurve = function(e, t) {
  52159. this.v1 = e,
  52160. this.v2 = t
  52161. }
  52162. ,
  52163. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52164. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52165. Ci.LineCurve.prototype.getPoint = function(e) {
  52166. var t = this.v2.clone().sub(this.v1);
  52167. return t.multiplyScalar(e).add(this.v1),
  52168. t
  52169. }
  52170. ,
  52171. Ci.LineCurve.prototype.getPointAt = function(e) {
  52172. return this.getPoint(e)
  52173. }
  52174. ,
  52175. Ci.LineCurve.prototype.getTangent = function(e) {
  52176. return this.v2.clone().sub(this.v1).normalize()
  52177. }
  52178. ,
  52179. Ci.QuadraticBezierCurve = function(e, t, i) {
  52180. this.v0 = e,
  52181. this.v1 = t,
  52182. this.v2 = i
  52183. }
  52184. ,
  52185. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52186. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52187. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52188. var t = Ci.ShapeUtils.b2;
  52189. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52190. }
  52191. ,
  52192. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52193. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52194. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52195. }
  52196. ,
  52197. Ci.CubicBezierCurve = function(e, t, i, n) {
  52198. this.v0 = e,
  52199. this.v1 = t,
  52200. this.v2 = i,
  52201. this.v3 = n
  52202. }
  52203. ,
  52204. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52205. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52206. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52207. var t = Ci.ShapeUtils.b3;
  52208. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52209. }
  52210. ,
  52211. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52212. var t = Ci.CurveUtils.tangentCubicBezier;
  52213. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  52214. }
  52215. ,
  52216. Ci.SplineCurve = function(e) {
  52217. this.points = null == e ? [] : e
  52218. }
  52219. ,
  52220. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52221. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52222. Ci.SplineCurve.prototype.getPoint = function(e) {
  52223. var t = this.points
  52224. , i = (t.length - 1) * e
  52225. , n = Math.floor(i)
  52226. , r = i - n
  52227. , o = t[0 === n ? n : n - 1]
  52228. , a = t[n]
  52229. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52230. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52231. , c = Ci.CurveUtils.interpolate;
  52232. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52233. }
  52234. ,
  52235. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52236. this.aX = e,
  52237. this.aY = t,
  52238. this.xRadius = i,
  52239. this.yRadius = n,
  52240. this.aStartAngle = r,
  52241. this.aEndAngle = o,
  52242. this.aClockwise = a,
  52243. this.aRotation = s || 0
  52244. }
  52245. ,
  52246. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52247. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52248. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52249. var t, i = this.aEndAngle - this.aStartAngle;
  52250. i < 0 && (i += 2 * Math.PI),
  52251. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52252. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52253. var n = this.aX + this.xRadius * Math.cos(t)
  52254. , r = this.aY + this.yRadius * Math.sin(t);
  52255. if (0 !== this.aRotation) {
  52256. var o = Math.cos(this.aRotation)
  52257. , a = Math.sin(this.aRotation)
  52258. , s = n
  52259. , l = r;
  52260. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52261. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52262. }
  52263. return new Ci.Vector2(n,r)
  52264. }
  52265. ,
  52266. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52267. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52268. }
  52269. ,
  52270. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52271. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52272. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52273. this.v1 = e,
  52274. this.v2 = t
  52275. }, function(e) {
  52276. var t = new Ci.Vector3;
  52277. return t.subVectors(this.v2, this.v1),
  52278. t.multiplyScalar(e),
  52279. t.add(this.v1),
  52280. t
  52281. }),
  52282. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52283. this.v0 = e,
  52284. this.v1 = t,
  52285. this.v2 = i
  52286. }, function(e) {
  52287. var t = Ci.ShapeUtils.b2;
  52288. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  52289. }),
  52290. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52291. this.v0 = e,
  52292. this.v1 = t,
  52293. this.v2 = i,
  52294. this.v3 = n
  52295. }, function(e) {
  52296. var t = Ci.ShapeUtils.b3;
  52297. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  52298. }),
  52299. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52300. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52301. this.points = null == e ? [] : e
  52302. }, function(e) {
  52303. var t = this.points
  52304. , i = (t.length - 1) * e
  52305. , n = Math.floor(i)
  52306. , r = i - n
  52307. , o = t[0 == n ? n : n - 1]
  52308. , a = t[n]
  52309. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52310. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52311. , c = Ci.CurveUtils.interpolate;
  52312. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  52313. }),
  52314. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52315. Xt = new xi,
  52316. Zt = new xi,
  52317. Kt = new xi,
  52318. xi.prototype.init = function(e, t, i, n) {
  52319. this.c0 = e,
  52320. this.c1 = i,
  52321. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52322. this.c3 = 2 * e - 2 * t + i + n
  52323. }
  52324. ,
  52325. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52326. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52327. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52328. s *= o,
  52329. l *= o,
  52330. this.init(t, i, s, l)
  52331. }
  52332. ,
  52333. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52334. this.init(t, i, r * (i - e), r * (n - t))
  52335. }
  52336. ,
  52337. xi.prototype.calc = function(e) {
  52338. var t = e * e
  52339. , i = t * e;
  52340. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52341. }
  52342. ,
  52343. Ci.Curve.create(function(e) {
  52344. this.points = e || [],
  52345. this.closed = !1
  52346. }, function(e) {
  52347. var t, i, n, r, o, a, s, l, c = this.points;
  52348. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52349. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52350. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52351. n = 1),
  52352. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52353. qt),
  52354. a = c[i % r],
  52355. s = c[(i + 1) % r],
  52356. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52357. qt),
  52358. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52359. var h = "chordal" === this.type ? .5 : .25
  52360. , u = Math.pow(o.distanceToSquared(a), h)
  52361. , d = Math.pow(a.distanceToSquared(s), h)
  52362. , p = Math.pow(s.distanceToSquared(l), h);
  52363. d < 1e-4 && (d = 1),
  52364. u < 1e-4 && (u = d),
  52365. p < 1e-4 && (p = d),
  52366. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52367. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52368. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52369. } else if ("catmullrom" === this.type) {
  52370. var f = void 0 !== this.tension ? this.tension : .5;
  52371. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52372. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52373. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52374. }
  52375. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52376. })),
  52377. Ci.ClosedSplineCurve3 = function(e) {
  52378. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52379. Ci.CatmullRomCurve3.call(this, e),
  52380. this.type = "catmullrom",
  52381. this.closed = !0
  52382. }
  52383. ,
  52384. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52385. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52386. Ci.Geometry.call(this),
  52387. this.type = "BoxGeometry",
  52388. this.parameters = {
  52389. width: e,
  52390. height: t,
  52391. depth: i,
  52392. widthSegments: n,
  52393. heightSegments: r,
  52394. depthSegments: o
  52395. },
  52396. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52397. this.mergeVertices()
  52398. }
  52399. ,
  52400. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52401. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52402. Ci.CubeGeometry = Ci.BoxGeometry,
  52403. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52404. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52405. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  52406. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52407. var b = _ * u - p;
  52408. C[e] = b * n,
  52409. C[t] = E * r,
  52410. C[i] = g,
  52411. P[D] = C.x,
  52412. P[D + 1] = C.y,
  52413. P[D + 2] = C.z,
  52414. C[e] = 0,
  52415. C[t] = 0,
  52416. C[i] = 0 < s ? 1 : -1,
  52417. O[D] = C.x,
  52418. O[D + 1] = C.y,
  52419. O[D + 2] = C.z,
  52420. L[N] = _ / l,
  52421. L[N + 1] = 1 - I / c,
  52422. D += 3,
  52423. N += 2,
  52424. y += 1
  52425. }
  52426. for (I = 0; I < c; I++)
  52427. for (_ = 0; _ < l; _++) {
  52428. var w = B + _ + m * I
  52429. , T = B + _ + m * (I + 1)
  52430. , x = B + (_ + 1) + m * (I + 1)
  52431. , S = B + (_ + 1) + m * I;
  52432. R[F] = w,
  52433. R[F + 1] = T,
  52434. R[F + 2] = S,
  52435. R[F + 3] = T,
  52436. R[F + 4] = x,
  52437. R[F + 5] = S,
  52438. F += 6,
  52439. A += 6
  52440. }
  52441. M.addGroup(V, A, h),
  52442. V += A,
  52443. B += y
  52444. }
  52445. Ci.BufferGeometry.call(this),
  52446. this.type = "BoxBufferGeometry",
  52447. this.parameters = {
  52448. width: e,
  52449. height: t,
  52450. depth: i,
  52451. widthSegments: n,
  52452. heightSegments: r,
  52453. depthSegments: o
  52454. };
  52455. var M = this;
  52456. n = Math.floor(n) || 1,
  52457. r = Math.floor(r) || 1,
  52458. o = Math.floor(o) || 1;
  52459. var s, l, c, h, u = (h = 0,
  52460. h += (s = n) * (l = r) * 2,
  52461. h += s * (c = o) * 2,
  52462. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  52463. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52464. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52465. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52466. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52467. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52468. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52469. this.setIndex(new Ci.BufferAttribute(R,1)),
  52470. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52471. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52472. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52473. }
  52474. ,
  52475. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52476. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52477. Ci.CircleGeometry = function(e, t, i, n) {
  52478. Ci.Geometry.call(this),
  52479. this.type = "CircleGeometry",
  52480. this.parameters = {
  52481. radius: e,
  52482. segments: t,
  52483. thetaStart: i,
  52484. thetaLength: n
  52485. },
  52486. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52487. }
  52488. ,
  52489. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52490. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52491. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52492. Ci.BufferGeometry.call(this),
  52493. this.type = "CircleBufferGeometry",
  52494. this.parameters = {
  52495. radius: e,
  52496. segments: t,
  52497. thetaStart: i,
  52498. thetaLength: n
  52499. },
  52500. e = e || 50,
  52501. t = void 0 !== t ? Math.max(3, t) : 8,
  52502. i = void 0 !== i ? i : 0,
  52503. n = void 0 !== n ? n : 2 * Math.PI;
  52504. var r = t + 2
  52505. , o = new Float32Array(3 * r)
  52506. , a = new Float32Array(3 * r)
  52507. , s = new Float32Array(2 * r);
  52508. a[2] = 1,
  52509. s[0] = .5,
  52510. s[1] = .5;
  52511. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52512. c += 3,
  52513. h += 2) {
  52514. var u = i + l / t * n;
  52515. o[c] = e * Math.cos(u),
  52516. o[c + 1] = e * Math.sin(u),
  52517. a[c + 2] = 1,
  52518. s[h] = (o[c] / e + 1) / 2,
  52519. s[h + 1] = (o[c + 1] / e + 1) / 2
  52520. }
  52521. var d = [];
  52522. for (c = 1; c <= t; c++)
  52523. d.push(c, c + 1, 0);
  52524. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52525. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52526. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52527. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52528. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52529. }
  52530. ,
  52531. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52532. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52533. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52534. function t(e) {
  52535. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52536. for (i = b,
  52537. t = 1; t <= m; t++)
  52538. I.setXYZ(b, 0, x * s, 0),
  52539. E.setXYZ(b, 0, s, 0),
  52540. !0 === e ? (r.x = t / m,
  52541. r.y = 0) : (r.x = (t - 1) / m,
  52542. r.y = 1),
  52543. _.setXY(b, r.x, r.y),
  52544. b++;
  52545. for (n = b,
  52546. t = 0; t <= m; t++) {
  52547. var l = t / m;
  52548. o.x = a * Math.sin(l * A + y),
  52549. o.y = x * s,
  52550. o.z = a * Math.cos(l * A + y),
  52551. I.setXYZ(b, o.x, o.y, o.z),
  52552. E.setXYZ(b, 0, s, 0),
  52553. _.setXY(b, l, !0 === e ? 1 : 0),
  52554. b++
  52555. }
  52556. for (t = 0; t < m; t++) {
  52557. var c = i + t
  52558. , h = n + t;
  52559. !0 === e ? (C.setX(w, h),
  52560. w++,
  52561. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52562. w++,
  52563. C.setX(w, h)),
  52564. w++,
  52565. C.setX(w, c),
  52566. w++
  52567. }
  52568. }
  52569. Ci.BufferGeometry.call(this),
  52570. this.type = "CylinderBufferGeometry",
  52571. this.parameters = {
  52572. radiusTop: p,
  52573. radiusBottom: f,
  52574. height: g,
  52575. radialSegments: m,
  52576. heightSegments: v,
  52577. openEnded: e,
  52578. thetaStart: y,
  52579. thetaLength: A
  52580. },
  52581. p = void 0 !== p ? p : 20,
  52582. f = void 0 !== f ? f : 20,
  52583. g = void 0 !== g ? g : 100,
  52584. m = Math.floor(m) || 8,
  52585. v = Math.floor(v) || 1,
  52586. e = void 0 !== e && e,
  52587. y = void 0 !== y ? y : 0,
  52588. A = void 0 !== A ? A : 2 * Math.PI;
  52589. var i, n, r = (n = (m + 1) * (v + 1),
  52590. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52591. n), o = (i = m * v * 2 * 3,
  52592. !1 === e && (i += 2 * m * 3),
  52593. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  52594. (function() {
  52595. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52596. for (t = 0; t <= v; t++) {
  52597. var o = []
  52598. , a = t / v
  52599. , s = a * (f - p) + p;
  52600. for (e = 0; e <= m; e++) {
  52601. var l = e / m;
  52602. n.x = s * Math.sin(l * A + y),
  52603. n.y = -a * g + x,
  52604. n.z = s * Math.cos(l * A + y),
  52605. I.setXYZ(b, n.x, n.y, n.z),
  52606. i.copy(n),
  52607. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52608. i.z = Math.cos(l * A + y)),
  52609. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52610. E.setXYZ(b, i.x, i.y, i.z),
  52611. _.setXY(b, l, 1 - a),
  52612. o.push(b),
  52613. b++
  52614. }
  52615. T.push(o)
  52616. }
  52617. for (e = 0; e < m; e++)
  52618. for (t = 0; t < v; t++) {
  52619. var c = T[t][e]
  52620. , h = T[t + 1][e]
  52621. , u = T[t + 1][e + 1]
  52622. , d = T[t][e + 1];
  52623. C.setX(w, c),
  52624. w++,
  52625. C.setX(w, h),
  52626. w++,
  52627. C.setX(w, d),
  52628. w++,
  52629. C.setX(w, h),
  52630. w++,
  52631. C.setX(w, u),
  52632. w++,
  52633. C.setX(w, d),
  52634. w++
  52635. }
  52636. }
  52637. )(),
  52638. !1 === e && (0 < p && t(!0),
  52639. 0 < f && t(!1)),
  52640. this.setIndex(C),
  52641. this.addAttribute("position", I),
  52642. this.addAttribute("normal", E),
  52643. this.addAttribute("uv", _)
  52644. }
  52645. ,
  52646. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52647. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52648. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52649. Ci.Geometry.call(this),
  52650. this.type = "CylinderGeometry",
  52651. this.parameters = {
  52652. radiusTop: e,
  52653. radiusBottom: t,
  52654. height: i,
  52655. radialSegments: n,
  52656. heightSegments: r,
  52657. openEnded: o,
  52658. thetaStart: a,
  52659. thetaLength: s
  52660. },
  52661. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52662. this.mergeVertices()
  52663. }
  52664. ,
  52665. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52666. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52667. Ci.EdgesGeometry = function(e, t) {
  52668. function i(e, t) {
  52669. return e - t
  52670. }
  52671. Ci.BufferGeometry.call(this),
  52672. t = void 0 !== t ? t : 1;
  52673. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  52674. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  52675. n.mergeVertices(),
  52676. n.computeFaceNormals();
  52677. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  52678. for (var d = c[h], p = 0; p < 3; p++) {
  52679. o[0] = d[s[p]],
  52680. o[1] = d[s[(p + 1) % 3]],
  52681. o.sort(i),
  52682. void 0 === a[g = o.toString()] ? a[g] = {
  52683. vert1: o[0],
  52684. vert2: o[1],
  52685. face1: h,
  52686. face2: void 0
  52687. } : a[g].face2 = h
  52688. }
  52689. var f = [];
  52690. for (var g in a) {
  52691. var m = a[g];
  52692. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  52693. var v = l[m.vert1];
  52694. f.push(v.x),
  52695. f.push(v.y),
  52696. f.push(v.z),
  52697. v = l[m.vert2],
  52698. f.push(v.x),
  52699. f.push(v.y),
  52700. f.push(v.z)
  52701. }
  52702. }
  52703. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  52704. }
  52705. ,
  52706. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52707. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  52708. Ci.ExtrudeGeometry = function(e, t) {
  52709. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  52710. this.type = "ExtrudeGeometry",
  52711. e = Array.isArray(e) ? e : [e],
  52712. this.addShapeList(e, t),
  52713. void this.computeFaceNormals())
  52714. }
  52715. ;
  52716. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52717. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  52718. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  52719. for (var i = e.length, n = 0; n < i; n++) {
  52720. var r = e[n];
  52721. this.addShape(r, t)
  52722. }
  52723. }
  52724. ,
  52725. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  52726. function i(e, t, i) {
  52727. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  52728. t.clone().multiplyScalar(i).add(e)
  52729. }
  52730. function n(e, t, i) {
  52731. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  52732. if (Math.abs(u) > Number.EPSILON) {
  52733. var d = Math.sqrt(h)
  52734. , p = Math.sqrt(l * l + c * c)
  52735. , f = t.x - s / d
  52736. , g = t.y + a / d
  52737. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  52738. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  52739. if (v <= 2)
  52740. return new Ci.Vector2(n,r);
  52741. o = Math.sqrt(v / 2)
  52742. } else {
  52743. var y = !1;
  52744. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  52745. o = y ? (n = -s,
  52746. r = a,
  52747. Math.sqrt(h)) : (n = a,
  52748. r = s,
  52749. Math.sqrt(h / 2))
  52750. }
  52751. return new Ci.Vector2(n / o,r / o)
  52752. }
  52753. function r(e, t) {
  52754. var i, n;
  52755. for (G = e.length; 0 <= --G; ) {
  52756. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  52757. var r = 0
  52758. , o = A + 2 * m;
  52759. for (r = 0; r < o; r++) {
  52760. var a = U * r
  52761. , s = U * (r + 1);
  52762. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  52763. }
  52764. }
  52765. }
  52766. function o(e, t, i) {
  52767. T.vertices.push(new Ci.Vector3(e,t,i))
  52768. }
  52769. function a(e, t, i) {
  52770. e += x,
  52771. t += x,
  52772. i += x,
  52773. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  52774. var n = E.generateTopUV(T, e, t, i);
  52775. T.faceVertexUvs[0].push(n)
  52776. }
  52777. function l(e, t, i, n) {
  52778. e += x,
  52779. t += x,
  52780. i += x,
  52781. n += x,
  52782. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  52783. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  52784. var r = E.generateSideWallUV(T, e, t, i, n);
  52785. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  52786. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  52787. }
  52788. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  52789. C && (s = C.getSpacedPoints(A),
  52790. v = !(I = !0),
  52791. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  52792. h = new Ci.Vector3,
  52793. u = new Ci.Vector3,
  52794. d = new Ci.Vector3),
  52795. v || (g = f = m = 0);
  52796. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  52797. if (P) {
  52798. for (M = M.reverse(),
  52799. b = 0,
  52800. w = R.length; b < w; b++)
  52801. _ = R[b],
  52802. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  52803. P = !1
  52804. }
  52805. var O = Ci.ShapeUtils.triangulateShape(M, R)
  52806. , L = M;
  52807. for (b = 0,
  52808. w = R.length; b < w; b++)
  52809. _ = R[b],
  52810. M = M.concat(_);
  52811. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  52812. j++,
  52813. Y++)
  52814. j === W && (j = 0),
  52815. Y === W && (Y = 0),
  52816. z[G] = n(L[G], L[j], L[Y]);
  52817. var q, X, Z = [], K = z.concat();
  52818. for (b = 0,
  52819. w = R.length; b < w; b++) {
  52820. for (_ = R[b],
  52821. q = [],
  52822. G = 0,
  52823. j = (W = _.length) - 1,
  52824. Y = G + 1; G < W; G++,
  52825. j++,
  52826. Y++)
  52827. j === W && (j = 0),
  52828. Y === W && (Y = 0),
  52829. q[G] = n(_[G], _[j], _[Y]);
  52830. Z.push(q),
  52831. K = K.concat(q)
  52832. }
  52833. for (D = 0; D < m; D++) {
  52834. for (B = f * (1 - (F = D / m)),
  52835. N = g * Math.sin(F * Math.PI / 2),
  52836. G = 0,
  52837. W = L.length; G < W; G++)
  52838. o((V = i(L[G], z[G], N)).x, V.y, -B);
  52839. for (b = 0,
  52840. w = R.length; b < w; b++)
  52841. for (_ = R[b],
  52842. q = Z[b],
  52843. G = 0,
  52844. W = _.length; G < W; G++)
  52845. o((V = i(_[G], q[G], N)).x, V.y, -B)
  52846. }
  52847. for (N = g,
  52848. G = 0; G < U; G++)
  52849. V = v ? i(M[G], K[G], N) : M[G],
  52850. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  52851. h.copy(c.binormals[0]).multiplyScalar(V.y),
  52852. d.copy(s[0]).add(u).add(h),
  52853. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  52854. for (X = 1; X <= A; X++)
  52855. for (G = 0; G < U; G++)
  52856. V = v ? i(M[G], K[G], N) : M[G],
  52857. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  52858. h.copy(c.binormals[X]).multiplyScalar(V.y),
  52859. d.copy(s[X]).add(u).add(h),
  52860. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  52861. for (D = m - 1; 0 <= D; D--) {
  52862. for (B = f * (1 - (F = D / m)),
  52863. N = g * Math.sin(F * Math.PI / 2),
  52864. G = 0,
  52865. W = L.length; G < W; G++)
  52866. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  52867. for (b = 0,
  52868. w = R.length; b < w; b++)
  52869. for (_ = R[b],
  52870. q = Z[b],
  52871. G = 0,
  52872. W = _.length; G < W; G++)
  52873. V = i(_[G], q[G], N),
  52874. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  52875. }
  52876. (function() {
  52877. if (v) {
  52878. var e = 0
  52879. , t = U * e;
  52880. for (G = 0; G < H; G++)
  52881. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  52882. for (t = U * (e = A + 2 * m),
  52883. G = 0; G < H; G++)
  52884. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  52885. } else {
  52886. for (G = 0; G < H; G++)
  52887. a((k = O[G])[2], k[1], k[0]);
  52888. for (G = 0; G < H; G++)
  52889. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  52890. }
  52891. }
  52892. )(),
  52893. function() {
  52894. var e = 0;
  52895. for (r(L, e),
  52896. e += L.length,
  52897. b = 0,
  52898. w = R.length; b < w; b++)
  52899. r(_ = R[b], e),
  52900. e += _.length
  52901. }()
  52902. }
  52903. ,
  52904. Ci.ExtrudeGeometry.WorldUVGenerator = {
  52905. generateTopUV: function(e, t, i, n) {
  52906. var r = e.vertices
  52907. , o = r[t]
  52908. , a = r[i]
  52909. , s = r[n];
  52910. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  52911. },
  52912. generateSideWallUV: function(e, t, i, n, r) {
  52913. var o = e.vertices
  52914. , a = o[t]
  52915. , s = o[i]
  52916. , l = o[n]
  52917. , c = o[r];
  52918. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  52919. }
  52920. },
  52921. Ci.ShapeGeometry = function(e, t) {
  52922. Ci.Geometry.call(this),
  52923. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  52924. this.addShapeList(e, t),
  52925. this.computeFaceNormals()
  52926. }
  52927. ,
  52928. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52929. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  52930. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  52931. for (var i = 0, n = e.length; i < n; i++)
  52932. this.addShape(e[i], t);
  52933. return this
  52934. }
  52935. ,
  52936. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  52937. void 0 === t && (t = {});
  52938. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  52939. if (d) {
  52940. for (h = h.reverse(),
  52941. i = 0,
  52942. n = u.length; i < n; i++)
  52943. r = u[i],
  52944. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  52945. d = !1
  52946. }
  52947. var p = Ci.ShapeUtils.triangulateShape(h, u);
  52948. for (i = 0,
  52949. n = u.length; i < n; i++)
  52950. r = u[i],
  52951. h = h.concat(r);
  52952. var f, g, m = h.length, v = p.length;
  52953. for (i = 0; i < m; i++)
  52954. f = h[i],
  52955. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  52956. for (i = 0; i < v; i++) {
  52957. var y = (g = p[i])[0] + l
  52958. , A = g[1] + l
  52959. , C = g[2] + l;
  52960. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  52961. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  52962. }
  52963. }
  52964. ,
  52965. Ci.LatheBufferGeometry = function(e, t, i, n) {
  52966. Ci.BufferGeometry.call(this),
  52967. this.type = "LatheBufferGeometry",
  52968. this.parameters = {
  52969. points: e,
  52970. segments: t,
  52971. phiStart: i,
  52972. phiLength: n
  52973. },
  52974. t = Math.floor(t) || 12,
  52975. i = i || 0,
  52976. n = n || 2 * Math.PI,
  52977. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  52978. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  52979. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  52980. for (o = 0; o <= t; o++) {
  52981. var v = i + o * f * n
  52982. , y = Math.sin(v)
  52983. , A = Math.cos(v);
  52984. for (a = 0; a <= e.length - 1; a++)
  52985. g.x = e[a].x * y,
  52986. g.y = e[a].y,
  52987. g.z = e[a].x * A,
  52988. h.setXYZ(d, g.x, g.y, g.z),
  52989. m.x = o / t,
  52990. m.y = a / (e.length - 1),
  52991. u.setXY(d, m.x, m.y),
  52992. d++
  52993. }
  52994. for (o = 0; o < t; o++)
  52995. for (a = 0; a < e.length - 1; a++) {
  52996. var C = r = a + o * e.length
  52997. , I = r + e.length
  52998. , E = r + e.length + 1
  52999. , _ = r + 1;
  53000. c.setX(p, C),
  53001. p++,
  53002. c.setX(p, I),
  53003. p++,
  53004. c.setX(p, _),
  53005. p++,
  53006. c.setX(p, I),
  53007. p++,
  53008. c.setX(p, E),
  53009. p++,
  53010. c.setX(p, _),
  53011. p++
  53012. }
  53013. if (this.setIndex(c),
  53014. this.addAttribute("position", h),
  53015. this.addAttribute("uv", u),
  53016. this.computeVertexNormals(),
  53017. n === 2 * Math.PI) {
  53018. var b = this.attributes.normal.array
  53019. , w = new Ci.Vector3
  53020. , T = new Ci.Vector3
  53021. , x = new Ci.Vector3;
  53022. for (r = t * e.length * 3,
  53023. a = o = 0; o < e.length; o++,
  53024. a += 3)
  53025. w.x = b[a + 0],
  53026. w.y = b[a + 1],
  53027. w.z = b[a + 2],
  53028. T.x = b[r + a + 0],
  53029. T.y = b[r + a + 1],
  53030. T.z = b[r + a + 2],
  53031. x.addVectors(w, T).normalize(),
  53032. b[a + 0] = b[r + a + 0] = x.x,
  53033. b[a + 1] = b[r + a + 1] = x.y,
  53034. b[a + 2] = b[r + a + 2] = x.z
  53035. }
  53036. }
  53037. ,
  53038. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53039. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53040. Ci.LatheGeometry = function(e, t, i, n) {
  53041. Ci.Geometry.call(this),
  53042. this.type = "LatheGeometry",
  53043. this.parameters = {
  53044. points: e,
  53045. segments: t,
  53046. phiStart: i,
  53047. phiLength: n
  53048. },
  53049. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53050. this.mergeVertices()
  53051. }
  53052. ,
  53053. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53054. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53055. Ci.PlaneGeometry = function(e, t, i, n) {
  53056. Ci.Geometry.call(this),
  53057. this.type = "PlaneGeometry",
  53058. this.parameters = {
  53059. width: e,
  53060. height: t,
  53061. widthSegments: i,
  53062. heightSegments: n
  53063. },
  53064. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53065. }
  53066. ,
  53067. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53068. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53069. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53070. Ci.BufferGeometry.call(this),
  53071. this.type = "PlaneBufferGeometry",
  53072. this.parameters = {
  53073. width: e,
  53074. height: t,
  53075. widthSegments: i,
  53076. heightSegments: n
  53077. };
  53078. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53079. for (var y = v * u - o, A = 0; A < l; A++) {
  53080. var C = A * h - r;
  53081. d[g] = C,
  53082. d[g + 1] = -y,
  53083. p[g + 2] = 1,
  53084. f[m] = A / a,
  53085. f[m + 1] = 1 - v / s,
  53086. g += 3,
  53087. m += 2
  53088. }
  53089. g = 0;
  53090. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53091. for (v = 0; v < s; v++)
  53092. for (A = 0; A < a; A++) {
  53093. var E = A + l * v
  53094. , _ = A + l * (v + 1)
  53095. , b = A + 1 + l * (v + 1)
  53096. , w = A + 1 + l * v;
  53097. I[g] = E,
  53098. I[g + 1] = _,
  53099. I[g + 2] = w,
  53100. I[g + 3] = _,
  53101. I[g + 4] = b,
  53102. I[g + 5] = w,
  53103. g += 6
  53104. }
  53105. this.setIndex(new Ci.BufferAttribute(I,1)),
  53106. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53107. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53108. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53109. }
  53110. ,
  53111. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53112. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53113. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53114. Ci.BufferGeometry.call(this),
  53115. this.type = "RingBufferGeometry",
  53116. this.parameters = {
  53117. innerRadius: e,
  53118. outerRadius: t,
  53119. thetaSegments: i,
  53120. phiSegments: n,
  53121. thetaStart: r,
  53122. thetaLength: o
  53123. },
  53124. e = e || 20,
  53125. t = t || 50,
  53126. r = void 0 !== r ? r : 0,
  53127. o = void 0 !== o ? o : 2 * Math.PI;
  53128. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  53129. for (s = 0; s <= n; s++) {
  53130. for (l = 0; l <= i; l++)
  53131. a = r + l / i * o,
  53132. A.x = v * Math.cos(a),
  53133. A.y = v * Math.sin(a),
  53134. d.setXYZ(g, A.x, A.y, A.z),
  53135. p.setXYZ(g, 0, 0, 1),
  53136. C.x = (A.x / t + 1) / 2,
  53137. C.y = (A.y / t + 1) / 2,
  53138. f.setXY(g, C.x, C.y),
  53139. g++;
  53140. v += y
  53141. }
  53142. for (s = 0; s < n; s++) {
  53143. var I = s * (i + 1);
  53144. for (l = 0; l < i; l++) {
  53145. var E = a = l + I
  53146. , _ = a + i + 1
  53147. , b = a + i + 2
  53148. , w = a + 1;
  53149. u.setX(m, E),
  53150. m++,
  53151. u.setX(m, _),
  53152. m++,
  53153. u.setX(m, b),
  53154. m++,
  53155. u.setX(m, E),
  53156. m++,
  53157. u.setX(m, b),
  53158. m++,
  53159. u.setX(m, w),
  53160. m++
  53161. }
  53162. }
  53163. this.setIndex(u),
  53164. this.addAttribute("position", d),
  53165. this.addAttribute("normal", p),
  53166. this.addAttribute("uv", f)
  53167. }
  53168. ,
  53169. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53170. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53171. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53172. Ci.Geometry.call(this),
  53173. this.type = "RingGeometry",
  53174. this.parameters = {
  53175. innerRadius: e,
  53176. outerRadius: t,
  53177. thetaSegments: i,
  53178. phiSegments: n,
  53179. thetaStart: r,
  53180. thetaLength: o
  53181. },
  53182. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53183. }
  53184. ,
  53185. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53186. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53187. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53188. Ci.Geometry.call(this),
  53189. this.type = "SphereGeometry",
  53190. this.parameters = {
  53191. radius: e,
  53192. widthSegments: t,
  53193. heightSegments: i,
  53194. phiStart: n,
  53195. phiLength: r,
  53196. thetaStart: o,
  53197. thetaLength: a
  53198. },
  53199. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53200. }
  53201. ,
  53202. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53203. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53204. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53205. Ci.BufferGeometry.call(this),
  53206. this.type = "SphereBufferGeometry",
  53207. this.parameters = {
  53208. radius: e,
  53209. widthSegments: t,
  53210. heightSegments: i,
  53211. phiStart: n,
  53212. phiLength: r,
  53213. thetaStart: o,
  53214. thetaLength: a
  53215. },
  53216. e = e || 50,
  53217. t = Math.max(3, Math.floor(t) || 8),
  53218. i = Math.max(2, Math.floor(i) || 6),
  53219. n = void 0 !== n ? n : 0,
  53220. r = void 0 !== r ? r : 2 * Math.PI;
  53221. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  53222. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53223. var A = y / t
  53224. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53225. , I = e * Math.cos(o + v * a)
  53226. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53227. f.set(C, I, E).normalize(),
  53228. c.setXYZ(d, C, I, E),
  53229. h.setXYZ(d, f.x, f.y, f.z),
  53230. u.setXY(d, A, 1 - v),
  53231. m.push(d),
  53232. d++
  53233. }
  53234. p.push(m)
  53235. }
  53236. var _ = [];
  53237. for (g = 0; g < i; g++)
  53238. for (y = 0; y < t; y++) {
  53239. var b = p[g][y + 1]
  53240. , w = p[g][y]
  53241. , T = p[g + 1][y]
  53242. , x = p[g + 1][y + 1];
  53243. (0 !== g || 0 < o) && _.push(b, w, x),
  53244. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53245. }
  53246. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53247. this.addAttribute("position", c),
  53248. this.addAttribute("normal", h),
  53249. this.addAttribute("uv", u),
  53250. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53251. }
  53252. ,
  53253. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53254. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53255. Ci.TextGeometry = function(e, t) {
  53256. var i = (t = t || {}).font;
  53257. if (i instanceof Ci.Font == 0)
  53258. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53259. new Ci.Geometry;
  53260. var n = i.generateShapes(e, t.size, t.curveSegments);
  53261. t.amount = void 0 !== t.height ? t.height : 50,
  53262. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53263. void 0 === t.bevelSize && (t.bevelSize = 8),
  53264. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53265. Ci.ExtrudeGeometry.call(this, n, t),
  53266. this.type = "TextGeometry"
  53267. }
  53268. ,
  53269. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53270. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53271. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53272. Ci.BufferGeometry.call(this),
  53273. this.type = "TorusBufferGeometry",
  53274. this.parameters = {
  53275. radius: e,
  53276. tube: t,
  53277. radialSegments: i,
  53278. tubularSegments: n,
  53279. arc: r
  53280. },
  53281. e = e || 100,
  53282. t = t || 40,
  53283. i = Math.floor(i) || 8,
  53284. n = Math.floor(n) || 6,
  53285. r = r || 2 * Math.PI;
  53286. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  53287. for (o = 0; o <= i; o++)
  53288. for (a = 0; a <= n; a++) {
  53289. var A = a / n * r
  53290. , C = o / i * Math.PI * 2;
  53291. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53292. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53293. v.z = t * Math.sin(C),
  53294. h[p] = v.x,
  53295. h[p + 1] = v.y,
  53296. h[p + 2] = v.z,
  53297. m.x = e * Math.cos(A),
  53298. m.y = e * Math.sin(A),
  53299. y.subVectors(v, m).normalize(),
  53300. u[p] = y.x,
  53301. u[p + 1] = y.y,
  53302. u[p + 2] = y.z,
  53303. d[f] = a / n,
  53304. d[f + 1] = o / i,
  53305. p += 3,
  53306. f += 2
  53307. }
  53308. for (o = 1; o <= i; o++)
  53309. for (a = 1; a <= n; a++) {
  53310. var I = (n + 1) * o + a - 1
  53311. , E = (n + 1) * (o - 1) + a - 1
  53312. , _ = (n + 1) * (o - 1) + a
  53313. , b = (n + 1) * o + a;
  53314. c[g] = I,
  53315. c[g + 1] = E,
  53316. c[g + 2] = b,
  53317. c[g + 3] = E,
  53318. c[g + 4] = _,
  53319. c[g + 5] = b,
  53320. g += 6
  53321. }
  53322. this.setIndex(new Ci.BufferAttribute(c,1)),
  53323. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53324. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53325. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53326. }
  53327. ,
  53328. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53329. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53330. Ci.TorusGeometry = function(e, t, i, n, r) {
  53331. Ci.Geometry.call(this),
  53332. this.type = "TorusGeometry",
  53333. this.parameters = {
  53334. radius: e,
  53335. tube: t,
  53336. radialSegments: i,
  53337. tubularSegments: n,
  53338. arc: r
  53339. },
  53340. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53341. }
  53342. ,
  53343. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53344. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53345. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53346. function a(e, t, i, n, r) {
  53347. var o = Math.cos(e)
  53348. , a = Math.sin(e)
  53349. , s = i / t * e
  53350. , l = Math.cos(s);
  53351. r.x = n * (2 + l) * .5 * o,
  53352. r.y = n * (2 + l) * a * .5,
  53353. r.z = n * Math.sin(s) * .5
  53354. }
  53355. Ci.BufferGeometry.call(this),
  53356. this.type = "TorusKnotBufferGeometry",
  53357. this.parameters = {
  53358. radius: e,
  53359. tube: t,
  53360. tubularSegments: i,
  53361. radialSegments: n,
  53362. p: r,
  53363. q: o
  53364. },
  53365. e = e || 100,
  53366. t = t || 40,
  53367. i = Math.floor(i) || 64,
  53368. r = r || 2,
  53369. o = o || 3;
  53370. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  53371. for (s = 0; s <= i; ++s) {
  53372. var w = s / i * r * Math.PI * 2;
  53373. for (a(w, r, o, e, C),
  53374. a(.01 + w, r, o, e, I),
  53375. _.subVectors(I, C),
  53376. b.addVectors(I, C),
  53377. E.crossVectors(_, b),
  53378. b.crossVectors(E, _),
  53379. E.normalize(),
  53380. b.normalize(),
  53381. l = 0; l <= n; ++l) {
  53382. var T = l / n * Math.PI * 2
  53383. , x = -t * Math.cos(T)
  53384. , S = t * Math.sin(T);
  53385. v.x = C.x + (x * b.x + S * E.x),
  53386. v.y = C.y + (x * b.y + S * E.y),
  53387. v.z = C.z + (x * b.z + S * E.z),
  53388. d.setXYZ(g, v.x, v.y, v.z),
  53389. y.subVectors(v, C).normalize(),
  53390. p.setXYZ(g, y.x, y.y, y.z),
  53391. A.x = s / i,
  53392. A.y = l / n,
  53393. f.setXY(g, A.x, A.y),
  53394. g++
  53395. }
  53396. }
  53397. for (l = 1; l <= i; l++)
  53398. for (s = 1; s <= n; s++) {
  53399. var M = (n + 1) * (l - 1) + (s - 1)
  53400. , R = (n + 1) * l + (s - 1)
  53401. , P = (n + 1) * l + s
  53402. , O = (n + 1) * (l - 1) + s;
  53403. u.setX(m, M),
  53404. m++,
  53405. u.setX(m, R),
  53406. m++,
  53407. u.setX(m, O),
  53408. m++,
  53409. u.setX(m, R),
  53410. m++,
  53411. u.setX(m, P),
  53412. m++,
  53413. u.setX(m, O),
  53414. m++
  53415. }
  53416. this.setIndex(u),
  53417. this.addAttribute("position", d),
  53418. this.addAttribute("normal", p),
  53419. this.addAttribute("uv", f)
  53420. }
  53421. ,
  53422. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53423. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53424. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53425. Ci.Geometry.call(this),
  53426. this.type = "TorusKnotGeometry",
  53427. this.parameters = {
  53428. radius: e,
  53429. tube: t,
  53430. tubularSegments: i,
  53431. radialSegments: n,
  53432. p: r,
  53433. q: o
  53434. },
  53435. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53436. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53437. this.mergeVertices()
  53438. }
  53439. ,
  53440. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53441. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53442. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53443. Ci.Geometry.call(this),
  53444. this.type = "TubeGeometry",
  53445. this.parameters = {
  53446. path: e,
  53447. segments: t,
  53448. radius: i,
  53449. radialSegments: n,
  53450. closed: r,
  53451. taper: o
  53452. },
  53453. t = t || 64,
  53454. i = i || 1,
  53455. n = n || 8,
  53456. r = r || !1,
  53457. o = o || Ci.TubeGeometry.NoTaper;
  53458. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  53459. for (this.tangents = D,
  53460. this.normals = N,
  53461. this.binormals = F,
  53462. f = 0; f < P; f++)
  53463. for (M[f] = [],
  53464. l = f / (P - 1),
  53465. p = e.getPointAt(l),
  53466. D[f],
  53467. a = N[f],
  53468. s = F[f],
  53469. h = i * o(l),
  53470. g = 0; g < n; g++)
  53471. c = g / n * 2 * Math.PI,
  53472. u = -h * Math.cos(c),
  53473. d = h * Math.sin(c),
  53474. O.copy(p),
  53475. O.x += u * a.x + d * s.x,
  53476. O.y += u * a.y + d * s.y,
  53477. O.z += u * a.z + d * s.z,
  53478. M[f][g] = (T = O.x,
  53479. x = O.y,
  53480. S = O.z,
  53481. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53482. for (f = 0; f < t; f++)
  53483. for (g = 0; g < n; g++)
  53484. m = r ? (f + 1) % t : f + 1,
  53485. v = (g + 1) % n,
  53486. y = M[f][g],
  53487. A = M[m][g],
  53488. C = M[m][v],
  53489. I = M[f][v],
  53490. E = new Ci.Vector2(f / t,g / n),
  53491. _ = new Ci.Vector2((f + 1) / t,g / n),
  53492. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53493. w = new Ci.Vector2(f / t,(g + 1) / n),
  53494. this.faces.push(new Ci.Face3(y,A,I)),
  53495. this.faceVertexUvs[0].push([E, _, w]),
  53496. this.faces.push(new Ci.Face3(A,C,I)),
  53497. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53498. this.computeFaceNormals(),
  53499. this.computeVertexNormals()
  53500. }
  53501. ,
  53502. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53503. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53504. Ci.TubeGeometry.NoTaper = function(e) {
  53505. return 1
  53506. }
  53507. ,
  53508. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53509. return Math.sin(Math.PI * e)
  53510. }
  53511. ,
  53512. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53513. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  53514. for (this.tangents = u,
  53515. this.normals = d,
  53516. this.binormals = p,
  53517. l = 0; l < m; l++)
  53518. c = l / (m - 1),
  53519. u[l] = e.getTangentAt(c),
  53520. u[l].normalize();
  53521. for (d[0] = new Ci.Vector3,
  53522. p[0] = new Ci.Vector3,
  53523. r = Number.MAX_VALUE,
  53524. o = Math.abs(u[0].x),
  53525. a = Math.abs(u[0].y),
  53526. s = Math.abs(u[0].z),
  53527. o <= r && (r = o,
  53528. h.set(1, 0, 0)),
  53529. a <= r && (r = a,
  53530. h.set(0, 1, 0)),
  53531. s <= r && h.set(0, 0, 1),
  53532. f.crossVectors(u[0], h).normalize(),
  53533. d[0].crossVectors(u[0], f),
  53534. p[0].crossVectors(u[0], d[0]),
  53535. l = 1; l < m; l++)
  53536. d[l] = d[l - 1].clone(),
  53537. p[l] = p[l - 1].clone(),
  53538. f.crossVectors(u[l - 1], u[l]),
  53539. f.length() > Number.EPSILON && (f.normalize(),
  53540. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53541. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53542. p[l].crossVectors(u[l], d[l]);
  53543. if (i)
  53544. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53545. n /= m - 1,
  53546. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53547. l = 1; l < m; l++)
  53548. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53549. p[l].crossVectors(u[l], d[l])
  53550. }
  53551. ,
  53552. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53553. function f(e) {
  53554. var t = e.normalize().clone();
  53555. t.index = m.vertices.push(t) - 1;
  53556. var i = a(e) / 2 / Math.PI + .5
  53557. , n = function(e) {
  53558. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53559. }(e) / Math.PI + .5;
  53560. return t.uv = new Ci.Vector2(i,1 - n),
  53561. t
  53562. }
  53563. function g(e, t, i, n) {
  53564. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53565. m.faces.push(r),
  53566. y.copy(e).add(t).add(i).divideScalar(3);
  53567. var o = a(y);
  53568. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53569. }
  53570. function r(e, t) {
  53571. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  53572. a[l] = [];
  53573. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  53574. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53575. }
  53576. for (l = 0; l < i; l++)
  53577. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53578. var p = Math.floor(d / 2);
  53579. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  53580. }
  53581. }
  53582. function a(e) {
  53583. return Math.atan2(e.z, -e.x)
  53584. }
  53585. function s(e, t, i) {
  53586. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53587. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53588. e.clone()
  53589. }
  53590. Ci.Geometry.call(this),
  53591. this.type = "PolyhedronGeometry",
  53592. this.parameters = {
  53593. vertices: e,
  53594. indices: t,
  53595. radius: i,
  53596. detail: n
  53597. },
  53598. i = i || 1,
  53599. n = n || 0;
  53600. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53601. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53602. var c = this.vertices
  53603. , h = []
  53604. , u = (o = 0,
  53605. 0);
  53606. for (l = t.length; o < l; o += 3,
  53607. u++) {
  53608. var d = c[t[o]]
  53609. , p = c[t[o + 1]]
  53610. , v = c[t[o + 2]];
  53611. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53612. }
  53613. var y = new Ci.Vector3;
  53614. for (o = 0,
  53615. l = h.length; o < l; o++)
  53616. r(h[o], n);
  53617. for (o = 0,
  53618. l = this.faceVertexUvs[0].length; o < l; o++) {
  53619. var A = this.faceVertexUvs[0][o]
  53620. , C = A[0].x
  53621. , I = A[1].x
  53622. , E = A[2].x
  53623. , _ = Math.max(C, I, E)
  53624. , b = Math.min(C, I, E);
  53625. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53626. I < .2 && (A[1].x += 1),
  53627. E < .2 && (A[2].x += 1))
  53628. }
  53629. for (o = 0,
  53630. l = this.vertices.length; o < l; o++)
  53631. this.vertices[o].multiplyScalar(i);
  53632. this.mergeVertices(),
  53633. this.computeFaceNormals(),
  53634. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53635. }
  53636. ,
  53637. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53638. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53639. Ci.DodecahedronGeometry = function(e, t) {
  53640. var i = (1 + Math.sqrt(5)) / 2
  53641. , n = 1 / i
  53642. , r = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  53643. Ci.PolyhedronGeometry.call(this, r, [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], e, t),
  53644. this.type = "DodecahedronGeometry",
  53645. this.parameters = {
  53646. radius: e,
  53647. detail: t
  53648. }
  53649. }
  53650. ,
  53651. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53652. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53653. Ci.IcosahedronGeometry = function(e, t) {
  53654. var i = (1 + Math.sqrt(5)) / 2
  53655. , n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1];
  53656. Ci.PolyhedronGeometry.call(this, n, [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], e, t),
  53657. this.type = "IcosahedronGeometry",
  53658. this.parameters = {
  53659. radius: e,
  53660. detail: t
  53661. }
  53662. }
  53663. ,
  53664. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53665. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53666. Ci.OctahedronGeometry = function(e, t) {
  53667. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  53668. this.type = "OctahedronGeometry",
  53669. this.parameters = {
  53670. radius: e,
  53671. detail: t
  53672. }
  53673. }
  53674. ,
  53675. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53676. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  53677. Ci.TetrahedronGeometry = function(e, t) {
  53678. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  53679. this.type = "TetrahedronGeometry",
  53680. this.parameters = {
  53681. radius: e,
  53682. detail: t
  53683. }
  53684. }
  53685. ,
  53686. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53687. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  53688. Ci.ParametricGeometry = function(e, t, i) {
  53689. Ci.Geometry.call(this),
  53690. this.type = "ParametricGeometry",
  53691. this.parameters = {
  53692. func: e,
  53693. slices: t,
  53694. stacks: i
  53695. };
  53696. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  53697. for (n = 0; n <= i; n++)
  53698. for (a = n / i,
  53699. r = 0; r <= t; r++)
  53700. o = e(r / t, a),
  53701. g.push(o);
  53702. for (n = 0; n < i; n++)
  53703. for (r = 0; r < t; r++)
  53704. l = (s = n * y + r) + 1,
  53705. c = (n + 1) * y + r + 1,
  53706. h = (n + 1) * y + r,
  53707. u = new Ci.Vector2(r / t,n / i),
  53708. d = new Ci.Vector2((r + 1) / t,n / i),
  53709. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  53710. f = new Ci.Vector2(r / t,(n + 1) / i),
  53711. m.push(new Ci.Face3(s,l,h)),
  53712. v.push([u, d, f]),
  53713. m.push(new Ci.Face3(l,c,h)),
  53714. v.push([d.clone(), p, f.clone()]);
  53715. this.computeFaceNormals(),
  53716. this.computeVertexNormals()
  53717. }
  53718. ,
  53719. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53720. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  53721. Ci.WireframeGeometry = function(e) {
  53722. function t(e, t) {
  53723. return e - t
  53724. }
  53725. Ci.BufferGeometry.call(this);
  53726. var i = [0, 0]
  53727. , n = {}
  53728. , r = ["a", "b", "c"];
  53729. if (e instanceof Ci.Geometry) {
  53730. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  53731. for (var u = a[c], d = 0; d < 3; d++) {
  53732. i[0] = u[r[d]],
  53733. i[1] = u[r[(d + 1) % 3]],
  53734. i.sort(t),
  53735. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53736. l[2 * s + 1] = i[1],
  53737. n[E] = !0,
  53738. s++)
  53739. }
  53740. var p = new Float32Array(2 * s * 3);
  53741. for (c = 0,
  53742. h = s; c < h; c++)
  53743. for (d = 0; d < 2; d++) {
  53744. var f = o[l[2 * c + d]];
  53745. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  53746. p[_ + 1] = f.y,
  53747. p[_ + 2] = f.z
  53748. }
  53749. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53750. } else if (e instanceof Ci.BufferGeometry)
  53751. if (null !== e.index) {
  53752. var g = e.index.array
  53753. , m = (o = e.attributes.position,
  53754. e.groups);
  53755. s = 0;
  53756. 0 === m.length && e.addGroup(0, g.length);
  53757. l = new Uint32Array(2 * g.length);
  53758. for (var v = 0, y = m.length; v < y; ++v)
  53759. for (var A = m[v], C = A.start, I = (c = C,
  53760. C + A.count); c < I; c += 3)
  53761. for (d = 0; d < 3; d++) {
  53762. var E;
  53763. i[0] = g[c + d],
  53764. i[1] = g[c + (d + 1) % 3],
  53765. i.sort(t),
  53766. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53767. l[2 * s + 1] = i[1],
  53768. n[E] = !0,
  53769. s++)
  53770. }
  53771. for (p = new Float32Array(2 * s * 3),
  53772. c = 0,
  53773. h = s; c < h; c++)
  53774. for (d = 0; d < 2; d++) {
  53775. var _ = 6 * c + 3 * d
  53776. , b = l[2 * c + d];
  53777. p[_ + 0] = o.getX(b),
  53778. p[_ + 1] = o.getY(b),
  53779. p[_ + 2] = o.getZ(b)
  53780. }
  53781. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53782. } else {
  53783. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  53784. for (p = new Float32Array(2 * s * 3),
  53785. c = 0,
  53786. h = w; c < h; c++)
  53787. for (d = 0; d < 3; d++) {
  53788. var T = 9 * c + 3 * d;
  53789. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  53790. p[_ + 1] = o[1 + T],
  53791. p[_ + 2] = o[2 + T];
  53792. b = 9 * c + (d + 1) % 3 * 3;
  53793. p[_ + 3] = o[b],
  53794. p[_ + 4] = o[b + 1],
  53795. p[_ + 5] = o[b + 2]
  53796. }
  53797. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53798. }
  53799. }
  53800. ,
  53801. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53802. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  53803. Ci.AxisHelper = function(e) {
  53804. e = e || 1;
  53805. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  53806. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  53807. , n = new Ci.BufferGeometry;
  53808. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  53809. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  53810. var r = new Ci.LineBasicMaterial({
  53811. vertexColors: Ci.VertexColors
  53812. });
  53813. Ci.LineSegments.call(this, n, r)
  53814. }
  53815. ,
  53816. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53817. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  53818. Ci.ArrowHelper = function() {
  53819. var a = new Ci.Geometry;
  53820. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  53821. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  53822. return s.translate(0, -.5, 0),
  53823. function(e, t, i, n, r, o) {
  53824. Ci.Object3D.call(this),
  53825. void 0 === n && (n = 16776960),
  53826. void 0 === i && (i = 1),
  53827. void 0 === r && (r = .2 * i),
  53828. void 0 === o && (o = .2 * r),
  53829. this.position.copy(t),
  53830. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  53831. color: n
  53832. })),
  53833. this.line.matrixAutoUpdate = !1,
  53834. this.add(this.line),
  53835. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  53836. color: n
  53837. })),
  53838. this.cone.matrixAutoUpdate = !1,
  53839. this.add(this.cone),
  53840. this.setDirection(e),
  53841. this.setLength(i, r, o)
  53842. }
  53843. }(),
  53844. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  53845. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  53846. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  53847. function(e) {
  53848. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  53849. yi = Math.acos(e.y),
  53850. this.quaternion.setFromAxisAngle(Ai, yi))
  53851. }
  53852. ),
  53853. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  53854. void 0 === t && (t = .2 * e),
  53855. void 0 === i && (i = .2 * t),
  53856. this.line.scale.set(1, Math.max(0, e - t), 1),
  53857. this.line.updateMatrix(),
  53858. this.cone.scale.set(i, t, i),
  53859. this.cone.position.y = e,
  53860. this.cone.updateMatrix()
  53861. }
  53862. ,
  53863. Ci.ArrowHelper.prototype.setColor = function(e) {
  53864. this.line.material.color.set(e),
  53865. this.cone.material.color.set(e)
  53866. }
  53867. ,
  53868. Ci.BoxHelper = function(e) {
  53869. var t = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7])
  53870. , i = new Float32Array(24)
  53871. , n = new Ci.BufferGeometry;
  53872. n.setIndex(new Ci.BufferAttribute(t,1)),
  53873. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  53874. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  53875. color: 16776960
  53876. })),
  53877. void 0 !== e && this.update(e)
  53878. }
  53879. ,
  53880. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53881. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  53882. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  53883. function(e) {
  53884. if (vi.setFromObject(e),
  53885. !vi.isEmpty()) {
  53886. var t = vi.min
  53887. , i = vi.max
  53888. , n = this.geometry.attributes.position
  53889. , r = n.array;
  53890. r[0] = i.x,
  53891. r[1] = i.y,
  53892. r[2] = i.z,
  53893. r[3] = t.x,
  53894. r[4] = i.y,
  53895. r[5] = i.z,
  53896. r[6] = t.x,
  53897. r[7] = t.y,
  53898. r[8] = i.z,
  53899. r[9] = i.x,
  53900. r[10] = t.y,
  53901. r[11] = i.z,
  53902. r[12] = i.x,
  53903. r[13] = i.y,
  53904. r[14] = t.z,
  53905. r[15] = t.x,
  53906. r[16] = i.y,
  53907. r[17] = t.z,
  53908. r[18] = t.x,
  53909. r[19] = t.y,
  53910. r[20] = t.z,
  53911. r[21] = i.x,
  53912. r[22] = t.y,
  53913. r[23] = t.z,
  53914. n.needsUpdate = !0,
  53915. this.geometry.computeBoundingSphere()
  53916. }
  53917. }
  53918. ),
  53919. Ci.BoundingBoxHelper = function(e, t) {
  53920. var i = void 0 !== t ? t : 8947848;
  53921. this.object = e,
  53922. this.box = new Ci.Box3,
  53923. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  53924. color: i,
  53925. wireframe: !0
  53926. }))
  53927. }
  53928. ,
  53929. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  53930. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  53931. Ci.BoundingBoxHelper.prototype.update = function() {
  53932. this.box.setFromObject(this.object),
  53933. this.box.size(this.scale),
  53934. this.box.center(this.position)
  53935. }
  53936. ,
  53937. Ci.CameraHelper = function(e) {
  53938. function t(e, t, i) {
  53939. n(e, i),
  53940. n(t, i)
  53941. }
  53942. function n(e, t) {
  53943. i.vertices.push(new Ci.Vector3),
  53944. i.colors.push(new Ci.Color(t)),
  53945. void 0 === o[e] && (o[e] = []),
  53946. o[e].push(i.vertices.length - 1)
  53947. }
  53948. var i = new Ci.Geometry
  53949. , r = new Ci.LineBasicMaterial({
  53950. color: 16777215,
  53951. vertexColors: Ci.FaceColors
  53952. })
  53953. , o = {}
  53954. , a = 16755200
  53955. , s = 16711680
  53956. , l = 3355443;
  53957. t("n1", "n2", a),
  53958. t("n2", "n4", a),
  53959. t("n4", "n3", a),
  53960. t("n3", "n1", a),
  53961. t("f1", "f2", a),
  53962. t("f2", "f4", a),
  53963. t("f4", "f3", a),
  53964. t("f3", "f1", a),
  53965. t("n1", "f1", a),
  53966. t("n2", "f2", a),
  53967. t("n3", "f3", a),
  53968. t("n4", "f4", a),
  53969. t("p", "n1", s),
  53970. t("p", "n2", s),
  53971. t("p", "n3", s),
  53972. t("p", "n4", s),
  53973. t("u1", "u2", 43775),
  53974. t("u2", "u3", 43775),
  53975. t("u3", "u1", 43775),
  53976. t("c", "t", 16777215),
  53977. t("p", "c", l),
  53978. t("cn1", "cn2", l),
  53979. t("cn3", "cn4", l),
  53980. t("cf1", "cf2", l),
  53981. t("cf3", "cf4", l),
  53982. Ci.LineSegments.call(this, i, r),
  53983. this.camera = e,
  53984. this.camera.updateProjectionMatrix(),
  53985. this.matrix = e.matrixWorld,
  53986. this.matrixAutoUpdate = !1,
  53987. this.pointMap = o,
  53988. this.update()
  53989. }
  53990. ,
  53991. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53992. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  53993. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  53994. mi = new Ci.Camera,
  53995. function() {
  53996. pi = this.geometry,
  53997. fi = this.pointMap,
  53998. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  53999. Ni("c", 0, 0, -1),
  54000. Ni("t", 0, 0, 1),
  54001. Ni("n1", -1, -1, -1),
  54002. Ni("n2", 1, -1, -1),
  54003. Ni("n3", -1, 1, -1),
  54004. Ni("n4", 1, 1, -1),
  54005. Ni("f1", -1, -1, 1),
  54006. Ni("f2", 1, -1, 1),
  54007. Ni("f3", -1, 1, 1),
  54008. Ni("f4", 1, 1, 1),
  54009. Ni("u1", .7, 1.1, -1),
  54010. Ni("u2", -.7, 1.1, -1),
  54011. Ni("u3", 0, 2, -1),
  54012. Ni("cf1", -1, 0, 1),
  54013. Ni("cf2", 1, 0, 1),
  54014. Ni("cf3", 0, -1, 1),
  54015. Ni("cf4", 0, 1, 1),
  54016. Ni("cn1", -1, 0, -1),
  54017. Ni("cn2", 1, 0, -1),
  54018. Ni("cn3", 0, -1, -1),
  54019. Ni("cn4", 0, 1, -1),
  54020. pi.verticesNeedUpdate = !0
  54021. }
  54022. ),
  54023. Ci.DirectionalLightHelper = function(e, t) {
  54024. Ci.Object3D.call(this),
  54025. this.light = e,
  54026. this.light.updateMatrixWorld(),
  54027. this.matrix = e.matrixWorld,
  54028. this.matrixAutoUpdate = !1,
  54029. t = t || 1;
  54030. var i = new Ci.Geometry;
  54031. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54032. var n = new Ci.LineBasicMaterial({
  54033. fog: !1
  54034. });
  54035. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54036. this.lightPlane = new Ci.Line(i,n),
  54037. this.add(this.lightPlane),
  54038. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54039. (n = new Ci.LineBasicMaterial({
  54040. fog: !1
  54041. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54042. this.targetLine = new Ci.Line(i,n),
  54043. this.add(this.targetLine),
  54044. this.update()
  54045. }
  54046. ,
  54047. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54048. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54049. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54050. this.lightPlane.geometry.dispose(),
  54051. this.lightPlane.material.dispose(),
  54052. this.targetLine.geometry.dispose(),
  54053. this.targetLine.material.dispose()
  54054. }
  54055. ,
  54056. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54057. ui = new Ci.Vector3,
  54058. di = new Ci.Vector3,
  54059. function() {
  54060. hi.setFromMatrixPosition(this.light.matrixWorld),
  54061. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54062. di.subVectors(ui, hi),
  54063. this.lightPlane.lookAt(di),
  54064. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54065. this.targetLine.geometry.vertices[1].copy(di),
  54066. this.targetLine.geometry.verticesNeedUpdate = !0,
  54067. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54068. }
  54069. ),
  54070. Ci.EdgesHelper = function(e, t, i) {
  54071. var n = void 0 !== t ? t : 16777215;
  54072. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54073. color: n
  54074. })),
  54075. this.matrix = e.matrixWorld,
  54076. this.matrixAutoUpdate = !1
  54077. }
  54078. ,
  54079. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54080. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54081. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54082. this.object = e,
  54083. this.size = void 0 !== t ? t : 1;
  54084. var r = void 0 !== i ? i : 16776960
  54085. , o = void 0 !== n ? n : 1
  54086. , a = 0
  54087. , s = this.object.geometry;
  54088. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54089. var l = new Ci.BufferGeometry
  54090. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54091. l.addAttribute("position", c),
  54092. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54093. color: r,
  54094. linewidth: o
  54095. })),
  54096. this.matrixAutoUpdate = !1,
  54097. this.update()
  54098. }
  54099. ,
  54100. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54101. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54102. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54103. li = new Ci.Vector3,
  54104. ci = new Ci.Matrix3,
  54105. function() {
  54106. this.object.updateMatrixWorld(!0),
  54107. ci.getNormalMatrix(this.object.matrixWorld);
  54108. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  54109. var l = r[a]
  54110. , c = l.normal;
  54111. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54112. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54113. t.setXYZ(o, si.x, si.y, si.z),
  54114. o += 1,
  54115. t.setXYZ(o, li.x, li.y, li.z),
  54116. o += 1
  54117. }
  54118. return t.needsUpdate = !0,
  54119. this
  54120. }
  54121. ),
  54122. Ci.GridHelper = function(e, t) {
  54123. var i = new Ci.Geometry
  54124. , n = new Ci.LineBasicMaterial({
  54125. vertexColors: Ci.VertexColors
  54126. });
  54127. this.color1 = new Ci.Color(4473924),
  54128. this.color2 = new Ci.Color(8947848);
  54129. for (var r = -e; r <= e; r += t) {
  54130. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  54131. var o = 0 === r ? this.color1 : this.color2;
  54132. i.colors.push(o, o, o, o)
  54133. }
  54134. Ci.LineSegments.call(this, i, n)
  54135. }
  54136. ,
  54137. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54138. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54139. Ci.GridHelper.prototype.setColors = function(e, t) {
  54140. this.color1.set(e),
  54141. this.color2.set(t),
  54142. this.geometry.colorsNeedUpdate = !0
  54143. }
  54144. ,
  54145. Ci.HemisphereLightHelper = function(e, t) {
  54146. Ci.Object3D.call(this),
  54147. this.light = e,
  54148. this.light.updateMatrixWorld(),
  54149. this.matrix = e.matrixWorld,
  54150. this.matrixAutoUpdate = !1,
  54151. this.colors = [new Ci.Color, new Ci.Color];
  54152. var i = new Ci.SphereGeometry(t,4,2);
  54153. i.rotateX(-Math.PI / 2);
  54154. for (var n = 0; n < 8; n++)
  54155. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54156. var r = new Ci.MeshBasicMaterial({
  54157. vertexColors: Ci.FaceColors,
  54158. wireframe: !0
  54159. });
  54160. this.lightSphere = new Ci.Mesh(i,r),
  54161. this.add(this.lightSphere),
  54162. this.update()
  54163. }
  54164. ,
  54165. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54166. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54167. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54168. this.lightSphere.geometry.dispose(),
  54169. this.lightSphere.material.dispose()
  54170. }
  54171. ,
  54172. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54173. function() {
  54174. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54175. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54176. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54177. this.lightSphere.geometry.colorsNeedUpdate = !0
  54178. }
  54179. ),
  54180. Ci.PointLightHelper = function(e, t) {
  54181. this.light = e,
  54182. this.light.updateMatrixWorld();
  54183. var i = new Ci.SphereGeometry(t,4,2)
  54184. , n = new Ci.MeshBasicMaterial({
  54185. wireframe: !0,
  54186. fog: !1
  54187. });
  54188. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54189. Ci.Mesh.call(this, i, n),
  54190. this.matrix = this.light.matrixWorld,
  54191. this.matrixAutoUpdate = !1
  54192. }
  54193. ,
  54194. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54195. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54196. Ci.PointLightHelper.prototype.dispose = function() {
  54197. this.geometry.dispose(),
  54198. this.material.dispose()
  54199. }
  54200. ,
  54201. Ci.PointLightHelper.prototype.update = function() {
  54202. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54203. }
  54204. ,
  54205. Ci.SkeletonHelper = function(e) {
  54206. this.bones = this.getBoneList(e);
  54207. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54208. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54209. t.vertices.push(new Ci.Vector3),
  54210. t.colors.push(new Ci.Color(0,0,1)),
  54211. t.colors.push(new Ci.Color(0,1,0)))
  54212. }
  54213. t.dynamic = !0;
  54214. var n = new Ci.LineBasicMaterial({
  54215. vertexColors: Ci.VertexColors,
  54216. depthTest: !1,
  54217. depthWrite: !1,
  54218. transparent: !0
  54219. });
  54220. Ci.LineSegments.call(this, t, n),
  54221. this.root = e,
  54222. this.matrix = e.matrixWorld,
  54223. this.matrixAutoUpdate = !1,
  54224. this.update()
  54225. }
  54226. ,
  54227. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54228. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54229. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54230. var t = [];
  54231. e instanceof Ci.Bone && t.push(e);
  54232. for (var i = 0; i < e.children.length; i++)
  54233. t.push.apply(t, this.getBoneList(e.children[i]));
  54234. return t
  54235. }
  54236. ,
  54237. Ci.SkeletonHelper.prototype.update = function() {
  54238. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  54239. var o = this.bones[r];
  54240. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54241. e.vertices[n].setFromMatrixPosition(i),
  54242. i.multiplyMatrices(t, o.parent.matrixWorld),
  54243. e.vertices[n + 1].setFromMatrixPosition(i),
  54244. n += 2)
  54245. }
  54246. e.verticesNeedUpdate = !0,
  54247. e.computeBoundingSphere()
  54248. }
  54249. ,
  54250. Ci.SpotLightHelper = function(e) {
  54251. Ci.Object3D.call(this),
  54252. this.light = e,
  54253. this.light.updateMatrixWorld(),
  54254. this.matrix = e.matrixWorld,
  54255. this.matrixAutoUpdate = !1;
  54256. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54257. t.translate(0, -.5, 0),
  54258. t.rotateX(-Math.PI / 2);
  54259. var i = new Ci.MeshBasicMaterial({
  54260. wireframe: !0,
  54261. fog: !1
  54262. });
  54263. this.cone = new Ci.Mesh(t,i),
  54264. this.add(this.cone),
  54265. this.update()
  54266. }
  54267. ,
  54268. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54269. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54270. Ci.SpotLightHelper.prototype.dispose = function() {
  54271. this.cone.geometry.dispose(),
  54272. this.cone.material.dispose()
  54273. }
  54274. ,
  54275. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54276. oi = new Ci.Vector3,
  54277. function() {
  54278. var e = this.light.distance ? this.light.distance : 1e4
  54279. , t = e * Math.tan(this.light.angle);
  54280. this.cone.scale.set(t, t, e),
  54281. ri.setFromMatrixPosition(this.light.matrixWorld),
  54282. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54283. this.cone.lookAt(oi.sub(ri)),
  54284. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54285. }
  54286. ),
  54287. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54288. this.object = e,
  54289. this.size = void 0 !== t ? t : 1;
  54290. var r = void 0 !== i ? i : 16711680
  54291. , o = void 0 !== n ? n : 1
  54292. , a = 0
  54293. , s = this.object.geometry;
  54294. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54295. var l = new Ci.BufferGeometry
  54296. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54297. l.addAttribute("position", c),
  54298. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54299. color: r,
  54300. linewidth: o
  54301. })),
  54302. this.matrixAutoUpdate = !1,
  54303. this.update()
  54304. }
  54305. ,
  54306. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54307. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54308. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54309. ii = new Ci.Vector3,
  54310. ni = new Ci.Matrix3,
  54311. function() {
  54312. var e = ["a", "b", "c"];
  54313. this.object.updateMatrixWorld(!0),
  54314. ni.getNormalMatrix(this.object.matrixWorld);
  54315. var t = this.object.matrixWorld
  54316. , i = this.geometry.attributes.position
  54317. , n = this.object.geometry;
  54318. if (n instanceof Ci.Geometry)
  54319. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54320. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54321. var d = r[c[e[h]]]
  54322. , p = c.vertexNormals[h];
  54323. ti.copy(d).applyMatrix4(t),
  54324. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54325. i.setXYZ(a, ti.x, ti.y, ti.z),
  54326. a += 1,
  54327. i.setXYZ(a, ii.x, ii.y, ii.z),
  54328. a += 1
  54329. }
  54330. else if (n instanceof Ci.BufferGeometry) {
  54331. var f = n.attributes.position
  54332. , g = n.attributes.normal;
  54333. for (h = a = 0,
  54334. u = f.count; h < u; h++)
  54335. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54336. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54337. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54338. i.setXYZ(a, ti.x, ti.y, ti.z),
  54339. a += 1,
  54340. i.setXYZ(a, ii.x, ii.y, ii.z),
  54341. a += 1
  54342. }
  54343. return i.needsUpdate = !0,
  54344. this
  54345. }
  54346. ),
  54347. Ci.WireframeHelper = function(e, t) {
  54348. var i = void 0 !== t ? t : 16777215;
  54349. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54350. color: i
  54351. })),
  54352. this.matrix = e.matrixWorld,
  54353. this.matrixAutoUpdate = !1
  54354. }
  54355. ,
  54356. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54357. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54358. Ci.ImmediateRenderObject = function(e) {
  54359. Ci.Object3D.call(this),
  54360. this.material = e,
  54361. this.render = function(e) {}
  54362. }
  54363. ,
  54364. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54365. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54366. Ci.MorphBlendMesh = function(e, t) {
  54367. Ci.Mesh.call(this, e, t),
  54368. this.animationsMap = {},
  54369. this.animationsList = [];
  54370. var i = this.geometry.morphTargets.length
  54371. , n = i - 1
  54372. , r = i / 1;
  54373. this.createAnimation("__default", 0, n, r),
  54374. this.setAnimationWeight("__default", 1)
  54375. }
  54376. ,
  54377. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54378. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54379. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54380. var r = {
  54381. start: t,
  54382. end: i,
  54383. length: i - t + 1,
  54384. fps: n,
  54385. duration: (i - t) / n,
  54386. lastFrame: 0,
  54387. currentFrame: 0,
  54388. active: !1,
  54389. time: 0,
  54390. direction: 1,
  54391. weight: 1,
  54392. directionBackwards: !1,
  54393. mirroredLoop: !1
  54394. };
  54395. this.animationsMap[e] = r,
  54396. this.animationsList.push(r)
  54397. }
  54398. ,
  54399. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54400. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54401. var s = r.morphTargets[o].name.match(i);
  54402. if (s && 1 < s.length)
  54403. n[l = s[1]] || (n[l] = {
  54404. start: 1 / 0,
  54405. end: -1 / 0
  54406. }),
  54407. o < (c = n[l]).start && (c.start = o),
  54408. o > c.end && (c.end = o),
  54409. t = t || l
  54410. }
  54411. for (var l in n) {
  54412. var c = n[l];
  54413. this.createAnimation(l, c.start, c.end, e)
  54414. }
  54415. this.firstAnimation = t
  54416. }
  54417. ,
  54418. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54419. var t = this.animationsMap[e];
  54420. t && (t.direction = 1,
  54421. t.directionBackwards = !1)
  54422. }
  54423. ,
  54424. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54425. var t = this.animationsMap[e];
  54426. t && (t.direction = -1,
  54427. t.directionBackwards = !0)
  54428. }
  54429. ,
  54430. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54431. var i = this.animationsMap[e];
  54432. i && (i.fps = t,
  54433. i.duration = (i.end - i.start) / i.fps)
  54434. }
  54435. ,
  54436. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54437. var i = this.animationsMap[e];
  54438. i && (i.duration = t,
  54439. i.fps = (i.end - i.start) / i.duration)
  54440. }
  54441. ,
  54442. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54443. var i = this.animationsMap[e];
  54444. i && (i.weight = t)
  54445. }
  54446. ,
  54447. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54448. var i = this.animationsMap[e];
  54449. i && (i.time = t)
  54450. }
  54451. ,
  54452. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54453. var t = 0
  54454. , i = this.animationsMap[e];
  54455. return i && (t = i.time),
  54456. t
  54457. }
  54458. ,
  54459. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54460. var t = -1
  54461. , i = this.animationsMap[e];
  54462. return i && (t = i.duration),
  54463. t
  54464. }
  54465. ,
  54466. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54467. var t = this.animationsMap[e];
  54468. t ? (t.time = 0,
  54469. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54470. }
  54471. ,
  54472. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54473. var t = this.animationsMap[e];
  54474. t && (t.active = !1)
  54475. }
  54476. ,
  54477. Ci.MorphBlendMesh.prototype.update = function(e) {
  54478. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54479. var n = this.animationsList[t];
  54480. if (n.active) {
  54481. var r = n.duration / n.length;
  54482. n.time += n.direction * e,
  54483. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54484. n.time > n.duration && (n.time = n.duration,
  54485. n.directionBackwards = !0),
  54486. n.time < 0 && (n.time = 0,
  54487. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54488. n.time < 0 && (n.time += n.duration));
  54489. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54490. , a = n.weight;
  54491. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54492. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54493. this.morphTargetInfluences[o] = 0,
  54494. n.lastFrame = n.currentFrame,
  54495. n.currentFrame = o);
  54496. var s = n.time % r / r;
  54497. n.directionBackwards && (s = 1 - s),
  54498. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54499. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54500. }
  54501. }
  54502. }
  54503. ,
  54504. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54505. i.THREE = Ci) : this.THREE = Ci
  54506. }
  54507. , {}]
  54508. }, {}, [116]);